How do I declare a variable that has a type and implements a protocol?

I think you can get there by adding an (empty) extension to UIViewController and then specifying your detailViewController attribute using a composed protocol of the empty extension and your DetailViewController. Like this: protocol UIViewControllerInject {} extension UIViewController : UIViewControllerInject {} Now all subclasses of UIViewController satisfy protocol UIViewControllerInject. Then with that, simply: typealias DetailViewControllerComposed = … Read more

shorthand http:// as // for script and link tags? anyone see / use this before?

Starting a URL with // means “Use a different server but keep the same scheme” So if you load //example.net/script from https://example.com/ it will get https://example.net/script, while if you load it from http://example.com/ it will get http://example.net/script. If, on the other hand, you load it from file://c:/Users/You/Documents/test.html then it will probably not resolve to anything … Read more