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
Post a Comment