This is a build error with XCode Beta 4, Swift, and framework targets with BUILD_LIBRARY_FOR_DISTRIBUTION set to yes so I can build an XCFramework. I'm seeing if anyone else has seen this and can help me out.
When BUILD_LIBRARY_FOR_DISTRIBUTION to No, then everything can build and archive just fine. When BUILD_LIBRARY_FOR_DISTRIBUTION is Yes I get a bunch of these errors:
- @IBOutlet property cannot have non-'@objc' class type 'UIImageViewSubclass'
- Method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C
The only thing I can see in common with all the failures is that each class is itself a subclass of another, and that other class is a direct subclass of a UIKit object. Ones that are direct subclasses do not give the error.
So this works (one level):
@IBDesignable open class MyLabel: UILabel
// Compiles fine
@IBOutlet weak var confirmPasswordErrorLabel: MyLabel!
This fails (two levels):
@IBDesignable open class MyImageView: UIImageView
open class MyCardImageView: MyImageView
// Emits an error when BUILD_LIBRARY_FOR_DISTRIBUTION is Yes
@IBOutlet weak var cardImageView: MyCardImageView!