← スキル一覧に戻る

swiftui-debug
by willsigmon
Website for sigstack.dev - Claude Code stack showcase
⭐ 0🍴 0📅 2026年1月23日
SKILL.md
name: swiftui-debug description: Debug SwiftUI view issues (state, bindings, rendering) model: sonnet
SwiftUI Debugging Guide
Debug common SwiftUI issues in the Leavn app:
Common Issues
1. View Not Updating
Check:
- Is ViewModel using
@Observablemacro? - Are properties marked
@MainActorif needed? - Is view observing the right object?
Fix:
// Ensure ViewModel is @Observable
@Observable
class MyViewModel {
var state: String = "" // Auto-tracked
}
// Ensure view observes it
@State var viewModel = MyViewModel() // Not @StateObject
2. Binding Not Working
Check:
- Is the binding two-way?
- Is the source value actually mutable?
- Is there a
@Bindingvs@Statemismatch?
Fix:
// Correct binding chain
@State var value: String
TextField("", text: $value) // $ creates Binding
3. Modal/Sheet Won't Dismiss
Check:
- Is
@Environment(\.dismiss)being called? - Is
isPresentedbinding being set to false? - Are there multiple presentation modifiers conflicting?
Fix:
@Environment(\.dismiss) var dismiss
Button("Close") {
isPresented = false // Update binding
dismiss() // Call environment dismiss
}
4. Performance Issues
Check:
- Are views too complex? (use
Self._printChanges()) - Unnecessary re-renders?
- Heavy computations in body?
Fix:
- Extract subviews
- Use
@Statesparingly - Move logic to ViewModel
Return specific fixes for the reported SwiftUI issue.
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です