[swift-users] @NSCopying semantic does not appear to copy in Swift initializer

2017-01-26 Thread Torin Kwok via swift-users
Hello guys, I wanna ask a question about the behavior of `@NSCopying` semantic in Swift 3. Well, according to Apple's official documentation: > In Swift, the Objective-C copy property attribute translates to > @NSCopying. The type of the property must conform to the NSCopying > protocol. However

Re: [swift-users] SPM: how to create cocoa xcode projects?

2017-01-26 Thread Rien via swift-users
> On 26 Jan 2017, at 17:58, Doug Hill wrote: > > In Xcode, select menu item File>New>Project > > Select the template for macOS>Cocoa Application > > Doug Hill > Yes, but what is the best way to create a cocoa application building on a bunch of SPM packages? Rien. > >> On Jan 26, 2017, at

Re: [swift-users] Avoiding an extra copy withUnsafeBytes

2017-01-26 Thread Joe Groff via swift-users
> On Jan 26, 2017, at 7:03 AM, Ray Fix via swift-users > wrote: > > To compute a hash, I want to loop through bytes of a trivial type. To get > the bytes, I use withUnsafeBytes hands me a rawBufferPointer collection type. > Great! > > However this call also requires that the "of arg" be de

Re: [swift-users] SPM: how to create cocoa xcode projects?

2017-01-26 Thread Doug Hill via swift-users
In Xcode, select menu item File>New>Project Select the template for macOS>Cocoa Application Doug Hill > On Jan 26, 2017, at 4:24 AM, Rien via swift-users > wrote: > > Just a quick question, > >> swift package init —type executable > > creates an xcode project with a main.swift. > > I want

Re: [swift-users] [swift-corelibs-dev] DateFormatter crash on second usage (new instance) on Linux (swift 3.0.1)

2017-01-26 Thread Philippe Hausler via swift-users
You are probably missing the package libblocksruntime-dev. That would cause that failure. Sent from my iPhone > On Jan 26, 2017, at 6:33 AM, Dennis Schafroth wrote: > > Thanks for the suggestions. > > It works with 3.0.2 but won't compile with 3.1 beta for Ubuntu 14.04. Missing > a Block.h

[swift-users] Avoiding an extra copy withUnsafeBytes

2017-01-26 Thread Ray Fix via swift-users
To compute a hash, I want to loop through bytes of a trivial type. To get the bytes, I use withUnsafeBytes hands me a rawBufferPointer collection type. Great! However this call also requires that the "of arg" be declared as a “var" instead of “let” because it is inout. So to do it genericall

Re: [swift-users] [swift-corelibs-dev] DateFormatter crash on second usage (new instance) on Linux (swift 3.0.1)

2017-01-26 Thread Dennis Schafroth via swift-users
Thanks for the suggestions. It works with 3.0.2 but won't compile with 3.1 beta for Ubuntu 14.04. Missing a Block.h which does exist in 3.0.2 :-Dennis > On 26 Jan 2017, at 05.20, Philippe Hausler wrote: > > We should run those tests with ASAN, I thought I had fixed that with the > Sierra me

[swift-users] SPM: how to create cocoa xcode projects?

2017-01-26 Thread Rien via swift-users
Just a quick question, > swift package init —type executable creates an xcode project with a main.swift. I want to create a macOS cocoa based application. How is that best achieved? Or is that not supported yet? Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com G

Re: [swift-users] SPM: no such module - System Library Wrapper

2017-01-26 Thread Rien via swift-users
Thanks, that was interesting. However I did not find a solution. The problem is not that my COpenSsl does not work, it does. I can compile & link SecureSockets just fine. However the (macOS cocoa) app that uses SecureSockets -even though it does not use COpenSsl- wants access to that module. An

Re: [swift-users] SPM: no such module - System Library Wrapper

2017-01-26 Thread Alex Blewitt via swift-users
Have a look at BlueSockets which does the same kind of thing: https://github.com/IBM-Swift/BlueSocket https://github.com/IBM-Swift/BlueSSLService There's a wrapper around OpenSSL as well: https://github.co

[swift-users] SPM: no such module - System Library Wrapper

2017-01-26 Thread Rien via swift-users
I have created the following packages: 1) SwifterSockets (Swift) 2) COpenSsl (wrapper for system libraries) 3) SecureSockets (Swift, uses SwifterSockets and COpenSsl) Now I want to build a macOS app that uses SecureSockets. I have created the app in the traditional way, via Xcode. In this app I