Yesterday I upgraded my iPhone to iOS 16.
My M1 MacBook Air is running on macOS 12.4
And Xcode version is 13.4.1
When I am trying to build and deploy an app to my iPhone I am getting an error message that iPhone's OS version is not compatible with Xcode's supported OS version.
I understand Xcode should support iOS 16, for that I think it should be upgraded to Xcode 14 for which maybe my macOS should be 12.5
But when I check for updates there is no new update either for Xcode or macOS.
I cannot downgrade my iOS version either (I do not have a latest backup)
What can be done please suggest.
Thanks.
Post
Replies
Boosts
Views
Activity
Hi,
So I am using this function getListAtFIRStore() which is fetching data from firestore and returning it. But the fetching takes some time and before that happens the function already returns back the array which is empty at that moment.
How do I wait for the fetching task to be completed before the function returns the array back?
class CheckForDownloads {
var userName = String()
func refreshResources(forUser username: String) {
self.userName = username
let listOfImagesAtFirestore = getListAtFIRStore()
print(listOfImagesAtFirestore)
}
func getListAtFIRStore() -> [String]{
let root = Storage.storage().reference()
var str3 = [String]()
root.child("MagicFrame/\(userName)/images").listAll { (result, error) in
if let error = error {
print("Error in fetching list from firestore \(error.localizedDescription)")
}else{
for item in result.items{
if let str1 = (item.description.components(separatedBy: ["/"]).last) {
if let str2 = (str1.components(separatedBy: ["."])).first{
print(str2)
str3.append(str2)
}
}
}
}
}
return str3
}
}
Hi folks,
I am downloading some images from Firebase and adding them to main bundle resources, after which I use them.
I am having trouble with making my code to wait for the downloads to get complete before it executes the next statement.
I tried completion handlers, async/await but still the same.
Not sure if I am doing it the right way.
Can anyone help what is the correct approach for this scenario.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Create a session configuration
let configuration = ARImageTrackingConfiguration()
Task{
await self.checkForDownloads.refreshResources(forUser: self.username)
}
if let trackedImages = ARReferenceImage.referenceImages(inGroupNamed: "AR Resources", bundle: Bundle.main){
configuration.trackingImages = trackedImages
configuration.maximumNumberOfTrackedImages = 1
print("Images Found: \(trackedImages.count)")
}
sceneView.session.run(configuration)
}
func refreshResources(forUser username: String) async {
//..
}
I am expecting checkForDownloads.refreshResources to finish downloading first, then proceed to next statement.