In Xcode 6 Beta 6,
I am unable to use any NSFontManager
methods in Swift.
For example:
var fontManager = NSFontManager.sharedFontManager()
fontManager.setAction("changeFont:")
I always get the error: NSFontManager does not have a member named setAction
This occurs for any method (e.g. setDelegate
, setTarget
)
Thanks for any help.
Try this:
Properties are set using the property syntax in Swift.
In ObjC, properties were declared with (if not using
@property
):In Swift, the property declarations look more like C#:
So you can't call the setter explicitly using the same method name as in ObjC (though I have actually no idea what it will be compiled into...).