-
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
Feature/#7 assignment 3 #8
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.
์๋น๋,, ์ค๋๋ ๋ง์ด ๋ฐฐ์๊ฐ๋๋ค,, ์ต๊ณ ์ต๊ณ ์ต๊ณ ์ค์ค์ค์ค์ค์ค!!!!!!!
|
||
} | ||
|
||
/// ์ฝ๋๋ฒ ์ด์ค๋ก cell์ ์์ฑํ ๋ ํ์ํ ์ด๊ธฐํ ํจ์ (์ธํฐํ์ด์ค ๋น๋์์๋ ์๋์ผ๋ก ์ด๊ธฐํํ๊ธฐ ๋๋ฌธ์ init ํ์ X) |
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.
๋์น ์ ์๋ ๋ถ๋ถ์ด์๋๋ฐ, ๋ค์ํ๋ฒ ์๊ธฐ์ํค๊ณ ๊ฐ๋๋ค!!๐ ์ ์น์ ...
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.
์ค... ์ฃผ์๋์ cell์ ์ฝ๋๋ก ์์ฑํ ๋ ์ด๊ธฐํ๊ฐ ํ์ํ๋ค๋๊ฒ์ ์๊ณ ๊ฐ๋๋ค.. ์๋น ์จ๋ฐฐ ์งฑ
func setupLayout() { | ||
self.addSubview(categoryLabel) | ||
|
||
categoryLabel.snp.makeConstraints { make in |
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.
๋ค์์๋ then์ ๊ฐ์ด ์ฌ์ฉํด๋ด๋ ์ข์ ๊ฒ ๊ฐ์์!! ใ ใ make in ์ ์ฐ์ง ์๊ณ $0. ์ผ๋ก ๋ชจ๋ ํ๋กํผํฐ์ ์ ๊ทผ ๊ฐ๋ฅํด์ snapkit๊ณผ ํจ๊ป ์ผ์ ๋ ์์ฒญ ํจ์จ์ ์ด๋๋ผ๊ตฌ์!! ใ ใ
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.
๊ทธ๋์ ์ชผ๊ธ ๋ฌด์์์ ๋ชป์ฐ๊ณ ์์๋๋ฐ ์ด์ ์ ๋ง๋ฃจ then ์ ๋ฐฐ๋ฆ ์ ๋ง์ฃผํ ๋๊ฐ ๋๋๋ด์ฌ... ์ ์ฉํด๋ณด๊ฒ ์ด๋ค!๐
|
||
channelCollectionView.delegate = self | ||
channelCollectionView.dataSource = self | ||
categoriesCollectionView.delegate = self | ||
categoriesCollectionView.dataSource = self | ||
contentTableView.delegate = self | ||
contentTableView.dataSource = self |
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.
์ข์์ฌ! ์ฌ์ค ํจ์ํ๋ฅผ ํ๊ณ ์ถ์๋๋ฐ ํจ์ ์ด๋ฆ์ ์ด๋ค ์์ผ๋ก ํ ์ง ๋ชจ๋ฅด๊ฒ ๋๋ผ๊ตฌ์ฌ.. delegate๋ datasource๋ก ๋๋ ์ผํ ์ง.. collectionView๋ tableView๋ก ๋๋์ง.. ๊ณ ๋ฏผ๋ง ํ๋ค๊ฐ ๋๋ค์ฌ...
ํน์ ์ง์๋์ด๋ผ๋ฉด ํจ์ ์ด๋ฆ ์ด๋ค ์์ผ๋ก ์ง์ผ์ค ๊ฒ ๊ฐ๋์ฌ.......?๐ง
์ง์๋ ์ฝ๋ ์ฝ์ฅ ์๋ฃ๐
/// categoriesCollectionView์ ๋ค์ด๊ฐ label์ ํฌ๊ธฐ๋ฅผ categoryLabel์ด๋ผ๋ ์์์ label์ ๋ง๋ค์ด์ ๊ณ์ฐ ํ return | ||
func setupLabelSize(index: Int) -> CGSize { | ||
let categoryLabel = UILabel() | ||
categoryLabel.text = categorieList[index] | ||
categoryLabel.sizeToFit() | ||
|
||
return categoryLabel.bounds.size | ||
} | ||
} |
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.
์ค ์ด์ฝ๋ ์ง์ง ์ข์ ๊ฒ ๊ฐ์์! ์ ๋ ์ด๋ ๊ฒ returnํด์ ์ฌ์ฉํ ์๊ฐ์ ๋ชปํ์๋๋ฐ..! ์ต๊ณฑ๋๋น!!
let size = setupLabelSize(index: indexPath.row) | ||
return CGSize(width: size.width + 20, height: 30) |
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.
๐๐ป๐๐ป
cell.contentTitleLabel.text = contentTitleList[indexPath.row] | ||
cell.contentImageView.image = UIImage(named: "\(contentImageList[indexPath.row])") | ||
cell.contentChannelImageView.image = UIImage(named: "wesoptProfile") | ||
cell.contentMoreButton.setImage(UIImage(named: "moreMenuIcon"), for: .normal) |
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.
์ด๋ ๊ฒ cell์์ ์ง์ ํด์ค์ผ ํ ๊ฐ๋ค์ด ๋ง์ ๋ cell๋ด์์ ํจ์๋ฅผ ๋ง๋ค๊ณ , ๊ทธ ํจ์๋ฅผ ๋ถ๋ฌ์์ ์ฝ๋ ํ์ค๋ก ์ฐ๋ ๋ฐฉ๋ฒ๋ ์์ต๋๋ท!! ใ ใ
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.
์ค๊ฐ์ค๊ฐ ๊ฐ์ฅ๋ณด๋ฉด์ ํ๋งํ๋ฉฐ ๋ดค์ต๋๋ค ์๋น๋..์
ค๊ธฐ๊ฐ์ธ๋ฐ ๋๋ฌด ๊ณ ์๋ง์ผ์
จ์ต๋๋ค!!
ํญ์ ์น์ ํ ์ฃผ์์ ์จ์ฃผ์๋ ๋ฐฐ๋ ค์ ๊ฐ๋๋ฐ๊ณ ๊ฐ๋๋ค ๐ฅฒ
์ผ์ค๋์น๋ ์ฝ๋ ์๋ดค์ต๋๋ค ใ
ใ
|
||
} | ||
|
||
/// ์ฝ๋๋ฒ ์ด์ค๋ก cell์ ์์ฑํ ๋ ํ์ํ ์ด๊ธฐํ ํจ์ (์ธํฐํ์ด์ค ๋น๋์์๋ ์๋์ผ๋ก ์ด๊ธฐํํ๊ธฐ ๋๋ฌธ์ init ํ์ X) |
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.
๋์น ์ ์๋ ๋ถ๋ถ์ด์๋๋ฐ, ๋ค์ํ๋ฒ ์๊ธฐ์ํค๊ณ ๊ฐ๋๋ค!!๐ ์ ์น์ ...
func configUI() { | ||
contentTitleLabel.numberOfLines = 2 | ||
contentTitleLabel.text = "4์ฐจ iOS ์ธ๋ฏธ๋: ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ๊ณผ ํจ๊ป ์นํจ ๋จน๋ ๋ฐฉ๋ฒ" | ||
contentSubLabel.text = "WE SOPT ยท ์กฐํ์ 100๋งํ ยท 3์ฃผ์ " |
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.
๋์ค์ ๊ฐ์ ํ์ํ ๋ ๋ณ๊ฒฝํด๋ ์ข๊ฒ ์ง๋ง ํน์๋ ํ์ฌ ใ
ใ
์กฐํ์ \(n)ํ, \(n)์
ํ
์คํธ ๋นผ๊ณ ๋ค ๋ณํ ์ ์๋ ์น๊ตฌ๋ค์ด๋ ๋ฐ๋ก ์ง์ ํด์ฃผ์ด๋ ์ข์ ๊ฒ ๊ฐ์์!!๐ค
"3์ฃผ์ฐจ iOS: ๋ก๋ณถ์ด ์ฌ์ฃผ์ธ์ ๋งค์ด๊ฑฐ๋ก ์ฌ์ฃผ์ธ์", | ||
"4์ฃผ์ฐจ iOS: ์ค๋์ ์ฝ๋ก์ ๋จน์๊น ์๋ก์ ๋จน์๊น ์ ์ ์ ๋จน์๊น?", | ||
"5์ฃผ์ฐจ iOS: ์กํ์คํฐ๋ ์์น๋ฐ ์ ๋ฆฌํด์ ์ฌ๋ ค์ผ๋๋๋ฐ", | ||
"6์ฃผ์ฐจ iOS: ์๋ฃ๊ตฌ์กฐ ์ํ ๋งํ๋ ๋ฒ"] |
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.
๋๋ฌผ...๐ฅฒ
switch collectionView { | ||
case channelCollectionView: | ||
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HomeChannelCVC.identifier, for: indexPath) as? HomeChannelCVC else {return UICollectionViewCell()} | ||
cell.setData(channelName: channelNameList[indexPath.row], channelImage: channelImageList[indexPath.row]) | ||
return cell | ||
|
||
case categoriesCollectionView: | ||
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HomeCategoryCVC.identifier, for: indexPath) as? HomeCategoryCVC else {return UICollectionViewCell()} | ||
cell.categoryLabel.text = categorieList[indexPath.row] | ||
return cell | ||
|
||
default: | ||
return UICollectionViewCell() | ||
} | ||
} |
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.
์ค ์๋ ๊ฒ cell ์์ฑ์ ๋ถ๊ธฐ์ฒ๋ฆฌ ํด์ค ์๋ ์๊ตฐ์!! ๋ฐฐ์๊ฐ๋๋ค ใ ใ โ๏ธ
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.
์ฌ์ค if-else๋ฌธ์ผ๋ก ์งฐ์๋๋ฐ ์๋น์จ๋ฐฐ๊บผ ๋ชฐ๋ ๋ณด๊ณ ํธ๋ค๋ฅ ๋ฐ๊ฟ์ ๋ด์ ์นญ์ฐฌ๋ฐ์๋ค.. ์๋น์จ๋ฐฐ ๊ฐ์ฌํจ๋ค...
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.
์๋น์จ๋ฐฐ... snapkit์ฐ๋๊ฑฐ ๋ ๋ฉ์ช..R....
์กฐ๊ธ ์ด๋ ค์ด ๊ฐ๋
์ด๋ ๋ด๊ฐ ์ด๋ค ์๋๋ก ์ฝ๋์งฐ๋์ง ์ฃผ์์ผ๋ก ์ค๋ช
ํด์ฃผ๋๊ฑฐ ๋ ์ดํด๋ ์๊ฐ๊ณ ํด์ ๋๋ ๋ด์ ์ ์ฉํด๋ณด๊ฒ ์ต๋๋ค!!
๋๋ฌด ์๊ณ ํ์ด์ค~~!
|
||
} | ||
|
||
/// ์ฝ๋๋ฒ ์ด์ค๋ก cell์ ์์ฑํ ๋ ํ์ํ ์ด๊ธฐํ ํจ์ (์ธํฐํ์ด์ค ๋น๋์์๋ ์๋์ผ๋ก ์ด๊ธฐํํ๊ธฐ ๋๋ฌธ์ init ํ์ X) |
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.
์ค... ์ฃผ์๋์ cell์ ์ฝ๋๋ก ์์ฑํ ๋ ์ด๊ธฐํ๊ฐ ํ์ํ๋ค๋๊ฒ์ ์๊ณ ๊ฐ๋๋ค.. ์๋น ์จ๋ฐฐ ์งฑ
layer.cornerRadius = 14 | ||
layer.borderWidth = 1 | ||
layer.borderColor = .init(gray: 125/235, alpha: 0.5) | ||
backgroundColor = .systemGray6 |
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.
์ ๊บผ์ ๋ฌ์์คฌ๋ ๋ถ๋ถ์ด ์ด๊ฑฐ๊ตฐ์..! ๋ณด๊ณ ์ ์ฉํด๋ณด๊ฒ ์ต๋๋น!
contentImageView.contentMode = .scaleToFill | ||
} | ||
|
||
func setupLayout(){ |
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.
๋ ์ด์์ ์ฝ๋๋ก ์ง๋ ์จ๋ฐฐ.... ๋ ๋ฉ์์ต๋๋ค.... ์์ง์ ๋์ผ๋ก ์ตํ๊ฐ๋ ๋จ๊ณ์ธ์ง๋ผ ์นจ๋ง ํ๋ฆด๊ป์
switch collectionView { | ||
case channelCollectionView: | ||
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HomeChannelCVC.identifier, for: indexPath) as? HomeChannelCVC else {return UICollectionViewCell()} | ||
cell.setData(channelName: channelNameList[indexPath.row], channelImage: channelImageList[indexPath.row]) | ||
return cell | ||
|
||
case categoriesCollectionView: | ||
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HomeCategoryCVC.identifier, for: indexPath) as? HomeCategoryCVC else {return UICollectionViewCell()} | ||
cell.categoryLabel.text = categorieList[indexPath.row] | ||
return cell | ||
|
||
default: | ||
return UICollectionViewCell() | ||
} | ||
} |
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.
์ฌ์ค if-else๋ฌธ์ผ๋ก ์งฐ์๋๋ฐ ์๋น์จ๋ฐฐ๊บผ ๋ชฐ๋ ๋ณด๊ณ ํธ๋ค๋ฅ ๋ฐ๊ฟ์ ๋ด์ ์นญ์ฐฌ๋ฐ์๋ค.. ์๋น์จ๋ฐฐ ๊ฐ์ฌํจ๋ค...
๐ ๊ด๋ จ ์ด์
closed #7
๐ ๋ณ๊ฒฝ ์ฌํญ ๋ฐ ์ด์
3์ฃผ์ฐจ ๊ณผ์ ์๋ฃํ์ด๋ค
๐ PR Point
์คํ ๋ฆฌ๋ณด๋์ ์ค๋ธ์ ํธ๋ฅผ ์ฌ๋ ค์ IBOutlet ์ฐ๊ฒฐ๋ง ํด์ฃผ๊ณ , ์คํ ๋ ์ด์์์ Snapkit์ ํ์ฉํด์ ์ฝ๋๋ก ์ก์์ต๋๋ค..
๋ทฐ๋ ์ ์ฒด์ ์ผ๋ก collectionView 2๊ฐ์ tableView 1๊ฐ๋ก ๊ตฌ์ฑํ์ต๋๋ค
์ ํฌ ์ ๊ธฐ ๊ท์ฝ์ฃ ... ๋ด์ฃผ์ธ์ฌ ์๋ํ๋๊ฑฐ์์...
๐ ์ฐธ๊ณ ์ฌํญ
์คํ ๋ฆฌ๋ณด๋์ ์ฝ๋๋ฅผ ๊ฐ์ด ์ฌ์ฉํ๋ ค ํ๋๊น ์ฝ๊ฐ ์ฌ๊ธฐ์ ๊ธฐ ์ ์ ์ด ์๋ค์ ํจ....๐คฏ
๋ญ๊ฐ ui ์ค์ ํ๋ ์ฝ๋๊ฐ ๋น ์ง ๊ฒ ๊ฐ์๋ฐ..? ์ถ์ผ๋ฉด ์๋ง ์คํ ๋ฆฌ๋ณด๋์์ ์ค์ ํ์ ์๋ ์์ต๋๋ค..
์ง์ง ์ ์ ์์ด ํด์ ์ ๊ฐ ์ด๋์ ๋ญ ํ๋์ง.... ์กฐ๊ธ ํผ๋์ค๋ฝ๊ธฐ๋ ํ๋๋ผ๊ตฌ์ฌ.....
๋ญ ํ๊ฑด์ง ์ดํด๊ฐ ์๋๊ฑฐ๋ ๋ ํจ์จ์ ์ผ๋ก ํ ์ ์๋ ๋ถ๋ถ์ด ์๋ค๋ฉด ์ฝ๋ฉํธ... ๋ถํ๋๋ฆผ๋ค๐
๋ฒ์จ ์ด๋ฏธ 3์ฐจ ๊ณผ์ ์ง๋ง... ๋ค์ ๊ณผ์ ๋ถํฐ๋ ์ข ๋ ์ด์ฌํ ํด๋ณด๊ฒ ์ด๋ค....