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
46
swift warm up NSURLQueryItem
Johnlin
May 08, 2018
Tweet
Share
More Decks by Johnlin
See All by Johnlin
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
110
Ruby 型別檢查工具簡介
johnlinvc
0
310
Swift Actor 實作探索
johnlinvc
0
130
用 mruby 來寫跨平台工具
johnlinvc
0
49
Actor model 簡介
johnlinvc
0
120
一起玩 Helm 3
johnlinvc
1
82
為什麼 App 卡卡的
johnlinvc
2
1k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
140
Life of a Cell
johnlinvc
0
1.3k
Other Decks in Programming
See All in Programming
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
Anthropic Cookbook のおすすめレシピ
schroneko
7
870
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
6
910
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
290
雑に思考を整理する技術と効能
konifar
58
29k
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
26
8.2k
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
Goのmultiple errorsについて (2024年4月版)
syumai
3
550
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
700
データアナリストが行うDatabricksを活用したETLの自動化事例
shinoa
0
260
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
Featured
See All Featured
How to name files
jennybc
65
93k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
120
39k
Writing Fast Ruby
sferik
621
60k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
What's new in Ruby 2.0
geeforr
337
31k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Creatively Recalculating Your Daily Design Routine
revolveconf
210
11k
Building an army of robots
kneath
300
41k
A Philosophy of Restraint
colly
197
16k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
78
42k
Unsuck your backbone
ammeep
663
57k
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