Skip to content

Commit 6f57433

Browse files
committed
- 修复pauseBlock问题
- other
1 parent d0d3802 commit 6f57433

File tree

4 files changed

+66
-11
lines changed

4 files changed

+66
-11
lines changed

Example/LSTTimer.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@
567567
INFOPLIST_FILE = "LSTTimer/LSTTimer-Info.plist";
568568
MARKETING_VERSION = 0.1;
569569
MODULE_NAME = ExampleApp;
570-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
570+
PRODUCT_BUNDLE_IDENTIFIER = com.LSTTimer.www;
571571
PRODUCT_NAME = LSTTimer;
572572
SWIFT_VERSION = 4.0;
573573
WRAPPER_EXTENSION = app;
@@ -586,7 +586,7 @@
586586
INFOPLIST_FILE = "LSTTimer/LSTTimer-Info.plist";
587587
MARKETING_VERSION = 0.1;
588588
MODULE_NAME = ExampleApp;
589-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
589+
PRODUCT_BUNDLE_IDENTIFIER = com.LSTTimer.www;
590590
PRODUCT_NAME = LSTTimer;
591591
SWIFT_VERSION = 4.0;
592592
WRAPPER_EXTENSION = app;

Example/LSTTimer/LSTTimer-Info.plist

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
<string>$(CURRENT_PROJECT_VERSION)</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
27+
<key>UIBackgroundModes</key>
28+
<array>
29+
<string>audio</string>
30+
<string>fetch</string>
31+
<string>processing</string>
32+
</array>
2733
<key>UILaunchStoryboardName</key>
2834
<string>LaunchScreen</string>
2935
<key>UIMainStoryboardFile</key>

LSTTimer.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'LSTTimer'
11-
s.version = '0.1.08251125'
12-
s.summary = 'A short description of LSTTimer.'
11+
s.version = '0.2.10'
12+
s.summary = '一个计时器组件'
1313

1414
# This description is used to generate tags and improve search results.
1515
# * Think: What does it do? Why did you write it? What is the focus?

LSTTimer/Classes/LSTTimer.m

+56-7
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,43 @@ + (void)addTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle
143143
+ (void)addTimerForTime:(NSTimeInterval)time
144144
identifier:(NSString *)identifier
145145
handle:(LSTTimerChangeBlock)handle {
146-
[self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:-1 handle:handle finish:nil pause:nil];
146+
147+
[self initTimerForForTime:time
148+
identifier:identifier
149+
ForIsDisk:NO
150+
unit:-1
151+
handle:handle
152+
finish:nil
153+
pause:nil];
147154
}
148155
/** 添加定时器并开启计时 */
149156
+ (void)addTimerForTime:(NSTimeInterval)time
150157
identifier:(NSString *)identifier
151158
handle:(LSTTimerChangeBlock)handle
152159
finish:(LSTTimerFinishBlock)finishBlock
153160
pause:(LSTTimerPauseBlock)pauseBlock {
154-
[self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:-1 handle:handle finish:finishBlock pause:pauseBlock];
161+
162+
[self initTimerForForTime:time
163+
identifier:identifier
164+
ForIsDisk:NO
165+
unit:-1
166+
handle:handle
167+
finish:finishBlock
168+
pause:pauseBlock];
155169
}
156170

157171
/** 添加定时器并开启计时 */
158172
+ (void)addDiskTimerForTime:(NSTimeInterval)time
159173
identifier:(NSString *)identifier
160174
handle:(LSTTimerChangeBlock)handle {
161-
[self initTimerForForTime:time identifier:identifier ForIsDisk:YES unit:-1 handle:handle finish:nil pause:nil];
175+
176+
[self initTimerForForTime:time
177+
identifier:identifier
178+
ForIsDisk:YES
179+
unit:-1
180+
handle:handle
181+
finish:nil
182+
pause:nil];
162183
}
163184

164185
/** 添加定时器并开启计时 */
@@ -167,7 +188,14 @@ + (void)addDiskTimerForTime:(NSTimeInterval)time
167188
handle:(LSTTimerChangeBlock)handle
168189
finish:(LSTTimerFinishBlock)finishBlock
169190
pause:(LSTTimerPauseBlock)pauseBlock {
170-
[self initTimerForForTime:time identifier:identifier ForIsDisk:YES unit:-1 handle:handle finish:finishBlock pause:pauseBlock];
191+
192+
[self initTimerForForTime:time
193+
identifier:identifier
194+
ForIsDisk:YES
195+
unit:-1
196+
handle:handle
197+
finish:finishBlock
198+
pause:pauseBlock];
171199
}
172200

173201

@@ -179,7 +207,14 @@ + (void)addMinuteTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)h
179207
+ (void)addMinuteTimerForTime:(NSTimeInterval)time
180208
identifier:(NSString *)identifier
181209
handle:(LSTTimerChangeBlock)handle {
182-
[self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:1000 handle:handle finish:nil pause:nil];
210+
211+
[self initTimerForForTime:time
212+
identifier:identifier
213+
ForIsDisk:NO
214+
unit:1000
215+
handle:handle
216+
finish:nil
217+
pause:nil];
183218
}
184219

185220
/** 添加定时器并开启计时 */
@@ -188,7 +223,14 @@ + (void)addMinuteTimerForTime:(NSTimeInterval)time
188223
handle:(LSTTimerChangeBlock)handle
189224
finish:(LSTTimerFinishBlock)finishBlock
190225
pause:(LSTTimerPauseBlock)pauseBlock {
191-
[self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:1000 handle:handle finish:finishBlock pause:pauseBlock];
226+
227+
[self initTimerForForTime:time
228+
identifier:identifier
229+
ForIsDisk:NO
230+
unit:1000
231+
handle:handle
232+
finish:finishBlock
233+
pause:pauseBlock];
192234
}
193235

194236
/** 添加定时器并开启计时 */
@@ -197,7 +239,14 @@ + (void)addDiskMinuteTimerForTime:(NSTimeInterval)time
197239
handle:(LSTTimerChangeBlock)handle
198240
finish:(LSTTimerFinishBlock)finishBlock
199241
pause:(LSTTimerPauseBlock)pauseBlock {
200-
[self initTimerForForTime:time identifier:identifier ForIsDisk:YES unit:1000 handle:handle finish:finishBlock pause:pauseBlock];
242+
243+
[self initTimerForForTime:time
244+
identifier:identifier
245+
ForIsDisk:YES
246+
unit:1000
247+
handle:handle
248+
finish:finishBlock
249+
pause:pauseBlock];
201250
}
202251

203252
//总初始化入口

0 commit comments

Comments
 (0)