Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. extension UIView {
  2.  
  3. func appearFromBelow(parent: UIView, below: Bool = true) {
  4.  
  5. let wrapper = UIView(frame: frame)
  6. wrapper.clipsToBounds = true
  7. wrapper.addSubview(self)
  8. wrapper.backgroundColor = UIColor.blueColor()
  9. frame = wrapper.bounds
  10. parent.addSubview(wrapper)
  11.  
  12. }
  13.  
  14. func animateIn(duration: Double) {
  15. UIView.animateWithDuration(duration) {
  16. self.transform = CGAffineTransformIdentity
  17. }
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement