• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CGFloat and literal floats in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGFloat and literal floats in Swift


  • Subject: CGFloat and literal floats in Swift
  • From: Rick Mann <email@hidden>
  • Date: Sun, 26 Jul 2015 15:57:33 -0700

I'm finding it a bit cumbersome to use CGFloat in graphics code in Swift, because the compiler won't let me pass a floating-point literal to a parameter that takes a CGFloat. I have to wrap them all in CGFloat(<val>).

This seems really, well, cumbersome. Why does the language impose this burden? Is there any way around it?

TIA,

--
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


  • Follow-Ups:
    • Re: CGFloat and literal floats in Swift
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Generics Question
  • Next by Date: Re: Updating a screensaver from 10.6 to 10.10
  • Previous by thread: Re: Generics Question
  • Next by thread: Re: CGFloat and literal floats in Swift
  • Index(es):
    • Date
    • Thread