Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS AssistiveTouch slow animation when using custom keyboard

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 ?

like image 522
TomSawyer Avatar asked Nov 27 '14 14:11

TomSawyer


1 Answers

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)
like image 76
TomSawyer Avatar answered Oct 13 '22 01:10

TomSawyer