XLOG

[UIKit] iOS15 이상 UITableView Section Header Padding 적용 본문

카테고리 없음

[UIKit] iOS15 이상 UITableView Section Header Padding 적용

X_PROFIT 2023. 1. 30. 23:39

iOS 15 부터 UITableView 섹션 헤더에 기본 패딩이 적용되어 있다.

섹션 헤더 패딩값을 제로로 만들기

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    if #available(iOS 15.0, *) {
        UITableView.appearance().sectionHeaderTopPadding = .zero
    }
    return true
}