自己写的常用方法(Swfit版)
来源:互联网 发布:第一视角软件 编辑:程序博客网 时间:2024/05/10 04:57
记载一些常用的公共方法 不断更新中····
/** 判断字符串是否为空 - parameter str: String - returns: true Or false */ class func judgeIsEmptyWithString(str:String) -> Bool { if str.isEmpty { return true } return false } /** 设置UIButton圆角 */ class func setButtonBorderRadius(button:UIButton, radius:CGFloat) { button.layer.masksToBounds = true button.layer.cornerRadius = radius } /** 设置UIImageView圆角 */ class func setImageViewBorderRadius(imageView:UIImageView, radius:CGFloat) { imageView.layer.masksToBounds = true imageView.layer.cornerRadius = radius } /** 随机颜色 - returns: 返回一个颜色 */ class func randomColor() ->UIColor{ return self.init(red: CGFloat(CGFloat(random())/CGFloat(RAND_MAX)), green: CGFloat(CGFloat(random())/CGFloat(RAND_MAX)), blue: CGFloat(CGFloat(random())/CGFloat(RAND_MAX)), alpha: 1) } /** 设置RGB颜色值 - parameter red: red - parameter green: green - parameter blue: blue - parameter alpha: alpha - returns: 一个颜色值 */ class func RGBColor(red:CGFloat, green:CGFloat, blue:CGFloat, alpha:CGFloat) ->UIColor { return self.init(red: red / 255.0, green: green / 255.0, blue: blue / 255.0, alpha: alpha) }
0 0
- 自己写的常用方法(Swfit版)
- 自己写了些js常用的方法
- 我自己写的几个C++常用方法
- 自己写的常用库
- CSDN上常用的markdown编辑器的常用方法(自己该手动写的部分【左边】)
- 常用的jquery方法(写给自己)
- 常用的正则表达式(不需要在自己写了)
- lua学习实例,都是自己写的,慢慢摸索,涵盖了lua常用的方法
- 自己写的JSON 工具类,封装一些常用的方法
- 自己写的一些Delphi常用函数
- 整理下自己写的常用库
- 自己写的一些Delphi常用函数
- 自己写的一些Delphi常用函数
- swfit 的 get 和 set 方法, willSet 和 didSet
- swfit字符串的截取
- 自己写的JAVA排列组合方法
- 自己写的一个replaceAll方法
- properties文件读写自己写的方法
- java编程300例:3.输出由“*”组成的三角形
- android studio 工程目录详解
- angular 表单验证 ng-repeat里的验证
- action接收不到参数
- 解决webview内存泄露的问题
- 自己写的常用方法(Swfit版)
- mysql的gap锁导致Lock wait timeout exceeded try restarting transaction异常
- POJ 2353 DP
- Android学习第九天---Android数据存储
- JS简介
- 求一个数组的秩 Java实现
- C语言学习6
- Android UI(RadioButton)详解
- Permutations 全排列生成算法