IBInspectable properties not showing in XCode 8.3.3

I am new to xcode development and while trying to modify the Apple tutorial I found it here in IBinspectable properties for my own project. I ran into a major roadblock.

I have defined a simple button subclass:

import UIKit

@IBDesignable public class SocialMediaLoginButton: UIButton {

  private var _loginType: SocialMediaLoginType = .facebook

  @IBInspectable public var loginType: SocialMediaLoginType 
              = SocialMediaLoginType.facebook {

      didSet {
          self._loginType = loginType
      }
  }
}

      

Then added the UIButton to my storyboard, after which I selected CustomClass as the above type. When I go to the attribute inspector, the property doesn't work for me. I have no idea what's going on:

Attributes inspector

I looked at other questions, however they are either extremely out of date or have no answers on the app developers forum.

I tried:

  • Manually update views
  • closing and reopening xcode
  • removing and re-adding a control
  • adding different controls like UIView and trying to accomplish the same thing.

None of them worked. I don't understand how to fix this. I am using Xcode 8.3.3

+3


source to share


1 answer


The Builder interface supports validation of basic types (and their corresponding options), including: booleans, numbers, strings, as well as CGRect, CGSize, CGPoint, and UIColor.



I think your type doesn't work with the interface builder.

+3


source







All Articles