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

it2025-06-04  74

当我们在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;

转载于:https://www.cnblogs.com/bhlsheji/p/5314281.html

最新回复(0)