Created
March 23, 2016 04:55
-
-
Save xhinking/e5e1a8fb751d71dcd932 to your computer and use it in GitHub Desktop.
Init helper source: https://github.com/Ramotion/circle-menu/blob/master/CircleMenuLib/CircleMenu.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public func Init<Type>(value: Type, @noescape block: (object: Type) -> Void) -> Type { | |
block(object: value) | |
return value | |
} | |
let fade = Init(CABasicAnimation(keyPath: "opacity")) { | |
$0.duration = NSTimeInterval(duration) | |
$0.fromValue = fromOpacity | |
$0.toValue = toOpacity | |
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) | |
$0.fillMode = kCAFillModeForwards | |
$0.removedOnCompletion = false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment