Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
iOSのインジゲーターができない Objective−C側
#import <Foundation/Foundation.h>
#ifdef __cplusplus
extern "C" {
#endif
static UIActivityIndicatorView* spinner = nil;
void startSpinner() {
if(spinner == nil) {
spinner = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 100, 80)];
}
[spinner startAnimating];
}
void stopSpinner() {
if(spinner == nil) {
return;
}
if( ![spinner isAnimating] ) {
return;
}
[spinner stopAnimating];
}
#ifdef __cplusplus
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment