- Hands-On Full:Stack Development with Swift
- Ankur Patel
- 71字
- 2021-08-27 19:39:47
Exercise answer
The following is the answer to generating fake items. Copy this code if you were not able to create your own version of generating fake items as we will need this later in our app:
static func fake(_ count: Int) -> [Item] {
var items = [Item]()
for i in 0...count {
let item = Item(name: "Item \(i)", isChecked: i % 2 == 0)
items.append(item)
}
return items
}
推薦閱讀
- EJB 3.1從入門到精通
- 物聯網智慧安監技術
- Truffle Quick Start Guide
- Getting Started with WebRTC
- 面向物聯網的嵌入式系統開發:基于CC2530和STM32微處理器
- Wireshark網絡分析就這么簡單
- 電力物聯網工程技術原理與應用
- 計算機網絡原理與應用技術
- Getting Started with Memcached
- Learning Node.js Development
- Web用戶查詢日志挖掘與應用
- 新媒體交互藝術
- Hands-On Reactive Programming in Spring 5
- 趣話通信:6G的前世、今生和未來
- 智能物聯安防視頻技術基礎與應用