Created
April 11, 2016 23:18
-
-
Save jaybuangan/1a8c020ac2b2b213928bc2afa865be22 to your computer and use it in GitHub Desktop.
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
import UIKit | |
import Firebase | |
import DZNWebViewController | |
class HomeViewController: UIViewController { | |
@IBOutlet weak var tableView: UITableView! | |
let firebaseRef = Firebase(url:"") | |
weak var webModalNC: UINavigationController? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
... | |
} | |
override func viewWillAppear(animated: Bool) { | |
self.tabBarController?.tabBar.hidden = false | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
} | |
extension HomeViewController: ShowSourceModalDelegate { | |
func showSource(url: String) { | |
let vc = DZNWebViewController(URL: NSURL(string: url)!) | |
self.webModalNC = UINavigationController(rootViewController: vc) | |
vc.supportedWebNavigationTools = DZNWebNavigationTools.All | |
vc.supportedWebActions = DZNsupportedWebActions.DZNWebActionAll | |
vc.showLoadingProgress = true | |
vc.hideBarsWithGestures = true | |
vc.showPageTitleAndURL = true | |
let closeButton = UIBarButtonItem(title: "Close", style: .Plain, target: self, action: #selector(HomeViewController.closeWebModal)) | |
vc.navigationItem.rightBarButtonItem = closeButton | |
if let webModal = self.webModalNC { | |
print(webModal) | |
self.presentViewController(webModal, animated: true, completion: nil) | |
} | |
} | |
func closeWebModal(){ | |
self.webModalNC!.dismissViewControllerAnimated(true, completion: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment