//1.添加返回按钮 func addBackBtn(){ let leftBtn:UIBarButtonItem=UIBarButtonItem(title: "返回", style: UIBarButtonItemStyle.Plain, target: self, action: "ac...
分类:
编程语言 时间:
2015-10-21 20:55:31
阅读次数:
244
//1.初始化UITextField let userName=UITextField(frame: CGRectMake(0, 100, 100, 100));//2.将文本框userName添加到当前视图中 self.view.addSubview(userName);//3.文本框默认显...
分类:
编程语言 时间:
2015-10-21 20:51:45
阅读次数:
159
Swift 提供了三种方式来比较文本值:字符串字符相等、前缀相等和后缀相等。字符串/字符相等 (String and Character Equality)字符串/字符可以用等于操作符(==)和不等于操作符(!=),详细描述在比较运算符:let quotation = "We're a lot al...
分类:
编程语言 时间:
2015-10-21 14:05:57
阅读次数:
241
Happy 2004问题描述 :Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (t...
分类:
移动开发 时间:
2015-10-18 20:05:47
阅读次数:
195
//计算内存使用率function calcMem(){ let mem_total = os.totalmem(), mem_free = os.freemem(), mem_used = mem_total - mem_free, mem_ratio = 0; mem_total = (m...
分类:
Web程序 时间:
2015-10-17 01:47:18
阅读次数:
155
swift在几个方面Singleton模式:1. 全局变量private let _singleton = Singleton()class Singleton: NSObject { class var sharedInstance: Singleton { get { ...
分类:
编程语言 时间:
2015-10-16 18:31:49
阅读次数:
165
UIActivityIndicatorView UIActivityIndicatorView(活动指示器)控件,也就是环形进度条,也就是Loading效果。 UIActivityIndicatorView的创建: (1) 在Stroyboard中使用Ctrl+Drag拖拽法创建 (2) 代码创建: let?...
分类:
编程语言 时间:
2015-10-15 23:50:22
阅读次数:
415
1. I see.我明白了。2. I quit! 我不干了!3. Let go! 放手!4. Me too.我也是。5. My god! 天哪!6. No way! 不行!7. Come on.来吧(赶快)8. Hold on.等一等。9. I agree。我同意。10. Not bad.还不错。1...
分类:
其他好文 时间:
2015-10-15 10:04:49
阅读次数:
248
最近比较忙,想要做的事情有很多,能做出来的就只有一部份,我觉得也许是我没有计划和规律造成的,我需要坚持下去,今天写了一个swift2.0给按钮或者图片添加阴影的效果,就当做笔记吧:-)Swift Code:let image1 = UIImageView(frame: CGRectMake(20,5...
分类:
编程语言 时间:
2015-10-15 01:01:19
阅读次数:
276
swift最基础: 关于基本类型: let是声明常量,var是声明变量。心得:要创建一个变量时,都应先定为常量,用到需要改的时候再改,因为变量量可变,可能会出现不安全因素,且常量效率高。 字符串:字符串是变量,字符串是值类型。关于字符串:后面再详细解释。 元祖...
分类:
移动开发 时间:
2015-10-14 23:16:22
阅读次数:
312