Skip to content

Commit

Permalink
Merge branch 'feature/resources-fixed'
Browse files Browse the repository at this point in the history
  • Loading branch information
MojitoBar committed Dec 22, 2023
2 parents 48615e0 + e4c6d1e commit f92d86d
Show file tree
Hide file tree
Showing 27 changed files with 130 additions and 63 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ jobs:
echo "GCM_SENDER_ID=${{ secrets.GCM_SENDER_ID }}" >> Secrets.xcconfig
echo "GOOGLE_APP_ID=${{ secrets.GOOGLE_APP_ID }}" >> Secrets.xcconfig
echo "REVERSED_CLIENT_ID=${{ secrets.REVERSED_CLIENT_ID }}" >> Secrets.xcconfig
- name: Print Current Working Directory
run: pwd
- name: Move Secrets File to Resources
run: |
mv Secrets.xcconfig pins/Resources/
- name: Print GoogleService-Info.plist
run: cat pins/Resources/GoogleService-Info.plist
- name: Print xcconfig
run: cat pins/Resources/Secrets.xcconfig
- name: Build Xcode
run: |
xcodebuild clean test -project pins.xcodeproj \
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ iOSInjectionProject/

# End of https://www.toptal.com/developers/gitignore/api/macos,swift,git
Secrets.xcconfig
GoogleService-Info.plist

pinsTests/ReferenceImages_64/pinsTests.SnapshotTestTests/

