-
Notifications
You must be signed in to change notification settings - Fork 1
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
✨ [FEAT] 홈 배너 UI 구현 #421
✨ [FEAT] 홈 배너 UI 구현 #421
Conversation
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.
고생해쏘~~ 코리 한번만 확인해줭~~~
/// 캐시를 저장해 놓을 싱글톤 클래스 | ||
class ImageCacheManager { | ||
static let shared = NSCache<NSString, UIImage>() | ||
private init() {} | ||
} |
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.
머시따!!!
private lazy var segmentedControl = UISegmentedControl().then { | ||
$0.removeAllSegments() | ||
for i in 0..<bannerImaURLsData.count - 2 { | ||
$0.insertSegment(with: UIImage(named: "unselectedSegmentImage"), at: i, animated: false) | ||
} | ||
$0.setDividerImage(UIImage(), forLeftSegmentState: .normal, rightSegmentState: .normal, barMetrics: .default) | ||
$0.setBackgroundImage(UIImage(), for: .normal, barMetrics: .default) | ||
$0.selectedSegmentIndex = 0 | ||
$0.setImage(UIImage(named: "selectedSegmentImage"), forSegmentAt: $0.selectedSegmentIndex) | ||
$0.isUserInteractionEnabled = false | ||
} |
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.
요기서 UISegmentedControl 말고 기본 UIPageControl을 사용하면 iOS HIG에 기반한 기본 페이징 컨트롤 컴포넌트를 사용해서 구현할 수 있을거 같은데 UISegmentedControl로 구현한 이유가 있나용~??
그 page item들 간에 간격이 너무 커서 고민이라면 그냥 기본 컴포넌트 쓰는것도 좋을 것 같애!!
tintColor / currentPageTintColor로 color 값으로 선택된 페이지, 그렇지 않은 페이지를 표시할 수 있어서 이미지도 사용하지 않아도 되구!!!
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.
@hwangJi-dev 앗. ㅋ ㅋ ㅋ 이거 해주는 애가 있었구나.?.?.?.?.??..?.??.? 바로 리팩 갈길게 거마워... ㅎ.......
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.
굿,,저도 동의합니다!! UIPageControl 추천!! 온보딩에도 얘 써줬어 코드 참고해봐도 좋을듯~!!
switch pageInt { | ||
case 0: | ||
segmentedControl.selectedSegmentIndex = bannerImaURLsData.count - 3 | ||
bannerCV.scrollToItem(at: [0, bannerImaURLsData.count - 2], at: .left, animated: false) | ||
case bannerImaURLsData.count - 1: | ||
segmentedControl.selectedSegmentIndex = 0 | ||
bannerCV.scrollToItem(at: [0, 1], at: .left, animated: false) | ||
default: | ||
segmentedControl.selectedSegmentIndex = pageInt - 1 | ||
} |
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.
멋지다 정정빈~
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.
굿 확인했어여!! 수고했어 정빈걸~!
private lazy var segmentedControl = UISegmentedControl().then { | ||
$0.removeAllSegments() | ||
for i in 0..<bannerImaURLsData.count - 2 { | ||
$0.insertSegment(with: UIImage(named: "unselectedSegmentImage"), at: i, animated: false) | ||
} | ||
$0.setDividerImage(UIImage(), forLeftSegmentState: .normal, rightSegmentState: .normal, barMetrics: .default) | ||
$0.setBackgroundImage(UIImage(), for: .normal, barMetrics: .default) | ||
$0.selectedSegmentIndex = 0 | ||
$0.setImage(UIImage(named: "selectedSegmentImage"), forSegmentAt: $0.selectedSegmentIndex) | ||
$0.isUserInteractionEnabled = false | ||
} |
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.
굿,,저도 동의합니다!! UIPageControl 추천!! 온보딩에도 얘 써줬어 코드 참고해봐도 좋을듯~!!
🍎 관련 이슈
closed #420
🍎 변경 사항 및 이유
🍎 PR Point
📸 ScreenShot
Simulator.Screen.Recording.-.iPhone.13.mini.-.2022-08-08.at.01.46.24.mp4