Today installs the Xcode6-beta edition, wants to experience the SWIFT charm: installs the SWIFT System the minimum version number is: 10.9.3
Just take a look at a little bit of the Swift programming Language, here's to share: (to be Continued ...) )
Playground-noun:a place where people can playimport cocoa///1. Declares a mutable variable var str = "Hello, Playground"///2. Declaring a constant let IMP Licitinteger=70let IMPLICITDOUBLE=70.0//3. Clear declare a variable variable name: type = initial value let EXPLICITDOUBLE:DOUBLE=70//clear Declare a Double variable let Explicitfloat:float=4///4. Type conversion let label= "the width are" let Width=94let widthlabel=label+ "" +string (width)//coercion type conversion///5. Use the \ () string to include the variable let Apples=3let oranges=5let applesummary= "I had \ (apples) apples" let fruitsummary= "I had \ (Apples+orang es) pieces of fruit. " 6. Use [] to declare an array or dictionary//6.1 declare an array var names=["Lves Li", "Wildcat", "LeLe"]var lele=names[2]//Get array contents names[1]= "Cat"//Change array Elements in Names//["Lves li", "Cat", "LeLe"]//6.2 Declaration of a dictionary var info=["lves Li": "Mei Man paper", "Wildcat": "Handsome Pot", "LeLe": "Yard Farm"]var lIn fo=info["Lele"]info["lves"]= "programmer" info//[lves: Programmer, lves Li: Beauty man paper, Wildcat: Hot Pot, Lele: yards Nong]//6.3 Create an empty array or dictionary let Emptyarray =string[] () let emptydictionary=dictionary<string,float> () var shoppinglist=[]//Declare an empty array
The official recommendation is to use playground to view effects without compiling in real time:
Reprint please specify, this article turn from: Http://blog.csdn.net/wildcatlele not finished ...
Swift's primary exploration of a