Created
December 3, 2017 09:52
-
-
Save lengocgiang/9a3e1003964c916a0ca7b574db0180e2 to your computer and use it in GitHub Desktop.
addSubview and removeFromSuperview animation in Swift 4.0
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
# addSubview | |
UIView.transition(with: self.view, duration: 0.25, options: [.transitionCrossDissolve], animations: { | |
self.view.addSubview(view) | |
}, completion: nil) | |
# removeFromSuperview | |
UIView.transition(with: self.view, duration: 0.25, options: [.transitionCrossDissolve], animations: { | |
subview.removeFromSuperview() | |
}, completion: nil) |
Thank you ^_^
Yeah, thanks!
Thanks!
thx a lot !
Hi, thanks for this. But can this be used on UITabBarItem subviews that are within ViewControllers? Or how do we make this work on UITabBarItems?
Thanks, man!
Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you're welcome, happy coding