Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
75
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
180
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
300
Ruby 型別檢查工具簡介
johnlinvc
0
510
Swift Actor 實作探索
johnlinvc
0
170
用 mruby 來寫跨平台工具
johnlinvc
0
90
Actor model 簡介
johnlinvc
0
200
一起玩 Helm 3
johnlinvc
1
130
為什麼 App 卡卡的
johnlinvc
2
1.2k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
220
Other Decks in Programming
See All in Programming
CSC305 Lecture 17
javiergs
PRO
0
240
【レイトレ合宿11】kagayaki_v4
runningoutrate
0
210
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
520
React Native New Architecture 移行実践報告
taminif
1
130
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
200
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
380
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
5
1.2k
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
120
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
130
How Software Deployment tools have changed in the past 20 years
geshan
0
27k
関数の挙動書き換える
takatofukui
4
760
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
100
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
690
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Visualization
eitanlees
150
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
The Invisible Side of Design
smashingmag
302
51k
A Tale of Four Properties
chriscoyier
162
23k
Practical Orchestrator
shlominoach
190
11k
Docker and Python
trallard
46
3.7k
Site-Speed That Sticks
csswizardry
13
980
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