小编Use*_*er4的帖子

关闭UITableViewRowAction

我有一个自定义UITableViewRowAction设置和工作.我唯一无法解决的是如何在选择一个动作后解除UITableViewRowAction.我确定我错过了一些非常明显的东西.这是我目前的设置:

func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {

    var moreRowAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "In", handler:{action, indexpath in
        //Some code to execute here
    });
    moreRowAction.backgroundColor = UIColor(red: 0.298, green: 0.851, blue: 0.3922, alpha: 1.0)

    return [moreRowAction];
}
Run Code Online (Sandbox Code Playgroud)

谢谢你的建议.

ios swift

37
推荐指数
2
解决办法
1万
查看次数

字典不能转换为Void

大家好,我一直在网上搜索没有太多运气,但我正试图绕过Alamofires异步性质.我试图将JSON响应作为字典返回,但Xcode给了我"字典不能转换为'Void'"

func homePageDetails(userName:String) -> (Dictionary<String,AnyObject>){
    let username = userName
    let hompePageDetails = Alamofire.request(.GET, "http://example.com/API/Bunch/GetHomePageDetails/\(username)/").responseJSON{(request, response, JSON, error) in
    print(JSON)
    var test = JSON as Dictionary<String,AnyObject>
    return test
    }
}
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激.

ios swift alamofire

2
推荐指数
1
解决办法
2477
查看次数

标签 统计

ios ×2

swift ×2

alamofire ×1