diff --git a/BeReal.xcodeproj/project.pbxproj b/BeReal.xcodeproj/project.pbxproj index b41bbcb..c9f7f8b 100644 --- a/BeReal.xcodeproj/project.pbxproj +++ b/BeReal.xcodeproj/project.pbxproj @@ -36,6 +36,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 02784F03293A8331005F839D /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Modules; sourceTree = ""; }; 02AE64EB29363DBF005A4AF3 /* BeReal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BeReal.app; sourceTree = BUILT_PRODUCTS_DIR; }; 02AE64EE29363DBF005A4AF3 /* BeRealApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealApp.swift; sourceTree = ""; }; 02AE64F029363DBF005A4AF3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -47,7 +48,6 @@ 02AE650929363DC1005A4AF3 /* BeRealUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealUITests.swift; sourceTree = ""; }; 02AE650B29363DC1005A4AF3 /* BeRealUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealUITestsLaunchTests.swift; sourceTree = ""; }; 02FFFD7A29395DD200306533 /* String+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Constants.swift"; sourceTree = ""; }; - 4694AA9D293A7B8B00D54903 /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Modules; path = ../../../../../../Users/logansama/Desktop/Modules; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -79,23 +79,14 @@ 027F60592937662300467238 /* Login */ = { isa = PBXGroup; children = ( - 02FFFD7629395D7F00306533 /* Components */, - 027F605C29376EEB00467238 /* Views */, ); path = Login; sourceTree = ""; }; - 027F605C29376EEB00467238 /* Views */ = { - isa = PBXGroup; - children = ( - ); - path = Views; - sourceTree = ""; - }; 02AE64E229363DBF005A4AF3 = { isa = PBXGroup; children = ( - 4694AA9D293A7B8B00D54903 /* Modules */, + 02784F03293A8331005F839D /* Modules */, 02AE64ED29363DBF005A4AF3 /* BeReal */, 02AE64FE29363DC1005A4AF3 /* BeRealTests */, 02AE650829363DC1005A4AF3 /* BeRealUITests */, @@ -152,13 +143,6 @@ path = BeRealUITests; sourceTree = ""; }; - 02FFFD7629395D7F00306533 /* Components */ = { - isa = PBXGroup; - children = ( - ); - path = Components; - sourceTree = ""; - }; 02FFFD7929395DBF00306533 /* Extensions */ = { isa = PBXGroup; children = ( diff --git a/Modules/Package.swift b/Modules/Package.swift new file mode 100644 index 0000000..98ab061 --- /dev/null +++ b/Modules/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version: 5.7 + +import PackageDescription + +let package = Package( + name: "Modules", + defaultLocalization: "en", + platforms: [ + .iOS(.v15) + ], + products: [ + .library( + name: "Modules", + targets: [ + "Login" + ] + ), + ], + targets: [ + .target( + name: "Login", + resources: [.process("Resources")] + ), + ] +) diff --git a/BeReal/Localizable.strings b/Modules/Sources/Login/Resources/en.lproj/Localizable.strings similarity index 92% rename from BeReal/Localizable.strings rename to Modules/Sources/Login/Resources/en.lproj/Localizable.strings index 546b3bb..bd901a9 100644 --- a/BeReal/Localizable.strings +++ b/Modules/Sources/Login/Resources/en.lproj/Localizable.strings @@ -1,13 +1,11 @@ /* Localizable.strings - BeReal + Login Created by Javier Cicchelli on 02/12/2022. Copyright © 2022 Röck+Cöde. All rights reserved. */ -// Login view - "login.title.text" = "My files"; "login.text_field.username.placeholder" = "Username"; "login.text_field.password.placeholder" = "Password"; diff --git a/BeReal/Login/Components/LoginForm.swift b/Modules/Sources/Login/UI/Components/LoginForm.swift similarity index 100% rename from BeReal/Login/Components/LoginForm.swift rename to Modules/Sources/Login/UI/Components/LoginForm.swift diff --git a/BeReal/Login/Views/LoginView.swift b/Modules/Sources/Login/UI/Views/LoginView.swift similarity index 91% rename from BeReal/Login/Views/LoginView.swift rename to Modules/Sources/Login/UI/Views/LoginView.swift index 7dc99fd..45cb4df 100644 --- a/BeReal/Login/Views/LoginView.swift +++ b/Modules/Sources/Login/UI/Views/LoginView.swift @@ -8,15 +8,19 @@ import SwiftUI -struct LoginView: View { +public struct LoginView: View { // MARK: States @State private var containerTopPadding: CGFloat = 0 + // MARK: Initialisers + + public init() {} + // MARK: Body - var body: some View { + public var body: some View { ScrollView( .vertical, showsIndicators: false @@ -42,15 +46,15 @@ fileprivate extension LoginView { // MARK: States @State private var isAuthenticating: Bool = false - @State private var username: String = .empty - @State private var password: String = .empty + @State private var username: String = "" + @State private var password: String = "" @State private var errorMessage: String? // MARK: Body var body: some View { VStack(spacing: 32) { - Text("login.title.text") + Text("login.title.text", bundle: .module) .font(.largeTitle) .fontWeight(.bold) .foregroundColor(.primary) @@ -67,7 +71,7 @@ fileprivate extension LoginView { // TODO: login with the username and password. } label: { Label { - Text("login.button.log_in.text") + Text("login.button.log_in.text", bundle: .module) .fontWeight(.semibold) } icon: { if isAuthenticating {