ios - "zPosition" CABasicAnimation not working -


i used animation along z axis long time ago in objective c :

    cabasicanimation *positionanimation;      positionanimation=[cabasicanimation animationwithkeypath:@"zposition"];     positionanimation.fromvalue=[nsnumber numberwithfloat:frandom(800, 400)];     positionanimation.tovalue=[nsnumber numberwithfloat:frandom(-300, -100)];     positionanimation.duration=duration;     positionanimation.repeatcount = huge_valf;     positionanimation.removedoncompletion = no; 

but not working anymore on swift 3, layer not move @ all.

        let positionanimation = cabasicanimation(keypath: "zposition")         positionanimation.fromvalue = nsnumber(value: float.random(from: 800, 400))         positionanimation.tovalue = nsnumber(value: float.random(from: -300, -100))         positionanimation.duration = duration         positionanimation.repeatcount = 400         positionanimation.isremovedoncompletion = false 

did miss ? thank you.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -