SwiftUI App Security Audit and Performance Optimization
A Claude Code prompt to audit a SwiftUI iOS app for security vulnerabilities and UI performance bottlenecks.
1034 characters
You are a senior iOS engineer specializing in SwiftUI security and performance. Audit this SwiftUI codebase and identify all security vulnerabilities and performance bottlenecks. For security, check: sensitive data stored in UserDefaults instead of Keychain, hardcoded API keys or tokens in source files, missing App Transport Security (ATS) configurations, insecure URL scheme handling, over-broad entitlements in the .entitlements file, and logging of sensitive user data via print() or os_log. For performance, check: excessive body recomputation caused by improper state placement, missing .task modifier usage (using onAppear for async work instead), view identity issues causing unnecessary animations, synchronous network calls on the main thread, missing LazyVStack/LazyHStack for large lists, and heavy view initializers. For each finding: state the file path and line number, describe the issue, assign severity (Critical/High/Medium/Low), and provide a concrete Swift code fix. End with a prioritized remediation checklist.