1

I just updated to Xcode 13 and iOS 15 and I'm experiencing weird glitch that I cannot figure out how to fix. I have a List with header. The header has fixed height of 44.0. The extra space isn't there on iOS 14.

Screenshots:

Xcode App
Xcode App

List:

var body: some View {
    List {
        pendingRequestsSection
        visitedRequestsSection
    }
    .listStyle(InsetGroupedListStyle())
}

// Sections

private var pendingRequestsSection: some View {
    Section(
            content: {
                if viewModel.pendingRowModels.isEmpty {
                    noRequestsRow
                } else {
                    ForEach(viewModel.pendingRowModels, content: requestRow)
                }
            },
            header: {
                ListReloadView(
                    isLoading: $viewModel.isLoading,
                    lastFetchDate: $viewModel.recentFetchDate,
                    action: viewModel.reloadTapped
                )
            }
        )
    .textCase(nil)
}

...

Header:

var body: some View {
        Button(
            action: action,
            label: { buttonContent }
        )
        .frame(height: 44.0)
    }

    // Helpers

    private var buttonContent: some View {
        HStack(alignment: .center) {
            Spacer()
            lastFetchDate.flatMap(timeLabel)
            reloadLabel
            Spacer()
        }
    }

    private var reloadLabel: some View {
        Text(isLoading ? "Loading..." : "Reload")
            .font(.system(size: 12.0, weight: .semibold))
            .foregroundColor(UIColor.accent.color)
            .multilineTextAlignment(.center)
    }

Any ideas? I'm really pissed with this iOS+Xcode release. So many things broke suddenly. Smh. Thanks in advance!

Lachtan
  • 4,253
  • 6
  • 21
  • 32
  • Does [this](https://stackoverflow.com/questions/69308399/how-to-remove-ios-15-extra-top-padding-in-swiftui-insetgroupedliststyle) answer your question? – Yrb Sep 29 '21 at 15:50
  • @Yrb Unfortunately not – Lachtan Sep 29 '21 at 15:56
  • How about this one [padding above section headers in iOS 15](https://stackoverflow.com/questions/68155090/extra-padding-above-table-view-headers-in-ios-15)? Think it may be relevant as you’re using Section. (This was linked from the question/answer @Yrb suggested.) – 4D45 Sep 29 '21 at 16:03
  • @user16966757 It' s very odd, but setting the section padding in `UITableView`s appearance doesn't help either – Lachtan Sep 29 '21 at 16:17
  • 2
    At this point, I think this is going to need a minimal, reproducible example. Creating it Amy actually point to the solution. – Yrb Sep 29 '21 at 16:42
  • Hey guys @Yrb (i wasn't able to tag user169...). Here's link with sample project: https://github.com/adam-leitgeb/iOS15-Headers – Lachtan Sep 30 '21 at 15:26
  • I have nothing. It seems to have been an off and on problem with 15 from the beginning, and each "fix" got broken. – Yrb Sep 30 '21 at 19:33
  • Yeah, it’s quite annoying how many things broke with the new release. Thanks for the help anyway, Yrb! – Lachtan Oct 01 '21 at 20:17

0 Answers0