Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/problame/CSNotificationView
Drop-in, semi-translucent and blurring notification view.
https://github.com/problame/CSNotificationView
Last synced: 3 months ago
JSON representation
Drop-in, semi-translucent and blurring notification view.
- Host: GitHub
- URL: https://github.com/problame/CSNotificationView
- Owner: problame
- License: mit
- Created: 2013-09-18T19:02:30.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-09-04T21:16:43.000Z (over 6 years ago)
- Last Synced: 2024-10-12T21:33:54.216Z (4 months ago)
- Language: Objective-C
- Homepage:
- Size: 850 KB
- Stars: 900
- Watchers: 28
- Forks: 152
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
#CSNotificationView
Easy to use, semi-translucent and blurring notification view that drops into `UIView`, `UITableView`, `UICollectionView`.
Also supports displaying progress.**Supports iOS 7 and iOS 8. Requires Xcode 6.**
![]()
![]()
![]()
##Example code
###Quick presentation
```objc
[CSNotificationView showInViewController:self
style:CSNotificationViewStyleError
message:@"A critical error happened."];
[CSNotificationView showInViewController:self
style:CSNotificationViewStyleSuccess
message:@"Great, it works."];
```###UIActivityIndicatorView built-in
```objc
CSNotificationView* note = (...);
note.showingActivity = YES;[note setVisible:YES animated:YES completion:nil];
(...)
[note dismissWithStyle:CSNotificationViewStyleSuccess message:@"Success!"
duration:kCSNotificationViewDefaultShowDuration animated:YES];
```###Tap handling
Handle tap events on the notification using a block callback
```objc
__block typeof(self) weakSelf = self;
self.loadingNotificationView.tapHandler = ^{
[weakSelf cancelOperationXYZ];
[weakSelf.loadingNotificationView dismissWithStyle:CSNotificationViewStyleError
message:@"Cancelled"
duration:kCSNotificationViewDefaultShowDuration animated:YES];
};
```###Customization
####Custom image / icon
```objc
note.image = [UIImage imageNamed:@"mustache"];
```####Flexible with text & no images
```objc
[CSNotificationView showInViewController:self
tintColor:[UIColor colorWithRed:0.000 green:0.6 blue:1.000 alpha:1]
image:nil
message:@"No icon and a message that needs two rows and extra \
presentation time to be displayed properly."
duration:5.8f];```
##License
See [LICENSE.md](https://raw.github.com/problame/CSNotificationView/master/LICENSE.md)