[swift-users] Wrapping function declarations in #if swift()

2016-05-12 Thread Tyler Fleming Cloutier via swift-users
Hello everyone, It does seem like it is currently possible to wrap just the function declaration in an #if swift() directive like so: #if swift(>=3.0) public func add(filter filterName: String, path: String) { #else // ERROR Expected ‘}’ at end of brace statement public func

Re: [swift-users] CGPathApply

2016-05-12 Thread Zach Waldowski via swift-users
This seems to do it: https://gist.github.com/zwaldowski/7e6eacc9dea0682690a820afa62e54ff Problems are just like any context-based C API, you need to squeeze all the important stuff into a word-size thing. Cheers!   Zachary Waldowski   z...@waldowski.me On Thu, May 12, 2016, at 09:04 PM,

[swift-users] CGPathApply

2016-05-12 Thread Jonathan Hull via swift-users
I am having the darnedest time trying to figure out how to use CGPathApply with a swift function in Swift 2.2+. I tried it before in Swift 1.2 and it wasn’t possible without bridging to ObjC, but I am fairly sure that changed with Swift 2. Every search I do just comes up with people saying it

Re: [swift-users] Can't declare variable with same name as func called to assign its initial value

2016-05-12 Thread Evan Maloney via swift-users
> On May 12, 2016, at 3:12 PM, Erica Sadun wrote: > > I'm going to go with the classic answer: > http://www.urbandictionary.com/define.php?term=Henny+Youngman+problem > > > consider: let sale2 =

Re: [swift-users] Can't declare variable with same name as func called to assign its initial value

2016-05-12 Thread David Sweeris via swift-users
I can't recall whether functions and variables can have the same name (though I think not), but at the least that error message seems to miss the point. Sent from my iPhone > On May 12, 2016, at 14:07, Evan Maloney via swift-users > wrote: > > Adopting the newer Swift

Re: [swift-users] Can't declare variable with same name as func called to assign its initial value

2016-05-12 Thread Erica Sadun via swift-users
> On May 12, 2016, at 1:07 PM, Evan Maloney via swift-users > wrote: > > Adopting the newer Swift style of preferring first parameter labels, I wrote > a function: > >func sale(options options: DeepLinkOptions) >throws >-> Sale >{ >//

[swift-users] Can't declare variable with same name as func called to assign its initial value

2016-05-12 Thread Evan Maloney via swift-users
Adopting the newer Swift style of preferring first parameter labels, I wrote a function: func sale(options options: DeepLinkOptions) throws -> Sale { // ...implementation... } I then tried calling it elsewhere, and setting the result to a variable named

Re: [swift-users] swift redistributable without Xcode

2016-05-12 Thread Tim Prepscius via swift-users
Apparently utils/build-toolchain must fail on my mac. I can't find any pkg output archive. Nor any directory structure that looks like: du -h -d 3 308K./swift-2.2.1-SNAPSHOT-2016-04-23-a-osx-package.pkg/_CodeSignature 111M./swift-2.2.1-SNAPSHOT-2016-04-23-a-osx-package.pkg/System/Library

Re: [swift-users] swift redistributable without Xcode

2016-05-12 Thread Jordan Rose via swift-users
That's utils/build-toolchain. The SDK that's needed is the actual OS X SDK that comes with Xcode. (It says that in the error message.) This is not something that people are allowed to distribute on their own; the destination computer will need to have either Xcode or Apple's Command-Line Tools