Closed AurelTyson closed 7 years ago
Nice, looking forward to try this in Swift 3.0. I just replaced the content of the DOFavoriteButton.swift file with yours and I don't have any compiling errors any more but while running the app the buttons are not visible. They work but they aren't visible. I created the buttons through storyboard as described here. Do you know what could cause this problem?
@XHotSniperX add self.layoutIfNeeded() before access frames does the work. I just add at the start of fun fileprivate func createLayers(image: UIImage!)
. it is needed since upgrade to Xcode 8. If anybody has a more elegant way to achieve this kind if problem?
@familyconnect that fixed it, thank you!
anyone know when this will be available on the main branch? im new to github.
Hi, After a quick look I can reproduce the issue but I couldn't resolve it quickly. I will take a look at this weekend ;)
@familyconnect I also add my buttons using storyboard but if I add your fix I get a constraint error: @AurelTyson did you find anything?
"<NSLayoutConstraint:0x608000093920 App.DOFavoriteButton:0x7ff542d33fc0.height == 44 (active)>",
"<NSLayoutConstraint:0x608000093b00 '_UITemporaryLayoutHeight' App.DOFavoriteButton:0x7ff542d33fc0.height == 1000 (active)>"
@XHotSniperX Dont you get constraint errors with that fix? I get:
"<NSLayoutConstraint:0x608000093920 App.DOFavoriteButton:0x7ff542d33fc0.height == 44 (active)>",
"<NSLayoutConstraint:0x608000093b00 '_UITemporaryLayoutHeight' App.DOFavoriteButton:0x7ff542d33fc0.height == 1000 (active)>"
Dunno why but its adding a 1000H 1000W constraint
To anyone adding self.layoutIfNeeded() in fileprivate func createLayers(image: UIImage!)
in order to get it to work in storyboard will prob get a _UITemporaryLayoutHeight
constraint error.
The fix to this is to set the constraints priority to 750 (Anythinig under 1000) on all of your button constraints in storyboard W/H
@XHotSniperX @AurelTyson @familyconnect
@XHotSniperX @AurelTyson @familyconnect
The constraint issue seems to be fixed in Xcode 8.1 I dont see the error occur if I build the project in xcode 8 and run on a device using ios 10.0
I have just updated the project to be compatible with Swift 3.0.
Just create a new branch to continue supporting the current version of Swift.
Thanks !