You can add this package to Package.swift
, include it in your target dependencies.
let package = Package(
dependencies: [
.package(url: "https://github.com/KantaSwift/SettingsScreen.git", .upToNextMajor(from: "0.0.1")),
],
targets: [
.target(
name: "<your-target-name>",
dependencies: ["ScreenSettings"]),
]
)
You can add this package on Xcode. See documentation.
import SwiftUI
import SettingsNavigation
struct SettingsView: View {
var body: some View {
SettingsNavigationList {
SettingsSection(title: "hogehoge") {
SettingsNavigationView(.assessment())
SettingsNavigationView(.notification())
SettingsNavigationView(.colorTheme())
SettingsNavigationView(
.url(
.init(
title: "hoge",
url: "https://example.com"
)
)
)
SettingsNavigationView(
.custom(
.init(
title: "title",
action: {
// something
}
)
)
)
}
.navigationTitle("設定")
.navigationBarTitleDisplayMode(.inline)
}
}
}
- It is recommended to use the following view modifier.
SettingsNavigationView(.notification())
.disclosureIndicatorIsHidden(true)
- Please refer to the following writing style
SettingsNavigationView(.assessment(.original("hoge")))
SettingsNavigationView(.notification(.system(systemName: "hoge")))
SettingsNavigationView(
.url(
.init(
title: "hoge",
url: "https://example.com",
imageType: .none
)
)
)
- Support for formats using ScrollView, not just list forms, is also planned.
I would be happy if you contribute :)