TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jul 2016 |
SPMSupports SPM | ✗ |
Maintained by Taiki Suzuki.
connpass search API for Swift.
let query = ConnpassSearchQuery(.Keyword("swift"), .Count(100))
ConnpassApiClient.sharedClient.searchEvent(query) { response in
switch response.result {
case .Success(let result):
print(result.events)
case .Failure(let error):
print(error)
}
}
You can use Associated values as parameter with ConnpassSearchQuery
.
ConnpassSearchQuery.Parameter | Type |
---|---|
.EventId | Int |
.Keyword | String |
.KeywordOr | String |
.Ym | Int |
.Ymd | Int |
.Nickname | String |
.OwnerNickname | String |
.SeriesId | Int |
.Start | Int |
.Order | DisplayOrder |
.Count | Int |
DisplayOrder |
---|
.UpdateTime |
.StartDate |
.New |
You can fetch the result as ConnpassResult
.
public struct ConnpassResult {
public let resultsReturned: Int
public let resultsAvailable: Int
public let resultsStart: Int
public let events: [ConnpassEvent]
}
public struct ConnpassEvent {
public enum EventType: String {
case Participation = "participation"
case Advertisement = "advertisement"
}
public let eventId: Int
public let title: String
public let `catch`: String
public let `descriotion`: String
public let eventUrl: NSURL
public let hashTag: String
public let startedAt: NSDate
public let endAt: NSDate
public let limit: Int?
public let eventType: EventType
public let series: ConnpassSeries?
public let address: String?
public let place: String?
public let lat: Double?
public let lon: Double?
public let ownerId: Int
public let ownerNickname: String
public let ownerDisplayname: String
public let accepted: Int
public let waiting: Int
public let updatedAt: NSDate
}
public struct ConnpassSeries {
public let url: String
public let id: Int
public let title: String
}
public func searchEvent(query: ConnpassSearchQuery, completion: (Response -> Void)?)
public func searchEvent(query: ConnpassSearchQuery, success: ((NSURLResponse?, ConnpassResult) -> Void)?, failure: ((NSURLResponse?, NSError) -> Void)?)
Connpass is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Connpass"
http://connpass.com/about/api/
szk-atmosphere, [email protected]
Connpass is available under the MIT license. See the LICENSE file for more info.