Skip to content

Commit

Permalink
+ initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
naderrashed committed Nov 14, 2016
0 parents commit 5512569
Show file tree
Hide file tree
Showing 6 changed files with 821 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Classes/SNPDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// InformationDialogViewController.h
// Snapp
//
// Created by Apple on 10/30/16.
// Copyright © 2016 Snapp. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, SNPDialogStyle) {
SNPDialogStyleInformation,
SNPDialogStyleError,
SNPDialogStyleDecision,
};

typedef NS_ENUM(NSUInteger, SNPDialogButtonArrangement) {
SNPDialogButtonArrangementVertical,
SNPDialogButtonArrangementHorizontal,
};



@interface SNPDialog : UIViewController <UIPickerViewDelegate,UIPickerViewDataSource>

@property (nonatomic,assign) BOOL loadingMode;
@property (nonatomic,assign) BOOL shouldCloseOnOutsideTouch;

@property (nonatomic,retain) UITextField* textField;
@property (nonatomic,retain) NSMutableArray* buttons;

@property (nonatomic,assign) SNPDialogStyle style;
@property (nonatomic,assign) SNPDialogButtonArrangement buttonArrangement;

@property (nonatomic,retain) UIViewController* presentorViewController;


-(instancetype) initWithImage:(NSString *)imageText andTitle:(NSString *)title andMessage:(NSString *)message andStyle:(SNPDialogStyle)style andButtonArrangement:(SNPDialogButtonArrangement)arrangement;


-(void) addButtonWithTitle:(NSString*)title andCallback:(void (^)(void) )callback;


-(void) setupTextInputMode;
-(void) setupOptionsModeWithOptions:(NSArray<NSString *>*)options;

-(NSInteger) getOptionsSelectedIndex;


// if we set presentorViewController, the dialog will present through it , other wise the dialog will add to UIWindow
-(void) show;
-(void) dismiss;

@end
Loading

0 comments on commit 5512569

Please sign in to comment.