Swift 裡有個很特別的型別叫 Result,就像它名字 result(結果)暗示的,它可以告訴我們結果。而結果也跟我們生活中大部分的事一樣,只有兩種可能,成功或失敗。就像彼得潘會不會跟 IU…
開發 iOS App 的 in app purchase (IAP)功能時,我們希望能白吃白喝,測試 App 時不用真的付錢買東西。
感謝 Apple 捨不得我們花錢,以下兩種 case 都可以免費測試 in app purchase !
Swift 的 enum 有個特別的 associated value 語法,它將讓 enum 的 case 具有儲存相關聯資料的特異功能。接下來讓我們透過實際的例子好好認識它吧。
當我們利用 JSONDecoder 串接 API 回傳的 JSON 資料時,通常我們會將時間欄位的資料對應到 Date 型別,方便之後App 使用一些時間運算的 function。不過…
在 SwiftUI 我們可以利用 clipShape 或 mask 將 view 裁切成各種形狀。
These were the top 10 stories published by 彼得潘的 Swift iOS App 開發問題解答集 in April of 2020. You can also dive into daily archives for April of 2020 by using the calendar at the top of this page.