4.8 C
London
Tuesday, February 13, 2024

ios – SideMenuSwift ViewControllers are nil after cloning undertaking from a repo


I must get an iOS app working in xcode on my machine from a web-based repo. Simply to notice, I’ve nearly 0 expertise with iOS improvement so I is perhaps going about a few of these steps improper. My first steps have been cloning the repo, working pod set up after which opening the project_name.xcworkspace file. The app is utilizing about 20 or so pods, and one in every of them known as SideMenuSwift. After I construct and cargo the undertaking, the construct will get hung up on this error:

SideMenuSwift/SideMenuController.swift:172: Deadly error: [SideMenuSwift] `menuViewController` or `contentViewController` shouldn't be nil.

Going via the code, this error happens within the controller of the SideMenuSwift pod file, proper right here:

open override func viewDidLoad(){
    tremendous.viewDidLoad()
    // stuff
    if isContentOrMenuNotInitialized{
        fatalError("[SideMenuSwift] `menuViewController` or `contentViewController` shouldn't be nil.") // <- error
    }
    // extra stuff
}

There are two different errors that happen as a result of menuViewController and contentViewController are nil, they usually happen within the FeedbackViewController and HomepageViewController information in the identical manor.

override func viewDidLoad() {
    tremendous.viewDidLoad() // <- error
    // stuff
}

I’ve entry to the laptop computer that the app was created on and I’m able to view the file construction of each tasks facet by facet and the one distinction, is that some folders on the developer’s laptop computer include a DS_STORE file. I do not assume that this ought to be an issue however I’m not positive. The truth that the code is identical in each places makes me assume that this is perhaps one thing greater than a difficulty with this package deal, it may need been how I cloned and setup the app.

What I’ve tried:

  1. made positive that I’ve the identical model of all of the pod information, cocoapods, swift and xcode because the developer’s laptop computer.

  2. made positive that I’m on the identical department and on the identical commit because the working model on the developer’s laptop computer

  3. checked the .gitignore and made positive that every one the information in my listing are the identical as within the developer’s listing.

  4. adopted the docs, added the perform beneath to initialize the ViewControllers in my SceneDelegate.swift file, and located the suitable view controllers for menuViewController and contentViewController

    import UIKit
    import SideMenuSwift
    
    
    class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    
        var window: UIWindow?
    
        @objc func applicationDidFinishLaunching(_ software: UIApplication) {
                let contentViewController = HomePageViewController()
                let menuViewController = FeedbackViewController()
    
                window = UIWindow(body: UIScreen.predominant.bounds)
                window?.rootViewController = SideMenuController(contentViewController: contentViewController,
                menuViewController: menuViewController)
    
                window?.makeKeyAndVisible()
                return true
            }
        // Different stuff
    
  5. loaded an older commit in xcode

  6. constructed the app for iPhone 14, iPhone 15 and iPad (tenth era)

Latest news
Related news

LEAVE A REPLY

Please enter your comment!
Please enter your name here