Re: CGFloat and literal floats in Swift
Re: CGFloat and literal floats in Swift
- Subject: Re: CGFloat and literal floats in Swift
- From: Rick Mann <email@hidden>
- Date: Sun, 26 Jul 2015 16:38:05 -0700
> On Jul 26, 2015, at 16:34 , Quincey Morris <email@hidden> wrote:
>
> On Jul 26, 2015, at 16:29 , Rick Mann <email@hidden> wrote:
>>
>> addArc(CGPoint(x: 0, y: 0), 50.0, 0.0, M_PI)
>
> The problem in this case is that M_PI is a Double variable in Swift, not a compile time constant like in Obj-C. You will unfortunately have to wrap it in CGFloat(), then the constants should work fine.
So, is a literal 0.0 not of type Double?
And can CGFloat be made to be implicitly assignable from Double?
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden