iOS开发——Swift快速上手(区别篇)


       主要内容:objective-c和swift的区别

     

     1.1 属性
iOS开发——Swift快速上手(区别篇)



        2 宏定义全局变量
         OC中用 #define  aValue  @"确定"
          swift 用全局常量:
          let screenWith   = UIScreen.main.bounds.size.width
          let screenHeight = UIScreen.main.bounds.size.height

        3  selector使用区别
        oc使用方式:@selector(questionClick)
           swift使用:#selector(gotoWenjuan)

      4.值的类型和引用类型
iOS开发——Swift快速上手(区别篇)



      5.控制流
iOS开发——Swift快速上手(区别篇)
iOS开发——Swift快速上手(区别篇)
iOS开发——Swift快速上手(区别篇)


      6.函数默认参数值
iOS开发——Swift快速上手(区别篇)


      7.delegate
iOS开发——Swift快速上手(区别篇)


      8.id和AnyObject
iOS开发——Swift快速上手(区别篇)


      9.错误处理
       
iOS开发——Swift快速上手(区别篇)