我有一个关于新版Alamofire for Swift 2的问题
Alamofire.request(.POST, urlString, parameters: parameters as? [String : AnyObject])
.responseJSON { (request, response, result) -> Void in
let dico = result as? NSDictionary
for (index, value) in dico! {
print("index : \(index) value : \(value)")
}
}
Run Code Online (Sandbox Code Playgroud)
在本节中,我想将结果转换为NSDictionary.但是当我编译并设置断点时,调试器说dico是零.如果我使用debugDescription打印结果,它不是nil并包含我所期望的如何转换Result变量?
我在Xcode 8上用iOS10将我的应用更新为Swift 3,我收到错误:
Btn.setTitle('str', forState: .Normal)
Run Code Online (Sandbox Code Playgroud)
.Normal不再是UIControlState的枚举类型.我应该将哪种类型的UIControlState用于此状态?
Apple枚举现在定义为
public struct UIControlState : OptionSet {
public init(rawValue: UInt)
public static var highlighted: UIControlState { get } // used when UIControl isHighlighted is set
public static var disabled: UIControlState { get }
public static var selected: UIControlState { get } // flag usable by app (see below)
@available(iOS 9.0, *)
public static var focused: UIControlState { get } // Applicable only when the screen supports focus
public static var application: UIControlState { …Run Code Online (Sandbox Code Playgroud)