Skip to content

Instantly share code, notes, and snippets.

@tdtsh
Created February 11, 2016 13:14
Show Gist options
  • Save tdtsh/62ad6291c384b96885ed to your computer and use it in GitHub Desktop.
Save tdtsh/62ad6291c384b96885ed to your computer and use it in GitHub Desktop.
Swift2 Facebook Popでフェードイン
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