zoukankan      html  css  js  c++  java
  • Swift的关键字

    在声明中使用关键字

     let   :声明一个常量

    var  :声明一个变量

    class  :声明一个类

    static  :静态的

    deinit  :反初始化方法?析构方法

    init  :构造方法?初始化方法

    enum  :枚举

    extension  :扩展---给对象增加方法

    func  :声明一个函数

    import  :导入头文件

    internal  :内部的

    private  :私有的

    public  :公开的

    operator  :自定义运算符

    protocol  :协议

    struct  :结构体

    subscript  :下标

    typealias  :重命名某方法    typealias Feet = Int

    在语句中使用关键词

    break  :打断

    case   :条件

    continue  :跳过

    default  :默认

    do  :做什么例如 do...while

    repeat :同上 repeat...while

    if   :条件判断

    else   :条件判断

    else if   :条件判断

    switch   :条件选择

    fallthrough   :语句跳转 用在switch中跳转执行某段代码有fallthrough的代码都要并且跳转到default

    for   :循环

    for in   :循环

    while   :循环

    where  :接在case后判断执行       case let (x, y) where x == y:

    在表达式和类型中使用关键字

    as dynamicType false is
    nil self Self super
    true _COLUMN_ _FILE_ _FUNCTION_
    _LINE_
     
     
     

    在特定情况下使用的关键字

    associativity convenience dynamic didSet
    final get infix inout
    lazy left mutating none
    nonmutating optional override postfix
    precedence prefix Protocol required
    right set Type unowned
    weak willSet  
  • 相关阅读:
    HDR & Bloom
    Parallax Mapping
    Normal Mapping & Tangent Space
    Gamma校正背后的原理
    内存对齐及其原理
    关于深度值的一些需要说明的点
    帧缓冲(Framebuffer)
    面剔除和深度测试
    工具·MashLab调整网格模型坐标系
    工具·notepad++正则表达式替换文本
  • 原文地址:https://www.cnblogs.com/liuShanPei1024/p/5348490.html
Copyright © 2011-2022 走看看