- 博客(18)
- 资源 (2)
- 收藏
- 关注
原创 Swfit3.0升级遇到Convert to Current Swift Syntax Failed: Could not find test host
swift3.0升级遇到这样的错误 这样解决
2017-03-02 09:15:38
2714
原创 使用UIAlertControllerStyleActionSheet IPAD崩溃 swift
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet) let action = UIAlertAction(title: "保存到相册".localized(), style: .Default) { (action) in sel
2017-02-24 17:04:49
1157
转载 SVN 冲突
今天遇到一个关于故事版在svn冲突的事情,在解决之后便想记下来以便以后可以用 场景是这样的: 我更新了工程,发现和同事的有冲突,然后就删掉冲突,如下,之后点击resolve,这是我的故事版就不能用IB方式打开,只能用源码方式打开,当用IB方式打开的时候提示The document "me.storyboard" could not be opened. Unrecognized file
2017-02-24 08:57:00
250
原创 swift 3.0 哈希sha1方法
#import //sha1 func sha1() -> String{ let data = self.data(using: String.Encoding.utf8, allowLossyConversion: true)! let uint8Ptr = UnsafeMutablePointerUInt8>.allocate(capacity: data.count)
2017-02-23 14:54:43
588
原创 网易云信 短信接口Swift 调用
func getCode() { let time = timeStamp()//时间戳 let ran = ranmdow()//5位随机数 let check = "App Secret" + ran + time let checkS = check.sha1()//哈希加密 let headers:HTTPHeaders = ["AppKey":
2017-02-23 14:53:58
426
原创 swift 3.0 短信验证码倒计时实现
class TCCountDown { private var countdownTimer: Timer? var codeBtn = UIButton() private var remainingSeconds: Int = 0 { willSet { codeBtn.setTitle("重新获取\(newValue)秒", for: .normal)
2017-02-23 14:53:14
1966
原创 计算Label高度swift
func labelWithHeight(labelStr:String,label:UILabel,width:CGFloat) ->CGFloat { let statusLabelText: NSString = labelStr as NSString let size = CGSize(width: SCREENWIDTH - width, height: 900) let dic =
2017-02-23 14:50:22
653
原创 swift 3.0 字典与JSON互转
class JsonToSturt: NSObject { class func dictionaryWithJsonString(jsonString:String) ->NSDictionary { var dicx:NSDictionary! let data : Data! = jsonString.data(using: .utf8) let dic : Any
2017-02-23 14:47:41
446
原创 RN stylesheet
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, }
2017-02-23 09:12:01
1044
原创 xcode7.0https安全协议
NSAppTransportSecurity NSAllowsArbitraryLoads 添加到info.plist 里
2016-05-19 16:32:08
301
转载 libxml/tree.h file not found解决办法
1. 导入libxml2.dylib 包 2.设置Header Search Paths 为 /usr/include/libxml2
2016-05-19 16:06:02
417
原创 pod 最新安装不成功办法
mkdir -p $HOME/Software/ruby export GEM_HOME=$HOME/Software/ruby gem install cocoapods export PATH=$PATH:$HOME/Sofware/ruby/bin pod install --verbose --no-repo-update
2016-05-19 16:05:08
433
转载 ARC 与 MRC 混编
选择target -> build phases -> compile sources -> 单击ARC的文件将compiler flags设置为:-fobjc-arc 如果一个工程为ARC,其中要添加MRC的文件: 同样的路径,然后单击MRC的文件将compiler flags设置为:-fno-objc-arc。
2016-05-19 16:03:22
204
原创 WEBService
-(void)loadWeb{ // 假如在这开始请求 NSString* webServiceBodyStr = [NSString stringWithFormat:@"%@%@",_nameText.text,_pwdText.text]; NSString* webServiceStr = [NSString stringWithFormat:@" %@ "
2016-04-28 15:00:44
293
原创 swfit 网络请求对应json转模型!
import UIKitimport Alamofireclass FindTableViewController: UITableViewController { //声明一个结构体类型的数组 var array:[Re] = [] override func viewDidLoad() { super.viewDidLoad() title
2016-04-27 14:05:37
275
原创 Swift - 多线程实现方式
1,Swift继续使用Object-C原有的一套线程,包括三种多线程编程技术: (1)NSThread (2)Cocoa NSOperation(NSOperation和NSOperationQueue) (3)Grand Central Dispath(GCD)2,本文着重介绍Grand Central Dispath(GCD) GCD是Apple开发的一个多核编程的解决方法,基本概念就是
2016-04-25 14:51:57
3109
转载 swift秒表的实现
import UIKit class ViewController: UIViewController { @IBOutlet weak var playBtn: UIButton! @IBOutlet weak var pauseBtn: UIButton! 初始化秒表 var Counter = 0.0 var Timer = NSTimer
2016-04-21 15:53:42
1348
UIwatch展示
2015-11-24
展示appWatchUI中期机试考试题
2015-11-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人