Skip to content
Open

hi #3

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions JNJProgressButton-Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@
CLASSPREFIX = JNJ;
LastUpgradeCheck = 0460;
ORGANIZATIONNAME = JNJ;
TargetAttributes = {
A464A211177E9DB600BCE741 = {
DevelopmentTeam = WQWKS8U593;
};
};
};
buildConfigurationList = A464A20D177E9DB600BCE741 /* Build configuration list for PBXProject "JNJProgressButton-Sample" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -315,6 +320,7 @@
A464A230177E9DB600BCE741 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "JNJProgressButton-Sample/JNJProgressButton-Sample-Prefix.pch";
INFOPLIST_FILE = "JNJProgressButton-Sample/JNJProgressButton-Sample-Info.plist";
Expand All @@ -326,6 +332,7 @@
A464A231177E9DB600BCE741 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "JNJProgressButton-Sample/JNJProgressButton-Sample-Prefix.pch";
INFOPLIST_FILE = "JNJProgressButton-Sample/JNJProgressButton-Sample-Info.plist";
Expand Down
31 changes: 18 additions & 13 deletions JNJProgressButton-Sample/JNJSampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,24 @@ - (IBAction)showActionSheet:(id)sender

- (void)startProgressWithButton:(JNJProgressButton *)button
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
[NSThread sleepForTimeInterval:3];
NSInteger index = 0;
while (index <= 100) {
[NSThread sleepForTimeInterval:0.04];
dispatch_async(dispatch_get_main_queue(), ^{
button.progress = (index / 100.0f);
});
index++;

if (!button.progressing) return;
}
});
[button endProgressWithState:JNJProgressButtonStateUnstarted];
//
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [button endProgressWithState:JNJProgressButtonStateFinished];
// });
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
// [NSThread sleepForTimeInterval:3];
// NSInteger index = 0;
// while (index <= 100) {
// [NSThread sleepForTimeInterval:0.04];
// dispatch_async(dispatch_get_main_queue(), ^{
// button.progress = (index / 100.0f);
// });
// index++;
//
// if (!button.progressing) return;
// }
// });
}

@end
Loading