zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

XCode中在提示窗体中对已弃用的API接口画上红线

xcode接口API 提示 窗体
2023-09-14 09:07:57 时间

当我们在XCode中写程序时会不断的出现相关API提示窗体,那敲起来是一个爽啊。


有时候会看到一些API已经弃用了被画上红色的横线。说明该接口已经被弃用,仍保留,但不建议使用,对弃用API实现画横线事实上非常easy,仅仅须要在接口文件(.h)中这样写就可以实现上图效果,非常easy吧。

/*!
 DEPRECATED: Use the [CustomIOS7AlertView init] method without passing a parent view.
 */
- (id)initWithParentView: (UIView *)_parentView __attribute__ ((deprecated));


为接口加入接口说明


/**设置app的友盟appKey,此appKey从友盟站点获取

 @param appKey 友盟appKey
 */

+ (void)setAppKey:(NSString *)appKey;