TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2016 |
Maintained by soya-bean.
导入方法:
Example:
DownJacketSearchBar *searchBar = [[DownJacketSearchBar alloc] init];
searchBar.delegate = self;
searchBar.placeholder = @" 搜索昵称/姓名";
searchBar.leftImage = [UIImage imageNamed:@"downJacket_search"];;
[self.view addSubview:searchBar];
- (void)addDownJackets:(DownJackets *)downJackets
- (void)removeDownJackets:(DownJackets *)downJackets
TODO (待完善的地方):
- (void)downJacketdeleteBackward {
if ([self.delegate respondsToSelector:@selector(textFieldDidDeleteBackward:)]) {
id <DownJacketTextFieldDelegate> delegate = (id<DownJacketTextFieldDelegate>)self.delegate;
[delegate textFieldDidDeleteBackward:self];
}
/**
1. 交互方法:runtime
method_exchangeImplementations(deleteBackward, downJacketdeleteBackward);
也就是外部调用downJacketdeleteBackward就相当于调用了deleteBackward,调用deleteBackward就相当于调用了downJacketdeleteBackward
2. 此时调用的方法 'downJacketdeleteBackward' 相当于调用系统的 'deleteBackward' 方法,原因是在load方法中进行了方法交换.
3. 注: 此处并没有递归操作
4. 在执行自定义方法'downJacketdeleteBackward'之后再去调用'deleteBackward',可以防止多余删除操作!(可根据实际情况处理调用的先后顺序)
*/
[self downJacketdeleteBackward];
[[NSNotificationCenter defaultCenter] postNotificationName:DownJacketTextFieldDidDeleteBackwardNotification object:self];
}