Last active
November 29, 2016 12:32
-
-
Save xremix/2a3033f0513ffa3742348148a18734dd to your computer and use it in GitHub Desktop.
UIViewController Playground for Swift 3.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Big thanks to Pretz | |
import UIKit | |
let vc = UIViewController() | |
vc.view.backgroundColor = .white | |
vc.navigationItem.title = "This is a view controller" | |
let searchController = UISearchController(searchResultsController: nil) | |
searchController.searchBar.barTintColor = UIColor.orange | |
searchController.searchBar.tintColor = UIColor.green | |
UITextField.appearance(whenContainedInInstancesOf:[UISearchBar.self]).backgroundColor = UIColor.white.withAlphaComponent(0.8) | |
vc.navigationItem.titleView = searchController.searchBar | |
let w = UIWindow(frame: CGRect(x: 0, y: 0, width: 320, height: 480)) | |
let nc = UINavigationController(rootViewController: vc) | |
w.rootViewController = nc | |
nc.view.frame | |
//nc.view.frame = CGRectMake(0, 0, 320, 480) | |
nc.navigationBar.barStyle = .black | |
nc.navigationBar.barTintColor = UIColor(red:0.16, green:0.45, blue:0.72, alpha:1) | |
nc.navigationBar.tintColor = .white | |
nc.view.setNeedsDisplay() | |
w.makeKeyAndVisible() | |
w | |
nc.navigationBar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment