Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Neil Faiman via swift-users
> On Apr 21, 2016, at 6:42 PM, Erica Sadun wrote: > > >> On Apr 21, 2016, at 4:37 PM, Neil Faiman via swift-users >> wrote: >> >> >>> On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users >>> wrote: >>> >>> Xcode wants to insert a comma between the words ‘with rect:’ for some >>> re

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Charles Lane via swift-users
OK, I got it. Instead of string.draw(with rect: CGRect(etc. etc. etc. It’s string.draw(with: CGRect( and so on and on and on… I got no help from xcode figuring this out though! Regards, Chuck Lane ___ swift-users mailing list swift-users@swift.org https

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Jacob Bandes-Storch via swift-users
The latter. Check out the docs: https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Functions.html#//apple_ref/doc/uid/TP40014097-CH10-ID166 On Thu, Apr 21, 2016 at 3:37 PM, Neil Faiman via swift-users < swift-users@swift.org> wrote: > > > On Apr 21,

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Erica Sadun via swift-users
> On Apr 21, 2016, at 4:37 PM, Neil Faiman via swift-users > wrote: > > >> On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users >> wrote: >> >> Xcode wants to insert a comma between the words ‘with rect:’ for some reason. > > Is that a two-word parameter “name”, or is it just a parame

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Neil Faiman via swift-users
> On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users > wrote: > > Xcode wants to insert a comma between the words ‘with rect:’ for some reason. Is that a two-word parameter “name”, or is it just a parameter with an external name “with” and an internal name “rect”? Neil Faiman

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Charles Lane via swift-users
Thanks Erica! Sadly I don’t have it working yet. Xcode wants to insert a comma between the words ‘with rect:’ for some reason. I’ll keep at it! Regards, Chuck Lane ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listi

Re: [swift-users] FlatMap and Casting

2016-04-21 Thread Nate Birkholz via swift-users
I would swear I had marked the optional initially with the same result, but it works, so apparently I didn't! On Thu, Apr 21, 2016 at 1:49 PM, Dennis Weissmann wrote: > Since sublayers are optional you’re calling the the flatMap function on > Optionals, which behaves differently. > > let layers

Re: [swift-users] FlatMap and Casting

2016-04-21 Thread Dennis Weissmann via swift-users
Since sublayers are optional you’re calling the the flatMap function on Optionals, which behaves differently. let layers = myView.layer.sublayers?.flatMap({ $0 as? CAShapeLayer }) // sublayers?. instead of sublayers. should fix the problem :) - Dennis > On Apr 21, 2016, at 9:53 PM,

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Erica Sadun via swift-users
> On Apr 21, 2016, at 2:23 PM, Ryan Lovelett wrote: > > On Thu, Apr 21, 2016, at 04:13 PM, Erica Sadun wrote: >> >>> On Apr 21, 2016, at 2:05 PM, Ryan Lovelett >> > wrote: >>> >>> On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote:

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Ryan Lovelett via swift-users
On Thu, Apr 21, 2016, at 04:13 PM, Erica Sadun wrote: > >> On Apr 21, 2016, at 2:05 PM, Ryan Lovelett > d...@ryan.lovelett.me> wrote: >> >> On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote: >>> On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users >>> us...@swift.org>

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Erica Sadun via swift-users
> On Apr 21, 2016, at 2:05 PM, Ryan Lovelett wrote: > > On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote: >> >>> On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users >>> mailto:swift-users@swift.org>> wrote: >>> >>> While rebuilding some apps using the new developm

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Ryan Lovelett via swift-users
On Thu, Apr 21, 2016, at 03:50 PM, Erica Sadun via swift-users wrote: > >> On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users > us...@swift.org> wrote: >> >> While rebuilding some apps using the new development trunk build, I >> figured out the naming changes to just about everything but th

[swift-users] FlatMap and Casting

2016-04-21 Thread Nate Birkholz via swift-users
myView.layer.sublayers returns an array of CALayer objects. Some of my sublayers are CAShapeLayers. I want to act on the CAShapeLayer objects. Shouldn't flatMap allow me to conditionally cast CALayers to CAShapeLayers? i.e. let layers = myView.layer.sublayers.flatMap({ $0 as? CAShapeLayer }) The

Re: [swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Erica Sadun via swift-users
> On Apr 21, 2016, at 12:57 PM, Charles Lane via swift-users > wrote: > > While rebuilding some apps using the new development trunk build, I figured > out the naming changes to just about everything but this: > > let string = "Here is a string" > > string.drawWithRect(CGRect(x

[swift-users] Trying to learn swift 3 renamification (as mattn calls it!)

2016-04-21 Thread Charles Lane via swift-users
While rebuilding some apps using the new development trunk build, I figured out the naming changes to just about everything but this: let string = "Here is a string" string.drawWithRect(CGRect(x: 10, y: 10, width: 200, height: 200), options: .usesLineFragmentOrigin, attributes: