I'm trying to make a framework of a custom UIViewController using @IBInspectable
to edit its properties in Interface Builder.
public class BWWalkthroughPageViewController: UIViewController {
@IBInspectable public var speed: CGPoint = CGPointZero
@IBInspectable public var speedVariance: CGPoint = CGPointZero
@IBInspectable public var animationType: String = ""
@IBInspectable public var animateAlpha: Bool = false
}
If the framework source code is in a sample app project, the properties come up to Attribute Inspector as shown in the image below,
but if I add the built framework to my app project, the properties are not displayed in the inspector.
Is it possible to show the inspectable properties in a built framework to Interface Builder? If possible, how to?
Here is the framework source code, which is forked from a non-framework project. https://github.com/yoichitgy/BWWalkthrough/tree/support-carthage
Create default framework and add there your swift files.
Then set your swift files as public.
After that copy your framework and add it to your project folder
Add the framework in your project
Create new viewController in your storyboard and set viewController's class which is located in your framework
Thats all. You will see your your properties in the storyboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With