diff --git a/Projects/CommonUI/CommonUI.xcodeproj/project.pbxproj b/Projects/CommonUI/CommonUI.xcodeproj/project.pbxproj index ba04ba1..bf9de2e 100644 --- a/Projects/CommonUI/CommonUI.xcodeproj/project.pbxproj +++ b/Projects/CommonUI/CommonUI.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ @@ -272,8 +272,6 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - TargetAttributes = { - }; }; buildConfigurationList = 26B57D5F96290632B0503228 /* Build configuration list for PBXProject "CommonUI" */; compatibilityVersion = "Xcode 14.0"; @@ -358,11 +356,7 @@ "$(inherited)", "-fmodule-map-file=$(SRCROOT)/../../Tuist/.build/tuist-derived/RxCocoaRuntime/RxCocoaRuntime.modulemap", ); - OTHER_SWIFT_FLAGS = ( - "$(inherited)", - "-Xcc", - "-fmodule-map-file=$(SRCROOT)/../../Tuist/.build/tuist-derived/RxCocoaRuntime/RxCocoaRuntime.modulemap", - ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -fmodule-map-file=$(SRCROOT)/../../Tuist/.build/tuist-derived/RxCocoaRuntime/RxCocoaRuntime.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = io.tuist.CommonUI; PRODUCT_NAME = CommonUI; SDKROOT = iphoneos; @@ -456,11 +450,7 @@ "$(inherited)", "-fmodule-map-file=$(SRCROOT)/../../Tuist/.build/tuist-derived/RxCocoaRuntime/RxCocoaRuntime.modulemap", ); - OTHER_SWIFT_FLAGS = ( - "$(inherited)", - "-Xcc", - "-fmodule-map-file=$(SRCROOT)/../../Tuist/.build/tuist-derived/RxCocoaRuntime/RxCocoaRuntime.modulemap", - ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -fmodule-map-file=$(SRCROOT)/../../Tuist/.build/tuist-derived/RxCocoaRuntime/RxCocoaRuntime.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = io.tuist.CommonUI; PRODUCT_NAME = CommonUI; SDKROOT = iphoneos; @@ -468,10 +458,7 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)", - DEBUG, - ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; diff --git a/Projects/CommonUI/Derived/Sources/TuistAssets+CommonUI.swift b/Projects/CommonUI/Derived/Sources/TuistAssets+CommonUI.swift index 7283a57..bdb751a 100644 --- a/Projects/CommonUI/Derived/Sources/TuistAssets+CommonUI.swift +++ b/Projects/CommonUI/Derived/Sources/TuistAssets+CommonUI.swift @@ -1,156 +1,156 @@ -// swiftlint:disable:this file_name -// swiftlint:disable all -// swift-format-ignore-file -// swiftformat:disable all -// Generated using tuist — https://github.com/tuist/tuist - -#if os(macOS) - import AppKit -#elseif os(iOS) - import UIKit -#elseif os(tvOS) || os(watchOS) - import UIKit -#endif -#if canImport(SwiftUI) - import SwiftUI -#endif - -// MARK: - Asset Catalogs - -public enum CommonUIAsset: Sendable { - public enum Colors { - public static let lmBlack = CommonUIColors(name: "LMBlack") - public static let lmGray01 = CommonUIColors(name: "LMGray01") - public static let lmGray03 = CommonUIColors(name: "LMGray03") - public static let lmGray05 = CommonUIColors(name: "LMGray05") - public static let lmWhite = CommonUIColors(name: "LMWhite") - public static let lmOrange01 = CommonUIColors(name: "LMOrange01") - public static let lmOrange03 = CommonUIColors(name: "LMOrange03") - public static let lmOrange04 = CommonUIColors(name: "LMOrange04") - } - public enum Images { - public static let back = CommonUIImages(name: "back") - public static let play = CommonUIImages(name: "play") - public static let smallLogo = CommonUIImages(name: "small_logo") - public static let tabIconChat = CommonUIImages(name: "tab_icon_chat") - public static let tabIconChatSelected = CommonUIImages(name: "tab_icon_chat_selected") - public static let tabIconDiary = CommonUIImages(name: "tab_icon_diary") - public static let tabIconDiarySelected = CommonUIImages(name: "tab_icon_diary_selected") - public static let tabIconHome = CommonUIImages(name: "tab_icon_home") - public static let tabIconHomeSelected = CommonUIImages(name: "tab_icon_home_selected") - public static let tabIconMypage = CommonUIImages(name: "tab_icon_mypage") - public static let tabIconMypageSelected = CommonUIImages(name: "tab_icon_mypage_selected") - public static let tabIconStats = CommonUIImages(name: "tab_icon_stats") - public static let tabIconStatsSelected = CommonUIImages(name: "tab_icon_stats_selected") - } -} - -// MARK: - Implementation Details - -public final class CommonUIColors: Sendable { - public let name: String - - #if os(macOS) - public typealias Color = NSColor - #elseif os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) - public typealias Color = UIColor - #endif - - @available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, visionOS 1.0, *) - public var color: Color { - guard let color = Color(asset: self) else { - fatalError("Unable to load color asset named \(name).") - } - return color - } - - #if canImport(SwiftUI) - @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) - public var swiftUIColor: SwiftUI.Color { - return SwiftUI.Color(asset: self) - } - #endif - - fileprivate init(name: String) { - self.name = name - } -} - -public extension CommonUIColors.Color { - @available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, visionOS 1.0, *) - convenience init?(asset: CommonUIColors) { - let bundle = Bundle.module - #if os(iOS) || os(tvOS) || os(visionOS) - self.init(named: asset.name, in: bundle, compatibleWith: nil) - #elseif os(macOS) - self.init(named: NSColor.Name(asset.name), bundle: bundle) - #elseif os(watchOS) - self.init(named: asset.name) - #endif - } -} - -#if canImport(SwiftUI) -@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) -public extension SwiftUI.Color { - init(asset: CommonUIColors) { - let bundle = Bundle.module - self.init(asset.name, bundle: bundle) - } -} -#endif - -public struct CommonUIImages: Sendable { - public let name: String - - #if os(macOS) - public typealias Image = NSImage - #elseif os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) - public typealias Image = UIImage - #endif - - public var image: Image { - let bundle = Bundle.module - #if os(iOS) || os(tvOS) || os(visionOS) - let image = Image(named: name, in: bundle, compatibleWith: nil) - #elseif os(macOS) - let image = bundle.image(forResource: NSImage.Name(name)) - #elseif os(watchOS) - let image = Image(named: name) - #endif - guard let result = image else { - fatalError("Unable to load image asset named \(name).") - } - return result - } - - #if canImport(SwiftUI) - @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) - public var swiftUIImage: SwiftUI.Image { - SwiftUI.Image(asset: self) - } - #endif -} - -#if canImport(SwiftUI) -@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) -public extension SwiftUI.Image { - init(asset: CommonUIImages) { - let bundle = Bundle.module - self.init(asset.name, bundle: bundle) - } - - init(asset: CommonUIImages, label: Text) { - let bundle = Bundle.module - self.init(asset.name, bundle: bundle, label: label) - } - - init(decorative asset: CommonUIImages) { - let bundle = Bundle.module - self.init(decorative: asset.name, bundle: bundle) - } -} -#endif - -// swiftformat:enable all -// swiftlint:enable all +//// swiftlint:disable:this file_name +//// swiftlint:disable all +//// swift-format-ignore-file +//// swiftformat:disable all +//// Generated using tuist — https://github.com/tuist/tuist +// +//#if os(macOS) +// import AppKit +//#elseif os(iOS) +// import UIKit +//#elseif os(tvOS) || os(watchOS) +// import UIKit +//#endif +//#if canImport(SwiftUI) +// import SwiftUI +//#endif +// +//// MARK: - Asset Catalogs +// +//public enum CommonUIAsset: Sendable { +// public enum Colors { +// public static let lmBlack = CommonUIColors(name: "LMBlack") +// public static let lmGray01 = CommonUIColors(name: "LMGray01") +// public static let lmGray03 = CommonUIColors(name: "LMGray03") +// public static let lmGray05 = CommonUIColors(name: "LMGray05") +// public static let lmWhite = CommonUIColors(name: "LMWhite") +// public static let lmOrange01 = CommonUIColors(name: "LMOrange01") +// public static let lmOrange03 = CommonUIColors(name: "LMOrange03") +// public static let lmOrange04 = CommonUIColors(name: "LMOrange04") +// } +// public enum Images { +// public static let back = CommonUIImages(name: "back") +// public static let play = CommonUIImages(name: "play") +// public static let smallLogo = CommonUIImages(name: "small_logo") +// public static let tabIconChat = CommonUIImages(name: "tab_icon_chat") +// public static let tabIconChatSelected = CommonUIImages(name: "tab_icon_chat_selected") +// public static let tabIconDiary = CommonUIImages(name: "tab_icon_diary") +// public static let tabIconDiarySelected = CommonUIImages(name: "tab_icon_diary_selected") +// public static let tabIconHome = CommonUIImages(name: "tab_icon_home") +// public static let tabIconHomeSelected = CommonUIImages(name: "tab_icon_home_selected") +// public static let tabIconMypage = CommonUIImages(name: "tab_icon_mypage") +// public static let tabIconMypageSelected = CommonUIImages(name: "tab_icon_mypage_selected") +// public static let tabIconStats = CommonUIImages(name: "tab_icon_stats") +// public static let tabIconStatsSelected = CommonUIImages(name: "tab_icon_stats_selected") +// } +//} +// +//// MARK: - Implementation Details +// +//public final class CommonUIColors: Sendable { +// public let name: String +// +// #if os(macOS) +// public typealias Color = NSColor +// #elseif os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) +// public typealias Color = UIColor +// #endif +// +// @available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, visionOS 1.0, *) +// public var color: Color { +// guard let color = Color(asset: self) else { +// fatalError("Unable to load color asset named \(name).") +// } +// return color +// } +// +// #if canImport(SwiftUI) +// @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) +// public var swiftUIColor: SwiftUI.Color { +// return SwiftUI.Color(asset: self) +// } +// #endif +// +// fileprivate init(name: String) { +// self.name = name +// } +//} +// +//public extension CommonUIColors.Color { +// @available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, visionOS 1.0, *) +// convenience init?(asset: CommonUIColors) { +// let bundle = Bundle.module +// #if os(iOS) || os(tvOS) || os(visionOS) +// self.init(named: asset.name, in: bundle, compatibleWith: nil) +// #elseif os(macOS) +// self.init(named: NSColor.Name(asset.name), bundle: bundle) +// #elseif os(watchOS) +// self.init(named: asset.name) +// #endif +// } +//} +// +//#if canImport(SwiftUI) +//@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) +//public extension SwiftUI.Color { +// init(asset: CommonUIColors) { +// let bundle = Bundle.module +// self.init(asset.name, bundle: bundle) +// } +//} +//#endif +// +//public struct CommonUIImages: Sendable { +// public let name: String +// +// #if os(macOS) +// public typealias Image = NSImage +// #elseif os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) +// public typealias Image = UIImage +// #endif +// +// public var image: Image { +// let bundle = Bundle.module +// #if os(iOS) || os(tvOS) || os(visionOS) +// let image = Image(named: name, in: bundle, compatibleWith: nil) +// #elseif os(macOS) +// let image = bundle.image(forResource: NSImage.Name(name)) +// #elseif os(watchOS) +// let image = Image(named: name) +// #endif +// guard let result = image else { +// fatalError("Unable to load image asset named \(name).") +// } +// return result +// } +// +// #if canImport(SwiftUI) +// @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) +// public var swiftUIImage: SwiftUI.Image { +// SwiftUI.Image(asset: self) +// } +// #endif +//} +// +//#if canImport(SwiftUI) +//@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, visionOS 1.0, *) +//public extension SwiftUI.Image { +// init(asset: CommonUIImages) { +// let bundle = Bundle.module +// self.init(asset.name, bundle: bundle) +// } +// +// init(asset: CommonUIImages, label: Text) { +// let bundle = Bundle.module +// self.init(asset.name, bundle: bundle, label: label) +// } +// +// init(decorative asset: CommonUIImages) { +// let bundle = Bundle.module +// self.init(decorative: asset.name, bundle: bundle) +// } +//} +//#endif +// +//// swiftformat:enable all +//// swiftlint:enable all diff --git a/Projects/CommonUI/Derived/Sources/TuistBundle+CommonUI.swift b/Projects/CommonUI/Derived/Sources/TuistBundle+CommonUI.swift index cf585b1..3aac6c9 100644 --- a/Projects/CommonUI/Derived/Sources/TuistBundle+CommonUI.swift +++ b/Projects/CommonUI/Derived/Sources/TuistBundle+CommonUI.swift @@ -1,25 +1,25 @@ -// periphery:ignore:all -// swiftlint:disable:this file_name -// swiftlint:disable all -// swift-format-ignore-file -// swiftformat:disable all -#if hasFeature(InternalImportsByDefault) -public import Foundation -#else -import Foundation -#endif -// MARK: - Swift Bundle Accessor for Frameworks -private class BundleFinder {} -extension Foundation.Bundle { -/// Since CommonUI is a dynamic framework, the bundle for classes within this module can be used directly. - static let module = Bundle(for: BundleFinder.self) -} -// MARK: - Objective-C Bundle Accessor -@objc -public class CommonUIResources: NSObject { -@objc public class var bundle: Bundle { - return .module -} -} -// swiftformat:enable all -// swiftlint:enable all \ No newline at end of file +//// periphery:ignore:all +//// swiftlint:disable:this file_name +//// swiftlint:disable all +//// swift-format-ignore-file +//// swiftformat:disable all +//#if hasFeature(InternalImportsByDefault) +//public import Foundation +//#else +//import Foundation +//#endif +//// MARK: - Swift Bundle Accessor for Frameworks +//private class BundleFinder {} +//extension Foundation.Bundle { +///// Since CommonUI is a dynamic framework, the bundle for classes within this module can be used directly. +// static let module = Bundle(for: BundleFinder.self) +//} +//// MARK: - Objective-C Bundle Accessor +//@objc +//public class CommonUIResources: NSObject { +//@objc public class var bundle: Bundle { +// return .module +//} +//} +//// swiftformat:enable all +//// swiftlint:enable all diff --git a/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMGrayColor/LMGray06.colorset/Contents.json b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMGrayColor/LMGray06.colorset/Contents.json new file mode 100644 index 0000000..043d131 --- /dev/null +++ b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMGrayColor/LMGray06.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xEE", + "green" : "0xEE", + "red" : "0xEE" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xEE", + "green" : "0xEE", + "red" : "0xEE" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMBlue.colorset/Contents.json b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMBlue.colorset/Contents.json new file mode 100644 index 0000000..1651786 --- /dev/null +++ b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMBlue.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xEA", + "red" : "0xD9" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xEA", + "red" : "0xD9" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMGreen.colorset/Contents.json b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMGreen.colorset/Contents.json new file mode 100644 index 0000000..37ae77a --- /dev/null +++ b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMGreen.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD8", + "green" : "0xFF", + "red" : "0xE5" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD8", + "green" : "0xFF", + "red" : "0xE5" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMRed.colorset/Contents.json b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMRed.colorset/Contents.json new file mode 100644 index 0000000..f5e3ce7 --- /dev/null +++ b/Projects/CommonUI/Sources/Assets/Colors.xcassets/LMPointColor/LMRed.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD2", + "green" : "0xDA", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD2", + "green" : "0xDA", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/apple.imageset/Contents.json b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/apple.imageset/Contents.json new file mode 100644 index 0000000..0fcd2b1 --- /dev/null +++ b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/apple.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "apple.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/apple.imageset/apple.png b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/apple.imageset/apple.png new file mode 100644 index 0000000..c33b4d6 Binary files /dev/null and b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/apple.imageset/apple.png differ diff --git a/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/google.imageset/Contents.json b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/google.imageset/Contents.json new file mode 100644 index 0000000..8ff8a35 --- /dev/null +++ b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/google.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "google.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/google.imageset/google.png b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/google.imageset/google.png new file mode 100644 index 0000000..54e2e46 Binary files /dev/null and b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/google.imageset/google.png differ diff --git a/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/Contents.json b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/Contents.json new file mode 100644 index 0000000..71810bb --- /dev/null +++ b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "logo@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "logo@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/logo@2x.png b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/logo@2x.png new file mode 100644 index 0000000..dfad38c Binary files /dev/null and b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/logo@2x.png differ diff --git a/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/logo@3x.png b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/logo@3x.png new file mode 100644 index 0000000..981a214 Binary files /dev/null and b/Projects/CommonUI/Sources/Assets/Images.xcassets/Logo/logo.imageset/logo@3x.png differ diff --git a/Projects/CommonUI/Sources/Enum/CommonUIAssets.swift b/Projects/CommonUI/Sources/Enum/CommonUIAssets.swift index 2775d09..0f0badb 100644 --- a/Projects/CommonUI/Sources/Enum/CommonUIAssets.swift +++ b/Projects/CommonUI/Sources/Enum/CommonUIAssets.swift @@ -42,6 +42,9 @@ public enum CommonUIAssets { /// * logo public static let smallLogo = image(named: "small_logo") + public static let logo = image(named: "logo") + public static let google = image(named: "google") + public static let apple = image(named: "apple") /// * Icon public static let IconPlay = image(named: "play") @@ -56,6 +59,10 @@ public enum CommonUIAssets { public static let LMGray1 = color(named: "LMGray01") public static let LMGray3 = color(named: "LMGray03") public static let LMGray5 = color(named: "LMGray05") + public static let LMGray6 = color(named: "LMGray06") + public static let LMBlue = color(named: "LMBlue") + public static let LMGreen = color(named: "LMGreen") + public static let LMRed = color(named: "LMRed") } private func image(named name: String) -> UIImage? { diff --git a/Projects/CommonUI/Sources/View/Home/AnswerView.swift b/Projects/CommonUI/Sources/View/Home/AnswerView.swift index 6ca487b..31c6a40 100644 --- a/Projects/CommonUI/Sources/View/Home/AnswerView.swift +++ b/Projects/CommonUI/Sources/View/Home/AnswerView.swift @@ -45,16 +45,13 @@ open class AnswerView: UIView { switch type { case .correct: correctView = correctView.then { - $0.layer.borderColor = UIColor.black.cgColor - $0.layer.borderWidth = 1 -// $0.backgroundColor = CommonUIAssets.LMGray6 + $0.backgroundColor = CommonUIAssets.LMGreen $0.layer.cornerRadius = 12 } correctLabel = correctLabel.then { - $0.textColor = .black - // $0.textColor = CommonUIAssets.LMGray1 - $0.textAlignment = .center + $0.textColor = CommonUIAssets.LMGray1 + $0.textAlignment = .left $0.font = .systemFont(ofSize: 13, weight: .regular) $0.numberOfLines = 0 $0.setContentHuggingPriority(.required, for: .vertical) @@ -62,15 +59,13 @@ open class AnswerView: UIView { } case .wrong: wrongView = wrongView.then { - $0.layer.borderColor = UIColor.black.cgColor - $0.layer.borderWidth = 1 -// $0.backgroundColor = CommonUIAssets.LMBlue + $0.backgroundColor = CommonUIAssets.LMRed $0.layer.cornerRadius = 12 } wrongLabel = wrongLabel.then { - $0.textColor = .black - // $0.textColor = CommonUIAssets.LMGray1 + $0.textColor = CommonUIAssets.LMGray1 + $0.textAlignment = .left $0.font = .systemFont(ofSize: 14, weight: .regular) $0.numberOfLines = 0 $0.setContentHuggingPriority(.required, for: .vertical) diff --git a/Projects/CommonUI/Sources/View/Home/HomeProgressView.swift b/Projects/CommonUI/Sources/View/Home/HomeProgressView.swift index 5d7e510..2f5f640 100644 --- a/Projects/CommonUI/Sources/View/Home/HomeProgressView.swift +++ b/Projects/CommonUI/Sources/View/Home/HomeProgressView.swift @@ -14,7 +14,7 @@ open class HomeProgressView: UIView { var courseLabel = UILabel() var progressLabel = UILabel() let progressEntireView = UIView().then { - $0.backgroundColor = .lightGray + $0.backgroundColor = CommonUIAssets.LMGray5 $0.layer.cornerRadius = 3 } var progressView = UIView() diff --git a/Projects/CommonUI/Sources/View/Home/HomeView.swift b/Projects/CommonUI/Sources/View/Home/HomeView.swift index 0f2291c..d97ea17 100644 --- a/Projects/CommonUI/Sources/View/Home/HomeView.swift +++ b/Projects/CommonUI/Sources/View/Home/HomeView.swift @@ -25,7 +25,6 @@ open class HomeView: UIView { } public func bind(course: CourseVO) { - titleLabel.text = "안녕하세요, " + "" + "님!" } func initAttribute() { @@ -43,7 +42,7 @@ open class HomeView: UIView { } titleLabel = titleLabel.then { - $0.text = "안녕하세요, OO님!" + $0.text = "안녕하세요!" $0.textColor = CommonUIAssets.LMBlack $0.font = .systemFont(ofSize: 19, weight: .semibold) } diff --git a/Projects/CommonUI/Sources/View/Home/OptionView.swift b/Projects/CommonUI/Sources/View/Home/OptionView.swift index 543d20b..c95e42d 100644 --- a/Projects/CommonUI/Sources/View/Home/OptionView.swift +++ b/Projects/CommonUI/Sources/View/Home/OptionView.swift @@ -37,15 +37,14 @@ open class OptionView: UIView { func initAttribute() { optionView = optionView.then { - $0.layer.borderColor = UIColor.black.cgColor + $0.layer.borderColor = CommonUIAssets.LMOrange1?.cgColor $0.layer.borderWidth = 1 -// $0.backgroundColor = CommonUIAssets.LMGray6 $0.layer.cornerRadius = 12 + $0.backgroundColor = .white } optionLabel = optionLabel.then { - $0.textColor = .black -// $0.textColor = CommonUIAssets.LMGray1 + $0.textColor = CommonUIAssets.LMGray1 $0.textAlignment = .center $0.font = .systemFont(ofSize: 13, weight: .regular) $0.numberOfLines = 0 diff --git a/Projects/CommonUI/Sources/View/Home/QuizCompleteAlertView.swift b/Projects/CommonUI/Sources/View/Home/QuizCompleteAlertView.swift index 9ba07a4..b4ea857 100644 --- a/Projects/CommonUI/Sources/View/Home/QuizCompleteAlertView.swift +++ b/Projects/CommonUI/Sources/View/Home/QuizCompleteAlertView.swift @@ -22,27 +22,33 @@ public final class QuizCompleteAlertView: UIView { $0.clipsToBounds = true } + private let congratulationLabel = UILabel().then { + $0.text = "🎉" + $0.font = .boldSystemFont(ofSize: 50) + $0.textAlignment = .center + } + private let titleLabel = UILabel().then { $0.text = "퀴즈 완료!" - $0.textColor = .black - $0.font = .boldSystemFont(ofSize: 20) + $0.textColor = CommonUIAssets.LMBlack + $0.font = .boldSystemFont(ofSize: 25) $0.textAlignment = .center $0.numberOfLines = 0 } private let messageLabel = UILabel().then { - $0.text = "모든 질문에 잘 답변했어요 👏" - $0.textColor = .darkGray + $0.text = "모든 질문에 잘 답변했어요.\n수고하셨습니다!" + $0.textColor = CommonUIAssets.LMGray1 $0.font = .systemFont(ofSize: 16) $0.textAlignment = .center $0.numberOfLines = 0 } - private let confirmButton = UIButton(type: .system).then { + private let confirmButton = UIButton().then { $0.setTitle("확인", for: .normal) $0.titleLabel?.font = .systemFont(ofSize: 16, weight: .medium) - $0.setTitleColor(.white, for: .normal) - $0.backgroundColor = .systemBlue + $0.setTitleColor(CommonUIAssets.LMGray1, for: .normal) + $0.backgroundColor = CommonUIAssets.LMOrange3 $0.layer.cornerRadius = 8 } @@ -61,7 +67,7 @@ public final class QuizCompleteAlertView: UIView { self.addSubview(backgroundView) self.addSubview(containerView) - [titleLabel, messageLabel, confirmButton].forEach { + [congratulationLabel, titleLabel, messageLabel, confirmButton].forEach { containerView.addSubview($0) } } @@ -76,8 +82,13 @@ public final class QuizCompleteAlertView: UIView { $0.width.equalToSuperview().multipliedBy(0.8) } + congratulationLabel.snp.makeConstraints { + $0.top.equalToSuperview().inset(34) + $0.leading.trailing.equalToSuperview().inset(16) + } + titleLabel.snp.makeConstraints { - $0.top.equalToSuperview().inset(24) + $0.top.equalTo(congratulationLabel.snp.bottom).offset(10) $0.leading.trailing.equalToSuperview().inset(16) } @@ -90,8 +101,8 @@ public final class QuizCompleteAlertView: UIView { $0.top.equalTo(messageLabel.snp.bottom).offset(20) $0.bottom.equalToSuperview().inset(20) $0.centerX.equalToSuperview() - $0.width.equalTo(100) - $0.height.equalTo(40) + $0.height.equalTo(44) + $0.leading.trailing.equalToSuperview().inset(16) } } diff --git a/Projects/CommonUI/Sources/View/Home/QuizView.swift b/Projects/CommonUI/Sources/View/Home/QuizView.swift index 5e369e2..e03a329 100644 --- a/Projects/CommonUI/Sources/View/Home/QuizView.swift +++ b/Projects/CommonUI/Sources/View/Home/QuizView.swift @@ -45,15 +45,12 @@ open class QuizView: UIView { switch type { case .situation: situationView = situationView.then { - $0.layer.borderColor = UIColor.black.cgColor - $0.layer.borderWidth = 1 -// $0.backgroundColor = CommonUIAssets.LMGray6 + $0.backgroundColor = CommonUIAssets.LMGray6 $0.layer.cornerRadius = 12 } situationLabel = situationLabel.then { - $0.textColor = .black - // $0.textColor = CommonUIAssets.LMGray1 + $0.textColor = CommonUIAssets.LMGray1 $0.textAlignment = .center $0.font = .systemFont(ofSize: 13, weight: .regular) $0.numberOfLines = 0 @@ -62,15 +59,12 @@ open class QuizView: UIView { } case .question: questionView = questionView.then { - $0.layer.borderColor = UIColor.black.cgColor - $0.layer.borderWidth = 1 -// $0.backgroundColor = CommonUIAssets.LMBlue + $0.backgroundColor = CommonUIAssets.LMBlue $0.layer.cornerRadius = 12 } questionLabel = questionLabel.then { - $0.textColor = .black - // $0.textColor = CommonUIAssets.LMGray1 + $0.textColor = CommonUIAssets.LMGray1 $0.font = .systemFont(ofSize: 14, weight: .regular) $0.numberOfLines = 0 $0.setContentHuggingPriority(.required, for: .vertical) diff --git a/Projects/CommonUI/Sources/View/Login/LoginView.swift b/Projects/CommonUI/Sources/View/Login/LoginView.swift index 0b00e8d..9e0f36d 100644 --- a/Projects/CommonUI/Sources/View/Login/LoginView.swift +++ b/Projects/CommonUI/Sources/View/Login/LoginView.swift @@ -19,7 +19,12 @@ open class LoginView: UIView, SFSafariViewControllerDelegate { $0.textColor = .black $0.font = .systemFont(ofSize: 20, weight: .bold) } - var logoView = UIImageView() + + let logoView = UIImageView().then { + $0.image = CommonUIAssets.logo + $0.contentMode = .scaleAspectFit + } + var googleLoginButton = UIButton() var appleLoginButton = UIButton() @@ -47,13 +52,29 @@ open class LoginView: UIView, SFSafariViewControllerDelegate { self.backgroundColor = .white googleLoginButton = googleLoginButton.then { - $0.backgroundColor = .blue + $0.setTitle("Google로 시작하기", for: .normal) + $0.setTitleColor(.black, for: .normal) + $0.setImage(CommonUIAssets.google? + .resize(to: CGSize(width: 25, height: 25)), for: .normal) + $0.backgroundColor = .white + $0.layer.borderColor = CommonUIAssets.LMGray3?.cgColor + $0.layer.borderWidth = 1 $0.layer.cornerRadius = 12 + $0.titleLabel?.font = UIFont.systemFont(ofSize: 15) + $0.semanticContentAttribute = .forceLeftToRight + $0.imageEdgeInsets = UIEdgeInsets(top: 0, left: -8, bottom: 0, right: 8) } appleLoginButton = appleLoginButton.then { + $0.setTitle("Apple로 시작하기", for: .normal) + $0.setTitleColor(.white, for: .normal) + $0.setImage(CommonUIAssets.apple? + .resize(to: CGSize(width: 25, height: 25)), for: .normal) $0.backgroundColor = .black $0.layer.cornerRadius = 12 + $0.titleLabel?.font = UIFont.systemFont(ofSize: 15) + $0.semanticContentAttribute = .forceLeftToRight + $0.imageEdgeInsets = UIEdgeInsets(top: 0, left: -8, bottom: 0, right: 8) } } @@ -62,24 +83,25 @@ open class LoginView: UIView, SFSafariViewControllerDelegate { .forEach { self.addSubview($0) } logoLabel.snp.makeConstraints { - $0.top.equalToSuperview().inset(130) - $0.centerX.equalToSuperview() + $0.bottom.equalTo(logoView.snp.top).offset(-15) + $0.leading.equalTo(logoView.snp.leading) } logoView.snp.makeConstraints { - $0.top.equalTo(logoLabel.snp.bottom) + $0.height.equalTo(56) + $0.centerY.equalToSuperview().offset(-50) $0.centerX.equalToSuperview() } googleLoginButton.snp.makeConstraints { - $0.bottom.equalTo(appleLoginButton.snp.top).offset(-40) - $0.height.equalTo(60) + $0.bottom.equalTo(appleLoginButton.snp.top).offset(-20) + $0.height.equalTo(50) $0.horizontalEdges.equalToSuperview().inset(20) } appleLoginButton.snp.makeConstraints { $0.bottom.equalToSuperview().inset(60) - $0.height.equalTo(60) + $0.height.equalTo(50) $0.horizontalEdges.equalToSuperview().inset(20) } } diff --git a/Projects/CommonUI/Sources/View/Navigation/DefaultNavigationBar.swift b/Projects/CommonUI/Sources/View/Navigation/DefaultNavigationBar.swift index 0bbe0fe..d1f182c 100644 --- a/Projects/CommonUI/Sources/View/Navigation/DefaultNavigationBar.swift +++ b/Projects/CommonUI/Sources/View/Navigation/DefaultNavigationBar.swift @@ -22,8 +22,10 @@ public final class DefaultNavigationBar: UIView { setupLayout() leftButton.setImage(leftImage, for: .normal) - rightButton.setImage(leftImage, for: .normal) + rightButton.setImage(rightImage, for: .normal) rightButton.isHidden = isRightButtonHidden + + leftButton.addTarget(self, action: #selector(leftButtonTapped), for: .touchUpInside) } required init?(coder: NSCoder) { @@ -31,7 +33,7 @@ public final class DefaultNavigationBar: UIView { } private func setupUI() { - backgroundColor = .white + backgroundColor = .clear leftButton.setTitle(nil, for: .normal) rightButton.setTitle(nil, for: .normal) @@ -70,5 +72,22 @@ public final class DefaultNavigationBar: UIView { public func setupViewProperty(title: String) { titleLabel.text = title } + + @objc private func leftButtonTapped() { + if let viewController = findViewController() { + viewController.navigationController?.popViewController(animated: true) + } + } + + private func findViewController() -> UIViewController? { + var responder: UIResponder? = self + while let nextResponder = responder?.next { + if let viewController = nextResponder as? UIViewController { + return viewController + } + responder = nextResponder + } + return nil + } } diff --git a/Projects/Domain/Domain.xcodeproj/project.pbxproj b/Projects/Domain/Domain.xcodeproj/project.pbxproj index 72b7b49..b51b4c5 100644 --- a/Projects/Domain/Domain.xcodeproj/project.pbxproj +++ b/Projects/Domain/Domain.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ @@ -15,6 +15,7 @@ 69DAD609572D32F2BA3845AE /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E1DA9A49E79A791F7A526A1 /* String+Extension.swift */; }; 92BD46EE48F6C63B6E43D069 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32AB908BB15CBDA006ADC3A1 /* UIView+Extension.swift */; }; 94174705336F0E353686EA83 /* LoginUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 574E8F32CEB080432AB7EA94 /* LoginUseCase.swift */; }; + 95369A7E2E28B8D9000C893F /* UIImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95369A7D2E28B8D1000C893F /* UIImage+Extension.swift */; }; A0CEC5A2E5A76EBD987CE37D /* StepVO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798CFC331192C9FE77F3446A /* StepVO.swift */; }; B0B0382EF5DFDACDD3EB8A75 /* QuizUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4565F6A02AFBF3D9A0D41B /* QuizUseCase.swift */; }; BBED9ACB62B271298F7028F8 /* CourseUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F904C836B5CD2D4DA5EAE38D /* CourseUseCase.swift */; }; @@ -48,6 +49,7 @@ 747DBBCAB797E5E0A82177F2 /* CourseVO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseVO.swift; sourceTree = ""; }; 798CFC331192C9FE77F3446A /* StepVO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepVO.swift; sourceTree = ""; }; 8A2AB67DE6AA50B3229C7A86 /* LoginRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginRepository.swift; sourceTree = ""; }; + 95369A7D2E28B8D1000C893F /* UIImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extension.swift"; sourceTree = ""; }; 9A2E30672E510822AAF38EAD /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; ABB8C62A6FE12783AD3819BE /* TokenUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenUseCase.swift; sourceTree = ""; }; BD15A37E85BAE3A36B2CE72C /* Domain-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Domain-Info.plist"; sourceTree = ""; }; @@ -89,6 +91,7 @@ 266DBF54466AF3D041290301 /* Extension */ = { isa = PBXGroup; children = ( + 95369A7D2E28B8D1000C893F /* UIImage+Extension.swift */, 2E1DA9A49E79A791F7A526A1 /* String+Extension.swift */, 32AB908BB15CBDA006ADC3A1 /* UIView+Extension.swift */, ); @@ -194,8 +197,6 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - TargetAttributes = { - }; }; buildConfigurationList = 5B17347D429F14C389327C78 /* Build configuration list for PBXProject "Domain" */; compatibilityVersion = "Xcode 14.0"; @@ -242,6 +243,7 @@ 3E835D4F2E5F639557AC7C06 /* TokenUseCase.swift in Sources */, 5EB8590C9D2C002D0BDBC021 /* CourseVO.swift in Sources */, 0DED9075FE34124C093D9FDF /* LoginVO.swift in Sources */, + 95369A7E2E28B8D9000C893F /* UIImage+Extension.swift in Sources */, CFBF3D58082C5F201FCFFD5B /* QuizVO.swift in Sources */, A0CEC5A2E5A76EBD987CE37D /* StepVO.swift in Sources */, ); @@ -417,10 +419,7 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)", - DEBUG, - ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; diff --git a/Projects/Domain/Sources/Extension/UIImage+Extension.swift b/Projects/Domain/Sources/Extension/UIImage+Extension.swift new file mode 100644 index 0000000..cf6cd49 --- /dev/null +++ b/Projects/Domain/Sources/Extension/UIImage+Extension.swift @@ -0,0 +1,18 @@ +// +// UIImage+Extension.swift +// Domain +// +// Created by 박지윤 on 7/17/25. +// + +import UIKit + +extension UIImage { + public func resize(to targetSize: CGSize) -> UIImage? { + UIGraphicsBeginImageContextWithOptions(targetSize, false, 0.0) + self.draw(in: CGRect(origin: .zero, size: targetSize)) + let resizedImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return resizedImage + } +} diff --git a/Projects/Home/Sources/View/QuizViewController.swift b/Projects/Home/Sources/View/QuizViewController.swift index 8d8b975..b421703 100644 --- a/Projects/Home/Sources/View/QuizViewController.swift +++ b/Projects/Home/Sources/View/QuizViewController.swift @@ -15,10 +15,12 @@ public class QuizViewController: UIViewController { let navigationBar = DefaultNavigationBar(leftImage: CommonUIAssets.IconBack ?? nil, rightImage: nil, isRightButtonHidden: true) - let progressView = UIView() + let progressView = UIView().then { + $0.backgroundColor = CommonUIAssets.LMOrange1 + $0.layer.cornerRadius = 3 + } let progressEntireView = UIView().then { - $0.backgroundColor = .gray - // $0.backgroundColor = CommonUIAssets.LMGray5 + $0.backgroundColor = CommonUIAssets.LMGray5 $0.layer.cornerRadius = 3 } let scrollView = UIScrollView() @@ -78,7 +80,7 @@ public class QuizViewController: UIViewController { } public func setupHierarchy() { - [navigationBar, progressView, progressEntireView, scrollView].forEach { view.addSubview($0) } + [navigationBar, progressEntireView, progressView, scrollView].forEach { view.addSubview($0) } scrollView.addSubview(quizStackView) } @@ -98,6 +100,13 @@ public class QuizViewController: UIViewController { $0.centerX.equalToSuperview() } + progressView.snp.makeConstraints { + $0.height.equalTo(6) + $0.top.equalTo(navigationBar.snp.bottom).offset(20) + $0.leading.equalToSuperview().inset(20) + $0.width.equalTo(0) + } + scrollView.snp.makeConstraints { $0.top.equalTo(progressEntireView.snp.bottom).offset(20) $0.horizontalEdges.bottom.equalToSuperview() @@ -192,6 +201,8 @@ public class QuizViewController: UIViewController { let feedback = AnswerView(text: feedbackText, type: .correct) quizStackView.addArrangedSubview(feedback) + updateProgress() + DispatchQueue.main.asyncAfter(deadline: .now() + 2) { let nextIndex = self.currentQuestionIndex + 1 self.currentQuestionIndex = nextIndex @@ -230,4 +241,23 @@ public class QuizViewController: UIViewController { let alertView = QuizCompleteAlertView() alertView.show(in: view) } + + private func updateProgress() { + guard let quizData = quizData else { return } + + let totalQuestions = quizData.quizList.count + let completedQuestions = currentQuestionIndex + 1 + + let totalWidth = UIScreen.main.bounds.width - 40 + + let progressPerQuestion = totalWidth / CGFloat(totalQuestions) + let currentProgress = progressPerQuestion * CGFloat(completedQuestions) + + UIView.animate(withDuration: 0) { + self.progressView.snp.updateConstraints { + $0.width.equalTo(currentProgress) + } + self.view.layoutIfNeeded() + } + } }