Fire suggests wrong constructor for UIFont

I am trying to instantiate an instance of UIFont but I am not getting it to work. The following definition is available when looking up the type in Fire it suggests:

public init( fontName: NSString!, size fontSize: CGFloat)

so I tried:

UIFont("Pacifico-Regular", size: CGFloat(32.0))

but then I am getting the error when trying to build the app:

E:                   Parameter labels case mismatch. Parameter 1 is labeled "" but should should be "" in call to "init(with fontName: NSString!, size fontSize: CGFloat) -> UIFont?" [/Users/weyertdeboer/Development/Projects/Experiments/EntitlementsApp/RootViewController.swift (19)]

if I then update the code to what the compiler is suggesting it compiles successfully:

UIFont(with: "Pacifico-Regular", size: CGFloat(32.0))

Fire: build 2629

Thanks, logged as bugs://85955

1 Like

Similar issue occurs when using CodeInsight and then try to use the UIStoryboard’s instantiateViewController function.

E:                   Parameter labels do not match. Parameter 1 is labeled "withIdentifier" but should should be
"identifier" in call to "func instantiateViewController(identifier identifier: NSString!) -> 
Dynamic<UIViewController!>" [/Users/weyertdeboer/Development/Projects/Experiments/EntitlementsApp/AppDelegate.swift (13)]

bugs://85955 got closed with status fixed.

1 Like

Thank you :slight_smile:

1 Like