terryworona / TWMessageBarManager

An iOS manager for presenting system-wide notifications via a dropdown message bar.
MIT License
1.77k stars 191 forks source link

Some change to your project. #91

Closed Dimajp closed 8 years ago

Dimajp commented 8 years ago

Below you can find code of you class with my minor changes (changes to .h can be done by oneself). Hope you'll find them useful.

// // TWMessageBarManager.m // // Created by Terry Worona on 5/13/13. // Copyright (c) 2013 Terry Worona. All rights reserved. //

import "TWMessageBarManager.h"

// Quartz

import <QuartzCore/QuartzCore.h>

// Numerics (TWMessageBarStyleSheet) CGFloat const kTWMessageBarStyleSheetMessageBarAlpha = 0.96f;

// Numerics (TWMessageView) CGFloat const kTWMessageViewBarPadding = 10.0f; CGFloat const kTWMessageViewIconSize = 36.0f; CGFloat const kTWMessageViewTextOffset = 2.0f; NSUInteger const kTWMessageViewiOS7Identifier = 7;

// Numerics (TWMessageBarManager) CGFloat const kTWMessageBarManagerDisplayDelay = 5.0f; CGFloat const kTWMessageBarManagerDismissAnimationDuration = 0.25f; CGFloat const kTWMessageBarManagerPanVelocity = 0.2f; CGFloat const kTWMessageBarManagerPanAnimationDuration = 0.0002f;

// Strings (TWMessageBarStyleSheet) NSString * const kTWMessageBarStyleSheetImageIconError = @"icon-error.png"; NSString * const kTWMessageBarStyleSheetImageIconSuccess = @"icon-success.png"; NSString * const kTWMessageBarStyleSheetImageIconInfo = @"icon-info.png";

// Fonts (TWMessageView) static UIFont kTWMessageViewTitleFont = nil; static UIFont kTWMessageViewDescriptionFont = nil;

// Colors (TWMessageView) static UIColor kTWMessageViewTitleColor = nil; static UIColor kTWMessageViewDescriptionColor = nil;

// Colors (TWDefaultMessageBarStyleSheet) static UIColor kTWDefaultMessageBarStyleSheetErrorBackgroundColor = nil; static UIColor kTWDefaultMessageBarStyleSheetSuccessBackgroundColor = nil; static UIColor kTWDefaultMessageBarStyleSheetInfoBackgroundColor = nil; static UIColor kTWDefaultMessageBarStyleSheetErrorStrokeColor = nil; static UIColor kTWDefaultMessageBarStyleSheetSuccessStrokeColor = nil; static UIColor kTWDefaultMessageBarStyleSheetInfoStrokeColor = nil;

@protocol TWMessageViewDelegate;

@interface TWMessageView : UIView

@property (nonatomic, copy) NSString titleString; @property (nonatomic, copy) NSString descriptionString;

@property (nonatomic, assign) TWMessageBarMessageType messageType;

@property (nonatomic, assign) BOOL hasCallbackOk; @property (nonatomic, strong) NSArray *callbacksOk;

@property (nonatomic, assign) BOOL hasCallbackCancel; @property (nonatomic, strong) NSArray *callbacksCancel;

@property (nonatomic, assign, getter = isHit) BOOL hit;

@property (nonatomic, assign) CGFloat duration;

@property (nonatomic, assign) UIStatusBarStyle statusBarStyle; @property (nonatomic, assign) BOOL statusBarHidden;

@property (nonatomic, weak) id delegate;

// Initializers

// Getters

// Helpers

// Notifications

@end

@protocol TWMessageViewDelegate

@end

@interface TWDefaultMessageBarStyleSheet : NSObject

@end

@interface TWMessageWindow : UIWindow

@end

@interface TWMessageBarViewController : UIViewController

@property (nonatomic, assign) UIStatusBarStyle statusBarStyle; @property (nonatomic, assign) BOOL statusBarHidden;

@end

@interface TWMessageBarManager ()

@property (nonatomic, strong) NSMutableArray messageBarQueue; @property (nonatomic, assign, getter = isMessageVisible) BOOL messageVisible; @property (nonatomic, strong) TWMessageWindow messageWindow; @property (nonatomic, readwrite) NSArray *accessibleElements; // accessibility

// Static

// Helpers

// Gestures

// Getters

// Master presetation

@end

@implementation TWMessageBarManager

pragma mark - Singleton

@end

@implementation TWMessageView

pragma mark - Alloc/Init

@end

@implementation TWDefaultMessageBarStyleSheet

pragma mark - Alloc/Init

@end

@implementation TWMessageWindow

pragma mark - Touches

@end

@implementation UIDevice (Additions)

pragma mark - OS Helpers

@end

@implementation TWMessageBarViewController

@end

terryworona commented 8 years ago

If you have a feature request, please submit a pull request.