iOS 青少年科技挑战赛 - 带回家挑战赛

iOS 青少年科技挑战赛 – 带回家挑战赛

感谢您有兴趣参加 iOS 技术挑战赛。

制备

请在 Xcode 中编译项目并在您选择的模拟器中运行它。您将找到一个带有 2 个屏幕的工作应用程序原型,可通过选项卡栏访问。这是挑战的起点。

tech_challenge_images 001

返回项目,找到该文件并查看驱动应用的数据模型 .可以在 中找到一些示例事务。这些用于填充您刚刚看到的交易列表。TransactionModel.swiftTransactionModelModelData.swift

作业

需要考虑的一般要点:

  • 仔细遵循规格
  • focus on writing clean, maintainable code
  • write your UI code in SwiftUI, not UIKit

1. Filtering buttons

Add a horizontally scrolling view with buttons for the different categories (shopping, entertainment, food, etc). When the user taps on each of these, the list below should show only the transactions for the selected category. Add a button for all categories as well.

Play the following video to see the feature in action (note: if seeing inside Xcode video may not show fully):

Here are the design specs for the scrolling list of buttons and the buttons themselves:

2. Floating sum view

Add a floating view at the bottom of the list displaying the sum for the transactions belonging to the selected category. The sum should update when the user chooses the different categories.

Play the following video to see the feature in action:

Here are the design specs for the floating view with the sum of the chosen transactions:

tech_challenge_images 003

3. Add a pin/unpin action to each transaction

By tapping on it, the UI should blend/unblend accordingly. The sum in the floating view at the bottom should only consider pinned transactions.

Play the following video to see the feature in action:

Here are the design specs for the unpinned transaction view and the pin/unpin icon:

tech_challenge_images 005

4. Update the list in the insights tab to reflect expense in each category

The insights view should only consider pinned transactions.

tech_challenge_images 007

Make sure that the state between the transactions and the insights tab is kept consistent, as shown in this video capture:

5. Unit tests

Write unit test to verify:

  • filtering of transactions according to category
  • sum of transaction amounts for filtered category

Wrapping up

Once you have completed the assignments, please follow the instructions provided. Please, make sure that your project is complete and it is ready to be compiled and tested using the latest stable version of Xcode.

Good luck!

GitHub

点击跳转