This file contains hidden or 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
["rgb(0, 1, 2)", "rgb(0, 1, 2)", "rgb(0, 1, 2)", "rgb(0, 1, 2)", "rgb(0, 1, 2)"] | |
.map((e) => "#" + e.style.borderTopColor | |
.replace(/rgb/g, '') | |
.replace(/\(/g,'') | |
.replace(/\)/g,'') | |
.replace(/ /g,'') | |
.split(',') | |
.map((e) => ("0" + parseInt(e).toString(16)).slice(-2)) | |
.join('')) | |
.join(" "); |
This file contains hidden or 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 | |
extension UIStoryboard { | |
static func mainInstantiate<T>(withViewController type: T.Type) -> T where T: UIViewController { | |
let storyboard = UIStoryboard(name: "Main", bundle: nil) | |
guard let controller = storyboard.instantiateViewController(withIdentifier: type.storyboardIdentifier) as? T else { | |
fatalError("Could not instantiate view controller with type \(T.self)") | |
} | |
return controller |
OlderNewer