Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-08 Thread Andrew Trick via swift-users
> On Feb 7, 2017, at 3:44 PM, Dave Abrahams via swift-users > wrote: > >> >> I phrased that as a question because I'm the last person who should be >> giving advice here... What I had in mind is this: >> >> if ([self isKindOfClass:NSClassFromString(@“Bar”)]) { >> self.perform(@selector(FakeB

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-07 Thread Saagar Jha via swift-users
Saagar Jha > On Feb 6, 2017, at 10:57 PM, Andrew Trick wrote: > > >> On Feb 6, 2017, at 8:51 PM, Dave Abrahams wrote: >> >> >> on Mon Feb 06 2017, Andrew Trick wrote: >> >>> Is a missing declaration a use case that needs to be supported? >> >> I couldn't say. >> >>> Wouldn’t it be more

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-07 Thread Dave Abrahams via swift-users
on Mon Feb 06 2017, Andrew Trick wrote: >> On Feb 6, 2017, at 8:51 PM, Dave Abrahams wrote: >> >> >> on Mon Feb 06 2017, Andrew Trick wrote: >> > >>> Is a missing declaration a use case that needs to be supported? >> >> I couldn't say. >> >>> Wouldn’t it be more proper to use selector bas

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-06 Thread Andrew Trick via swift-users
> On Feb 6, 2017, at 8:51 PM, Dave Abrahams wrote: > > > on Mon Feb 06 2017, Andrew Trick wrote: > >> Is a missing declaration a use case that needs to be supported? > > I couldn't say. > >> Wouldn’t it be more proper to use selector based dispatch in those >> cases? > > Example, please?

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-06 Thread Dave Abrahams via swift-users
on Mon Feb 06 2017, Andrew Trick wrote: > Is a missing declaration a use case that needs to be supported? I couldn't say. > Wouldn’t it be more proper to use selector based dispatch in those > cases? Example, please? I don't know what that means, though I probably should. -- -Dave

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-06 Thread Andrew Trick via swift-users
> On Feb 5, 2017, at 9:01 AM, Dave Abrahams via swift-users > wrote: > > > on Sat Feb 04 2017, Saagar Jha > wrote: > >> Thanks–your not only did you method work, it had the side effect of >> obviating the need for a Bridging Header. > > Uh, wait: this doesn

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-05 Thread Dave Abrahams via swift-users
on Sat Feb 04 2017, Saagar Jha wrote: > Thanks–your not only did you method work, it had the side effect of > obviating the need for a Bridging Header. Uh, wait: this doesn't add up. If you needed a bridging header before, surely it was so that you could get a declaration for Bar? If that's

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-04 Thread Saagar Jha via swift-users
Thanks–your not only did you method work, it had the side effect of obviating the need for a Bridging Header. One more thing: what happens if self isn’t a Bar (crash, I’m guessing)? Is there a way to compare the type of self, other than using `is` (which has the same issue as unsafeBitCast in th

Re: [swift-users] unsafeBitCast to Unimplemented Class

2017-02-04 Thread Dave Abrahams via swift-users
on Fri Feb 03 2017, Saagar Jha wrote: > Hello, > > I’m having an issue migrating some old Objective-C code that looks like this: > > @implementation Foo > > - (void)load { > // Swizzle one of Bar’s methods to call Foo’s baz method > } > > - (void)baz { > [self baz]; > if ([self

[swift-users] unsafeBitCast to Unimplemented Class

2017-02-03 Thread Saagar Jha via swift-users
Hello, I’m having an issue migrating some old Objective-C code that looks like this: @implementation Foo - (void)load { // Swizzle one of Bar’s methods to call Foo’s baz method } - (void)baz { [self baz]; if ([self isKindOfClass:NSClassFromString(@“Bar”)]) {