swift 3, swift2

Swift3:

DispatchQueue.main.async(execute: {

            })

Swift2:
dispatch_async(dispatch_get_main_queue(), {

            })

TimeInterval–swift3
NSTimeInterval–swift2

fileprivate-swift3
private-swift2

Data-swift3
NSData-swift2

URL-swift3
NSURL-swift2

UserDefaults-swift3
NSUserDefaults-swift2

URLSessionDataTask-swift3
NSURLSessionDataTask-swift2

HTTPURLResponse-swift3
NSHTTPURLResponse-swift2

JSONSerialization-swift3
NSJSONSerialization-swift2

ComparisonResult-swift3
NSComparisonResult-swift2

ViewController.present-swift3
ViewController.presentViewController-swift2

[UIApplicationLaunchOptionsKey: Any]-swift3
[NSObject : AnyObject]-swift2

UIScreen.main.bounds-swift3
UIScreen.mainScreen().bounds-swift2

override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)–swift3
override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer)—swift2

func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings)-swift3
func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) -swift2

[AnyHashable: Any]-swift3
[NSObject : AnyObject]-swift2

func getUserInfo(withUserId userId: String!, completion: ((RCUserInfo?) -> Void)!) -swift3
func getUserInfoWithUserId(userId: String!, completion: ((RCUserInfo!) -> Void)!)-swift2

UIApplication.shared.delegate -swift3
UIApplication.sharedApplication().delegate-swift2

NSArray? .object(at: 1)-swift3
NSArray .objectAtIndex(1)-swift2

Any -swift3
AnyObject-swift2

FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]-swift3
NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]-swift2

UITableViewCellAccessoryType.none-swift3
UITableViewCellAccessoryType.None-swift2

func numberOfSections(in tableView: UITableView) -> Int –swift3
func numberOfSectionsInTableView(tableView: UITableView) -> Int —swift2

DateFormatter-swift3
NSDateFormatter-swift2

UIBarButtonItemStyle.plain –swift3
UIBarButtonItemStyle.Plain -swift2

IndexPath-swift3
NSIndexPath -swift2

tableView.dequeueReusableCell(withIdentifier: cellIdentifier)-swift3
tableView.dequeueReusableCellWithIdentifier(cellIdentifier)–swift2

tableView.numberOfRows(inSection: 0) -swift3
tableView.numberOfRowsInSection(0)-swift2

override var canBecomeFirstResponder : Bool {
return true
}-swift3
override func canBecomeFirstResponder() -> Bool {
return true
}–swift2

var hasText : Bool {
return nextTag > 1 ? true : false
}-swift3
func hasText() -> Bool {
return nextTag > 1 ? true : false
}-swift2

guard let value = element.value as? Int8, value != 0 else { return identifier }–swift3
guard let value = element.value as? Int8 where value != 0 else { return identifier }-swift2

func functionName(_ user: String)–swift3
func functionName(user: String)–swift2

tableView.register( –swift3
tableView.registerClass( –swift2

one function of string
replacingOccurrences–swift3
stringByReplacingOccurrencesOfString -swift2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值