HomeiOS Developmentios - Xcode 15 Unusual behaviour with refreshable listing - progress indicator...

ios – Xcode 15 Unusual behaviour with refreshable listing – progress indicator stays seen


I am having an issue with a refreshable listing view in my App. This downside occurred only recently after making the change to Xcode 15 + Sonoma + iOS 17 and didn’t happen with Xcode 14 + Ventura + iOS16.

Let me present you what is bothering me. Take a look at this straightforward listing.

enter image description here

Now let’s swipe down and reveal a file importer to decide on a file and do some stuff (I edited the image to cover the names of the recordsdata). This image reveals the file importer:

enter image description here

After deciding on a file this occurs. See the that “progress indicator” factor? I feel it is from the refreshable motion, nonetheless it does not disappear. It is going to keep there indefinitely till you precise begin swiping on the listing.

enter image description here

I am fairly positive this “progress indicator” factor did not keep there and disappeared when utilizing Xcode 14 + Ventura + iOS16.

Is it simply me or does anyone have the identical difficulty with Xcode 15 + Sonoma + iOS 17 ?

Right here is the code I used if you wish to attempt it out for your self.

Right here is the ContentView with the listing:

//
//  ContentView.swift
//  ProblemDebug
//

import SwiftUI

struct ContentView: View {
    
    @State var fileImporterVisible: Bool = false
    
    var physique: some View {
        Record {
            Textual content("It is a refreshable listing. Swipe down!")
            Textual content("Let's  see what occurs ...")
        }
        // REFRESHABLE
        .refreshable(motion: {
            fileImporterVisible.toggle()
        })
        // SHOW SHEET WHEN fileImporterVisible IS TOGGLED
        .sheet(isPresented: $fileImporterVisible, content material: {
            ViewFileImporter(fileImporterVisible: $fileImporterVisible)
        })
    }
}

#Preview {
    ContentView()
}

And right here is the view with file importer:

//
//  ViewFileImporter.swift
//  ProblemDebug
//

import SwiftUI

struct ViewFileImporter: View {
    
    @Binding var fileImporterVisible: Bool
    
    var physique: some View {
        ZStack {
            // DO SOMETHING ...
        }
        .fileImporter(isPresented: $fileImporterVisible, allowedContentTypes: [.plainText, .pdf], onCompletion: { lead to
            change consequence {
            case .success(let spxFileImporterURL):
                if spxFileImporterURL.startAccessingSecurityScopedResource() {
                    print(spxFileImporterURL.absoluteString)
                } else {
                    spxFileImporterURL.stopAccessingSecurityScopedResource()
                }
            case .failure(let spxFileImporterError):
                print(spxFileImporterError.localizedDescription)
            }
        })
    }
}

#Preview {
    ViewFileImporter(fileImporterVisible: .fixed(false))
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments