gontovnik / DGRunkeeperSwitch

Runkeeper design switch control
MIT License
1.88k stars 175 forks source link

error: IB Designables: Failed to update auto layout status #32

Open rogomantik opened 8 years ago

rogomantik commented 8 years ago

Hello I have this error with Merge branch 'pr/23' update

error: IB Designables: Failed to update auto layout status: The agent raised a "CALayerInvalidGeometry" exception: CALayer position contains NaN: [nan 15.5] and error: IB Designables: Failed to render instance of DGRunkeeperSwitch: The agent threw an exception.

I put the switch into storyboard as navigation title as a view with custom class (DGRunkeeperSwitch) the position of the view is x 200 y 7 w 200 h 31 everything else is defaults for the view. without constraints in code the switch is set with 2 elements

but everything seems to be working as before

ps: the latest version of xcode suggests these changes

        // Gestures
-        tapGesture = UITapGestureRecognizer(target: self, action: "tapped:")
+        tapGesture = UITapGestureRecognizer(target: self, action: #selector(DGRunkeeperSwitch.tapped(_:)))

-        panGesture = UIPanGestureRecognizer(target: self, action: "pan:")
+        panGesture = UIPanGestureRecognizer(target: self, action: #selector(DGRunkeeperSwitch.pan(_:)))
vitobellini commented 8 years ago

I'm addressing the same issue

efremidze commented 8 years ago

I'm addressing the issue too

gontovnik commented 8 years ago

Are you all on the latest release 1.1.4?

rogomantik commented 8 years ago

I'm on 1.1.3 with these changes. Using xcode731

 -    @IBInspectable
     private(set) public var selectedIndex: Int = 0

 +    @IBInspectable
 +    public var titleFontFamily: String = "HelveticaNeue"

 +    @IBInspectable
 +    public var titleFontSize: CGFloat = 18.0

 -        // Setup default colors
 -        backgroundColor = .blackColor()
 +        // Setup defaul colors
 +        if backgroundColor == nil {
 +            backgroundColor = .blackColor()
 +        }

 +    override public func awakeFromNib() {
 +       super.awakeFromNib()
 +        
 +      self.titleFont = UIFont(name: self.titleFontFamily, size: self.titleFontSize)
 +   }
gontovnik commented 8 years ago

Please try 1.1.4.

vitobellini commented 8 years ago

Yep

Il giorno 24 ott 2016, alle ore 15:07, Danil Gontovnik notifications@github.com ha scritto:

Are you all on the latest release 1.1.4?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gontovnik/DGRunkeeperSwitch/issues/32#issuecomment-255735172, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKHb6lmPbLpVfhTE4uY5bgKneiuNGYGks5q3K2sgaJpZM4JX_q2.

alpi commented 7 years ago

@gontovnik i have the same issue (release 1.1.4 via Cocoapods, Xcode 8.1, macOS Sierra 10.12.1)

bildschirmfoto 2016-11-30 um 16 44 40
J-Arji commented 7 years ago

i have this problem :(

emirbeytekin commented 5 years ago

the problem continues on xCode 10

artemmihelson commented 5 years ago

The same issue on 1.1.4 for Xcode 11