-4

Unfortunately even I have built this 3 times I am still getting same result and can not understand why.

I expect a white screen with 3 buttoms with a flag drwing on each of them.

but I get only black screen and the error down. I searched for the error and it can be gone but this does not fix the problem of building the app, it is always a black screen.

Ramy Wadia
  • 45
  • 6
  • Did you set an initial view controller? – Muhammed Gül Oct 24 '19 at 22:36
  • There are several possible issues but you have not provided any information about what you are doing. – rmaddy Oct 24 '19 at 22:36
  • @MuhammedGül No I did not, afetr you comment I added it once to the view controlerbut it did not work as I have a navigation controler. set it to the navigation controller but no result. – Ramy Wadia Oct 24 '19 at 22:44
  • @RamyWadia you must be able to set a navigation controller as initial controller with no problem. As other comment suggests you must provide more information about your project. – Muhammed Gül Oct 24 '19 at 22:46
  • Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug. – Ramy Wadia Oct 24 '19 at 22:48
  • @MuhammedGül Navigation controller is initial controller but thr app screen is still black. – Ramy Wadia Oct 24 '19 at 22:50

2 Answers2

0

Does your storyboard look like this? You can control drag from the navigation controller to view controller you wish to set as your root view controller. Also make sure to set the navigation controller as your storyboard entry point.

Also check that your storyboard is correct (default is called "Main") and that you have chosen storyboard as your default interface builder and not swiftUI (unless you wish to use swiftUI).

This link may help: How to set the rootViewController with Swift, iOS 7

enter image description here

ekrenzin
  • 387
  • 2
  • 12
0

It may come from your AppDelegate. Could you show us you AppDelegate ?

Apple introduce SceneDelegate that can impact your AppDelegate. If you don't want to use SceneDelegate, you should define the UIWindow in the AppDelegate :

var window: UIWindow?

and init your variable :

window = UIWindow(frame: UIScreen.main.bounds)

in

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool 

I wish it can help you.