Re: [swift-users] Any reason of "@objc is not supported within extensions of generic classes." ?

2016-08-24 Thread Zhao Xin via swift-users
Thank you, Jordan. Zhaoxin On Thu, Aug 25, 2016 at 1:15 AM, Jordan Rose wrote: > The way @objc methods are added in an extension is by using Objective-C > categories. With a generic class, though, there's no Class object to attach > the category metadata to—it's all created dynamically at runti

[swift-users] Regression in Xcode8-beta6 Swift?

2016-08-24 Thread Travis Griggs via swift-users
Upgrading to beta6 of Xcode8, I’ve read through various SE’s and made fixes as appropriate, but the following behavior I didn’t catch an explanation as to why its now an error where it was fine before. In a ViewController, I have something that looks like: var addButton = UIButton(type: .cu

[swift-users] New Swift Snapshots Available!

2016-08-24 Thread mishal_shah via swift-users
New Swift Snapshots Available! Download new packages from https://swift.org/download/ Swift Development: (master) Following repository are tagged with swift-DEVELOPMENT-SNAPSHOT-2016-08-24-a https://github.com/apple/swift

Re: [swift-users] Any reason of "@objc is not supported within extensions of generic classes." ?

2016-08-24 Thread Jordan Rose via swift-users
The way @objc methods are added in an extension is by using Objective-C categories. With a generic class, though, there's no Class object to attach the category metadata to—it's all created dynamically at runtime. We could potentially support this some day, but it would take some thought, and w

Re: [swift-users] how to create an array by adding/removing from another array?

2016-08-24 Thread Jens Alfke via swift-users
> On Aug 24, 2016, at 7:07 AM, Jean-Denis Muys via swift-users > wrote: > > However I was wondering if it was possible (preferable?) to do it in a more > “functional” style. Apple’s Foundation framework has Array.arrayByAddingObject (but not ByRemoving). However, this would not be preferable

[swift-users] Any reason of "@objc is not supported within extensions of generic classes." ?

2016-08-24 Thread Zhao Xin via swift-users
I was trying to implement a final class to conform NSCopying by extension. List was a class in Realm object database. final class List My implementation: extension List:NSCopying { public func copy(with zone: NSZone? = nil) -> Any { ... } } I got an error called "@objc is not su

[swift-users] how to create an array by adding/removing from another array?

2016-08-24 Thread Jean-Denis Muys via swift-users
Hi, Using Swift 3, I am in a situation where I need to construct an output array step by step by picking (and possibly modifying) some item from an input array (“consuming” that item, i.e. removing it from the input array). That very easy to do by mutating “var” variables, using the append() an

Re: [swift-users] Data(bytesNoCopy:count:deallocator)

2016-08-24 Thread Stéphane Lizeray via swift-users
Tony, Andrew, Here it is. https://bugs.swift.org/browse/SR-2468 On Radar as well. Thanks, Stéphane > On 24 Aug 2016, at 00:32, Tony Parker wrote: > > We should probably add a predefined enum for a deallocator that matches > UnsafeMutableRawPointer.al

[swift-users] Cast from NSError to ErrorType causes weird behaviour

2016-08-24 Thread Ivan Rep via swift-users
Hi, I noticed weird behaviour using ErrorType that was casted from NSError. ​ Why is this happening? Thanks, Ivan ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] New Swift Snapshots Available!

2016-08-24 Thread Michael Ferenduros via swift-users
> On 24 Aug 2016, at 03:03, mishal_shah via swift-users > wrote: > > New Swift Snapshots Available! > > Download new packages from https://swift.org/download/ > In case anyone else hits an error about "uuid/uuid.h” when they import Foundation, I had to install u

Re: [swift-users] [swift-dev] New Swift Snapshots Available!

2016-08-24 Thread Chris Bailey via swift-users
If you haven't spotted it, the new snapshots include Dispatch on Linux for the first time - please test it out as there may well be number of issues to shake out, especially with the new Swift 3 API. The availability is thanks to the hard work of a large number of people, including Dave Grove,