Skip to content

Swift 5 requires the ViewController to adopt NSFontChanging #1

@ganeshh123

Description

@ganeshh123

Firstly, thanks so much for making this, I have no idea how you figured this out I couldn't find any decent documentation for this anywhere.

The current example works for up to Swift 4, but shows an error in Swift 5:
Method does not override any method from its superclass
image

To fix this, the ViewController needs to adopt the NSFontChanging protocol:
image
Then in the implementation, the override needs to be removed and Any? needs to be updated to NSFontManager?:

func changeFont(_ sender: NSFontManager?){}

The demo will then work correctly:
image

Could you please update the README to reflect this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions