 import Social
 import SwifteriOS
 
-class AccountViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate {
+class AccountViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
     
     // MARK: Types
     

                if twitterAccounts?.count == 0 {
                    self.alertWithTitle("Error", message: "There are no Twitter accounts configured. You can add or create a Twitter account in Settings.")
                } else {
                    let idMap = NSMutableDictionary()
                    let ids :Array<String> = twitterAccounts.map({
                        twitterAccount in
                        let id = twitterAccount.valueForKeyPath("properties.user_id") as String
                        idMap.setValue(twitterAccount, forKey: id)
                        return id
                    })
                    let url = NSURL(string: "https://api.twitter.com/1.1/users/lookup.json")
                    let params = ["user_id": ids]
                    let req = SLRequest(forServiceType: SLServiceTypeTwitter, requestMethod: .GET, URL: url, parameters: params)
                    req.account = twitterAccounts[0] as ACAccount
                    req.performRequestWithHandler({
                        (data :NSData!, res :NSHTTPURLResponse!, error :NSError!) -> Void in
                        NSLog("%@", NSString(data: data, encoding :NSUTF8StringEncoding))
                        let users = NSJSONSerialization.JSONObjectWithData(data!, options: nil, error: nil) as? [NSDictionary]
                        self.rows = users!.map({
                            user in
                            let account = idMap.valueForKey(user["id_str"] as String) as ACAccount
                            return AccountSettings.Account(credential: SwifterCredential(account: account),
                                userID: user["id_str"] as String,
                                screenName: user["screen_name"] as String,
                                name: user["name"] as String,
                                profileImageURL: NSURL(string: user["profile_image_url"] as String))
                        })
                        AccountSettingsStore.save(AccountSettings(current: 0, accounts: self.rows))
                        dispatch_async(dispatch_get_main_queue(), { () -> Void in
                            self.tableView.reloadData()
                        })
                    })
                }
            } else {
                self.alertWithTitle("Error", message: error.localizedDescription)
            }
        }
    }
    
    func initEditing() {

                cell.imageView?.image = UIImage(data:imageData)
                cell.setNeedsLayout()
            })
        })
        return cell
    }
