Re: [swift-users] EnumerateUsingObjects in Swift

2017-01-25 Thread Pierre Monod-Broca via swift-users
You should try: ``` class Test { let array: [T] = [] . . . ``` Because when you declare `class Test`, NSObject is the generic parameter, no longer the class. Pierre > Le 26 janv. 2017 à 02:45, Doug Hill via swift-users a > écrit : > > Unfortunately, this is for a work-related project

Re: [swift-users] How to use an SPM library in an (Xcode based) iOS project?

2017-01-19 Thread Pierre Monod-Broca via swift-users
Alright. Typically I create a workspace (menu File > New > Workspace) and add both the app's project and the library project to the workspace (menu File > Add Files). Then you can follow that guide to embed the framework in the app (which will also link it): https://developer.apple.com/library/

Re: [swift-users] How to use an SPM library in an (Xcode based) iOS project?

2017-01-19 Thread Pierre Monod-Broca via swift-users
Hi, swift package has a nice option for that : generate-xcodeproj (not sure about the exact spelling) which generate a proper Xcode project bundle. You can then reference it from another Xcode project or workspace. Pierre > Le 19 janv. 2017 à 11:22, Georgios Moschovitis via swift-users > a é

Re: [swift-users] [swift-evolution] Best way to handle escaping function that might throw

2017-01-12 Thread Pierre Monod-Broca via swift-users
@Howard I was thinking the same about the constraint. Does that mean that Never should be a subtype of Error (maybe it is already) ? Else you couldn't say throws(Never) or FSTore @Howard I'm not sure about <>, it should stay reserved for generics, IMHO. Pierre > Le 13 janv. 2017 à 01:11, Howar

Re: [swift-users] make a static/class method return type be the subclass it is called with

2017-01-10 Thread Pierre Monod-Broca via swift-users
Hi again, You might want to look at Self requirement in protocols for exemple: protocol P { func items(/*...*/) -> [Self] } class C: P { func items(/*...*/) -> [C] { ... } } However it might not always work as you expect. I can't say which is the better. Using associated type might be

Re: [swift-users] make a static/class method return type be the subclass it is called with

2017-01-05 Thread Pierre Monod-Broca via swift-users
Hello, It looks that you have what you wanted because Event.Entity is an alias of Event. Pierre > Le 5 janv. 2017 à 16:47, Dave Reed via swift-users a > écrit : > > Is there a way to make a static or class method specify the return type be > the actual class it is called with? > > The exa

Re: [swift-users] How to define interdependent modules in a package?

2015-12-23 Thread Pierre Monod-Broca via swift-users
here is link with more explanation : https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#module-interdependency-determination -- Pierre > Le 23 déc. 2015 à 14:50, Pierre Monod-Broca a écrit : > > It would be too costly to do that on each

Re: [swift-users] How to define interdependent modules in a package?

2015-12-23 Thread Pierre Monod-Broca via swift-users
It would be too costly to do that on each build, among other issues. So you do have to add all imported stuff as dependencies. If I recall correctly, SPM is planned to have an option to either list you all your imports so you can populate your dependencies, or edit the package manifest itself t

Re: [swift-users] Using Github's Atom as a Swift IDE for Linux and Mac

2015-12-14 Thread Pierre Monod-Broca via swift-users
Oh great ! Thanks for sharing ! -- Pierre > Le 12 déc. 2015 à 18:28, Ankit Agarwal via swift-users > a écrit : > > Hey > > I wrote a tiny atom plugin which enables building and debugging swift > packages (using SPM) from inside atom. > Here is the blog post with tutorial > https://medium.

Re: [swift-users] Capturing references to initializers?

2015-12-10 Thread Pierre Monod-Broca via swift-users
Hi, I had the same problem with delegate methods (they all had the same prefix). I used lambda as a workaround, but I agree it is less elegant : let b: = { Foo(customNumber: $0) } let c: = { Foo(numberToInc: $0) } Pierre > Le 10 déc. 2015 à 23:41, Austin Zheng via swift-users > a écrit : >