Re: [swift-users] Proper Way to make Errors in Swift 3

2016-09-29 Thread Ronak via swift-users
Hi, I’ve actually switched our implementation to: /// The type of an error code. @objc public enum FoundationErrorCode: Int { /// An ARCOperationCondition failed during evaluation case operationConditionFailed = 1 /// An ARCOperation failed during execution case

Re: [swift-users] Proper Way to make Errors in Swift 3

2016-09-29 Thread Zach Waldowski via swift-users
Error types themselves shouldn’t generally cross into Objective-C, because you don’t get interop; for that, we have Error, which crosses the bridge as NSError. If it’s instructive to think of it this way, both Objective-C and Swift should define errors in their best native way, and use NSError.

Re: [swift-users] SwiftPM: How to verify that PKG_CONFIG_PATH is being used

2016-09-29 Thread Ankit Agarwal via swift-users
Hi, SwiftPM finds the first matching .pc file in the list of search paths, unfortunately the environment variable PKG_CONFIG_PATH was last in the list. It was corrected in this commit: https://github.com/apple/swift-package-manager/commit/ac0479653032ded2efa1d71ab290d5b8d66c0e82 Can you try with

Re: [swift-users] RawRepresentable bug or intended?

2016-09-29 Thread Jordan Rose via swift-users
> On Sep 28, 2016, at 23:00, Adrian Zubarev via swift-users > wrote: > > struct B : RawRepresentable { > > let rawValue: Int > > // init?(rawValue: Int) { > // > // self.rawValue = rawValue > // } > > static let c: B = B(rawValue: 0) >

[swift-users] Proper Way to make Errors in Swift 3

2016-09-29 Thread Ronak via swift-users
Hello all, We are proceeding to update all of our Swift code to Swift 3 now and had a few questions about the proper way to implement Errors. We need these entities to be available in Objective-C and they are actively being used in Swift classes marked as @objc. I read:

Re: [swift-users] private vs. fileprivate on global declaration in Swift3?

2016-09-29 Thread Clément NONN via swift-users
fileprivate and private aren’t the same thing : try this on a playground : class Foo { fileprivate let test = "test" private let test2 = "test2" } let foo = Foo() foo.test foo.test2 You can see that foo.test work because his scope is the file whereas test2 doesn’t compile :

[swift-users] where to get the spiral for playgrounds example?

2016-09-29 Thread Mr Bee via swift-users
Hi, I just realized that the official Swift page here:  https://developer.apple.com/swift/ has a spiral drawing example for the Playgrounds (look at the first big picture on top of the page). It seems like an interesting example to play with, especially for my kids.  However, when I looked at

[swift-users] RawRepresentable bug or intended?

2016-09-29 Thread Adrian Zubarev via swift-users
struct B : RawRepresentable { let rawValue: Int // init?(rawValue: Int) { // // self.rawValue = rawValue // } static let c: B = B(rawValue: 0) static let d: B = B(rawValue: 1) } It seems to me that the memberwise initializer init(rawValue: Int) ignores the