Created
February 11, 2016 13:14
-
-
Save tdtsh/62ad6291c384b96885ed to your computer and use it in GitHub Desktop.
Swift2 Facebook Popでフェードイン
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
class SomeViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.view.backgroundColor = UIColor.blueColor() | |
// ラベル | |
var label: UILabel = UILabel() | |
label.frame = CGRect.init(x: 0, y: 300, width: self.view.frame.size.width, height: 200) | |
label.lineBreakMode = NSLineBreakMode.ByCharWrapping | |
label.numberOfLines = 0 | |
label.text = "FadeIn...." | |
self.view.addSubview(labelTran) | |
// フェードイン | |
let anim = POPBasicAnimation(propertyNamed: kPOPViewAlpha) | |
anim.timingFunction = CAMediaTimingFunction.init(name: kCAMediaTimingFunctionEaseInEaseOut) | |
anim.fromValue = 0.0 | |
anim.toValue = 1.0 | |
anim.duration = 3.0 | |
labelTran.pop_addAnimation(anim, forKey: "fade") | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment