OCScaffold
OCScaffold is a SwiftUI reusable scaffold view designed to provide a consistent layout for screens within your app. It simplifies the process of creating screens with common elements like navigation bars and content views.
Overview
The OCScaffold
struct encapsulates the structure of a screen with a navigation bar and a content view. You can customize the title displayed in the navigation bar and the content of the screen. This scaffold is useful for maintaining a consistent design across different screens in your app.
Installation
Add OpenContract via Pod.
Usage
-
Import the OpenContract framework:
import OpenContract
-
Create an instance of
OCScaffold
with a title and content view:OCScaffold(title: "My Screen Title") {
// Your content view here
} -
Customize the content view as needed. You can use any SwiftUI views within the content closure.
Example
To illustrate the usage of OCScaffold
, consider the following code snippet:
OCScaffold(title: "My Screen Title") {
ForEach(1...10, id: \.self) { index in
Text("Row \(index)")
.padding()
}
}