Skip to content

Instantly share code, notes, and snippets.

View elefantel's full-sized avatar

Mpendulo Ndlovu elefantel

  • MetaMask
  • Cape Town, WC
  • 14:54 (UTC +02:00)
View GitHub Profile
@elefantel
elefantel / clone_repos.sh
Created March 20, 2017 21:48
Clone git repositories
#!/bin/bash
clone_encryption_sdk() {
echo '--------------------------------------------------'
echo 'Cloning EncryptionSDK'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/EncryptionSDK.git
}
clone_utilities() {
//navigate within same module
func navigateToPayment() {
if let controller = AppStoryboard.Transactions.viewController(viewControllerClass: PaymentViewController.self) {
self.navigationController.pushViewController(controller, animated: true)
}
}
//navigate to different module
func navigateToPortfolioDashboard() {
let portfolioModule = Bundle(for: DashboardViewController.self)
//navigate within same module
func navigateToPayment() {
let storyboard = UIStoryboard(name: "Transactions", bundle: nil)
if let controller = storyboard.instantiateViewController(withIdentifier: "PaymentViewController") as? PaymentViewController {
self.navigationController.pushViewController(controller, animated: true)
}
}
//navigate to different module
func navigateToPortfolioDashboard() {
public enum Storyboard: String {
case Analytics, Dashboard, Reporting, Transactions
var instance: UIStoryboard {
return UIStoryboard(name: self.name, bundle: nil)
}
var name: String {
return self.rawValue
}
public extension UIViewController {
class var storyboardID: String {
return "\(self)"
}
public func instantiateViewController<T: UIViewController>(viewControllerClass: T.Type, inStoryboard: String, ofModule: Bundle?) -> T {
let storyboard = UIStoryboard(name: inStoryboard, bundle: ofModule)
return storyboard.instantiateViewController(withIdentifier: viewControllerClass.storyboardID) as! T
}