
swift
FlashCanSavetheWorld
不想起床
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UILable,UIfont,NSAttributedString模版
import UIKit class MyView: UIView { override func draw(_ rect: CGRect) { let roundedRect = UIBezierPath(roundedRect: bounds, cornerRadius: bounds.size.height*0.01) roundedRect.addClip() UIColor.white.setFill() roun原创 2020-06-22 12:03:46 · 157 阅读 · 0 评论 -
UIView的sizeToFit
https://www.jianshu.com/p/f32e65740240转载 2020-06-21 02:30:40 · 241 阅读 · 0 评论 -
uikit 坐标系,bounds,frame理解
坐标系 uikit坐标系(x,y)如图所示,在size中大小为(x-0,y-0) bounds&frame frame: 该view在父view坐标系统中的位置和大小。(参照点是,父亲的坐标系统) bounds:该view在本地坐标系统中的位置和大小。即永远是(0,0) 如图建立如下视图 override func layoutSubviews() { super.layoutSubviews() configureCornerlabel(mylabel)原创 2020-06-18 16:06:35 · 735 阅读 · 0 评论 -
ios view的frame和bounds之区别(位置和大小)
https://blog.youkuaiyun.com/mad1989/article/details/8711697转载 2020-05-21 00:41:28 · 149 阅读 · 0 评论 -
swift之mutating关键字的使用
https://blog.youkuaiyun.com/jacob_ios/article/details/87099070转载 2020-05-08 18:03:42 · 166 阅读 · 0 评论 -
Swift enum中的相关值
相关值是当你在创建一个基于枚举成员的新常量或变量时才会被设置,并且每次当你这么做得时候,它的值可以是不同的。 以下实例中我们定义一个名为 Student 的枚举类型,它可以是 Name 的一个字符串(String),或者是 Mark 的一个相关值(Int,Int,Int)。 enum Student{ case Name(String) case Mark(Int,Int,I...原创 2020-04-23 17:50:08 · 228 阅读 · 0 评论 -
Swift Switch
https://blog.youkuaiyun.com/zhangao0086/article/details/38667315转载 2020-04-23 15:49:59 · 139 阅读 · 0 评论 -
Swift中的required修饰符
https://blog.youkuaiyun.com/zhangchunxinzcx/article/details/52325169转载 2020-04-21 17:32:12 · 800 阅读 · 0 评论 -
swift ARC中的strong、weak、unowned
https://blog.youkuaiyun.com/qq_21933583/article/details/76674408转载 2020-04-13 18:03:41 · 263 阅读 · 0 评论 -
swift extension
参考于转载 2020-04-13 17:43:23 · 116 阅读 · 0 评论 -
swift get和set用法
var indexOfOneAndOnlyFaceUpCard: Int? { get{ var foundIndex:Int? for index in cards.indices{ if cards[index].isFaceUp{ if foundI...原创 2020-04-13 17:36:18 · 1024 阅读 · 0 评论 -
Swift条件判断中的逗号
转载转载 2020-04-03 15:50:09 · 201 阅读 · 0 评论 -
利用arc4random_uniform()产生随机数
arc4random_uniform(x), 可以用来产生0~(x-1)范围内的随机数, 不需要再进行取模运算。如果要生成1~x的随机数,可以这么写:arc4random_uniform(x)+1 该函数的参数和返回值都是UInt32 ...原创 2020-04-03 15:44:31 · 480 阅读 · 0 评论 -
swift-optional
转载转载 2020-03-31 18:20:56 · 109 阅读 · 0 评论 -
swift函数
func flipCard(withEmoji emoji:String,on Button :UIButton) { if Button.currentTitle==emoji{ Button.setTitle("", for: UIControl.State.normal) Button.backgroundColor = ...原创 2020-03-26 15:40:35 · 102 阅读 · 0 评论