Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit b99e4bc

Browse files
Jakob MygindJakob Mygind
authored andcommitted
- disabled userinteraction while showing spinner
1 parent 35018f4 commit b99e4bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Spinner/Spinner.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class SpinnerView: NSObject, Spinner {
6767
*/
6868
public static func showSpinnerInButton(button: UIButton, style: UIActivityIndicatorViewStyle = .White, color:UIColor? = nil) -> Spinner {
6969
let view = showSpinnerInView(button, style: style, color: color)
70-
70+
button.userInteractionEnabled = false
7171
if let spinnerView = view as? SpinnerView {
7272
spinnerView.controlTitleColors = button.allTitleColors()
7373
button.removeAllTitleColors()
@@ -78,6 +78,7 @@ public class SpinnerView: NSObject, Spinner {
7878

7979
public func dismiss() {
8080
if let button = spinner?.superview as? UIButton {
81+
button.userInteractionEnabled = true
8182
button.restoreTitleColors(controlTitleColors)
8283
}
8384
spinner?.dismiss()

0 commit comments

Comments
 (0)