quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

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
      • NSJSONSerialization.dataWithJSONObject(params, options: 0, error: nil)
    • class APIResponse
      • attr_reader :success, :data, :error
  • NSScreencastのエピソードへのリンクが2つ