Search code examples
macosswifttoday-extension

How can I add an info button in OSX today extension?


I am looking for a way to add an "info" button on the top bar of a today extension. Just like the ones Apple uses in its own extensions in OSX. I have tried looking for ways to implement it but I can't seem to find anything.

enter image description here

Thanks for your help.


Solution

  • For those interested, I finally found the solution:

    You have to implement the following methods :

       //func widgetAllowsEditing() -> Bool {
       //     return true
       // }
    
        var widgetAllowsEditing: Bool {
            return true
        }
        func widgetDidBeginEditing() {
    
         // do your stuff
    
        }
    
        func widgetDidEndEditing() {
    
          // do your stuff
    
        }