2014年9月15日

摘要: 在iOS开发的过程中,控件的大小和位置如何去安排是一个现在看来比较麻烦的事情,需要从上到下的通知和从下到上的调整。而这部分在整个开发过程中是比较重要的,但是却经常没有被掌握。如果将这部分掌握,不管界面的大小怎么变,View都可以通过resize去调整自己的位置和大小,所以在看完View Cont... 阅读全文
posted @ 2014-09-15 14:06 SCaptain 阅读(115) 评论(0) 推荐(0) 编辑

2014年9月11日

摘要: TableView这个控件在iOS的开发中非常的常见,他可以较好的展示一个层级结构。这里主要介绍,在点击某个条目的时候,如何进行跳转的下一个界面。以下是官方的关于这个跳转如何去实现,和如何去传递数据的过程。 Storyboards make it easy to pass data from ... 阅读全文
posted @ 2014-09-11 14:38 SCaptain 阅读(1601) 评论(0) 推荐(0) 编辑

2014年9月3日

摘要: button.layer.cornerRadius = 10 // 这个值根据你想要的效果可以更改button.clipsToBounds = true这种方法不止可以设置按钮,UIView应该都可以设置,ImageView我试过ok,其他的UIKit用到了再试 阅读全文
posted @ 2014-09-03 15:27 SCaptain 阅读(459) 评论(0) 推荐(0) 编辑

2014年9月2日

摘要: 导入AudioToolbox.framework包在swift文件中import AudioToolboxAudioServicesPlaySystemSound(SystemSoundID.convertFromIntegerLiteral(UInt32(kSystemSoundID_Vibrat... 阅读全文
posted @ 2014-09-02 14:55 SCaptain 阅读(511) 评论(0) 推荐(0) 编辑

2014年9月1日

摘要: 在iOS7系统的Mail App中TableViewCell的一个功能让我们做TableView的比较羡慕,就是滑动cell,右边出现了两个按钮,如下:网上在github上有很多大牛用custom tableViewCell的方法实现了这个效果,甚至更强,比如这两位:https://github.c... 阅读全文
posted @ 2014-09-01 21:55 SCaptain 阅读(1531) 评论(0) 推荐(0) 编辑
摘要: 今天在看官方的TableView Guide,突然想起来最近写的一个代码中实现tableViewCell复用的时候有点问题:var cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: identi... 阅读全文
posted @ 2014-09-01 10:31 SCaptain 阅读(1023) 评论(0) 推荐(0) 编辑

2014年8月29日

摘要: var date = NSDate.date() var timeFormatter = NSDateFormatter()timeFormatter.dateFormat = "MM-dd 'at' HH:mm:ss.SSS"var time = timeFormatter.stri... 阅读全文
posted @ 2014-08-29 13:16 SCaptain 阅读(727) 评论(0) 推荐(0) 编辑

2014年8月28日

摘要: 蓝牙的重连主要分为以下两种:1、恢复一些已知的设备,已知的设备就是在此次操作之前你扫描到的或者已经连接过的设备。用retrievePeripheralsWithIdentifiers:函数去完成回复操作。Retrieve a list of known peripherals—periphera... 阅读全文
posted @ 2014-08-28 19:28 SCaptain 阅读(1149) 评论(0) 推荐(0) 编辑
摘要: 今天App写到了蓝牙重连的阶段,以前针对sdk 6.0写的代码,蓝牙设备的回复是通过- (void)retrievePeripherals:(NSArray *)peripheralUUIDs然后回调 centralManager:didRetrievePeripherals:函数来得到可以回复... 阅读全文
posted @ 2014-08-28 19:02 SCaptain 阅读(3155) 评论(0) 推荐(0) 编辑

2014年8月19日

摘要: 偷个懒,看到了个比较靠谱的答案,直接复制过来了。原网址:http://stackoverflow.com/questions/24024549/dispatch-once-singleton-model-in-swiftFrom my short experience with Swift ther... 阅读全文
posted @ 2014-08-19 15:55 SCaptain 阅读(994) 评论(0) 推荐(1) 编辑

导航