Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

pushviewcontroller swift autolayout

//call in ViewdidLoad or in Button as
button.addTarget(self, action: #selector(backButtonAction), for: .touchUpInside)
button.addTarget(self, action: #selector(nextButtonAction), for: .touchUpInside)


//Next button Action
@objc func nextButtonAction(){
        let vc2 = SecondViewController()
        self.navigationController?.pushViewController(vc2, animated: true)
    }
//back button action
@objc func backButtonAction(){
        self.navigationController?.popViewController(animated: true)
    }

//if you are not using Storyboard
//also Verify in SceneDelegate 
var window: UIWindow?//verify
    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
      
      
      let navController = UINavigationController(rootViewController: FirstViewController())
        navController.setNavigationBarHidden(true, animated: true)
        
        window = UIWindow(frame: windowScene.coordinateSpace.bounds)
        window?.makeKeyAndVisible()
        window?.windowScene = windowScene
        window?.rootViewController = navController
	}
Comment

PREVIOUS NEXT
Code Example
Swift :: cgrect swift 
Swift :: localized string format swift 
Swift :: get request swift 
Swift :: swift uipickerview 
Swift :: swiftui navigationview ignore top space 
Swift :: use of map instad of for loop 
Swift :: uicolor from hex swift 
Swift :: swift swipe gesture 
Swift :: save codable in userdefaults ios swift 
Swift :: how to check object is nil in swift 
Swift :: swift test if simulator 
Swift :: get class name swift 
Swift :: swiftui pull to refresh 
Swift :: dismiss two view controllers at once swift 
Swift :: show back button in navbar swift 
Swift :: swift print 
Swift :: swift alert toast 
Swift :: change image tint color swiftui 
Swift :: uiview set inside padding 
Swift :: swift try catch 
Swift :: swift constructor 
Swift :: type String and int swift addition 
Swift :: swift extension Array with specific element type 
Swift :: Swift Swift Function Return Values 
Swift :: two value sum in swift 
Swift :: Swift break with while Loop 
Swift :: swift multiple return values 
Swift :: int in swift 
Swift :: swift core data order by 
Swift :: single word search swift 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =