I'm building an custom keyboard, everything is fine now, except when i'm using AssistiveTouch during my custom keyboard is enabled, the animation of AssistiveTouch is little bit laggy (slow zoom in , zoom out) when tap to open it.
I tested on iPhone 4s and iPhone 6 , same trouble, so i think is not about device hardware or resource consume.
Anyone having same trouble or know reason? and how to solve it ?
I found reason by myself. that because of shadow. i added shadow for each button, after remove shadow, the lag didn't appear anymore.
so anyone suggest some better way to add shadow to button without laggy?
this is my way to add shadow to button:
button.layer.masksToBounds = false
button.layer.shadowColor = UIColor(rgb: 0x000000, alpha: 0.5).CGColor
button.layer.shadowOpacity = 1.0
button.layer.shadowRadius = 0
button.layer.shadowOffset = CGSizeMake(0, 1.0)
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