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
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 | |
} |
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
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 | |
} |
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
//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() { |
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
//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) |
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
#!/bin/bash | |
clone_encryption_sdk() { | |
echo '--------------------------------------------------' | |
echo 'Cloning EncryptionSDK' | |
echo '--------------------------------------------------' | |
git clone https://github.com/XYCompany/EncryptionSDK.git | |
} | |
clone_utilities() { |
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
#!/bin/bash | |
update_encryption_sdk() { | |
echo '--------------------------------------------------' | |
echo 'Running Carthage update on EncryptionSDK' | |
echo '--------------------------------------------------' | |
cd ../encryption-sdk/ | |
run_carthage_update | |
} |
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
#!/bin/bash | |
HARDWARE="iphonesimulator" | |
CONFIGURATION="Debug" | |
for i in "$@"; do | |
if [ "$i" = "all" ] | |
then | |
echo "====== Building all Frameworks ======" | |
xcodebuild -project encryption-sdk/EncryptionSDK.xcodeproj -configuration $CONFIGURATION -sdk $HARDWARE -scheme EncryptionSDK |
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
#!/bin/bash | |
clone_repos() { | |
./clone_repos.sh all | |
} | |
carthage_update() { | |
./carthage_update.sh all | |
} |
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
protocol KeyboardDisplayChangeProtocol { | |
func addKeyboardObserver(on view: UIView) | |
func removeKeyboardObserver() | |
} | |
public class KBTableView: UITableView { | |
weak var view: UIView? | |
public func addKeyboardObserver(on view: UIView) { |
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
class RegistrationViewController: UIViewController, KeyboardDisplayChangeProtocol, UITableViewDelegate, UITableViewDataSource { | |
public enum FormField: String { | |
case name = "Name" | |
case surname = "Surname" | |
case age = "Age" | |
case email = "Email" | |
case telephone = "Telephone" | |
case username = "Username" | |
case password = "Password" |
OlderNewer