Open KevinQuisquater opened 6 years ago
Thanks for the snippet, I am stuck trying to implement this but I have three errors with equal(width... Value of type 'UIButton?' has no member 'equal'
Where this function comes from?
Any help will be much welcome :)
Hey Alejandro, might be a method that was not part of LBTAComponents, sorry. Here it is:
public func equal(width: NSLayoutDimension? = nil, widthMultiplier: CGFloat? = 1.0, height: NSLayoutDimension? = nil, heightMultiplier: CGFloat? = 1.0) {
translatesAutoresizingMaskIntoConstraints = false
if let width = width {
widthAnchor.constraint(equalTo: width, multiplier: widthMultiplier!).isActive = true
}
if let height = height {
heightAnchor.constraint(equalTo: height, multiplier: heightMultiplier!).isActive = true
}
}
Implemented and working Kevin
Thank you so much for your help
Best Regards
Thanks for providing the workaround! FYI, I found the following fork with this fix and other recent improvements in it: https://github.com/gilthonweapps/AlertOnboarding
Thanks Philippe for the pod!
A quick heads-up, the alert is broken on iOS 12 beta.
Since I had to manually install the pod anyway to include all the nice PRs that people have pushed, here's how I replaced the constraints to fix the issue (only tested on iPhone X). Won't be pushing a PR because there is already a list of a few ones waiting, plus I am using a UIView convenience extension to create my anchors in a few lines.
In AlertOnboarding, after removing the constraints (keep those lines), here are the constraints to create:
view centered in its superview, on X and Y axis
buttomButton centered in its superview on X axis
container's view centered in its superview on X axis
background fills its superview (pinned to all edges)
For anyone using LBTAComponents's UIView extension, here's a ready-to-use snippet to replace AlertOnboarding' configureConstraints function: