Skip to content
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

๐ŸŽจ๐Ÿ›  MainVC UI ์ˆ˜์ • #78

Merged
merged 3 commits into from
Jan 25, 2024
Merged

Conversation

heejinnn
Copy link
Collaborator

@heejinnn heejinnn commented Jan 24, 2024

์ž‘์—… ์ด์œ 

  • NavigaionBar ์ ์šฉ + view ๋†’์ด์— ๋”ฐ๋ฅธ ๊ธฐ๋ณธ๊ฐ’ ์ ์šฉ
  • ์ผ€์–ด ์ˆ˜ํ–‰ ์™„๋ฃŒ์‹œ ui ๋ณ€๊ฒฝ
  • ์ผ€์–ด ์ˆ˜ํ–‰ ํ™•์ธ popup ์ฐฝ
  • ์ผ€์–ด ์ˆ˜์ • menu

์ž‘์—… ์‚ฌํ•ญ

1๏ธโƒฃ NavigationBar ์ ์šฉ + view ๋†’์ด์— ๋”ฐ๋ฅธ ๊ธฐ๋ณธ๊ฐ’ ์ ์šฉ

Simulator Screen Recording - iPhone 14 - 2024-01-25 at 04 56 02

private func updatePetCareCollectionViewHeight() {
    let cellHeight: CGFloat = 150
    let sectionHeaderHeight: CGFloat = 80
    var totalHeight: CGFloat = 0
    
    //cell ๊ฐœ์ˆ˜์— ๋”ฐ๋ผ ๋†’์ด ๊ณ„์‚ฐ
    for section in 0..<petCareMethod.numberOfSections(in: petCareCollectionView) {
        let numberOfCellsInSection = petCareMethod.collectionView(petCareCollectionView, numberOfItemsInSection: section)
        totalHeight += sectionHeaderHeight
        totalHeight += (numberOfCellsInSection % 2 == 0 ? cellHeight * CGFloat(numberOfCellsInSection/2) : cellHeight * CGFloat(numberOfCellsInSection/2+1))
    }
    
    //totalHeight๊ฐ€ ํ˜„์žฌ ํ™”๋ฉด์˜ ์ „์ฒด ๋†’์ด๋ณด๋‹ค ์ž‘๋‹ค๋ฉด ํ˜„์žฌ ํ™”๋ฉด์˜ ๋†’์ด๋ฅผ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ
    if totalHeight < self.view.frame.height{
        petCareCollectionViewHeightConstraint.constant = self.view.frame.height
        mainView.snp.updateConstraints { make in
            make.height.equalTo(self.view.frame.height)
        }
    }else{
        petCareCollectionViewHeightConstraint.constant = totalHeight
        mainView.snp.updateConstraints { make in
            make.height.equalTo(totalHeight)
        }
    }
    
    UIView.animate(withDuration: 0.3) {
        self.view.layoutIfNeeded()
    }
}

2๏ธโƒฃ ์ผ€์–ด ์ˆ˜ํ–‰ ์™„๋ฃŒ์‹œ ui ๋ณ€๊ฒฝ

3๏ธโƒฃ ์ผ€์–ด ์ˆ˜ํ–‰ ํ™•์ธ popup ์ฐฝ

4๏ธโƒฃ ์ผ€์–ด ์ˆ˜์ • menu

์ด์Šˆ ์—ฐ๊ฒฐ

#73

@heejinnn heejinnn self-assigned this Jan 24, 2024
Copy link
Member

@psychology50 psychology50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋Œ€์ฒด ๋ช‡ ์‹œ๊นŒ์ง€ ์ž‘์—…์„..?

@psychology50 psychology50 merged commit db14ccf into develop Jan 25, 2024
2 of 3 checks passed
@psychology50 psychology50 deleted the feat/73 branch January 25, 2024 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants