A Swift framework for the esa.io API
I worked on a Swift framework for the esa.io API called EsaKit. EsaKit is build with ReactiveSwift and Himotoki.
What’s esa.io?
esa.io is a service that is an expertise Sharing Archives for motivated teams. This is famous only in Japan. I use the service in my team as a quick daily report. So I made a simple client iOS application for the service before. (=> Esafeed)
For this app, I need to create a simple client framework. This is why I made EsaKit.
How to use EsaKit?
In EsaKit, you can get a necessary response easily like this.
let client = EsaClient(token: "your_token", teamName: "your_team_name")
client.members()
.startWithResult { result in
switch result {
case let .success(response, members):
print("\(response)") // => Response(xRateLimitLimit: 75, XRateLimitRemaining: 71)
print("\(members)") // => Memberss(members: [EsaKit.MemberUser(name:...
case let .failure(error):
print("An error occured: \(error)")
}
}
client.teamName = "other_your_team_name"
client.posts()
.startWithResult { result in
switch result {
case let .success(response, posts):
print("\(response)") // => Response(xRateLimitLimit: 75, XRateLimitRemaining: 70)
print("\(posts)") // => Posts(posts: [EsaKit.Post(number: 11, name:...
case let .failure(error):
print("An error occured: \(error)")
}
}
I’ll introduce EsaKit into production. Stay tuned:) Please add Github Star to EsaKit if you like it.