Weak Linking in Swift
I’m dealing with a scenario where there is an Objective-C class that I am weakly linking:
__attribute__((weak_import)) @interface MyClass : NSObject @end
I’m also using this class in my Swift code:
let myObject : MyClass = MyClass()
However, this always crashes when run in
swift_getObjCClassMetadata, even if I’m only casting an object that’s already of type
let myObject : MyClass = otherObj as? MyClass
Is there any way to successfully cast to, or utilize these classes from Swift?
- Convert UIKeyboardFrameEndUserInfoKey to View or Window Coordinates
- SKPhysicsContact Not Detecting categoryBitMask Collision
- Xcode 9 “no iTunes Connect account” error when uploading
- App Submission: Invalid Binary – Invalid Signature
- Custom SKSpriteNode not detected during touch
- MKMapView: Instead of Annotation Pin, a custom view
- how to convert gps north and gps west to lat/long in objective c
- Xcode: Which files need to be members of my target? (Target Membership)
- Converting jpeg to bitmap in ios using objective c?
- GMSMarker bouncing around the corners on GMSPolyline
- Using IOSurface to take screenshot in iOS7 in games
- reading samples with AVAssetReader and timeRange in real time
- When to use Core Data's NSMainQueueConcurrencyType?
- Bidi Right to Left Language in Firemonkey Mobile
- SpriteKit Incorrectly Detecting Multiple Collisions