08 2016 档案
摘要:// // ViewController.swift // 18-Swift中的闭包 // // Created by apple on 15/11/27. // Copyright © 2015年 xiaomage. All rights reserved. // import UIKit cla
阅读全文
posted @ 2016-08-28 21:39
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit class Person : NSObject { var name : String? var age : Int = 0 // 父类的init方法,子类再来写的时候
阅读全文
posted @ 2016-08-28 21:37
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit // 1.没有参数,没有返回值的函数 func about() -> Void { print("iPhone6s Plus 玫瑰金") } about() // 没有
阅读全文
posted @ 2016-08-28 21:36
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit /******************** 内部参数和外部参数 ********************/ // 内部参数:只有在内部才可以看到对应的参数名称 // 外
阅读全文
posted @ 2016-08-28 21:35
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit class Person : NSObject { var name : String? { // 可以给newValue自定义名称 willSet (new){ //
阅读全文
posted @ 2016-08-28 21:34
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit class Student : NSObject { // 1.属性 // 1> 存储属性 // 注意一:在开发中,如果是对象或者结构体,在没有赋值的情况下通常定义为可
阅读全文
posted @ 2016-08-28 21:33
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit /********************** 可选类型的定义 ************************/ /* class Person : NSObject
阅读全文
posted @ 2016-08-28 21:32
阿法狗的世界
摘要:// 元祖也是一个数据集合,可以在集合中定义一组数据 // 元祖的定义使用:(元素1,元素2) ("1001", "张三", 19, 1.88) (id : "1001", name : "张三", age : 19, height : 1.88) // 用一个数据类型来描述网络请求错误 // er
阅读全文
posted @ 2016-08-28 21:31
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit /************************** 字典定义 *****************************/ // Swift中字典的类型Dictio
阅读全文
posted @ 2016-08-28 21:31
阿法狗的世界
摘要://: Playground - noun: a place where people can play import UIKit /************************** 字典定义 *****************************/ // Swift中字典的类型Dictio
阅读全文
posted @ 2016-08-28 21:30
阿法狗的世界
摘要:/********************** 数组定义 **************************/ // 数组:Array表示数据 // let修饰的标识符是不可变数组(元素确定后不能修改) // var修饰的标识符是可变数组(可以添加和删除元素) // 注意: // 1>定义数组是使
阅读全文
posted @ 2016-08-28 21:29
阿法狗的世界
摘要:// 定义字符串 let string = "Hello World" let string1 : String string1 = "Hello" // 字符串的遍历 for c in string1.characters { print(c) } // 字符串的拼接 // 1.两个字符串之间的拼
阅读全文
posted @ 2016-08-28 21:28
阿法狗的世界
摘要:// for循环 // for循环后面不跟() // for循环的第一种写法 for var i = 0; i < 10;i++ { print(i) } // OC中的forin写法 let array = ["why", "lnj", "lmj", "yz"] for str in array
阅读全文
posted @ 2016-08-28 21:27
阿法狗的世界
摘要:// switch的基本用法 // 1>switch后面的()可以省略 // 2>case中语句结束后不需要跟break // 3>在case中定义局部变量不需要跟{} // 4>如果想要case穿透,则在case语句结束时跟:fallthrough let sex = 0 switch sex {
阅读全文
摘要:import UIKit // 整型:Int 浮点型:Double let π : Double = 3.14 var age : Int = 22 // 注意: // 1.如果一个标识符在定义时有直接复制,那么系统会根据后面赋值的类型来决定前面标识符的类型,这时(:类型)可以省略 // 2.查看标
阅读全文
posted @ 2016-08-28 21:25
阿法狗的世界
摘要:import UIKit // 整型:Int 浮点型:Double let π : Double = 3.14 var age : Int = 22 // 注意: // 1.如果一个标识符在定义时有直接复制,那么系统会根据后面赋值的类型来决定前面标识符的类型,这时(:类型)可以省略 // 2.查看标
阅读全文
posted @ 2016-08-28 21:24
阿法狗的世界
摘要:// 1.变量和常量的基本用法 // 1> 使用let定义变量 // 2> 使用var定义常量 let age : Int = 20 // age = 22 var height : Double = 1.78 height = 1.88 // 2.使用注意: // 1> 指向的对象不可以修改(指针
阅读全文
posted @ 2016-08-28 21:23
阿法狗的世界
摘要:func log<T>(message:T,file: String=__FILE__, funcName: String=__FUNCTION__, linNum:Int=__LINE__){ let fileName=(file as NSString).lastPathComponent pr
阅读全文
posted @ 2016-08-28 16:15
阿法狗的世界
摘要:+(instancetype)imageWithOriginalName:(NSString *)imageName{ UIImage *image=[UIImage imageNamed:imageName]; return [image imageWithRenderingMode:UIImag
阅读全文
摘要:[_iconView sd_setImageWithURL:[NSURL URLWithString:item.image_list] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"] options:SDWebImageCacheMe
阅读全文
posted @ 2016-08-19 20:03
阿法狗的世界
摘要:// // LSTWholeTableController.m // BUDEJIE // // Created by admin on 16/8/17. // Copyright © 2016年 ibokan. All rights reserved. // #import "LSTWholeTa
阅读全文
摘要:NSArray Class Reference NSArray Class Reference 标签: nsarrayclassnsmutablearray 2015-10-14 17:37 140人阅读 评论(0) 收藏 举报 标签: nsarrayclassnsmutablearray 2015
阅读全文
posted @ 2016-08-14 20:33
阿法狗的世界
摘要:前言: 在工作中, 很多小伙伴都会在PCH文件定义一些常用的宏,但是又怕写这些简单的宏浪费时间,又有时候忘记怎么定义了怎么办?本人在工作中也是如此。所以在这里给大家分享一些常用的宏定义,喜欢的小伙伴可以直接在项目中使用(持续更新)! 为了大家使用方便,请点击:GitHub - 宏定义头文件下载 1.
阅读全文
posted @ 2016-08-12 15:13
阿法狗的世界

浙公网安备 33010602011771号