Swift Overview and Swift operators and expressions

Source: Internet
Author: User
Tags logical operators

Swift is a new language for designing IOS and Mac OS X applications.

Swift Features

? Swift retains the strengths of C and Objective-c and rejects the restrictions it has imposed in order to be compatible with the C language.

? Swift incorporates a secure programming model and adds some modern features to make it easier to use, more flexible, and more fun.

? Swift's simple style, combined with the popular, mature framework Cocoa/cocoa Touch, will bring new opportunities to the development process of another conceived software.

? Swift memory management uses ARC style.

Swift code file extension *.swift

Operator

? Arithmetic operator, +,-, *,/,%,

+ +,--

? relational operators, >, <, >=, <=, = =,! =

?  Boolean logical operators,! , &&, | |

? Ternary operator,? :

An expression

1. Do not specify a data type

var A1 = ten var A2 =20

var a =a1 > a2? "A1": "A2"

2. Specify the data type

var a1:int =10 var a2:int = 20

var a =a1 > a2? "A1": "A2"

3, can have a semicolon end

var a1:int = 10; var a2:int = var a = a1> A2? "A1": "A2"

Gaze

//

/*    */

Swift Exchange Discussion Forum Forum: http://www.cocoagame.net
Welcome to add Swift Technology Group: 362298485

Swift Overview and Swift operators and expressions

Related Article

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.