Skip to content

Instantly share code, notes, and snippets.

@pedantix
Last active April 9, 2016 15:56
Show Gist options
  • Save pedantix/08e13b730b608a6c243496bb4d095055 to your computer and use it in GitHub Desktop.
Save pedantix/08e13b730b608a6c243496bb4d095055 to your computer and use it in GitHub Desktop.
Swift Activity View Mixin
//use whatever activity view makes you happy in this project we were converting from ObjC to Swift, #2016
protocol ActivityVC: class {
var activityView: DejalBezelActivityView? { get set }
var view: UIView! { get }
}
extension ActivityVC {
mutating func activityStart() {
if activityView == nil {
activityView = DejalBezelActivityView(forView: view, withLabel: nil, width: 40)
}
activityView!.animateShow()
}
func activityStop() {
activityView?.animateRemove()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment