I use size classes in my projet.
I have a button, which is displayed only for
This button isn't displayed for other size classes.
On this button I apply a specific effect. But I need to apply this effect ONLY for my 2 sizes classes.
Something like :
if button is available for the current size classe
apply the effect
Is it possible to implement ?
During ViewWillApper() check the traitCollection of your View Controller.
myViewController: UIViewController{
mybutton = UIButton(frame: myframe)
func viewWillAppear(){
if traitCollection.horizontalSizeClass == .Compact {
applyAwesomeEffect(myButton)
}
}
}