![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS
白月初
这个作者很懒,什么都没留下…
展开
-
初学swift_002
函数//: Playground - noun: a place where people can playimport UIKit//基本的函数func first() {//无参,无返回 print("first")}first()func first2() -> String {//返回字符串 return "abc"}first2()let r = first2()rlet _原创 2016-11-18 11:37:48 · 348 阅读 · 0 评论 -
初学swift_003
闭包,类,结构//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"func outer() -> ()->Void{ let x = func inner() { print(x) } return inner}let resu原创 2016-11-18 14:06:07 · 327 阅读 · 0 评论 -
初学swift_001
初学iOS_001直接贴代码及注释/*********常量与变量的声明**********/let a = 5 //定义常量 能使用常量尽量使用常量//a = 6 //常量不能修改var b = 5b = 6//swift中所有的基本类型都是值类型,包括string类型var c = bcb = 88c//swift中的类都是大写的//下面的常量声明是显式指定类型let i: Float =原创 2016-11-17 15:37:21 · 411 阅读 · 0 评论 -
初学swift_004
下标操作,枚举和类的递归//: Playground - noun: a place where people can playimport UIKit/****下标***********************/class Teacher { var students = ["a","b","c"] subscript(i: Int) ->String { g原创 2016-11-21 20:16:48 · 490 阅读 · 0 评论