UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Project 7 / 9

Forums > 100 Days of Swift

Good afternoon,

When creating project 7, I ran into some things that didn't work for me somehow. Now I am at project 9 and I need project 7 again so I grab the document from the download of HWS. But when I open it I get notifications and when I solve them through "FIX" then the app starts up with a black screen.

maybe someone has the right file for me so i can start project 9. With the latest version of Xcode and IOS version.

(It mainly gets stuck at the AppDelegate.) Line number 29,32,35.

I hope someone can help me. Thanks in advance!

3      

Did you want a new copy of Project 7? Or did you want Project 9

If you want a Project 7 you can download it from my GitHub

3      

Still i don't see the Top rated button.

3      

Hey! Were you able to solve your problem? I guess I had something similar though I didn't have any errors I could not see "Top Rated" button. After a couple of minutes I found that newer Xcode projects now have SceneDelegate besides AppDelegate and I tried to move required code from AppDelegate to SceneDelegate, it worked!

Here is how the first method in SceneDelegate file looks for me:

 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        if let tabBarController = window?.rootViewController as? UITabBarController {
            let storyboard = UIStoryboard(name: "Main", bundle: nil)
            let vc = storyboard.instantiateViewController(identifier: "NavController")
            vc.tabBarItem = UITabBarItem(tabBarSystemItem: .topRated, tag: 1)
            tabBarController.viewControllers?.append(vc)
        guard let _ = (scene as? UIWindowScene) else { return }
        }
    }

8      

I had this to and I was not able to see that top rated button as well and had lot of errors. How did you find out that if you go to the SceneDelegate.swift this will work? I've noticed that "window" property was missing from AppDelegate.swift. and had "@main"

Did you guys get the same error in the debug console?

2021-04-13 22:45:52.977330+0100 Project7 -White House Petitions App[3394:190540] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service 2021-04-13 22:45:55.937242+0100 Project7 -White House Petitions App[3394:190540] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service 2021-04-13 22:45:55.981992+0100 Project7 -White House Petitions App[3394:190540] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service 2021-04-13 22:45:58.502818+0100 Project7 -White House Petitions App[3394:190540] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service 2021-04-13 22:45:58.545459+0100 Project7 -White House Petitions App[3394:190540] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service

3      

Guys, On iOS 13 (and up), the scene delegate takes over some of the roles of the app delegate. :)) Read here for more information:

A scene delegate’s most important function is scene(:willConnectTo:options:). In a way, it’s most similar to the role of the application(:didFinishLaunchingWithOptions:) function of the app delegate. This function is called when a scene is added to the app, so it’s the perfect point to configure that scene. In the above code, we’re manually setting up the view controller stack, but more about that later.

https://learnappmaking.com/scene-delegate-app-delegate-xcode-11-ios-13/

5      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.