swift - CALayer, CAConstraint & Disabling the Animation -
i wondering if there's way disable animations particular layer?
my example here bog standard calayer (the nsview's calayer), , sublayer, catextlayer...
catextlayer nicely tethered nsview's calayer , should.. no issues there...
how turn off "easing" animations when view resized?
literally have in nsview subclass:
override func awakefromnib() { var newlayer: calayer = calayer() newlayer.backgroundcolor = nscolor.blackcolor().cgcolor newlayer.layoutmanager = caconstraintlayoutmanager.layoutmanager() self.layer = newlayer self.wantslayer = true var textlayer: catextlayer = catextlayer() newlayer.insertsublayer(textlayer, atindex: 0) textlayer.string = "yay layer" textlayer.foregroundcolor = nscolor.whitecolor().cgcolor textlayer.name = "textlayer" textlayer.fontsize = 42.0; textlayer.alignmentmode = kcaalignmentcenter; textlayer.addconstraint(caconstraint(attribute: .midx, relativeto: "superlayer", attribute: .midx, scale: 1.0, offset: 0.0)) textlayer.addconstraint(caconstraint(attribute: .maxy, relativeto: "superlayer", attribute: .maxy, scale: 1.0, offset: -50.0)) }
here's clip of i'm getting:
screen capture of wobbly (eased) constraints
what expected textlayer adhere constraints until otherwise given animator..
is there way stop, remove, or otherwise stop it?
cheers,
a
textlayer.actions = ["position" : nsnull()]
Comments
Post a Comment