swift-Initial (1)

Source: Internet
Author: User

Summary: Swift is a new programming language for writing iOS and OS X apps. Swift combines the advantages of C and objective-c and is not limited by C compatibility. Swift uses a secure programming model and adds a lot of new features, which makes programming easier, more flexible, and more fun. Swift is based on a mature and beloved Cocoa and Cocoa Touch framework, and its advent will redefine software development. Swift is also very friendly for beginners. It is the first programming language that satisfies both industry standards and is as expressive and interesting as the scripting language. It supports code previews, a revolutionary feature that allows programmers to run Swift code without compiling and running the application and view the results in real time.

Constants & Variables

    • Periodic summary
      • varDefine variables that can be modified after they are set
      • letDefines constants that cannot be modified after they are set
      • Do not use at end of statement;
      • In Swift, use println() an alternative in OCNSLog
      • printlnPerformance is better and will be demonstrated later

Defined OCObject

    • Periodic summary
      • In the Swift format that you want to instantiate an object 类名() with, the OC equivalent in alloc/init
      • OCinitWithXXX Swift can be used to 类名(XXX: ) find the corresponding function in the
      • OCA [UIColor redColor] class method in which Swift you can usually 类名.XXX find the corresponding function in the
      • Use let adornments v and assign values to indicate该常量的内存地址不允许修改,但是可以修改其内部的属性

swift-Initial (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.