Re: [swift-users] Instantiate Swift class from string

2015-12-11 Thread Matthew Davies via swift-users
viesgeek.com <http://facebook.com/daviesgeek> <http://us.linkedin.com/in/daviesgeek> <http://twitter.com/daviesgeek> <http://daviesgeek.com/feed.xml> <http://github.com/daviesgeek> On Fri, Dec 11, 2015 at 8:14 AM, Jeremy Pereira < jeremy.j.pere...@googlemail.com> w

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
Okay I'll have to dig more into using that sort of syntax. And no problem ;) *Matthew Davies* Junior Developer, GeoStrategies Director of Photography, OffBlock Films 209-225-3246 <209-225.3246> | 209-202-3284 | daviesg...@gmail.com | daviesge

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
om <http://facebook.com/daviesgeek> <http://us.linkedin.com/in/daviesgeek> <http://twitter.com/daviesgeek> <http://daviesgeek.com/feed.xml> <http://github.com/daviesgeek> On Thu, Dec 10, 2015 at 3:47 PM, Daniel Dunbar wrote: > > On Dec 10, 2015, at 1:01 P

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
viesgeek> On Thu, Dec 10, 2015 at 3:25 PM, Jens Alfke wrote: > > On Dec 10, 2015, at 1:01 PM, Matthew Davies via swift-users < > swift-users@swift.org> wrote: > > func get(url: String, ctrl: Controller.Type, method: String) { > let inst = ctrl.init() > *// R

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
able to replace this with a macro-based DSL, but > for now, I don't see a better option. > > On the bright side, this does mean you'll have actual machine code doing > your routing, which might be faster than a more dynamic system. > > Sent from my iPad > > On Dec 10,

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
n Thu, Dec 10, 2015 at 12:48 David Owens II wrote: > You have the protocol conformance, why can’t you simply call the method > directly? > > On Dec 10, 2015, at 12:22 PM, Matthew Davies via swift-users < > swift-users@swift.org> wrote: > > I'm building a URL router

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
te > some kind of dynamic proxy for a remote object ala NSXPCConnection? > > Dan > > On Dec 10, 2015, at 10:33 AM, Matthew Davies via swift-users < > swift-users@swift.org> wrote: > > Ooh okay. I think that should work for my purposes. Thanks. > > Somewhat

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
; init(description: GraphableDescription) { } > > func graph() { } > } > > // Example framework client. > func foo() { > graphItem(GraphableDescription(), graphable: Circle.self) > } > -- > > - Daniel > > On Dec 10, 2015, at 9:59 AM, Matthew Davies vi

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Matthew Davies via swift-users
I don't really like the idea of a factory function, but unfortunately that might be the only way to do it :( However, due to my specific use case, I don't think a factory function will work. I'm working on a framework that will need to both instantiate the class from a string (or class type) *and*