7. 在 Cursor 的 New chat 窗口內 取消任何檔案選擇(代表AI tool 需要修改整個項目而不是項目中個別檔案) 並加上 Doc - Apple Swift 及 Apple Design Tips 如下
及加入以下 Prompt 內容 send 去執行及讓 AI Generate Code,Auto 是代表讓 Cursor 自動選擇合適的 AI Model
I'm making an iOS stocks app. The app will have two screens:
Home Screen that will show the stocks of a few popular companies-Apple, Amazon, Google, Meta, and Microsoft. For each stock, we show the current price (latest market price) and daily price change (indicates the change in value since the market opened, both in absolute value and percentage). Price change should have green if it's positive and red if it's negative.
Stock details screen will screen provide in-depth data and insights for a selected stock. It should have Stock Name & Symbol (displayed at the top), current price, a linear chart showing price fluctuations throughout the day, and market stats (Opening Price, Previous Close, Daily High & Low).
複製代碼
9. 其間 Cursor 會Generate code 並提示創建 subfolder 或要確認及按 Accept / Accept all 去接受 AI 建議修改的內容
10. 在 Cursor 的 chat 窗口內再加入 Prompt 提示去逐步優化/修改項目如下
Please replace the ContentView with HomeView and to provide mock data for the preview.
複製代碼
Please make both HomeView and StockDetailView look visually nice and pretty and provide mock data to StockDetailView.
複製代碼
11. 最後切換到 XCode 內看 iPhone Simulator 的最後成果。
根據 AI Model 的提示,此 iOS app 可以再進一步優化
但在進一步優化前,強烈建議用XCode 進行 git Commit Changes
To make this a production app, you would need to:
Replace the mock data in StockService with real API calls