swift
会飞的程序员zjm
目标 —> 一行代码撬动地球。
while ( 1 ){
log"hahhaha"
}
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
swift 函数 做参数,函数做返回值
func name1(name2:()->Void){ name2() } func test2(str:String,in1:Int, func1:(str:String)->Void)->Void{ func1(str: "hahahahha") } func test3(int1:Int,String原创 2016-02-04 13:40:17 · 736 阅读 · 0 评论 -
swift 单例模式正确写法
class zuoManger:NSObject { staticlet sharedInstance = zuoManger() var ID:Int? privateoverride init() {}// 私有化init方法 }原创 2016-02-04 17:02:37 · 885 阅读 · 0 评论 -
swift 通知
NSNotificationCenter.defaultCenter().addObserver(self, selector: "noti:", name: "noti", object: nil) } overridefunc touchesBegan(touches: SetUITouch>, withEvent event:UIEvent原创 2016-02-04 17:24:26 · 416 阅读 · 0 评论 -
swift 指纹识别
func touAc(){ let laContext =LAContext() var error :NSError? let letview =UIAlertView(title: "指纹验证", message:"ok", delegate: nil, cancelButtonTitle:原创 2016-03-07 10:16:48 · 673 阅读 · 0 评论 -
swift 绘图
//// zuoView.swift// swift 仓库//// Created by zuo on 16/3/7.// Copyright © 2016年 zuo. All rights reserved.//import UIKitclass zuoView:UIView { overridefunc draw原创 2016-03-07 15:39:44 · 368 阅读 · 0 评论 -
swift gcd 延时调用封装
GCD 是一种非常方便的使用多线程的方式。通过使用 GCD,我们可以在确保尽量简单的语法的前提下进行灵活的多线程编程。在 “复杂必死” 的多线程编程中,保持简单就是避免错误的金科玉律。好消息是在 Swift 中是可以无缝使用 GCD 的 API 的,而且得益于闭包特性的加入,使用起来比之前在 Objective-C 中更加简单方便。在这里我不打算花费很多时间介绍 GCD 的语法和要素,如果这么做的原创 2016-03-07 16:56:30 · 549 阅读 · 0 评论 -
swift 高度自适应方法
func ZuoHeightWithConstrainedWidth ( width : CGFloat , font : UIFont, str :NSString ) -> CGFloat { let constraintRect = CGSize ( width : width , height : CGFloat . max ) l原创 2016-03-08 16:22:29 · 1673 阅读 · 0 评论 -
swift 拿到程序的委托
let theApp =UIApplication.sharedApplication().delegateas! AppDelegate原创 2016-03-10 10:08:32 · 313 阅读 · 0 评论
分享