-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 홈 투표 UI 및 내비게이션 바 구현 (#16) #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
50f2b4d
2fc912e
8f7503b
c31ff42
831be27
e614e38
fa3d4d1
0032fb5
00e9089
38c3f69
63f5354
b701295
bfd4c9b
d9e51a9
09c0c1a
045d48a
e78f880
3b2e769
b3b93db
1d2282b
2227e61
76e94c8
29cc96a
3b20ca7
7094e79
5c33a02
d6c510f
173a998
631399b
3436ce0
57ce04d
6c141f1
3bec860
c839674
1e16730
d882935
6427e85
a2869c3
68ff19a
f234f83
159e120
0680c59
f540a80
3ef492e
7f54eff
5faf5e3
9a0d3d2
8d8432e
f28656c
1a39588
b15ea5e
500e459
1997d2d
d074ef5
8eab445
e7d3f57
41b4bd1
0389c1f
b798563
98c7ca2
1d1e416
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // | ||
| // ReusableIdentifier+.swift | ||
| // MatzipBook | ||
| // | ||
| // Created by 심범수 on 6/16/25. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| protocol ReusableIdentifier: AnyObject {} | ||
|
|
||
| extension ReusableIdentifier where Self: UIView { | ||
|
|
||
| static var identifier: String { | ||
| return String(describing: self) | ||
| } | ||
| } | ||
|
|
||
| extension UICollectionReusableView: ReusableIdentifier {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // | ||
| // MatzipImage.swift | ||
| // MatzipBook | ||
| // | ||
| // Created by 심범수 on 6/9/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| enum MatzipImage: String { | ||
| case imgLogo = "img_logo" | ||
| case imgBubble = "img_bubble" | ||
| case imgVS = "img_vs" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // | ||
| // MatzipText.swift | ||
| // MatzipBook | ||
| // | ||
| // Created by 심범수 on 6/17/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| enum MatzipText { | ||
| enum Vote { | ||
| static let title: String = "당신의 선택은?" | ||
| static let subtitle: String = "오늘 당신의 맛집을 투표해주세요!" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // | ||
| // UIFont+.swift | ||
| // MatzipBook | ||
| // | ||
| // Created by 심범수 on 6/15/25. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| enum FontName: String { | ||
| case bold = "Pretendard-Bold" | ||
| case regular = "Pretendard-Regular" | ||
| } | ||
|
|
||
| extension UIFont { | ||
|
|
||
| static func applyFont(_ name: FontName, ofSize size: CGFloat) -> UIFont { | ||
| return UIFont(name: name.rawValue, size: size) ?? .systemFont(ofSize: size) | ||
| } | ||
| } | ||
|
Comment on lines
+15
to
+20
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 폰트를 이렇게 쓰는 방법도 있군요 static var pretendardBold14: Font { .pretend(type: .bold, size: 14) }
static var pretendardBold16: Font { .pretend(type: .bold, size: 16) }이런식으로 썻는데 범수님 같이 쓰는게 더 확장성이 좋아보이네요!!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 말씀해주신 방식도 충분히 좋은 접근이고 상황에 따라 더 적합할 수도 있다고 생각합니다! |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "ic_clock.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "preserves-vector-representation" : true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "ic_search.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "preserves-vector-representation" : true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "img_bubble.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "preserves-vector-representation" : true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "img_dummy0.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "img_dummy0@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "img_dummy0@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "img_dummy1.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "img_dummy1@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "img_dummy1@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "img_logo.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "img_logo@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "img_logo@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "img_vs.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "preserves-vector-representation" : true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // | ||
| // UIStackView+.swift | ||
| // MatzipBook | ||
| // | ||
| // Created by 심범수 on 6/16/25. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| extension UIStackView { | ||
|
|
||
| func configureStackView( | ||
| axis: NSLayoutConstraint.Axis = .horizontal, | ||
| alignment: UIStackView.Alignment = .fill, | ||
| distribution: UIStackView.Distribution = .fillEqually, | ||
| spacing: CGFloat = 0 | ||
| ) { | ||
| self.axis = axis | ||
| self.alignment = alignment | ||
| self.distribution = distribution | ||
| self.spacing = spacing | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // | ||
| // UIView+.swift | ||
| // MatzipBook | ||
| // | ||
| // Created by 심범수 on 6/10/25. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| extension UIView { | ||
|
|
||
| func addSubviews(_ views: UIView...) { | ||
| views.forEach { addSubview($0) } | ||
| } | ||
| } | ||
|
Comment on lines
+10
to
+15
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이부분은 addSubview를 여러번 말고 한번에 다 추가하는 방식이네요!! 배워갑니다!! 🙏 ...으로 list가 아닌 방식으로 하는 방식도 좋네요!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 감사합니다! 🙏 |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용되는 image, Text 들을 enum으로 관리해서 좋네요!!
혹시 따로 궁금한점인데 img_logo나 ic_clock등 snake case를 쓰신 이유가 궁금합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asset Catalog에서는 이름 구분할 때 대소문자를 구분하지 않아서 이미지 등록할 때 스네이크 케이스로 등록하는 것이 충돌 가능성을 방지하는걸로 알고 있습니다!