1. 无法切换分支 原因:ViewController.swift 中的文件提交后,commit 没有提交成功,需要提交成功,才能切换到其他支。 1.1 git add 几种区别 注意:git init后新加的文件,先要git add才能纳入git版本库管理,否则新加文件为未跟踪状态。即:与 git ...
分类:
其他好文 时间:
2017-08-05 20:30:37
阅读次数:
170
使?用let来声明常量,使?用var来声明变量。?一个常量的值在编译时并不须要获取,可是你仅仅能为它赋值?一次。也就是说你能够?用常量来表?示这样?一个值:你仅仅须要决定?一次,可是须要使?用非常多次。 NSLog(" ") var myVariable = 42 myVariable = 50 l ...
分类:
编程语言 时间:
2017-08-05 11:01:58
阅读次数:
177
//第一个控制器:显示基础控件 import UIKit class ViewController: UIViewController { var label: UILabel = UILabel() var button: UIButton = UIButton() var imageView: ...
分类:
编程语言 时间:
2017-08-05 10:58:58
阅读次数:
207
项目最终不须要支持iOS6了(泪崩),在二维码扫描这一块,可以全然的放弃ZXing库,改用系统的AVFoundation了,拿swift写了个Demo,效果例如以下: github地址:点这里 有关AVFoundation和Core Image(滤镜等),可以先看看objc.io第21期和第23期的 ...
分类:
编程语言 时间:
2017-08-04 20:37:48
阅读次数:
169
这是我在简书的文章. http://www.jianshu.com/p/734962c9bbed $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').l ...
分类:
编程语言 时间:
2017-08-04 10:03:03
阅读次数:
171
self.hidesBottomBarWhenPushed = true self.navigationController?.pushViewController(OderDetailViewController(),animated:true) self.hidesBottomBarWhenPu ...
分类:
编程语言 时间:
2017-08-03 15:09:07
阅读次数:
251
let infoDictionary = Bundle.main.infoDictionary let majorVersion : AnyObject? = infoDictionary! ["CFBundleShortVersionString"]as AnyObject? ...
分类:
编程语言 时间:
2017-08-03 15:00:13
阅读次数:
288
func fileSizeOfCache()-> Int { // 取出cache文件夹目录 缓存文件都在这个目录下 let cachePath =NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.cachesDi ...
分类:
编程语言 时间:
2017-08-03 14:56:29
阅读次数:
136
//注册点击事件 self.view.addGestureRecognizer(UITapGestureRecognizer(target:self, action:#selector(你的viewcontroller.handleTap(sender:)))) //对应方法 func handle ...
分类:
编程语言 时间:
2017-08-03 14:52:05
阅读次数:
182
//注意:在push后设置self.hidesBottomBarWhenPushed=NO; //这样back回来的时候,tabBar会恢复正常显示。 let detailCtrl = ScanViewController(nibName: "ScanViewController", bundle: ...
分类:
编程语言 时间:
2017-08-03 13:47:19
阅读次数:
147