-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,533 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh | ||
# written by Noah | ||
LINT=$(which swiftlint) | ||
|
||
if [[ -e "${LINT}" ]]; then | ||
echo "🚀 SwiftLint 시작..." | ||
echo "🔍 lint 적용 경로: $(pwd)" | ||
else | ||
echo "SwiftLint가 존재하지 않습니다, 공식문서를 확인해주세요. 🌐 https://github.com/realm/SwiftLint" | ||
exit 1 | ||
fi | ||
|
||
normalfiles=$(git diff --stat --cached) | ||
targets=$(git diff --stat --cached --diff-filter=d --name-only $(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)) | grep -F ".swift") | ||
|
||
if [ -n "$normalfiles" -a -z "$targets" ]; then | ||
printf "✨ 고생하셨습니다👏 👏 👏\n" | ||
exit 0 | ||
|
||
elif [ -z "${normalfiles}" ]; then | ||
printf "🏷️ Staging Area 파일이 없습니다" | ||
printf "\n ✔ git add를 먼저 진행해주세요:)" | ||
exit 1 | ||
|
||
elif [ -z "$targets" ]; then | ||
printf "🏷️ Staging Area swift 파일이 없습니다" | ||
printf "\n ✔ git add를 먼저 진행해주세요:)" | ||
exit 1 | ||
fi | ||
|
||
# lint rule 정의 파일 | ||
#RESULT=$($LINT lint --quiet --config .precommit.yml) | ||
RESULT=$($LINT lint --quiet) | ||
|
||
if [ "$RESULT" == '' ]; then | ||
printf "✨ SwiftLint 적용을 완료했습니다!! 고생하셨습니다:)\n" | ||
else | ||
echo "" | ||
printf "✔ SwiftLint Failed 아래 내용을 확인해주세요:\n" | ||
while read -r line; do | ||
FILEPATH=$(echo $line | cut -d : -f 1) | ||
L=$(echo $line | cut -d : -f 2) | ||
C=$(echo $line | cut -d : -f 3) | ||
TYPE=$(echo $line | cut -d : -f 4 | cut -c 2-) | ||
MESSAGE=$(echo $line | cut -d : -f 5 | cut -c 2-) | ||
DESCRIPTION=$(echo $line | cut -d : -f 6 | cut -c 2-) | ||
if [ $TYPE == 'warning' ]; then | ||
printf "\n 🚧 $TYPE\n" | ||
# warning 타입은 오류메시지만 표시하고 커밋을 허용하고 싶다면 line 40~42 주석 해제. | ||
# printf " $FILEPATH:$L:$C\n" | ||
# printf " 📌 $MESSAGE: - $DESCRIPTION\n" | ||
# exit 0 | ||
elif [ $TYPE == 'error' ]; then | ||
printf "\n 🚨 $TYPE\n" | ||
fi | ||
printf " ✔ $FILEPATH:$L:$C\n" | ||
printf " 📌 $MESSAGE: - $DESCRIPTION\n" | ||
done <<< "$RESULT" | ||
|
||
printf "\n 🚑 커밋실패!! Swiftlint rule에 맞게 코드를 변경해주세요:)\n" | ||
exit 1 | ||
fi |
Large diffs are not rendered by default.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
FlipClock.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "rxswift", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/ReactiveX/RxSwift", | ||
"state" : { | ||
"branch" : "main", | ||
"revision" : "e0ab8c4e18baf6679a65b325155923276b832687" | ||
} | ||
}, | ||
{ | ||
"identity" : "snapkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/SnapKit/SnapKit.git", | ||
"state" : { | ||
"branch" : "develop", | ||
"revision" : "07c5d1f6044701d97e94dc11157259e8811977be" | ||
} | ||
}, | ||
{ | ||
"identity" : "then", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/devxoul/Then.git", | ||
"state" : { | ||
"branch" : "master", | ||
"revision" : "d41ef523faef0f911369f79c0b96815d9dbb6d7a" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "theme2-modified.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "theme1-modified.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// ThemeCoordinator.swift | ||
// FlipClock | ||
// | ||
// Created by 홍승현 on 2022/08/03. | ||
// | ||
|
||
import UIKit | ||
|
||
final class ThemeCoordinator: Coordinator { | ||
|
||
var childCoordinators: [Coordinator] = [] | ||
var navigationController: UINavigationController | ||
|
||
init(navigationController: UINavigationController) { | ||
self.navigationController = navigationController | ||
} | ||
|
||
func start() { | ||
let themeVC = ThemeViewController() | ||
themeVC.coordinator = self | ||
navigationController.pushViewController(themeVC, animated: true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Theme.swift | ||
// FlipClock | ||
// | ||
// Created by 홍승현 on 2022/09/23. | ||
// | ||
|
||
import Foundation | ||
|
||
import RxCocoa | ||
|
||
enum Theme: Int { | ||
case dark | ||
case light | ||
|
||
static let currentTheme = BehaviorRelay<Theme>(value: Theme(rawValue: UserDefaults.standard.theme) ?? .dark) | ||
|
||
var colors: HexColor { | ||
switch self { | ||
case .dark: | ||
return HexColor(background: 0xAAAAAA, text: 0xFFFFFF, clockBackground: 0x000000) | ||
case .light: | ||
return HexColor(background: 0xF0F2F7, text: 0x000000, clockBackground: 0xFFFFFF) | ||
} | ||
} | ||
} | ||
|
||
// MARK: - Color(Hex Value) | ||
|
||
extension Theme { | ||
struct HexColor { | ||
let background: Int | ||
let text: Int | ||
let clockBackground: Int | ||
} | ||
} |
Oops, something went wrong.