swift warm up NSURLQueryItem

swift warm up NSURLQueryItem

3f7d9611fc919c98512b779cde637dfc?s=128

Johnlin

May 08, 2018
Tweet

Transcript

  1. Swift ఔࣜখ೤਎ NSURLQueryItem John Lin

  2. NSURLQueryItem • ୅ද URL ཫ໘తҰ෦෼ • https://www.google.com/search? q=nsurlqueryitem&ie=utf-8&oe=utf-8&client=firefox -b-ab

  3. URL • Uniform Resource Locator • ౷ҰࢿݯఆҐූ • ໢ᅿ

  4. URI • Uniform Resource Identifier • ౷Ұࢿݯඪࢽූ • መࡍ্զ၇༻తጯ֘ੋ URI

    • ࡏ2002೥8݄ɼRFC 3305ࢦग़ɼᦒવज़ޠʮURLʯနඃኍᔟ஍༻ԙ ೔ৗ༻ޠ೭தɼୠଖຊ਎ቮزݷඃኑغɻଖݱࡏతޭ༻ɼᷮੋ࡞ҝ ሣԙ๭ࠣURIҼแؚ๭छࢦࣔஶ໢࿏Մୡੑతڠఆࣕ࡞ҝҐᅿଘࡏ తఏ੧ࣕቮɻجԙURIత䱾ଟඪ४ɼྫ೗ࢿݯඳड़ᐽՍ౳ɼቮៃਗ਼ ુ஍ද໌ɼࢿݯඪࣝຊແधࢦग़௨ա໢ࡍ໢࿏֫ಘࢿݯ෭ຊతํ๏ɼ ຠແਢࢦग़ࢿݯੋ൱جԙ໢࿏ɻ
  5. URL ߏ଄ • ڠఆྨܕ:[//[ଘऔࢿݯधཁతጪᨽࢿ㘤@]࢕෰ثҐᅿ [:෈ᥒ]][/ࢿݯ૚ڃUNIX䈕Ҋ࿏ኸ]䈕Ҋ໊[?Ұ⇧][#ย ஈID] • https://zh.wikipedia.org/wiki/ %E7%BB%9F%E4%B8%80%E8%B5%84%E6%BA %90%E5%AE%9A%E4%BD%8D%E7%AC%A6

  6. NSURL -> URL • ༻ိṶଘҰݸ URL • ࡏ Swift ༗ఏڙ

    URL ိऔ୅ᢜత NSURL • URL ੋ Struct, NSURL ੋ Class • 䈕Ҋ໵ੋ url
  7. NSURL -> URL

  8. NSURL -> URL

  9. URLComponents • ՄҎ༻String ҃ URL ိ init, ໵ՄҎኺ಄૊߹ • ໵ՄҎ᫚׵ճ

    URL • ՄҎଘऔ࿨मվཫ໘తҰ෦෼ɼ૾ੋ host, port, path, query, queryItems ౳౳
  10. URLComponents

  11. Alamofire • େՈ࠷ৗ༻త http client let urlString = "https://httpbin.org/post" Alamofire.request(urlString,

    method: .post) let url = URL(string: urlString)! Alamofire.request(url, method: .post) let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)! Alamofire.request(urlComponents, method: .post)
  12. Alamofire • URLConvertible • ୞ཁੋ conform Ṝݸ protocol बೳᙛ໢ᅿ public

    protocol URLConvertible { func asURL() throws -> URL }
  13. ݁࿦ • ཁදࣔ url ब༻ URL • 䈕Ҋ໵ੋ url •

    ᔒࣄෆཁࣗݾ૊߹ url
  14. Q&A

  15. ፮ᐔػ • http://slot.miario.com/machines/150067