1

I try to follow by tutorial but this is quite old tutorial and here some issue when you run the app with the view of the app.

enter image description here

There is no images and I rebuild constraints but nothing has changed.

Code of the ViewController:

class MasterViewController: UIViewController {

  @IBOutlet var tableView: UITableView!
  @IBOutlet var searchBar: UISearchBar!

  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if segue.identifier == "showDetail" {
    }
  }

  override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)
    if let selectedIndexPath = self.tableView.indexPathForSelectedRow {
      self.tableView.deselectRowAtIndexPath(selectedIndexPath, animated: true)
    }
  }
}

extension MasterViewController: UITableViewDataSource, UITableViewDelegate {

  func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 1
  }

  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 0
  }

  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
    return cell
  }

  func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
    return true
  }

  func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
  }

}

extension MasterViewController: UISearchBarDelegate {

  func searchBarSearchButtonClicked(searchBar: UISearchBar) {
  }

}

How can I resize it not just for iPhone 4 (or get rid of black areas)?

wm.p1us
  • 2,019
  • 2
  • 27
  • 38

2 Answers2

2

Add the appropriate launch images inside Images.xcassets > LaunchImage for the resolutions that you want to support. For example, for iPhone 5 portrait, the resolution would be 640x1136.

Here is a screenshot of the interface to look for in Xcode:

enter image description here

Daniel Zhang
  • 5,778
  • 2
  • 23
  • 28
0

To resolve the issue, follow the below steps:

  1. Navigate to project settings

  2. Under "App Icons and Launch Images" click on "Use Asset Catalog"

  3. Select "Migrate" on the popup that appears.

This should fix the issue.

Orkhan Alizade
  • 7,379
  • 14
  • 40
  • 79