import SwiftUI
struct CleanArchitectureInfoView: View {
var body: some View {
VStack(alignment: .leading, spacing: 16) {
Text("Why use clean architecture?")
.font(.title2)
.bold()
VStack(alignment: .leading, spacing: 8) {
Text("- Separates code clearly")
Text("- Makes testing easier")
Text("- Helps add features fast")
Text("- Keeps bugs low")
}
Spacer()
Button(action: {
print("Close tapped")
}) {
Text("Close")
.frame(maxWidth: .infinity)
.padding()
.background(Color.blue)
.foregroundColor(.white)
.cornerRadius(8)
}
}
.padding()
}
}
struct CleanArchitectureInfoView_Previews: PreviewProvider {
static var previews: some View {
CleanArchitectureInfoView()
}
}This screen uses a vertical stack to arrange the title, bullet points, and a Close button.
The title uses a bold, larger font to stand out.
The bullet points are simple Text views with a dash to simulate bullets, spaced nicely.
The Close button is styled with a blue background and white text, filling the width for easy tapping.
When tapped, it prints a message to the console to simulate closing the screen.
This simple layout clearly communicates why clean architecture helps maintain codebases by separating concerns, easing testing, speeding feature addition, and reducing bugs.