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

来源:互联网 发布:mac装win10虚拟机 编辑:程序博客网 时间:2024/05/16 08:32

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


有时候会看到一些API已经弃用了被画上红色的横线,说明该接口已经被弃用,仍保留,但不建议使用,对弃用API实现画横线其实很简单,只需要在接口文件(.h)中这样写即可实现上图效果,很简单吧。

/*! 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;



1 0