楼下xcode8更新的 方法这样写 PlaygroundPage.current.liveView= showView
2016-10-25
在xcode8中需要 import PlaygroundSupport 而不是XCPlayground,在需要的地方使用PlaygroundPage.current.livePage = showView
2016-10-24
//返回函数类型 函数嵌套
func tw1(w:Int) -> Int{
return 1*w;
}
func tw3(w:Int) -> Int{
return 3*w;
}
func fp(p:Int,w:Int) -> Int {
//返回类型是函数
func cw(w:Int) -> ((Int) -> Int){
return w <= 10 ? tw1:tw3;
}
let m = cw(w:w);
return m(w) + p*w;
}
func tw1(w:Int) -> Int{
return 1*w;
}
func tw3(w:Int) -> Int{
return 3*w;
}
func fp(p:Int,w:Int) -> Int {
//返回类型是函数
func cw(w:Int) -> ((Int) -> Int){
return w <= 10 ? tw1:tw3;
}
let m = cw(w:w);
return m(w) + p*w;
}
2016-10-16
swift3.0 func swapTwoInts1(a:inout Int , _ b:inout Int)
2016-10-14
最新回答 / Code_浅蓝
func sayHello(to name:String = "Playground", withGreetingWord greadting:String = "Hello", punctuation:String = "!") -> String { return "\(greadting),\(name)\(punctuation)"}sayHello()sayHello(to: "OC", withGreetingWord: "Bye", punctuation: "!!!")XCOD...
2016-10-09
sayHelloTo(name: "Playground", greeting: "Welcome")
2016-10-05