import Foundation private let _SingleSharedConnect or Connector class

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import Foundation
private let _SingleSharedConnector = Connector()
class Connector {
class var sharedConnector: Connector {
return _SingleSharedConnector
}
func getInformationAboutUser(getInfo:(user:VKUser!) -> ()) {
let request:VKRequest = VKApi.users().get(
[
VK_API_FIELDS: "id, first_name, last_name, sex, bdate, city, country, photo_200, online, online_mobile, status"
])
request.executeWithResultBlock(
{(response:VKResponse!) in
if response.json is Array {
let respArray:Array = response.json
if respArray.count > 1 {
let userResp = respArray[0]
let user:VKUser = VKUser(userResp)
getInfo(user)
}
}
},
{(error:NSError!) in
println(error)
})
}
}