Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add text only mode #883

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
142 changes: 76 additions & 66 deletions Demo/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Demo/Classes/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- (IBAction)showInfoWithStatus;
- (IBAction)showSuccessWithStatus;
- (IBAction)showErrorWithStatus;
- (IBAction)showTextWithStatus;

- (IBAction)changeStyle:(id)sender;
- (IBAction)changeAnimationType:(id)sender;
Expand Down
5 changes: 5 additions & 0 deletions Demo/Classes/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ - (void)showErrorWithStatus {
self.activityCount++;
}

- (IBAction)showTextWithStatus {
[SVProgressHUD showTextWithStatus:@"Text"];
self.activityCount++;
}


#pragma mark - Styling

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Or show a confirmation glyph before before getting dismissed a little bit later.
+ (void)showSuccessWithStatus:(NSString*)string;
+ (void)showErrorWithStatus:(NSString*)string;
+ (void)showImage:(UIImage*)image status:(NSString*)string;
+ (void)showTextWithStatus:(nullable NSString*)status;
```

## Customization
Expand Down
1 change: 1 addition & 0 deletions SVProgressHUD/SVProgressHUD.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ typedef void (^SVProgressHUDDismissCompletion)(void);
+ (void)showSuccessWithStatus:(nullable NSString*)status maskType:(SVProgressHUDMaskType)maskType __attribute__((deprecated("Use showSuccessWithStatus: and setDefaultMaskType: instead.")));
+ (void)showErrorWithStatus:(nullable NSString*)status;
+ (void)showErrorWithStatus:(nullable NSString*)status maskType:(SVProgressHUDMaskType)maskType __attribute__((deprecated("Use showErrorWithStatus: and setDefaultMaskType: instead.")));
+ (void)showTextWithStatus:(nullable NSString*)status;

// shows a image + status, use white PNGs with the imageViewSize (default is 28x28 pt)
+ (void)showImage:(nonnull UIImage*)image status:(nullable NSString*)status;
Expand Down
5 changes: 5 additions & 0 deletions SVProgressHUD/SVProgressHUD.m
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ + (void)showErrorWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)ma
#endif
}

+ (void)showTextWithStatus:(nullable NSString*)status {
NSTimeInterval displayInterval = [self displayDurationForString:status];
[[self sharedView] showImage:nil status:status duration:displayInterval];
}

+ (void)showImage:(UIImage*)image status:(NSString*)status {
NSTimeInterval displayInterval = [self displayDurationForString:status];
[[self sharedView] showImage:image status:status duration:displayInterval];
Expand Down