Created
October 17, 2016 03:42
-
-
Save ahikmatf/339ede2bb0cdc5e31fa881268dc996a2 to your computer and use it in GitHub Desktop.
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
for view in self.view.subviews{ | |
print(view) | |
if view.isKind(of: SpinnerView.self) { | |
view.removeFromSuperview() | |
} | |
} | |
===== | |
func showLoading() { | |
var sizeScale = 1 | |
let model = UIDevice.current.model | |
if model == "iPhone" { | |
sizeScale = 1 | |
} else if model == "iPad" { | |
sizeScale = 2 | |
} | |
let x = Int(self.view.frame.width / 2) - (18 * sizeScale) | |
let y = Int(self.view.frame.height / 2) - (18 * sizeScale) | |
let size = 36 * 2 | |
loadingView = SpinnerView(frame: CGRect(x: x, y: y, width: size, height: size)) | |
loadingView.backgroundColor = UIColor.clear | |
self.view.addSubview(loadingView) | |
} | |
===== | |
var loadingView = UIView() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment