運用 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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Shin Yulin
Shin Yulin

Written by Shin Yulin

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

No responses yet

Write a response