Update init method

This commit is contained in:
isaced 2016-04-07 12:00:39 +08:00
parent 04ec7de27d
commit 4a4463a8ac
4 changed files with 7 additions and 10 deletions

View File

@ -19,7 +19,7 @@
[super viewDidLoad];
// init ISEmojiView
ISEmojiView *emojiView = [[ISEmojiView alloc] initWithTextField:self.textView delegate:self popAnimationEnable:YES];
ISEmojiView *emojiView = [[ISEmojiView alloc] initWithTextField:self.textView delegate:self];
self.textView.inputView = emojiView;
[self.textView becomeFirstResponder];

View File

@ -36,7 +36,7 @@
@property (nonatomic, strong) UIView *textField;
/**
* Are animation allowed (default:YES)
* Are animation allowed (default:NO)
*
* require set textField to get point
*/
@ -46,8 +46,7 @@
* init ISEmojiView
*/
- (instancetype)initWithTextField:(UIView *)textField
delegate:(id<ISEmojiViewDelegate>)delegate
popAnimationEnable:(BOOL)popAnimationEnable;
delegate:(id<ISEmojiViewDelegate>)delegate;
@end

View File

@ -35,12 +35,11 @@ static const CGFloat EmojiFontSize = 32;
return self;
}
-(instancetype)initWithTextField:(UIView *)textField delegate:(id<ISEmojiViewDelegate>)delegate popAnimationEnable:(BOOL)popAnimationEnable{
-(instancetype)initWithTextField:(UIView *)textField delegate:(id<ISEmojiViewDelegate>)delegate {
self = [super init];
if (self) {
self.delegate = delegate;
self.textField = textField;
self.popAnimationEnable = popAnimationEnable;
}
return self;
}
@ -140,7 +139,7 @@ static const CGFloat EmojiFontSize = 32;
[self addSubview:self.pageControl];
// default allow animation
self.popAnimationEnable = YES;
self.popAnimationEnable = NO;
self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
}

View File

@ -20,9 +20,8 @@ pod 'ISEmojiView'
### Init
```
// init ISEmojiView
ISEmojiView *emojiView = [[ISEmojiView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 216)];
emojiView.delegate = self;
self.textView.inputView = emojiView;
ISEmojiView *emojiView = [[ISEmojiView alloc] initWithTextField:textView delegate:self popAnimationEnable:YES];
textView.inputView = emojiView;
```
### Response