Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
swift warm up NSURLQueryItem
Search
Johnlin
May 08, 2018
Programming
0
61
swift warm up NSURLQueryItem
Johnlin
May 08, 2018
Tweet
Share
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
89
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
220
Ruby 型別檢查工具簡介
johnlinvc
0
430
Swift Actor 實作探索
johnlinvc
0
150
用 mruby 來寫跨平台工具
johnlinvc
0
71
Actor model 簡介
johnlinvc
0
180
一起玩 Helm 3
johnlinvc
1
110
為什麼 App 卡卡的
johnlinvc
2
1.1k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
190
Other Decks in Programming
See All in Programming
ミリしらMCP勉強会
watany
4
720
AHC045_解説
shun_pi
0
420
remix + cloudflare workers (DO) docker上でいい感じに開発する
yoshidatomoaki
0
120
PsySHから紐解くREPLの仕組み
muno92
PRO
1
540
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
220
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
1
420
自分のために作ったアプリが、グローバルに使われるまで / Indie App Development Lunch LT
pixyzehn
1
150
MCP世界への招待: AIエンジニアが創る次世代エージェント連携の世界
gunta
4
860
AtCoder Heuristic First-step Vol.1 講義スライド
terryu16
3
1.1k
Vibe Codingをせずに Clineを使っている
watany
17
5.7k
php-fpm がリクエスト処理する仕組みを追う / Tracing-How-php-fpm-Handles-Requests
shin1x1
5
2.7k
Youtube Lofier - Chrome拡張開発
ninikoko
0
2.4k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
GraphQLの誤解/rethinking-graphql
sonatard
70
10k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
How to Ace a Technical Interview
jacobian
276
23k
Why Our Code Smells
bkeepers
PRO
336
57k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
18
1.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
It's Worth the Effort
3n
184
28k
Fireside Chat
paigeccino
37
3.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Transcript
Swift ఔࣜখ NSURLQueryItem John Lin
NSURLQueryItem • ද URL ཫ໘తҰ෦ • https://www.google.com/search? q=nsurlqueryitem&ie=utf-8&oe=utf-8&client=firefox -b-ab
URL • Uniform Resource Locator • ౷ҰࢿݯఆҐූ • ᅿ
URI • Uniform Resource Identifier • ౷Ұࢿݯඪࢽූ • መࡍ্զ၇༻తጯ֘ੋ URI
• ࡏ20028݄ɼRFC 3305ࢦग़ɼᦒવज़ޠʮURLʯနඃኍᔟ༻ԙ ৗ༻ޠ೭தɼୠଖຊቮزݷඃኑغɻଖݱࡏతޭ༻ɼᷮੋ࡞ҝ ሣԙࠣURIҼแؚछࢦࣔஶ࿏Մୡੑతڠఆࣕ࡞ҝҐᅿଘࡏ తఏ੧ࣕቮɻجԙURIత䱾ଟඪ४ɼྫࢿݯඳड़ᐽՍɼቮៃਗ਼ ુද໌ɼࢿݯඪࣝຊແधࢦग़௨աࡍ࿏֫ಘࢿݯ෭ຊతํ๏ɼ ຠແਢࢦग़ࢿݯੋ൱جԙ࿏ɻ
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
NSURL -> URL • ༻ိṶଘҰݸ URL • ࡏ Swift ༗ఏڙ
URL ိऔᢜత NSURL • URL ੋ Struct, NSURL ੋ Class • 䈕Ҋੋ url
NSURL -> URL
NSURL -> URL
URLComponents • ՄҎ༻String ҃ URL ိ init, ՄҎኺ಄߹ • ՄҎճ
URL • ՄҎଘऔमվཫ໘తҰ෦ɼ૾ੋ host, port, path, query, queryItems
URLComponents
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)
Alamofire • URLConvertible • ཁੋ conform Ṝݸ protocol बೳᙛᅿ public
protocol URLConvertible { func asURL() throws -> URL }
݁ • ཁදࣔ url ब༻ URL • 䈕Ҋੋ url •
ᔒࣄෆཁࣗݾ߹ url
Q&A
፮ᐔػ • http://slot.miario.com/machines/150067