form1.cn
Make a little progress every day
12th of April 2017 Swift Swift+IOS 5993

Swift3.0设置状态栏的背景颜色与文字颜色

设置背景颜色//定义以下方法:funcsetStatusBarBackgroundColor(color:UIColor){letstatusBarWindow:UIView=UIApplication.shared.value(forKey:"statusBarWindow")as!UIViewletstatusBar:UIView=statusBarWindow.value(forKey:"statusBar")as!UIViewifstatusBar.responds(to:#selector(setter:UIView.backgr...
12th of April 2017 Swift Swift+IOS 5514

swift3.0设置导航栏,标题,字体,item颜色和字体大小

swift3.0设置导航栏(navigationBar)背景颜色,标题颜色和字体大小,item颜色//设置导航栏背景颜色self.navigationController?.navigationBar.barTintColor=UIColor.red//定义标题颜色与字体大小字典letdict:NSDictionary=[NSForegroundColorAttributeName:UIColor.blue,NSFontAttributeName:UIFont.boldSystemF...
04th of April 2017 Swift Swift+IOS 2070

MKNetworkKit更换域名时错误解决方法

如果出现以下问题NSURLSession/NSURLConnectionHTTPloadfailed(kCFStreamErrorDomainSSL,-9801)nw_coretls_read_one_recordtls_handshake_process:[-9801]需要在plist文件里作如下配置<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><false/><key>NSExceptionDomains</key><dict>...
04th of April 2017 Swift Swift+IOS 2634

Mac中Carthage的安装和使用

Carthage使用于Swift语言编写,只支持动态框架,只支持iOS8+的Cocoa依赖管理工具。与现在流行的CocoaPods不同,Carthage编译你的依赖,并提供框架的二进制.framework文件,但你仍然保留对项目的结构和设置的完整控制,Carthage不会自动的修改你的项目文件或编译设置。是一个去中心化的Cocoa依赖管理工具安装C...
05th of March 2017 Swift Swift+IOS 2183

swift3.0NotificationCenter通知使用

发送通知方法:name:一般情况下我们需要定义成一个常量,如:kNotiAddPhotoobject:(谁发送的通知)一般情况下我们可以不传,置为nil表示<匿名发送>,如果我们只需要传入一个参数的话,比如说本身控制器或者该类中的某一个控件的话,我们就可以使用object传出去,例子如下NotificationCenter.default.post(nam...
26th of February 2017 Swift Swift+IOS 2191

xcode8的http协议限制解决方法

使用XCode8.1开发iOS应用,使用WebView做一个网页demo,结果中途出现很多问题,第一是发现NSURL在XCode8.1的swift3版本下需要用URL替代,另外一个就是XCode默认不开启http请求的问题。运行日志内容如下:AppTransportSecurityhasblockedacleartextHTTP(http://)resourceloadsinceitisinsecure.Temporaryexcep...
23th of February 2017 Swift Swift+IOS 2594

Swift3.0中点击屏幕收回键盘

点击UITextField以外的区域,实际是点击了当前View,当前View捕获点击事件,可它不会传递该事件这种简单可用办法:addGestureRecognizerclassViewController:UIViewController{@IBOutletweakvarusername:UITextField!@IBOutletweakvarpassword:UITextField!overridefuncviewDidLoad(){super.viewDidLoad()//...