Closed jessepollak closed 9 years ago
What do you mean by this "Not subclassing the custom Objective-C class makes the build error go away"?
I'm using it in Swift myself, and I have many subclasses of objective-c classes with no issue. Does renaming the class parameter to something else fix the issue?
So, if I leave the import in my Module-Bridging-Header.h
and instead of subclassing CustomViewController
, I subclass UIViewController
, the app builds. It's only when I subclass CustomViewController
in my Swift code that the build fails.
Yes, I changed it to klass
and the problem was resolved, but I'm using Cocoapods, so this isn't really viable.
Thank you so much for your help :)
That's really odd, will look into it and change that in the next version.
Thank you, I'm just holding out from subclassing in Swift for as long as possible :)
Just one more thing before I push a fix for this. Are you using Swift 1.2?
I have XCode 6.3.1, which comes with v1.2, so I'm pretty sure, yes.
Can you check if this commit fixes the issue for you?
pod 'OCMapper', :git => 'https://github.com/aryaxt/OCMapper.git', :commit => '8a26f84537b803c1502963cb4e238195213ec8b3'
This does indeed fix the issue — sorry about the delay!
Cool, will push this to cocoapods tonight
Awesome, thank you!
On Mon, Jun 1, 2015 at 12:05 PM, Aryan Ghassemi notifications@github.com wrote:
Cool, will push this to cocoapods tonight
— Reply to this email directly or view it on GitHub https://github.com/aryaxt/OCMapper/issues/25#issuecomment-107672965.
+1 i have the same issue :)
I've been using OCMapper in Swift and I've run into a compilation problem. This may be an issue with XCode/Swift/Objective-C, but I figured I would open an issue here.
All was working well until I tried to subclass a custom Objective-C class that I had created (a subclass of
UIViewController
). When I tried to do this, I ran into a build error which pointed to OCMapper.Not subclassing the custom Objective-C class makes the build error go away (even if I still do the import).
Any ideas?