File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |s |
2
2
s . name = "EZLoadingActivity"
3
- s . version = "0.7 "
3
+ s . version = "0.8 "
4
4
s . summary = "Lightweight Swift loading activity for iOS7+"
5
5
s . description = "Lightweight Swift loading activity for iOS7+. Really simple to use, just add the class and write 1 line of code."
6
6
s . homepage = "https://github.com/goktugyil/EZLoadingActivity"
Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ public struct EZLoadingActivity {
50
50
print ( " EZLoadingActivity Error: You don't have any views set. You may be calling them in viewDidLoad. Try viewDidAppear instead. " )
51
51
return false
52
52
}
53
-
53
+ // Separate creation from showing
54
+ instance = LoadingActivity ( text: text, disableUI: disableUI)
54
55
dispatch_async ( dispatch_get_main_queue ( ) ) {
55
- instance = LoadingActivity ( text : text , disableUI : disableUI )
56
+ instance? . showLoadingActivity ( )
56
57
}
57
58
return true
58
59
}
@@ -126,17 +127,19 @@ public struct EZLoadingActivity {
126
127
textLabel. textAlignment = NSTextAlignment . Center
127
128
textLabel. text = text
128
129
129
- addSubview ( activityView)
130
- addSubview ( textLabel)
131
-
132
- topMostController!. view. addSubview ( self )
133
-
134
130
if disableUI {
135
131
UIApplication . sharedApplication ( ) . beginIgnoringInteractionEvents ( )
136
132
UIDisabled = true
137
133
}
138
134
}
139
135
136
+ func showLoadingActivity( ) {
137
+ addSubview ( activityView)
138
+ addSubview ( textLabel)
139
+
140
+ topMostController!. view. addSubview ( self )
141
+ }
142
+
140
143
func createShadow( ) {
141
144
layer. shadowPath = createShadowPath ( ) . CGPath
142
145
layer. masksToBounds = false
You can’t perform that action at this time.
0 commit comments