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
62
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
94
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
SwiftUI API Design Lessons
niw
1
290
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
150
Java 24まとめ / Java 24 summary
kishida
3
500
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
680
リストビュー画面UX改善の振り返り
splcywolf
0
140
複雑なフォームの jotai 設計 / Designing jotai(state) for Complex Forms #layerx_frontend
izumin5210
4
1k
「影響が少ない」を自分の目でみてみる
o0h
PRO
2
1.1k
Unlock the Potential of Swift Code Generation
rockname
0
260
State of Namespace
tagomoris
4
1.7k
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
k0kubun
0
850
監視 やばい
syossan27
9
8.3k
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
0
110
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
41
2.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
520
Git: the NoSQL Database
bkeepers
PRO
430
65k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Building an army of robots
kneath
304
45k
Speed Design
sergeychernyshev
29
900
Java REST API Framework Comparison - PWX 2021
mraible
30
8.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
It's Worth the Effort
3n
184
28k
Done Done
chrislema
183
16k
The Language of Interfaces
destraynor
157
25k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.4k
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