Skip to content

Commit 62e875d

Browse files
authored
Merge pull request #314 from DeveloperAcademy-POSTECH/release/v1.1.0
메인 브랜치를 릴리즈 v1.1.0으로 업데이트합니다
2 parents 7ae389e + 4d4072f commit 62e875d

File tree

324 files changed

+13526
-328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+13526
-328
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Manito Bug report
3+
about: MANITO 개발 중 생긴 버그를 작성합니다.
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
# 🐞 버그 설명
11+
| 문제 발생 일시 | 발생 위치 | 발생 조건 |
12+
| --- | --- | --- |
13+
| | | |
14+
15+
## 증상
16+
<!-- 문제 증상에 대해서 설명해주세요. -->
17+
18+
## 스크린샷
19+
<!-- 스크린샷을 첨부해주세요. -->
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Manito Issus Template
3+
about: Manito 기본 이슈 템플릿
4+
title: "[FEAT]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## 💡 Issue
11+
<!-- 이슈에 대한 내용을 설명해주세요. -->
12+
13+
## 📝 todo
14+
- [ ] todo !
15+
<!-- 해야 할 일들을 적어주세요. -->

.github/auto_assign.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Set to true to add reviewers to pull requests
2+
addReviewers: true
3+
4+
# Set to true to add assignees to pull requests
5+
addAssignees: false
6+
7+
# A list of reviewers to be added to pull requests (GitHub user name)
8+
reviewers:
9+
- YoonAh-dev
10+
- MMMIIIN
11+
- coby5502
12+
- CreoHwan
13+
- sunchoi22
14+
- dangsal
15+
# A list of keywords to be skipped the process that add reviewers if pull requests include it
16+
skipKeywords:
17+
- wip
18+
19+
# A number of reviewers added to the pull request
20+
# Set 0 to add all the reviewers (default: 0)
21+
numberOfReviewers: 0

Manito/Manito.xcodeproj/project.pbxproj

Lines changed: 844 additions & 25 deletions
Large diffs are not rendered by default.

Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1330"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "B5F524CA28519AA000614FF7"
18+
BuildableName = "Manito.app"
19+
BlueprintName = "Manito"
20+
ReferencedContainer = "container:Manito.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "B5F524CA28519AA000614FF7"
48+
BuildableName = "Manito.app"
49+
BlueprintName = "Manito"
50+
ReferencedContainer = "container:Manito.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "B5F524CA28519AA000614FF7"
65+
BuildableName = "Manito.app"
66+
BlueprintName = "Manito"
67+
ReferencedContainer = "container:Manito.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

Manito/Manito/Global/Base/BaseViewController.swift

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,148 @@ import UIKit
99

1010
class BaseViewController: UIViewController {
1111

12+
// MARK: - property
13+
14+
private lazy var backButton: UIButton = {
15+
let button = BackButton()
16+
let buttonAction = UIAction { [weak self] _ in
17+
self?.navigationController?.popViewController(animated: true)
18+
}
19+
button.addAction(buttonAction, for: .touchUpInside)
20+
return button
21+
}()
22+
lazy var guideButton = UIButton()
23+
lazy var guideBoxImageView = UIImageView(image: ImageLiterals.imgGuideBox)
24+
lazy var guideLabel: UILabel = {
25+
let label = UILabel()
26+
label.numberOfLines = 0
27+
label.font = .font(.regular, ofSize: 14)
28+
label.contentMode = .center
29+
return label
30+
}()
31+
32+
private let tokenService: TokenAPI = TokenAPI(apiService: APIService())
33+
34+
// MARK: - init
35+
36+
init() {
37+
super.init(nibName: nil, bundle: nil)
38+
}
39+
1240
deinit {
13-
NotificationCenter.default.removeObserver(self)
41+
print("success deallocation")
42+
}
43+
44+
required init?(coder: NSCoder) {
45+
super.init(coder: coder)
1446
}
1547

48+
// MARK: - life cycle
49+
1650
override func viewDidLoad() {
1751
super.viewDidLoad()
1852
render()
1953
configUI()
54+
setupBackButton()
55+
hidekeyboardWhenTappedAround()
56+
setupNavigationBar()
57+
}
58+
59+
override func viewDidDisappear(_ animated: Bool) {
60+
super.viewDidDisappear(animated)
61+
NotificationCenter.default.removeObserver(self)
2062
}
2163

2264
override func viewWillAppear(_ animated: Bool) {
2365
super.viewWillAppear(animated)
66+
setupInteractivePopGestureRecognizer()
2467
}
2568

2669
func render() {
2770
// Override Layout
2871
}
2972

3073
func configUI() {
31-
// View Configuration
74+
view.backgroundColor = .backgroundGrey
75+
}
76+
77+
func setupNavigationBar() {
78+
guard let navigationBar = navigationController?.navigationBar else { return }
79+
let appearance = UINavigationBarAppearance()
80+
let font = UIFont.font(.regular, ofSize: 14)
81+
let largeFont = UIFont.font(.regular, ofSize: 34)
82+
83+
appearance.titleTextAttributes = [.font: font]
84+
appearance.largeTitleTextAttributes = [.font: largeFont]
85+
appearance.shadowColor = .clear
86+
appearance.backgroundColor = .backgroundGrey
87+
88+
navigationBar.standardAppearance = appearance
89+
navigationBar.compactAppearance = appearance
90+
navigationBar.scrollEdgeAppearance = appearance
91+
}
92+
93+
// MARK: - helper func
94+
95+
func makeBarButtonItem<T: UIView>(with view: T) -> UIBarButtonItem {
96+
return UIBarButtonItem(customView: view)
97+
}
98+
99+
func removeBarButtonItemOffset(with button: UIButton, offsetX: CGFloat = 0, offsetY: CGFloat = 0) -> UIView {
100+
let offsetView = UIView(frame: CGRect(x: 0, y: 0, width: 45, height: 45))
101+
offsetView.bounds = offsetView.bounds.offsetBy(dx: offsetX, dy: offsetY)
102+
offsetView.addSubview(button)
103+
return offsetView
104+
}
105+
106+
func renderGuideArea() {
107+
view.addSubview(guideBoxImageView)
108+
guideBoxImageView.snp.makeConstraints {
109+
$0.top.equalTo(guideButton.snp.bottom).offset(-10)
110+
$0.trailing.equalTo(guideButton.snp.trailing).offset(-12)
111+
$0.width.equalTo(270)
112+
$0.height.equalTo(90)
113+
}
114+
115+
guideBoxImageView.addSubview(guideLabel)
116+
guideLabel.snp.makeConstraints {
117+
$0.top.equalToSuperview().inset(20)
118+
$0.leading.trailing.equalToSuperview().inset(15)
119+
}
120+
}
121+
122+
func setupGuideArea() {
123+
let guideAction = UIAction { [weak self] _ in
124+
self?.guideBoxImageView.isHidden.toggle()
125+
}
126+
guideButton.addAction(guideAction, for: .touchUpInside)
127+
guideBoxImageView.isHidden = true
128+
}
129+
130+
func setupGuideText(title: String, text: String) {
131+
guideLabel.text = text
132+
guideLabel.addLabelSpacing()
133+
guideLabel.textAlignment = .center
134+
guideLabel.applyColor(to: title, with: .subOrange)
135+
}
136+
137+
// MARK: - private func
138+
139+
private func setupBackButton() {
140+
let leftOffsetBackButton = removeBarButtonItemOffset(with: backButton, offsetX: 10)
141+
let backButton = makeBarButtonItem(with: leftOffsetBackButton)
142+
143+
navigationItem.leftBarButtonItem = backButton
144+
}
145+
146+
private func setupInteractivePopGestureRecognizer() {
147+
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
148+
}
149+
}
150+
151+
extension BaseViewController: UIGestureRecognizerDelegate {
152+
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
153+
guard let count = self.navigationController?.viewControllers.count else { return false }
154+
return count > 1
32155
}
33156
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// Date+Extension.swift
3+
// Manito
4+
//
5+
// Created by Mingwan Choi on 2022/07/09.
6+
//
7+
8+
import Foundation
9+
10+
extension Date {
11+
var dateToString: String {
12+
let formatter = DateFormatter()
13+
formatter.dateFormat = "yy.MM.dd"
14+
return formatter.string(from: self)
15+
}
16+
17+
var letterDateToString: String {
18+
let formatter = DateFormatter()
19+
formatter.dateFormat = "yyyy.MM.dd"
20+
return formatter.string(from: self)
21+
}
22+
23+
var isToday: Bool {
24+
let now = Date()
25+
let distance = self.distance(to: now)
26+
return distance > 0 && distance < 86400
27+
}
28+
29+
var isOverOpenTime: Bool {
30+
let now = Date()
31+
let nineHoursTimeInterval: TimeInterval = 32400
32+
let dateAddNineHours = self + nineHoursTimeInterval
33+
let distance = dateAddNineHours.distance(to: now)
34+
return distance > 0 && distance < 54000
35+
}
36+
37+
var isOpenManitto: Bool {
38+
return self.isToday && self.isOverOpenTime
39+
}
40+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// Encodable+Extension.swift
3+
// Manito
4+
//
5+
// Created by Mingwan Choi on 2022/07/12.
6+
//
7+
8+
import Foundation
9+
10+
extension Encodable {
11+
func encode() -> Data? {
12+
do {
13+
return try JSONEncoder().encode(self)
14+
} catch {
15+
return nil
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)