감자주먹밥
close
프로필 배경
프로필 로고

감자주먹밥

  • 분류 전체보기 (83)
    • IOS (1)
      • Swift (14)
      • RxSwift (2)
      • UIKit (31)
      • SwiftUI (9)
      • Test (4)
    • 코퉤엣 (12)
    • Git (2)
    • Android (8)
  • 홈
  • 태그
  • iOS
  • Github
  • 방명록
[UIKit] TableView Dynamic Height 사용하기

[UIKit] TableView Dynamic Height 사용하기

다음과 같은 화면을 섹션을 나눠서 TableView로 만들었는데 리뷰가 길거나 영화 제목?이 길면 그에따라 셀도 커졌으면 좋겠는데.. 하니까 바로 Dynamicheight를 설정할 수 있는걸 알고 사용한걸 정리해보았다.Dynamic Height in TableView tableView = UITableView(frame: view.bounds, style: .insetGrouped)// dynamic height 설정tableView.rowHeight = UITableView.automaticDimension// 대략적인 높이를 설정해줘야함tableView.estimatedRowHeight = 300설정은 간단하다 추가로 대략적인 높이를 설정해줘야한다. Cell 설정도 어렵지 않았다.class Movie..

  • format_list_bulleted IOS/UIKit
  • · 2025. 3. 4.
  • textsms

[UIKit] Long Press ContextMenu 띄우기 (TableView & CollectionView)

TableView, CollectionView 에서 Delegate 사용iOS 13+ 부터 가능함!TableView or CollectionView는 따로 만들었다는 가정하에 Delegate를 사용하는 법만 확인 UITableViewDelegate or UICollectionViewDelegate에 있는 contextMenuConfigurationForItemsAt 함수를 정의해 만들 수 있다. 예제는 CollectionView지만 TableView도 동일하게 사용이 가능함!extension HomeViewController: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, contextMenuCon..

  • format_list_bulleted IOS/UIKit
  • · 2025. 3. 4.
  • textsms
[IOS] CollectionView 정리

[IOS] CollectionView 정리

extension ViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return data.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier:..

  • format_list_bulleted IOS/UIKit
  • · 2022. 2. 6.
  • textsms
  • navigate_before
  • 1
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (83)
    • IOS (1)
      • Swift (14)
      • RxSwift (2)
      • UIKit (31)
      • SwiftUI (9)
      • Test (4)
    • 코퉤엣 (12)
    • Git (2)
    • Android (8)
최근 글
인기 글
태그
  • #programmers
  • #android
  • #ios
  • #코딩테스트
  • #백준
  • #tableView
  • #swiftUI
  • #Kotlin
  • #UIKit
  • #SWIFT
최근 댓글
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바