Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #9 and #11 #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions btCustomPopUP/btHomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#import "btHomeViewController.h"
#import "btSimplePopUP.h"

@interface btHomeViewController ()<btSimplePopUpDelegate>
@property(nonatomic, retain) btSimplePopUP *popUp, *popUpWithDelegate;
@interface btHomeViewController ()<BTSimplePopUPDelegate>
@property(nonatomic, retain) BTSimplePopUP *popUp, *popUpWithDelegate;
@end

@implementation btHomeViewController
Expand Down Expand Up @@ -72,7 +72,7 @@ - (void)viewDidLoad
[buttonDelegate addTarget:self action:@selector(showPopUpWithDelegate:) forControlEvents:UIControlEventTouchUpInside];
[scrollview addSubview:buttonDelegate];

popUpWithDelegate = [[btSimplePopUP alloc]initWithItemImage:@[
popUpWithDelegate = [[BTSimplePopUP alloc]initWithItemImage:@[
[UIImage imageNamed:@"alert.png"],
[UIImage imageNamed:@"attach.png"],
[UIImage imageNamed:@"cloudUp.png"],
Expand All @@ -98,10 +98,10 @@ - (void)viewDidLoad
popUpWithDelegate.delegate = self;

[self.view addSubview:popUpWithDelegate];
[popUpWithDelegate setPopUpStyle:BTPopUpStyleDefault];
[popUpWithDelegate setPopUpBorderStyle:BTPopUpBorderStyleDefaultNone];
[popUpWithDelegate setPopUpStyle:BTPopUPStyleDefault];
[popUpWithDelegate setPopUpBorderStyle:BTPopUPBorderStyleDefaultNone];

popUp = [[btSimplePopUP alloc]initWithItemImage:@[
popUp = [[BTSimplePopUP alloc]initWithItemImage:@[
[UIImage imageNamed:@"alert.png"],
[UIImage imageNamed:@"attach.png"],
[UIImage imageNamed:@"cloudUp.png"],
Expand Down Expand Up @@ -180,8 +180,8 @@ - (void)viewDidLoad
addToViewController:self];

[self.view addSubview:popUp];
[popUp setPopUpStyle:BTPopUpStyleDefault];
[popUp setPopUpBorderStyle:BTPopUpBorderStyleDefaultNone];
[popUp setPopUpStyle:BTPopUPStyleDefault];
[popUp setPopUpBorderStyle:BTPopUPBorderStyleDefaultNone];
// [popUp setPopUpBackgroundColor:[UIColor colorWithRed:0.1 green:0.2 blue:0.6 alpha:0.7]];

}
Expand Down Expand Up @@ -218,7 +218,7 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

#pragma -mark delegate btSimplePopUp

-(void)btSimplePopUP:(btSimplePopUP *)popUp didSelectItemAtIndex:(NSInteger)index{
-(void)btSimplePopUP:(BTSimplePopUP *)popUp didSelectItemAtIndex:(NSInteger)index{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"PopItem" message:[NSString stringWithFormat:@"iAM from Delegate. My Index is %ld", (long)index] delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
[alert show];
}
Expand Down
58 changes: 29 additions & 29 deletions btSimplePopUp/btSimplePopUP.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,57 @@
#import <QuartzCore/QuartzCore.h>
#import <Accelerate/Accelerate.h>

typedef NS_ENUM(NSInteger, BTPopUpStyle) {
BTPopUpStyleDefault,
BTPopUpStyleMinimalRoundedCorner
typedef NS_ENUM(NSInteger, BTPopUPStyle) {
BTPopUPStyleDefault,
BTPopUPStyleMinimalRoundedCorner
};

typedef NS_ENUM(NSInteger, BTPopUpAnimation) {
BTPopUPAnimateWithFade,
BTPopUPAnimateNone
typedef NS_ENUM(NSInteger, BTPopUPAnimation) {
BTPopUPAnimateWithFade,
BTPopUPAnimateNone
};

typedef NS_ENUM(NSInteger, BTPopUpBorderStyle) {
BTPopUpBorderStyleDefaultNone,
BTPopUpBorderStyleLightContent,
BTPopUpBorderStyleDarkContent
typedef NS_ENUM(NSInteger, BTPopUPBorderStyle) {
BTPopUPBorderStyleDefaultNone,
BTPopUPBorderStyleLightContent,
BTPopUPBorderStyleDarkContent
};


@class btSimplePopUP;
@class BTSimplePopUP;

@protocol btSimplePopUpDelegate <NSObject>
@protocol BTSimplePopUPDelegate <NSObject>

@optional
-(void)btSimplePopUP:(btSimplePopUP *)popUp didSelectItemAtIndex:(NSInteger)index;
-(void)btSimplePopUP:(BTSimplePopUP *)popUp didSelectItemAtIndex:(NSInteger)index;

@end

@interface btSimplePopUP : UIView <UIScrollViewDelegate>{
UIImageView *backGroundBlurr;
UIView *contentView;
CGSize itemSize;
UIColor *itemColor, *itemTextColor, *highlightColor, *backgroundColor;
UIFont *itemFont;
NSArray *popItems;
UIScrollView *scrollView;
UIPageControl * pageControl;
@interface BTSimplePopUP : UIView <UIScrollViewDelegate>{
UIImageView *backGroundBlurr;
UIView *contentView;
CGSize itemSize;
UIColor *itemColor, *itemTextColor, *highlightColor, *backgroundColor;
UIFont *itemFont;
NSArray *popItems;
UIScrollView *scrollView;
UIPageControl * pageControl;
}
@property (nonatomic, assign) BTPopUpStyle popUpStyle;
@property (nonatomic, assign) BTPopUpBorderStyle popUpBorderStyle;
@property (nonatomic, assign) BTPopUPStyle popUpStyle;
@property (nonatomic, assign) BTPopUPBorderStyle popUpBorderStyle;
@property (nonatomic, assign) UIColor *popUpBackgroundColor;
@property (nonatomic, assign) BTPopUpAnimation animationStyle;
@property(nonatomic, weak) id <btSimplePopUpDelegate> delegate;
@property (nonatomic, assign) BTPopUPAnimation animationStyle;
@property(nonatomic, weak) id <BTSimplePopUPDelegate> delegate;
@property (nonatomic) BOOL setShowRipples;

-(instancetype)initWithItemImage:(NSArray *)items andActionArray:(NSArray *)actionArray addToViewController:(UIViewController*)sender;
-(instancetype)initWithItemImage:(NSArray *)items andTitles:(NSArray *)titleArray andActionArray:(NSArray *)actionArray addToViewController:(UIViewController*)sender;

-(instancetype)initWithItemImage:(NSArray *)items andTitles:(NSArray *)titleArray addToViewController:(UIViewController*)sender;

-(void)setPopUpBackgroundColor:(UIColor *)popUpBackgroundColor;
-(void)show:(BTPopUpAnimation)animation;
-(void)dismiss;
-(void)setPopUPBackgroundColor:(UIColor *)popUpBackgroundColor;
-(void)show:(BTPopUPAnimation)animation;

@end


Expand Down
Loading