https://github.com/jjochen/jpmessagehandler
Handles and shows status messages on iOS devices.
https://github.com/jjochen/jpmessagehandler
Last synced: 2 months ago
JSON representation
Handles and shows status messages on iOS devices.
- Host: GitHub
- URL: https://github.com/jjochen/jpmessagehandler
- Owner: jjochen
- License: other
- Created: 2013-05-03T13:34:10.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-04-21T18:04:37.000Z (about 12 years ago)
- Last Synced: 2025-03-01T21:01:45.715Z (over 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 319 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# JPMessageHandler
Handles and shows status messages on iOS devices.
## Installation
_**Important note if your project doesn't use ARC**: you must add the `-fobjc-arc` compiler flag to `JPMessageHandler.m`, `JPMessage.m`, `JPMessageCell.m` and `XButton.m` in Target Settings > Build Phases > Compile Sources._
* Drag the `JPMessageHandler/JPMessageHandler` folder into your project.
* Add the **QuartzCore** framework to your project.
## Usage
(see sample Xcode project in `/Demo`)
### Init
In `viewDidLoad`
```objective-c
self.messageHandler = [[JPMessageHandler alloc] initWithSuperview:self.view];
```
### Showing a message
```objective-c
[self.messageHandler showMessage:@"Info Message" type:JPMessageTypeInfo];
[self.messageHandler showMessage:@"Long Error Message (min 4sec)" type:JPMessageTypeError minDuration:4.0 maxDuration:10.0];
```
## Customization
You can customize the following properties of `JPMessageHandler`:
``` objective-c
@property (nonatomic, assign) CGFloat rowHeight;
@property (nonatomic, assign) UITableViewCellSeparatorStyle separatorStyle;
@property (nonatomic, strong) UIView *backgroundView;
@property (nonatomic, strong) UIColor *backgroundColor;
@property (nonatomic, assign) CGFloat marginBottom;
@property (nonatomic, strong) UIColor *messageShadowColor;
@property (nonatomic, assign) CGSize messageShadowOffset;
@property (nonatomic, strong) NSArray *messageGradientColors;
@property (nonatomic, strong) UIFont *font;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, strong) UIColor *hideButtonColor;
@property (nonatomic, strong) UIColor *imageColor;
@property (nonatomic, assign) NSTimeInterval defaultMinDuration;
@property (nonatomic, assign) NSTimeInterval defaultMaxDuration;
```
## Example
As an example see the [iOS BBBike app](https://itunes.apple.com/us/app/bbbike/id555616117?mt=8).
## Credits
JPMessageHandler is brought to you by [Jochen Pfeiffer](http://jochen-pfeiffer.com) and [contributors to the project](https://github.com/jjochen/JPMessageHandler/contributors). If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by [creating new issues](https://github.com/jjochen/JPMessageHandler/issues/new). If you're using JPMessageHandler in your project, attribution would be nice.