I’m surprised how painful it is to do trivial things in Swift. All I want to do 
is convert NSFont.pointSize to an NSNumber, but I can’t figure out any syntax 
the Swift compiler will accept.

My latest fruitless attempt has involved trying to simply cast the value into 
something for which NSNumber has a corresponding init():

    let size:Float = font.pointSize as Float
    let points = NSNumber( float: size )
  
Neither Float nor Double works. What the heck is a Swift CGFloat that seemingly 
makes it incompatible with everything else?

— 

Charles
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to