https://github.com/sferrini/sfnotify
Simple custom user notifications
https://github.com/sferrini/sfnotify
Last synced: 5 days ago
JSON representation
Simple custom user notifications
- Host: GitHub
- URL: https://github.com/sferrini/sfnotify
- Owner: sferrini
- License: mit
- Created: 2014-02-24T17:45:05.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-28T12:57:19.000Z (over 10 years ago)
- Last Synced: 2025-03-29T14:41:20.937Z (28 days ago)
- Language: Objective-C
- Size: 5.05 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SFNotify
=============[](https://travis-ci.org/sferrini/SFNotify)
Simple custom user notifications
Based off [andreamazz / UIView-Notify](https://github.com/andreamazz/UIView-Notify)
Install
--------------------* Manually:
Copy the folder ```SFNotify``` to your project.* CocoaPods: Add the following line to your Podfile:
```
pod 'SFNotify'
```Usage
--------------------
Import ```SFNotify.h```* Default notification:
``` objc
NSString *yourMessage = [NSString stringWithFormat:@"This is the:\nSFNotify"]; //Change the text
[self.view notify:yourMessage
withDirection:DEFAULT_DIRECTION
withBackgroundColor:DEFAULT_COLOR_BACKGROUND
withFont:DEFAULT_FONT
withTextColor:DEFAULT_TEXT_COLOR
withDuration:DEFAULT_TIME_DURATION];
```* Custom notification:
``` objc
NSString *yourCustomMessage = [NSString stringWithFormat:@"This is the custom:\nSFNotify\n\nFeel free to modify whatever you want"]; //Change the text
[self.view notify:yourCustomMessage
withDirection:DIRECTION_LEFT_TO_RIGHT //Custom direction
withBackgroundColor:[UIColor blackColor] //Custom notify background color
withFont:[UIFont fontWithName:@"menlo" size:12] //Custom font
withTextColor:[UIColor whiteColor] //Custom font color
withDuration:4.0]; //Custom duration```
* Notification with specified event on touch
``` objc
NSString *yourMessage = [NSString stringWithFormat:@"This is the:\nSFNotify"]; //Change the text
[self.view notify:yourMessage
withDirection:DEFAULT_DIRECTION
withBackgroundColor:DEFAULT_COLOR_BACKGROUND
withFont:DEFAULT_FONT
withTextColor:DEFAULT_TEXT_COLOR
withDuration:DEFAULT_TIME_DURATION
andOnTouch:^{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"SFNotify"
message:@"Notification view was touched!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil, nil];
[alert show];
}];```
Screen
--------------------


