JPMessageHandler 0.1.0

JPMessageHandler 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



  • By
  • Jochen Pfeiffer

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

self.messageHandler = [[JPMessageHandler alloc] initWithSuperview:self.view];

Showing a message

[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:

@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.

Credits

JPMessageHandler is brought to you by Jochen Pfeiffer and contributors to the project. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by creating new issues. If you're using JPMessageHandler in your project, attribution would be nice.