diff --git a/Source/DDS/Component/NavigationView/NavigationView.swift b/Source/DDS/Component/NavigationView/NavigationView.swift index d510955..b826be3 100644 --- a/Source/DDS/Component/NavigationView/NavigationView.swift +++ b/Source/DDS/Component/NavigationView/NavigationView.swift @@ -3,10 +3,22 @@ import SwiftUI @available(macOS 12, iOS 15, *) public struct DodamNavigationView: NavigationViewProtocol { - internal let navigationBar: DodamNavigationBar - internal let buttons: [DodamNavigationBarButton] - internal let subView: AnyView? - internal let content: () -> C + public let navigationBar: DodamNavigationBar + public let buttons: [DodamNavigationBarButton] + public let subView: AnyView? + public let content: () -> C + + public init( + navigationBar: DodamNavigationBar, + buttons: [DodamNavigationBarButton] = .init(), + subView: AnyView? = nil, + @ViewBuilder content: @escaping () -> C + ) { + self.navigationBar = navigationBar + self.buttons = buttons + self.subView = subView + self.content = content + } public var body: some View { VStack(spacing: 0) { diff --git a/Source/DDS/Component/NavigationView/NavigationViewProtocol.swift b/Source/DDS/Component/NavigationView/NavigationViewProtocol.swift index 11135ee..40a7439 100644 --- a/Source/DDS/Component/NavigationView/NavigationViewProtocol.swift +++ b/Source/DDS/Component/NavigationView/NavigationViewProtocol.swift @@ -1,7 +1,7 @@ import SwiftUI @available(macOS 12, iOS 15, *) -protocol NavigationViewProtocol: View { +public protocol NavigationViewProtocol: View { associatedtype C: View @@ -18,7 +18,7 @@ protocol NavigationViewProtocol: View { ) } -extension NavigationViewProtocol { +public extension NavigationViewProtocol { init( navigationBar: DodamNavigationBar, diff --git a/Source/DDS/Component/ScrollView/ScrollView.swift b/Source/DDS/Component/ScrollView/ScrollView.swift index 09c3bd3..61004c1 100644 --- a/Source/DDS/Component/ScrollView/ScrollView.swift +++ b/Source/DDS/Component/ScrollView/ScrollView.swift @@ -3,10 +3,22 @@ import SwiftUI @available(macOS 12, iOS 15, *) public struct DodamScrollView: NavigationViewProtocol { - internal let navigationBar: DodamNavigationBar - internal let buttons: [DodamNavigationBarButton] - internal let subView: AnyView? - internal let content: () -> C + public let navigationBar: DodamNavigationBar + public let buttons: [DodamNavigationBarButton] + public let subView: AnyView? + public let content: () -> C + + public init( + navigationBar: DodamNavigationBar, + buttons: [DodamNavigationBarButton] = .init(), + subView: AnyView? = nil, + @ViewBuilder content: @escaping () -> C + ) { + self.navigationBar = navigationBar + self.buttons = buttons + self.subView = subView + self.content = content + } public var body: some View { ScrollView(showsIndicators: false) {