Skip to content

Commit

Permalink
refactor: SFSafeSystemSymbol Library 분리 및 리펙토링
Browse files Browse the repository at this point in the history
  • Loading branch information
heonha committed Dec 2, 2023
1 parent 3decd64 commit c5138a4
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 98 deletions.
37 changes: 2 additions & 35 deletions koget.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@
39EBEB4E29BE03C300B1FD54 /* PatchNoteListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39EBEB4D29BE03C300B1FD54 /* PatchNoteListCell.swift */; };
39EBEB5029BE06E900B1FD54 /* PatchNoteList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39EBEB4F29BE06E900B1FD54 /* PatchNoteList.swift */; };
39EBEB5229BE0A7900B1FD54 /* PatchNoteManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39EBEB5129BE0A7900B1FD54 /* PatchNoteManager.swift */; };
39ED274D29B98431001C368E /* SFSafeSymbols in Frameworks */ = {isa = PBXBuildFile; productRef = 39ED274C29B98431001C368E /* SFSafeSymbols */; };
39ED274F29B98707001C368E /* SFSafeSymbols in Frameworks */ = {isa = PBXBuildFile; productRef = 39ED274E29B98707001C368E /* SFSafeSymbols */; };
39ED275129B9871C001C368E /* SFSafeSymbols in Frameworks */ = {isa = PBXBuildFile; productRef = 39ED275029B9871C001C368E /* SFSafeSymbols */; };
39F8474F29B3990B000B817E /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 39F8474E29B3990B000B817E /* FirebaseAnalytics */; };
39F8475129B3990B000B817E /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 39F8475029B3990B000B817E /* FirebaseAuth */; };
39F8475329B3990B000B817E /* FirebaseFirestore in Frameworks */ = {isa = PBXBuildFile; productRef = 39F8475229B3990B000B817E /* FirebaseFirestore */; };
Expand Down Expand Up @@ -470,7 +467,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
39ED274F29B98707001C368E /* SFSafeSymbols in Frameworks */,
3A3C119428EDB4B800C9CCED /* Intents.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -480,7 +476,6 @@
buildActionMask = 2147483647;
files = (
394D69F62A3432AD00EC0A02 /* Lottie in Frameworks */,
39ED274D29B98431001C368E /* SFSafeSymbols in Frameworks */,
39F8474F29B3990B000B817E /* FirebaseAnalytics in Frameworks */,
39F8475529B3990B000B817E /* FirebaseFirestoreSwift in Frameworks */,
39F8475329B3990B000B817E /* FirebaseFirestore in Frameworks */,
Expand All @@ -496,7 +491,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
39ED275129B9871C001C368E /* SFSafeSymbols in Frameworks */,
3AF9F00628ED570D00F685E6 /* SwiftUI.framework in Frameworks */,
3AF9F00528ED570D00F685E6 /* WidgetKit.framework in Frameworks */,
);
Expand Down Expand Up @@ -1149,7 +1143,6 @@
);
name = LockScreenIntentsExtension;
packageProductDependencies = (
39ED274E29B98707001C368E /* SFSafeSymbols */,
);
productName = LockScreenIntentsExtension;
productReference = 3A3C119328EDB4B800C9CCED /* LockScreenIntentsExtension.appex */;
Expand Down Expand Up @@ -1178,7 +1171,6 @@
39F8475429B3990B000B817E /* FirebaseFirestoreSwift */,
39F8475629B3990B000B817E /* FirebaseStorage */,
39504A9229B3A059008A7BA4 /* SwiftEntryKit */,
39ED274C29B98431001C368E /* SFSafeSymbols */,
39EBEB4929BDF7A000B1FD54 /* Kingfisher */,
394D69F52A3432AD00EC0A02 /* Lottie */,
392DA3C92A51677B00175203 /* SVGKit */,
Expand All @@ -1201,7 +1193,6 @@
);
name = LockScreenWidgetExtension;
packageProductDependencies = (
39ED275029B9871C001C368E /* SFSafeSymbols */,
);
productName = LockScreenWidgetExtension;
productReference = 3AF9F00428ED570D00F685E6 /* LockScreenWidgetExtension.appex */;
Expand Down Expand Up @@ -1244,7 +1235,6 @@
packageReferences = (
39F8474D29B3990B000B817E /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
39504A9129B3A059008A7BA4 /* XCRemoteSwiftPackageReference "SwiftEntryKit" */,
39ED274B29B98431001C368E /* XCRemoteSwiftPackageReference "SFSafeSymbols" */,
39EBEB4829BDF7A000B1FD54 /* XCRemoteSwiftPackageReference "Kingfisher" */,
394D69F42A3432AC00EC0A02 /* XCRemoteSwiftPackageReference "lottie-ios" */,
392DA3C82A51677B00175203 /* XCRemoteSwiftPackageReference "SVGKit" */,
Expand Down Expand Up @@ -1805,7 +1795,7 @@
CODE_SIGN_ENTITLEMENTS = koget/koget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1211.0;
CURRENT_PROJECT_VERSION = 1211.1;
DEVELOPMENT_TEAM = ZH5GA3W8UP;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = koget/Info.plist;
Expand Down Expand Up @@ -1846,7 +1836,7 @@
CODE_SIGN_ENTITLEMENTS = koget/koget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1211.0;
CURRENT_PROJECT_VERSION = 1211.1;
DEVELOPMENT_TEAM = ZH5GA3W8UP;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = koget/Info.plist;
Expand Down Expand Up @@ -2022,14 +2012,6 @@
minimumVersion = 7.6.2;
};
};
39ED274B29B98431001C368E /* XCRemoteSwiftPackageReference "SFSafeSymbols" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SFSafeSymbols/SFSafeSymbols.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 4.1.1;
};
};
39F8474D29B3990B000B817E /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
Expand Down Expand Up @@ -2071,21 +2053,6 @@
package = 39EBEB4829BDF7A000B1FD54 /* XCRemoteSwiftPackageReference "Kingfisher" */;
productName = Kingfisher;
};
39ED274C29B98431001C368E /* SFSafeSymbols */ = {
isa = XCSwiftPackageProductDependency;
package = 39ED274B29B98431001C368E /* XCRemoteSwiftPackageReference "SFSafeSymbols" */;
productName = SFSafeSymbols;
};
39ED274E29B98707001C368E /* SFSafeSymbols */ = {
isa = XCSwiftPackageProductDependency;
package = 39ED274B29B98431001C368E /* XCRemoteSwiftPackageReference "SFSafeSymbols" */;
productName = SFSafeSymbols;
};
39ED275029B9871C001C368E /* SFSafeSymbols */ = {
isa = XCSwiftPackageProductDependency;
package = 39ED274B29B98431001C368E /* XCRemoteSwiftPackageReference "SFSafeSymbols" */;
productName = SFSafeSymbols;
};
39F8474E29B3990B000B817E /* FirebaseAnalytics */ = {
isa = XCSwiftPackageProductDependency;
package = 39F8474D29B3990B000B817E /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,6 @@
"version" : "2.2.0"
}
},
{
"identity" : "sfsafesymbols",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SFSafeSymbols/SFSafeSymbols.git",
"state" : {
"revision" : "7cca2d60925876b5953a2cf7341cd80fbeac983c",
"version" : "4.1.1"
}
},
{
"identity" : "svgkit",
"kind" : "remoteSourceControl",
Expand Down
11 changes: 6 additions & 5 deletions koget/Constant/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@
//

import SwiftUI
import SFSafeSymbols

// App

enum Constants {

static let kogetGradient = LinearGradient(colors: [.blue, .red],
startPoint: .topLeading,
endPoint: .bottomTrailing)
// 알수없는 데이터 Placeholder
static let unknownName = "알수없음"
static let unknownImage = Image(systemSymbol: .questionmarkCircle)
static let unknownUIImage = UIImage(systemSymbol: .questionmarkCircle)
static let deviceSize = UIScreen.main.bounds.size
static let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String
static let widgetCellWidthForGrid = deviceSize.width / 4.3
static let APP_GROUP_ID = "group.ZH5GA3W8UP.com.heon.koget"
static let COREDATA_CONTAINER_NAME = "WidgetModel"

}

enum AppConstant {
static let questionmarkCircle = Image(systemName: "questionmark.circle")
static let questionmark = Image(systemName: "questionmark")
static let uiQuestionmarkCircle = UIImage(systemName: "questionmark.circle") ?? UIImage()
}
2 changes: 1 addition & 1 deletion koget/Services/DeepLinkService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct DeepLinkService {
}

func getImage(imageName: String) -> UIImage {
return UIImage(named: imageName) ?? UIImage(named: "questionmark.circle")!
return UIImage(named: imageName) ?? AppConstant.uiQuestionmarkCircle
}

func getLocalName(appName: String, appNameEn: String) -> String {
Expand Down
4 changes: 2 additions & 2 deletions koget/UI/Create/CreateWidgetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ extension CreateWidgetView {
let setup = page.pageSetup().nameField
return Group {
if setup.isShow {
TextFieldView(systemName: .tag, placeholder: name, text: $viewModel.name, backgroundFill: setup.userInteraction)
TextFieldView(systemName: "tag", placeholder: name, text: $viewModel.name, backgroundFill: setup.userInteraction)
.disabled(!setup.userInteraction)
}
}
Expand All @@ -179,7 +179,7 @@ extension CreateWidgetView {
let setup = page.pageSetup().urlField
return Group {
if setup.isShow {
TextFieldView(systemName: .network, placeholder: url, text: $viewModel.url, backgroundFill: setup.userInteraction)
TextFieldView(systemName: "network", placeholder: url, text: $viewModel.url, backgroundFill: setup.userInteraction)
.disabled(!setup.userInteraction)
}
}
Expand Down
2 changes: 1 addition & 1 deletion koget/UI/Create/DeepLinkAssetProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension DeepLinkAssetProtocol {
func getWidgetData(selectedWidget: DeepLinkModel, webImage: UIImage?) {
self.name = selectedWidget.displayName
self.url = selectedWidget.url
self.widgetIcon = selectedWidget.image ?? webImage ?? UIImage(systemName: "questionmark.circle")
self.widgetIcon = selectedWidget.image ?? webImage ?? AppConstant.uiQuestionmarkCircle
Analytics.logEvent("create_app_name",
parameters: [
"event_name": "create_app_item",
Expand Down
1 change: 0 additions & 1 deletion koget/UI/CustomViews/Alert/AlertFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import SwiftUI
import SwiftEntryKit
import SFSafeSymbols

class AlertFactory {

Expand Down
1 change: 0 additions & 1 deletion koget/UI/CustomViews/PhotoEditMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import SFSafeSymbols

protocol VMPhotoEditProtocol: ObservableObject {
var widgetIcon: UIImage? { get set }
Expand Down
3 changes: 1 addition & 2 deletions koget/UI/CustomViews/Slider/OpacityPickerContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import SFSafeSymbols

struct OpacityPickerContainer<V: VMOpacityProtocol>: View {

Expand Down Expand Up @@ -57,7 +56,7 @@ struct OpacityPickerContainer<V: VMOpacityProtocol>: View {
Button {
isPresentQustionmark.toggle()
} label: {
Image(systemSymbol: .questionmarkCircle)
AppConstant.questionmarkCircle
.foregroundColor(AppColor.Label.third)
}
.overlay(
Expand Down
1 change: 0 additions & 1 deletion koget/UI/CustomViews/TextField/EditTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import SFSafeSymbols

protocol VMTextFieldProtocol: ObservableObject {
var nameStringLimit: Int { get set }
Expand Down
9 changes: 4 additions & 5 deletions koget/UI/CustomViews/TextField/TextFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import SFSafeSymbols

enum TextFieldType {
case title
Expand All @@ -15,15 +14,15 @@ enum TextFieldType {

struct TextFieldView: View {

var systemName: SFSymbol?
var systemName: String?
let placeholder: String
let padding: CGFloat = 32
var type: TextFieldType = .title

let backgroundFill: Bool
@Binding var text: String

init(systemName: SFSymbol? = nil, placeholder: String, type: TextFieldType = .title, text: Binding<String>, backgroundFill: Bool = true ) {
init(systemName: String? = nil, placeholder: String, type: TextFieldType = .title, text: Binding<String>, backgroundFill: Bool = true ) {
self.systemName = systemName
self.placeholder = placeholder
self.type = type
Expand All @@ -40,7 +39,7 @@ struct TextFieldView: View {
}
HStack(spacing: 16) {
if let systemName = systemName {
Image(systemSymbol: systemName)
Image(systemName: systemName)
.font(.system(size: 24))
.padding(.horizontal, 8)
.foregroundColor(.gray)
Expand Down Expand Up @@ -69,7 +68,7 @@ struct TextFieldView: View {
struct TextFieldView_Previews: PreviewProvider {
static var previews: some View {
VStack {
TextFieldView(systemName: .tag, placeholder: "자리표시자", text: .constant("text"))
TextFieldView(systemName: "tag", placeholder: "자리표시자", text: .constant("text"))
}
}
}
7 changes: 3 additions & 4 deletions koget/UI/CustomViews/Toggle/CheckmarkToggleStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
//

import SwiftUI
import SFSafeSymbols

struct CheckmarkToggleStyle: ToggleStyle {

let toggleSize = CGSize(width: 20, height: 20)

let onBGColor = AppColor.Background.first
let OffBGColor = AppColor.Background.first
let onImage: SFSymbol = .checkmarkCircleFill
let offImage: SFSymbol = .circleFill
let onImage = "checkmark.circle.fill"
let offImage = "circle.fill"

func makeBody(configuration: Configuration) -> some View {
HStack {
Expand All @@ -25,7 +24,7 @@ struct CheckmarkToggleStyle: ToggleStyle {
.frame(width: toggleSize.width, height: toggleSize.height, alignment: .center)
.overlay(
ZStack(content: {
Image(systemSymbol: configuration.isOn ? onImage : offImage)
Image(systemName: configuration.isOn ? onImage : offImage)
.font(.system(size: 20, weight: .heavy))
.foregroundColor(configuration.isOn ? AppColor.Accent.primary : .init(uiColor: .tertiaryLabel))
})
Expand Down
7 changes: 3 additions & 4 deletions koget/UI/CustomViews/Toggle/DarkModeToggleStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
//

import SwiftUI
import SFSafeSymbols

struct DarkModeToggleStyle: ToggleStyle {

let toggleSize = CGSize(width: 32, height: 32)
let onBGColor = AppColor.Fill.first
let OffBGColor = AppColor.Background.second
let onImage: SFSymbol = .moonFill
let offImage: SFSymbol = .sunMaxFill
let onImage = "moon.fill"
let offImage = "sun.max.fill"

func makeBody(configuration: Configuration) -> some View {
ZStack {
Expand All @@ -24,7 +23,7 @@ struct DarkModeToggleStyle: ToggleStyle {
.frame(width: toggleSize.width, height: toggleSize.height, alignment: .center)
.overlay(
ZStack(content: {
Image(systemSymbol: configuration.isOn ? onImage : offImage)
Image(systemName: configuration.isOn ? onImage : offImage)
.font(.system(size: 14, weight: .heavy))
.foregroundColor(.yellow)
.shadow(color: .black.opacity(configuration.isOn ? 0 : 0.35), radius: 0.3, x: 0.2, y: 0.3)
Expand Down
2 changes: 1 addition & 1 deletion koget/UI/DeepLinkAssets/DeepLinkAssetListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension DeepLinkAssetListView {

private func topView() -> some View {
VStack(alignment: .leading) {
TextFieldView(systemName: .magnifyingglass,
TextFieldView(systemName: "magnifyingglass",
placeholder: "앱 검색",
text: $searchText)
.padding(.horizontal)
Expand Down
1 change: 0 additions & 1 deletion koget/UI/Detail/DetailWidgetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import SFSafeSymbols

struct DetailWidgetView: View {

Expand Down
2 changes: 1 addition & 1 deletion koget/UI/Home/HomeWidgetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ extension HomeWidgetView {
.shadow(color: .black.opacity(0.18), radius: 1, x: 0, y: 0)
.shadow(color: .black.opacity(0.20), radius: 1, x: 0, y: 0)

Image(systemName: "questionmark")
AppConstant.questionmark
.fontWeight(.bold)
.foregroundColor(.init(uiColor: .secondaryLabel))
.aspectRatio(contentMode: .fit)
Expand Down
1 change: 0 additions & 1 deletion koget/UI/HomeHeader/HomeHeaderPageContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import SFSafeSymbols

// 메인화면 공지 Cell
struct HomeHeaderPageContainer: View {
Expand Down
3 changes: 1 addition & 2 deletions koget/UI/IconGrids/IconGridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import SFSafeSymbols
import SVGKit

struct IconGridView<V: VMPhotoEditProtocol>: View {
Expand Down Expand Up @@ -149,7 +148,7 @@ extension IconGridView {
.frame(height: 36)
.overlay {
HStack(spacing: 6) {
Image(systemSymbol: .magnifyingglass)
Image(systemName: "magnifyingglass")
.font(.custom(.robotoRegular, size: 11))
.foregroundColor(AppColor.Label.second)
.padding(.leading, 8)
Expand Down
Loading

0 comments on commit c5138a4

Please sign in to comment.