MotionInMotion Episode 33 - Roll Your Own API Client Using NSURLSession
Roll Your Own API Client Using NSURLSession - MotionInMotion
APIからデータを取得するclient class
- NSURLSession
- class API
- def get
- create_request
- create_task(request, &block).resume
- session
- NSURLSession.sessionWithConfiguration(config)
- def create_request
- request = NSMutableURLRequest.requestWithURL(url)
- def create_task(request, &block)
- session.dataTaskWithRequest
- create_json_data
- class APIResponse
- attr_reader :success, :data, :error
- def get
- NSScreencastのエピソードへのリンクが2つ