運用 PickerView 做出能夠選擇縣市與對應的區:

成果如下:

1.解析JSON格式:

從RainVisitor在GitHub提供的台灣行政區JSON
https://gist.githubusercontent.com/abc873693/2804e64324eaaf26515281710e1792df/raw/a1e1fc17d04b47c564bbd9dba0d59a6a325ec7c1/taiwan_districts.json

透過分析資料結構後,進行定義JSON對應的Decodable型別,與儲存轉換後的資料存在computed variable。

2.製作Pickview 並且匯入Data

DONE

--

--

Shin Yulin
Shin Yulin

Written by Shin Yulin

一個在前往 iOS 工程世界的視覺工作者

No responses yet