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
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.
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
> 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)
>
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:
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 :
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
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