From 938fd0fed17739cc97d516e9776b243033c79516 Mon Sep 17 00:00:00 2001 From: Yannis Lang Date: Thu, 7 Jan 2021 15:35:34 +0100 Subject: [PATCH] fix access control --- Sources/YLOnBoarding/YLOnBoarding.swift | 8 +++++++- Sources/YLOnBoarding/YLOnBoardingItem.swift | 8 +++++++- Sources/YLOnBoarding/YLOnBoardingStyle.swift | 9 +++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Sources/YLOnBoarding/YLOnBoarding.swift b/Sources/YLOnBoarding/YLOnBoarding.swift index 0636030..f9f38a9 100644 --- a/Sources/YLOnBoarding/YLOnBoarding.swift +++ b/Sources/YLOnBoarding/YLOnBoarding.swift @@ -10,9 +10,15 @@ import SwiftUI public struct YLOnBoarding: View { let title: String - var style: YLOnBoardingStyle = YLOnBoardingStyle() + let style: YLOnBoardingStyle let items: [YLOnBoardingItem] + public init(title: String, style: YLOnBoardingStyle = YLOnBoardingStyle(), items: [YLOnBoardingItem]) { + self.title = title + self.style = style + self.items = items + } + public var body: some View { VStack { Text(title) diff --git a/Sources/YLOnBoarding/YLOnBoardingItem.swift b/Sources/YLOnBoarding/YLOnBoardingItem.swift index 104d149..55f3655 100644 --- a/Sources/YLOnBoarding/YLOnBoardingItem.swift +++ b/Sources/YLOnBoarding/YLOnBoardingItem.swift @@ -10,7 +10,13 @@ import Foundation public struct YLOnBoardingItem: Decodable { let icon: String let title: String - var description: String = "" + let description: String + + public init(icon: String, title: String, description: String = "") { + self.icon = icon + self.title = title + self.description = description + } } diff --git a/Sources/YLOnBoarding/YLOnBoardingStyle.swift b/Sources/YLOnBoarding/YLOnBoardingStyle.swift index 6a16d10..a1aea21 100644 --- a/Sources/YLOnBoarding/YLOnBoardingStyle.swift +++ b/Sources/YLOnBoarding/YLOnBoardingStyle.swift @@ -8,6 +8,11 @@ import SwiftUI public struct YLOnBoardingStyle { - var mainColor : Color = .black - var accentColor : Color = .blue + var mainColor: Color + var accentColor: Color + + public init(mainColor: Color = .black, accentColor: Color = .blue) { + self.mainColor = mainColor + self.accentColor = accentColor + } }