![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS应用开发之Swift
尹现伟
人们不知道自己想要什么,直到你把产品摆在他们面前。
展开
-
Swift_5_类和结构体
import Foundationprintln("Hello, World!")class PeopleClass{ }struct PeopleStruct{ }struct Resolution { var width = 0 var heigth = 0}class VideoMode { var resolution原创 2014-07-21 15:42:37 · 1001 阅读 · 0 评论 -
Swift_6_方法
import Foundationprintln("Hello, World!")class Dog { func age() -> String { return "2" } var name : String? func getName(name1:String) -> String{ self.name =原创 2014-07-21 15:43:35 · 900 阅读 · 0 评论 -
Swift_7_继承
import Foundationprintln("Hello, World!")class People { var name:String? init(){ self.name="李四" } //防止重写关键字 @final @final var age = 15}class Man : Pe原创 2014-07-21 15:44:15 · 758 阅读 · 0 评论 -
Swift_8_扩展&类别
import Foundationprintln("Hello, World!")class People{ var name:String? }//方法扩展extension People{ func test() -> String{ return "abc" } }let p = People();var v原创 2014-07-21 15:45:00 · 919 阅读 · 0 评论 -
Swift_2_控制语句
import Foundationprintln("Hello, World!")/*for do While While Switch*/var arr = [1,2,3,4,5,7];for i in arr{ println(" i is \(i)");}var count = arr.count;for (var i = 0 ; i<count;原创 2014-07-21 11:41:29 · 806 阅读 · 0 评论 -
Swift_3_函数
import Foundationprintln("Hello, World!")//声明一个函数 不带参数 没有返回值func func1(){ }//声明一个函数 传入两个String类型参数 , 没有返回值func func2(v1:String, v2:String){ println(v1 + "and" + v2)}//声明一个求和的函数fu原创 2014-07-21 11:45:09 · 1221 阅读 · 0 评论 -
Swift_4_闭包(Blocks)
import Foundationprintln("Hello, World!")var arr = [1,2,4,6,74,2]func hasClosure(list:[Int], v2:Int, cb:(num:Int, v3:Int) ->Bool) ->Bool{ for item in arr{ if(cb(num:item, v3:v2原创 2014-07-21 12:56:44 · 1049 阅读 · 0 评论 -
Swift_1_基本数据类型
import Foundationprintln("Hello, World!");var v1 = 1;var v2 = 2;println(" v1 is \(v1) v2 is \(v2)");var v3 = v1 + v2;println("v3 is \(v3)");//字符转换var v4 : Double = Double(v3) + 3.14;p原创 2014-07-21 11:40:02 · 894 阅读 · 0 评论 -
Swift_10_网络请求
实现简单的糗百,以下是连接:https://code.csdn.net/yinxianwei88/swift_qiubai/tree/master原创 2014-07-21 15:57:03 · 982 阅读 · 0 评论