ios 方法使用

注意导入头文件

类方法的使用

//文件名 UIColor+Expend.h   扩展方法
.h @interface UIColor (Expend) .m // UIColor+Expend.m #import "UIColor+Expend.h" #pragma mark - 颜色转换 IOS中十六进制的颜色转换为UIColor + (UIColor *) colorWithHexString: (NSString *)color

使用

self.view.backgroundColor=[UIColor  colorWithHexString:@"#EEE4D9"];

---------------------------------------------------

继承方法

//.h 文件
@interface UnderlineButton : UIButton
+ (UnderlineButton *) underlinedButton;

直接使用

  UnderlineButton   *lginBtn=[UnderlineButton  buttonWithType:UIButtonTypeCustom];

  

 

 

ios 方法使用,,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。