[Swift 4] Error in Xcode Edition


1.  If You have Problem in Debug area and error comment like this - > reason 'pushing a navigation controller is not supported' swift.  In my problem i fix type class like this code below

Try this solution

Error condition :

import UIKit

class SecondViewController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }

}

Fix Condition :

import UIKit

class SecondViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }

}


2  If you found this error  “ Thread 1: Fatal error: Unexpectedly found
nil while unwrapping an Optional value ” , you can change optional " ! " to optional " ? ". This code example

Error condition

print ( data.item !) 

Fix condition




print ( data.item ?? “” ) // String 
print ( data.item ?? 0 ) // Int 


Next Update If i Found Error in my code











No comments: