A
A
Archakov Dennis2016-05-14 23:44:06
Swift
Archakov Dennis, 2016-05-14 23:44:06

Swift: Why does the ViewController display crooked?

What is the problem? Why is it crooked?
ebcb8ceb408b463a9a9af767957ff777.gif
The code is like this:

let detailView = DetailController() as UIViewController
self.navigationController?.pushViewController(detailView, animated: true)

And when I do this, it is normally displayed, but the window appears from the bottom up. And I want it to be from left to right (according to the standard).
self.performSegueWithIdentifier("showDetail", sender: self)

The code for the second controller is:
import Foundation
import UIKit

class DetailController: UIViewController {
    
    var fullname = "";
    
    @IBOutlet weak var fullnameLabel: UILabel!
    
    @IBOutlet weak var lbFullName: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.lbFullName?.text = fullname
    }
    
    
    
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Makaveli, 2016-05-23
@archakov06

Look at your StoryBoard, there, when choosing your segue, there is a choice of how to show - from left to right or from top to bottom.
Plus, left to right can only be done if a Navigation Controller is used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question