問答題APP

Shiny Shih
Aug 29, 2017 · 2 min read

這次用NBA的球星來做成問答題app,顯示照片,按answer按鈕顯示答案。

練習:

拉三個outlet,分別是題目圖片、答案、題號。

建立一個struct,定義答案以及圖片。

把資訊放入array裡面。

再來設計取得資料的function。

接下來讓next button動作。

按下answer鈕可以顯示答案。

最後要讓畫面一開始就出現第一題,把next()放到viewDidLoad裡面。


學習 Swift iOS App 開發的學生作品集

)

    Shiny Shih

    Written by

    彼得潘的 Swift iOS App 開發教室

    學習 Swift iOS App 開發的學生作品集

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade