UIKit UIデザイン原則
5/28/2025
1. Auto LayoutにはSnapKitを使用し、Dynamic TypeとSafe Areaをサポート。2. UIはプログラムで実装し、Storyboards/XIBsは避ける。3. UIコンポーネントはモデルに直接アクセスせず、OOP/MVC/MVVMに従う。4. イベントは'self'をパラメータとするクロージャで渡す。
#selector(buttonTapped), for: .touchUpInside)
}
private func setupUI() {
// setup UI
}
@objc private func buttonTapped() {
didTapButton?(self)
}
}
```