AXKit icon indicating copy to clipboard operation
AXKit copied to clipboard

系统类的功能扩展和一些常用的控件封装。文档地址:https://xaoxuu.com/wiki/axkit

Results 26 AXKit issues
Sort by recently updated
recently updated
newest added

## #if DEBUG的简单封装 函数很简单,能够提供一点便利,毕竟函数的调用比写宏更加快捷而且不易出错。 声明: ```objective-c /** 只在debug模式下运行的函数 @param debug debug操作 */ FOUNDATION_EXTERN void ax_debug_only(void (^debug)()); ``` 实现: ```objective-c inline void ax_debug_only(void (^debug)()){ #ifdef DEBUG if (debug) { debug(); }...

releaselog

### 必要性 首先我个人认为设计合理、逻辑严谨的代码是用不到这个机制的,但是我们不能保证我们面对的代码永远都是完美的,所以我就提供了这个冷却机制以延长那些癌症晚期的代码的寿命。 优点:执行代码像放技能一样,可以强行打破死循环、避免死循环、避免过高频率访问某一资源、从一定程度上缓解了内存、CPU压力。 缺点:治标不治本,最好是找出会产生问题的代码,从根源上解决问题。 ### 使用示例 #### 示例1 某种耗时耗能操作,希望在某种条件下触发,但又担心用户频繁触发,就可以这样: ```objective-c // @xaoxuu: 重新获取数据源并刷新tableView - (void)reloadDataAndRefreshTableView{ // 无论如何,2秒内最多只会执行一次此方法。 [NSBlockOperation ax_delay:0 cooldown:2 token:@"reload data and refresh table view" performInMainQueue:^{ [self.dataList removeAllObjects];...

enhancement
help

### UIAlertController 删除了两个使用频率低的接口 更改这两个接口使其能够返回实例: ```objective-c /** 弹窗(标题+消息+自定义按钮)(如果action为nil,则只有一个确定按钮) @param title 标题 @param message 消息 @param action 按钮 @return 返回alert对象 */ + (instancetype)ax_showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(void (^ __nullable)(UIAlertController *alert))actions;...

releaselog

### Fixed Bugs - [x] 修复了找不到AXKit.bundle资源的bug。

releaselog

接口: ```objective-c @interface UINavigationItem (AXExtension) /** 隐藏返回按钮的标题 */ - (void)ax_hideBackBarButtonTitle; /** 隐藏返回按钮(同时也不能右划返回) */ - (void)ax_hideBackBarButton; @end ``` 实现: ```objective-c @implementation UINavigationItem (AXExtension) /** 隐藏返回按钮的标题 */ - (void)ax_hideBackBarButtonTitle{ self.backBarButtonItem = [[UIBarButtonItem...

### 移除所有偏好设置 移除standardUserDefaults所有偏好设置 ```objective-c [NSUserDefaults ax_removeDefaultPersistentDomain]; ``` 声明: ```objective-c /** 移除默认的[NSUserDefaults standardUserDefaults]的所有配置 */ + (void)ax_removeDefaultPersistentDomain; ``` ### 获取启动图片 ```objective-c // 启动图片 UIImage *img = [NSBundle ax_appLaunchImage]; ``` 声明: ```objective-c /**...

releaselog

- [x] 完善NSUserDefaults的封装

help

### NSStringFromBool Convert a boolean value to Objective-C string. 将BOOL值转换成Objective-C字符串 ```objective-c NSString *string = NSStringFromBool(BOOL x); // x = YES, string = @"1" // x = NO, string = @"0"...

help

### 用法示例 ```objective-c // 将self.testView中所有的UILabel中的文字转换支持多语言 [self.testView ax_eachSubview:[UILabel class] action:^(__kindof UIView * _Nonnull subview) { UILabel *lb = subview; AXLocalizedLabel(lb); }]; // 将self.testView中所有的UITextField中的文字转换支持多语言 [self.local ax_eachSubview:[UITextField class] action:^(__kindof UIView * _Nonnull subview)...

enhancement
help