-
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.
[FEAT] 장소 필터링 모달 뷰 구현 (슬라이더 제외) (#29)
- Loading branch information
Showing
11 changed files
with
463 additions
and
191 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
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
74 changes: 74 additions & 0 deletions
74
ACON-iOS/ACON-iOS/Presentation/SpotListFilter/View/Component/CustomSegmentedControl.swift
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,74 @@ | ||
// | ||
// SpotSegmentedControl.swift | ||
// ACON-iOS | ||
// | ||
// Created by 김유림 on 1/16/25. | ||
// | ||
|
||
import UIKit | ||
|
||
import Then | ||
|
||
// TODO: 커스텀 세그먼트컨트롤 만들기... | ||
/// - 배경 insets | ||
/// - attributed string | ||
|
||
class CustomSegmentedControl: UISegmentedControl { | ||
|
||
|
||
|
||
// override init(frame: CGRect) { | ||
// super.init(frame: frame) | ||
//// self.removeBackgroundAndDivider() | ||
// } | ||
|
||
init() { | ||
let segmentItems = [StringLiterals.SpotListFilter.restaurant, | ||
StringLiterals.SpotListFilter.cafe] | ||
super.init(items: segmentItems) | ||
|
||
setStyle() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError() | ||
} | ||
|
||
// TODO: 커스텀 | ||
private func removeBackgroundAndDivider() { | ||
let image = UIImage() | ||
self.setBackgroundImage(image, for: .normal, barMetrics: .default) | ||
self.setBackgroundImage(image, for: .selected, barMetrics: .default) | ||
self.setBackgroundImage(image, for: .highlighted, barMetrics: .default) | ||
|
||
self.setDividerImage(image, forLeftSegmentState: .selected, rightSegmentState: .normal, barMetrics: .default) | ||
} | ||
|
||
private func setStyle() { | ||
self.do { | ||
$0.selectedSegmentIndex = 0 | ||
$0.selectedSegmentTintColor = .acWhite | ||
$0.backgroundColor = .gray8 | ||
$0.setTitleTextAttributes(ACStyle(.s2, .gray5), for: .normal) | ||
$0.setTitleTextAttributes(ACStyle(.s2, .gray9), for: .selected) | ||
} | ||
} | ||
|
||
func ACStyle(_ style: ACFontStyleType, _ color: UIColor = .acWhite) -> [NSAttributedString.Key: Any] { | ||
let attributes: [NSAttributedString.Key: Any] = [ | ||
.font: style.font, | ||
.kern: style.kerning, | ||
.paragraphStyle: { | ||
let paragraphStyle = NSMutableParagraphStyle() | ||
paragraphStyle.minimumLineHeight = style.lineHeight | ||
paragraphStyle.maximumLineHeight = style.lineHeight | ||
return paragraphStyle | ||
}(), | ||
.foregroundColor: color, | ||
.baselineOffset: (style.lineHeight - style.font.lineHeight) / 2 | ||
] | ||
|
||
return attributes | ||
} | ||
|
||
} |
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
23 changes: 23 additions & 0 deletions
23
ACON-iOS/ACON-iOS/Presentation/SpotListFilter/View/Component/PriorityLowEmptyView.swift
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 @@ | ||
// | ||
// PriorityLowEmptyView.swift | ||
// ACON-iOS | ||
// | ||
// Created by 김유림 on 1/16/25. | ||
// | ||
|
||
import UIKit | ||
|
||
class PriorityLowEmptyView: UIView { | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
setContentHuggingPriority(.defaultLow, for: .horizontal) | ||
setContentHuggingPriority(.defaultLow, for: .vertical) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
} | ||
|
||
} |
Oops, something went wrong.