Expand Down
25 changes: 19 additions & 6 deletions pins.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
B7DC98EF2B2619F3006DD8F7 /* CommentRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7DC98EE2B2619F3006DD8F7 /* CommentRepository.swift */; };
B7E050F12AE4FB3A007903C3 /* MainMapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E050F02AE4FB3A007903C3 /* MainMapView.swift */; };
B7E0D5912B0CB59D0090A465 /* AnimationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E0D5902B0CB59D0090A465 /* AnimationManager.swift */; };
B7E1AF432B346328008A638D /* ColorAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E1AF422B346328008A638D /* ColorAssets.swift */; };
B7E1AF452B346380008A638D /* ImageAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E1AF442B346380008A638D /* ImageAssets.swift */; };
B7E1AF472B3466FE008A638D /* UIColor+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E1AF462B3466FE008A638D /* UIColor+Extensions.swift */; };
B7E8A4702AEB84420026931D /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = B7E8A46F2AEB84420026931D /* FirebaseAnalytics */; };
B7E8A4722AEB84420026931D /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = B7E8A4712AEB84420026931D /* FirebaseCrashlytics */; };
B7ECD4502B3059E60085C809 /* PinClusterAnnotationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7ECD44F2B3059E60085C809 /* PinClusterAnnotationView.swift */; };
Expand Down Expand Up @@ -187,6 +190,9 @@
B7DC98EE2B2619F3006DD8F7 /* CommentRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentRepository.swift; sourceTree = "<group>"; };
B7E050F02AE4FB3A007903C3 /* MainMapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMapView.swift; sourceTree = "<group>"; };
B7E0D5902B0CB59D0090A465 /* AnimationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimationManager.swift; sourceTree = "<group>"; };
B7E1AF422B346328008A638D /* ColorAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorAssets.swift; sourceTree = "<group>"; };
B7E1AF442B346380008A638D /* ImageAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageAssets.swift; sourceTree = "<group>"; };
B7E1AF462B3466FE008A638D /* UIColor+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extensions.swift"; sourceTree = "<group>"; };
B7ECD44F2B3059E60085C809 /* PinClusterAnnotationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinClusterAnnotationView.swift; sourceTree = "<group>"; };
B7F071B62B14855000BB5AB9 /* DetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewModel.swift; sourceTree = "<group>"; };
B7F071B82B14876C00BB5AB9 /* PinResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinResponse.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -230,6 +236,7 @@
B70EE5BC2B15D7DD00BCCACF /* String+Extensions.swift */,
B70BBA522B1703C700F0F9A6 /* UIImage+Extensions.swift */,
B7194A452B1B573800642FDA /* CALayer+Extensions.swift */,
B7E1AF462B3466FE008A638D /* UIColor+Extensions.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand Down Expand Up @@ -345,6 +352,8 @@
B7157E6B2AF392E4007CEF95 /* pins.entitlements */,
B79A28F02AF37DEB008FD3CE /* Secrets.xcconfig */,
B7F6A8D82AE2B61500892215 /* LaunchScreen.storyboard */,
B7E1AF422B346328008A638D /* ColorAssets.swift */,
B7E1AF442B346380008A638D /* ImageAssets.swift */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -509,11 +518,11 @@
isa = PBXNativeTarget;
buildConfigurationList = B7AF69572AE0FEE000385632 /* Build configuration list for PBXNativeTarget "pins" */;
buildPhases = (
B745F0D72AF28A6600224EC9 /* Google Service Setting */,
B7AF69292AE0FEDF00385632 /* Sources */,
B703C0E22B29F28E008E9181 /* SwiftLint Script */,
B7AF692A2AE0FEDF00385632 /* Frameworks */,
B7AF692B2AE0FEDF00385632 /* Resources */,
B745F0D72AF28A6600224EC9 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -623,7 +632,7 @@
B703C0E22B29F28E008E9181 /* SwiftLint Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 8;
buildActionMask = 12;
files = (
);
inputFileListPaths = (
Expand All @@ -635,25 +644,26 @@
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nif test -d \"/opt/homebrew/bin/\"; then\n PATH=\"/opt/homebrew/bin/:${PATH}\"\nfi\n\nexport PATH\n\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
B745F0D72AF28A6600224EC9 /* ShellScript */ = {
B745F0D72AF28A6600224EC9 /* Google Service Setting */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 8;
buildActionMask = 12;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Google Service Setting";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# xcconfig에서 API_KEY 값을 읽기\nAPI_KEY=${GOOGLE_API_KEY}\nGCM_SENDER_ID=${GCM_SENDER_ID}\nGOOGLE_APP_ID=${GOOGLE_APP_ID}\nREVERSED_CLIENT_ID=${REVERSED_CLIENT_ID}\n# 커스텀 plist 파일 경로\nPLIST=${SRCROOT}/pins/Resources/GoogleService-Info.plist\n\n# plist 파일에 API_KEY 값 설정\n/usr/libexec/PlistBuddy -c \"Set :API_KEY $API_KEY\" \"$PLIST\"\n/usr/libexec/PlistBuddy -c \"Set :GCM_SENDER_ID $GCM_SENDER_ID\" \"$PLIST\"\n/usr/libexec/PlistBuddy -c \"Set :GOOGLE_APP_ID $GOOGLE_APP_ID\" \"$PLIST\"\n/usr/libexec/PlistBuddy -c \"Set :REVERSED_CLIENT_ID $REVERSED_CLIENT_ID\" \"$PLIST\"\n";
};
Expand Down Expand Up @@ -684,11 +694,13 @@
B7194A422B1B4F3300642FDA /* SigninViewController.swift in Sources */,
B7DC98EB2B26179A006DD8F7 /* DetailUseCase.swift in Sources */,
B7ECD4502B3059E60085C809 /* PinClusterAnnotationView.swift in Sources */,
B7E1AF452B346380008A638D /* ImageAssets.swift in Sources */,
B742C5782AEA5EE900E95E96 /* CreateViewModel.swift in Sources */,
B7DC98E72B260C17006DD8F7 /* CommentResponse.swift in Sources */,
B7D051502B10AD1A00D86183 /* DetailNavigationView.swift in Sources */,
B71C387E2B0754F90065A783 /* UserRequest.swift in Sources */,
B7AE77DE2B3199FB0056D451 /* ImageCacheManager.swift in Sources */,
B7E1AF432B346328008A638D /* ColorAssets.swift in Sources */,
B7B20E242B1CCDB800C8304B /* KeychainManager.swift in Sources */,
B7F071B72B14855000BB5AB9 /* DetailViewModel.swift in Sources */,
B7614C0F2AEE085B00CAB8F0 /* ImageCollectionViewCell.swift in Sources */,
Expand Down Expand Up @@ -721,6 +733,7 @@
B7B20E1B2B1CB92100C8304B /* SigninUseCase.swift in Sources */,
B785A7822B108A0A00DC2E88 /* PaddingLabel.swift in Sources */,
B7B977642AFA0D270023718B /* PinRequest.swift in Sources */,
B7E1AF472B3466FE008A638D /* UIColor+Extensions.swift in Sources */,
B7AF69332AE0FEDF00385632 /* SceneDelegate.swift in Sources */,
B71C38832B075CC70065A783 /* CryptoUtils.swift in Sources */,
B7B20E1D2B1CBAC700C8304B /* UserRepository.swift in Sources */,
Expand Down
16 changes: 8 additions & 8 deletions pins/Domain/Entity/Category.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ enum Category: String, CaseIterable {
var imageName: String {
switch self {
case .culture:
return "CulturePin"
return "culturePin"
case .exercise:
return "ExercisePin"
return "exercisePin"
case .food:
return "FoodPin"
return "foodPin"
case .friendship:
return "FriendshipPin"
return "friendshipPin"
case .game:
return "GamePin"
return "gamePin"
case .walk:
return "WalkPin"
return "walkPin"
case .study:
return "StudyPin"
return "studyPin"
case .pet:
return "PetPin"
return "petPin"
case .etc:
return "etc"
}
Expand Down
14 changes: 14 additions & 0 deletions pins/Extension/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// UIColor+Extensions.swift
// pins
//
// Created by 주동석 on 12/21/23.
//

import UIKit

extension UIColor {
convenience init(asset: ColorAssets) {
self.init(named: asset.rawValue)!
}
}
6 changes: 6 additions & 0 deletions pins/Extension/UIImage+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ extension UIImage {
return resizedImage!
}
}

extension UIImage {
convenience init(asset: ImageAssets) {
self.init(named: asset.rawValue)!
}
}
4 changes: 2 additions & 2 deletions pins/Presentation/View/Common/CustomTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protocol TextPublisher {
}

final class CustomTextView: UITextView {
private let placeholderColor = UIColor(resource: .placeholderGray)
private let placeholderColor = UIColor(asset: .placeholderGray)
private var placeholderLabel: UILabel?

init(placeholder: String, tag: Int) {
Expand All @@ -23,7 +23,7 @@ final class CustomTextView: UITextView {
textColor = placeholderColor
font = .preferredFont(forTextStyle: .callout)
adjustsFontForContentSizeCategory = true
backgroundColor = UIColor(resource: .background)
backgroundColor = UIColor(asset: .defaultBackground)
}

required init?(coder: NSCoder) {
Expand Down
2 changes: 1 addition & 1 deletion pins/Presentation/View/Common/Divider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import UIKit

final class Divider: UIView {
init(backgroundColor: UIColor = .extraLightGray, thickness: CGFloat = 1) {
init(backgroundColor: UIColor = UIColor(asset: .extraLightGray), thickness: CGFloat = 1) {
super.init(frame: .zero)
self.backgroundColor = backgroundColor
self.translatesAutoresizingMaskIntoConstraints = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class CategoryCollectionViewCell: UICollectionViewCell {

override init(frame: CGRect) {
super.init(frame: .zero)
contentView.backgroundColor = UIColor(resource: .categoryGray)
contentView.backgroundColor = UIColor(asset: .categoryGray)
contentView.layer.cornerRadius = 17.5
setLayout()
}
Expand All @@ -47,7 +47,7 @@ final class CategoryCollectionViewCell: UICollectionViewCell {
}

func isUnSelect() {
contentView.backgroundColor = UIColor(resource: .categoryGray)
contentView.backgroundColor = UIColor(asset: .categoryGray)
categoryLabel.textColor = .gray
}

Expand Down
18 changes: 9 additions & 9 deletions pins/Presentation/View/CreateView/CreateView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class CreateView: UIView {
}

private let imageButton: CustomButton = {
let button = CustomButton(backgroundColor: UIColor(resource: .background), cornerRadius: 10)
let button = CustomButton(backgroundColor: UIColor(asset: .defaultBackground), cornerRadius: 10)
button.setImageTitle(title: "0/\(Constants.selectionLimitCount)", systemName: "photo.badge.plus", titleColor: .gray, imageColor: .gray)
button.setBorder(width: 1, color: UIColor.lightGray.withAlphaComponent(0.5).cgColor)
return button
Expand All @@ -36,7 +36,7 @@ final class CreateView: UIView {
}()

private let backButton: CustomButton = {
let button = CustomButton(backgroundColor: UIColor(resource: .background))
let button = CustomButton(backgroundColor: UIColor(asset: .defaultBackground))
button.setImage(systemName: "chevron.backward")
return button
}()
Expand All @@ -46,7 +46,7 @@ final class CreateView: UIView {
label.text = NSLocalizedString("create.category.title", comment: "")
label.font = .preferredFont(forTextStyle: .headline)
label.adjustsFontForContentSizeCategory = true
label.textColor = UIColor(resource: .text)
label.textColor = UIColor(asset: .defaultText)
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
Expand All @@ -67,7 +67,7 @@ final class CreateView: UIView {
collectionView.register(CategoryCollectionViewCell.self, forCellWithReuseIdentifier: "categoryCell")
collectionView.translatesAutoresizingMaskIntoConstraints = false
collectionView.tag = 0
collectionView.backgroundColor = UIColor(resource: .background)
collectionView.backgroundColor = UIColor(asset: .defaultBackground)
return collectionView
}()

Expand All @@ -81,7 +81,7 @@ final class CreateView: UIView {
collectionView.register(ImageCollectionViewCell.self, forCellWithReuseIdentifier: "imageCell")
collectionView.translatesAutoresizingMaskIntoConstraints = false
collectionView.tag = 1
collectionView.backgroundColor = UIColor(resource: .background)
collectionView.backgroundColor = UIColor(asset: .defaultBackground)
return collectionView
}()

Expand All @@ -96,7 +96,7 @@ final class CreateView: UIView {
init(categoryCount: Int) {
itemCount = categoryCount
super.init(frame: .zero)
backgroundColor = UIColor(resource: .background)
backgroundColor = UIColor(asset: .defaultBackground)
titleTextView.delegate = self
contentTextView.delegate = self
setLayout()
Expand Down Expand Up @@ -212,9 +212,9 @@ final class CreateView: UIView {
// MARK: - Extensions
extension CreateView: UITextViewDelegate {
func textViewDidBeginEditing(_ textView: UITextView) {
if textView.textColor == UIColor(resource: .placeholderGray) {
if textView.textColor == UIColor(asset: .placeholderGray) {
textView.text = nil
textView.textColor = UIColor.init(resource: .text)
textView.textColor = UIColor(asset: .defaultText)
}
}

Expand All @@ -228,7 +228,7 @@ extension CreateView: UITextViewDelegate {
default:
return
}
textView.textColor = UIColor(resource: .placeholderGray)
textView.textColor = UIColor(asset: .placeholderGray)
}
}
}
2 changes: 1 addition & 1 deletion pins/Presentation/View/DetailView/CommentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class CommentView: UIView {
// MARK: - Properties
private let profileImageView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(resource: .test)
imageView.image = UIImage(asset: .testImage)
imageView.contentMode = .scaleAspectFill
imageView.layer.cornerRadius = 20
imageView.clipsToBounds = true
Expand Down
4 changes: 2 additions & 2 deletions pins/Presentation/View/DetailView/DetailCommentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class DetailCommentView: UIView {
// MARK: - Properties
private let myProfileImageView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(resource: .test)
imageView.image = UIImage(asset: .testImage)
imageView.contentMode = .scaleAspectFill
imageView.layer.cornerRadius = 20
imageView.clipsToBounds = true
Expand Down Expand Up @@ -43,7 +43,7 @@ final class DetailCommentView: UIView {

override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .background
backgroundColor = UIColor(asset: .defaultBackground)
setLayout()
setProfileImage()
}
Expand Down
2 changes: 1 addition & 1 deletion pins/Presentation/View/DetailView/DetailContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class DetailContentView: UIView {
// MARK: - Properties
private let profileImageView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(resource: .test)
imageView.image = UIImage(asset: .testImage)
imageView.contentMode = .scaleAspectFill
imageView.layer.cornerRadius = 20
imageView.clipsToBounds = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class DetailNavigationView: UIView {
// MARK: - Method
func changeBackgroundColor(as offset: CGFloat) {
if offset > 10 {
backgroundColor = .background
backgroundColor = UIColor(asset: .defaultBackground)
} else {
backgroundColor = .clear
}
Expand Down
2 changes: 1 addition & 1 deletion pins/Presentation/View/DetailView/DetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class DetailView: UIView {
}
let scrollView: DetailScrollView = {
let scrollView = DetailScrollView()
scrollView.backgroundColor = .background
scrollView.backgroundColor = UIColor(asset: .defaultBackground)
scrollView.contentSize = CGSize(width: UIScreenUtils.getScreenWidth(), height: UIConstants.extendedScreenHeight)
scrollView.contentInsetAdjustmentBehavior = .never
scrollView.tag = 0
Expand Down
8 changes: 4 additions & 4 deletions pins/Presentation/View/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ struct LoginView: View {
var body: some View {
VStack {
Spacer()
Image(.pinsIcon) // 로고 이미지
Image("pinsIcon") // 로고 이미지
.resizable()
.scaledToFit()
.frame(width: 100, height: 100)

Image(.pinsTitle) // 타이틀 이미지
Image("pinsTitle") // 타이틀 이미지
.resizable()
.scaledToFit()
.frame(width: 100, height: 50)
Expand All @@ -30,7 +30,7 @@ struct LoginView: View {
Button(action: {
googleLoginAction()
}, label: {
Image(.googleLogin) // 구글 로그인 버튼 이미지
Image("googleLogin") // 구글 로그인 버튼 이미지
.resizable()
.scaledToFit()
.frame(height: 50)
Expand All @@ -40,7 +40,7 @@ struct LoginView: View {
Button(action: {
appleLoginAction()
}, label: {
Image(.appleLogin) // 구글 로그인 버튼 이미지
Image("appleLogin") // 구글 로그인 버튼 이미지
.resizable()
.scaledToFit()
.frame(height: 50)
Expand Down
Loading

0 comments on commit f92d86d

Please sign in to comment.