From: Ace Date: Fri, 17 Jun 2016 04:59:23 +0000 (+0800) Subject: add AcePlay X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch08.html?a=commitdiff_plain;h=fb63ddca15138d3d6dcd0d3b41db4786528d6653;p=acecode.git add AcePlay --- diff --git a/learn/AcePlay/AcePlay.playground/Contents.swift b/learn/AcePlay/AcePlay.playground/Contents.swift new file mode 100644 index 0000000..b64b9e2 --- /dev/null +++ b/learn/AcePlay/AcePlay.playground/Contents.swift @@ -0,0 +1,45 @@ +//: Playground - noun: a place where people can play + +import UIKit + +var str = "Hello, playground.小狗:🐶 锤子:🔨" + + +func printLine(title: String) -> Void { + let line = String(format:"[%@]-----------------------------------", title) + print(line) +} + +// Index +var strInx:String.Index = str.startIndex +strInx.successor() +print(strInx) + +for c in str.characters { + print(c, terminator: "") +} +print() + +// Print separator & terminator +var company:Array = [ "Apple", "Google", "Facebook", "Tencent" ] +print(company, separator: "#", terminator: " $$$$$\n") + +printLine("Count company Array 1") +for (i,v) in company.enumerate() { + print(i, v, separator: " - ", terminator: "\n") +} + +printLine("Count company Array 2") +company.insert("Alibaba", atIndex: company.count) +for i in 0..(0.. + + + \ No newline at end of file diff --git a/learn/AcePlay/AcePlay.playground/playground.xcworkspace/contents.xcworkspacedata b/learn/AcePlay/AcePlay.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/learn/AcePlay/AcePlay.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate b/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..57048f1 Binary files /dev/null and b/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate differ