Re: [swift-users] Swift-C array interop with Swift 4/Xcode 9

2017-09-21 Thread Chris McIntyre via swift-users
Sorry to jump in here, and maybe I’m missing something obvious, but in your example Rick is two levels of closure deep and only has access to one of the arrays in his struct. In this case there is another array of floats he needs as an argument to his method call. Will he need to go through the

Re: [swift-users] Convenience initializers in structs?

2017-07-18 Thread Chris McIntyre via swift-users
Was it ever explained why the syntax is different? -- Chris McIntyre > On Jul 18, 2017, at 6:46 PM, Jens Persson via swift-users > wrote: > > That is not true. Structs can have delegating initializers but they cannot be > marked with `convenience` (only the

Re: [swift-users] weak self

2017-05-02 Thread Chris McIntyre via swift-users
I don’t think there’s any symmetry break. I would argue that forced-unwrapping is rarely a best-practice. The swifty way would be to always use guard let and if let for optionals. Looking through the Swift Programming Language book, the only examples of “if x != nil” I can find just print some

Re: [swift-users] Data withUnsafeBytes

2016-09-04 Thread Chris McIntyre via swift-users
That makes sense. I think I've gotten so used to the type system magically figuring out what I want, combined with the error message pointing to the return type that this just went right over my head. -- Chris McIntyre > On Sep 4, 2016, at 3:59 PM, Ole Begemann via swift-users >

[swift-users] Data withUnsafeBytes

2016-09-03 Thread Chris McIntyre via swift-users
Hi guys, I’m either missing a subtlety in regards to closures or I found a bug with the type inference system in Xcode 8 Beta 6. Thought I’d run it by you. I’m trying to use Data’s method withUnsafeBytes(_:). It’s declared as: func withUnsafeBytes(_ body: