0

So I've been building my first app and when I recently updated to Xcode 12 multiple issues have occurred...

I have noticed that there is no longer app and scene delegate files but my project is still using it. Wondering how I clean this up without copying and pasting everything into a new project.

I also am having multiple warnings saying:

"The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99."

I currently have my Deployment target to iOS 13. If I change it to 9 my URLIMAGE module comes up an error as it has a minimum of 11. When I change it to 11 I have 999+ errors...

example below: enter image description here

I have no idea what to put it to!

I am also seeing along with URLImage that my firebase isn't properly working and that most of my UI has disappeared. I am running through an instagram tutorial and my "Home" feed is now blank. My story feed file is still working fine though, not sure if it has something to do with firebase or URLImage?

enter image description here

I have played around with the view and added in a rectangle underneath my story scrollview and it has appeared so I suspect it has something to do with firebase.

Current code:

import SwiftUI
import URLImage
import Firebase

struct HomeView: View {
    
    @ObservedObject var homeViewModel = HomeViewModel()
    
    var body: some View {
        NavigationView {
            
            ScrollView(.vertical, showsIndicators: false) {
                
                Story()
                Rectangle().frame(width: 200, height: 200).foregroundColor(.red)
                if !homeViewModel.isLoading {
                    ForEach(self.homeViewModel.posts, id: \.postId) { post in
                        VStack(alignment: .center) {
                            
                            HeaderCell(post: post)
                            FooterCell(post: post)
                            
                            }.background(Color.white).cornerRadius(10)
                            .padding(.leading, 10).padding(.trailing, 10)
                    }
                    
                }
                }

This is my HomeViewModel:

import Foundation
import SwiftUI
import Firebase

class HomeViewModel: ObservableObject {
    @Published var posts: [Post] = []
    @Published var isLoading = false
    
    var listener: ListenerRegistration!
    
//    init() {
//        loadTimeline()
//    }
    
    func loadTimeline() {
        self.posts = []
        isLoading = true
        
        Api.Post.loadTimeline(onSuccess: { (posts) in
            self.isLoading = false

            if self.posts.isEmpty {
                self.posts = posts
            }
        }, newPost: { (post) in
            if !self.posts.isEmpty {
                self.posts.insert(post, at: 0)
            }
        }) { (listener) in
            self.listener = listener
        }

    }
}

Any help would be very much appreciated!

  • This is marked as Firebase but there is no Firebase code or references in the question. It's possible the security rules are preventing a load or maybe even your not authenticated when attempting to read the data. Without more info though, it's hard to tell. – Jay Oct 10 '20 at 13:29

1 Answers1

1

Without seeing your code, it's hard to say what exactly is the cause for the issues you're seeing. However, to answer some of your questions:

  1. You can still use the old way the app is set up (using the AppDelegate and SceneDelegate. See my answer here for more details
  2. You can safely ignore the warnings. If it bothers you a lot, check out this answer for a way to match the deployment target of your pods.

As for why your UI has disappeared, it would be useful if you could provide a couple of relevant code snippets and a few lines from your log output. Also, make sure to check if your Security Rules are set up correctly.

Peter Friese
  • 6,709
  • 31
  • 43