Converting my code to Swift 3 I found a weird issue. Right now (15th September 2016) Xcode 8 (public version) is out, and after converting the code, my App crashes without an apparently reason.
There is something wrong with Auto Layout and the log says something like:
[_SwiftValue nsli_superitem]: unrecognized selector sent to instance
How can I solve? Thanks
Just figured out the weird but working solution:
Instead of doing this:
let views = ["view":aView] view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "...", options:[], metrics: metrics, views: views))
Declare the dictionary explicitly:
let views: [String:UIView] = ["view":aView] view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "...", options:[], metrics: metrics, views: views))
I know, it's weird but it works. Cheers
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