Skip to content

Instantly share code, notes, and snippets.

@adamkuipers
Last active December 14, 2015 23:37
Show Gist options
  • Save adamkuipers/6330b53b8b025a3a7717 to your computer and use it in GitHub Desktop.
Save adamkuipers/6330b53b8b025a3a7717 to your computer and use it in GitHub Desktop.
import UIKit
protocol Bar {
var layoutOrientation: NSTextLayoutOrientation { get }
}
extension Bar {
var layoutOrientation: NSTextLayoutOrientation {
return .Horizontal
}
}
class Foo: NSTextLayoutOrientationProvider, Bar {}
func showOrientation(provider: NSTextLayoutOrientationProvider) -> NSTextLayoutOrientation {
return provider.layoutOrientation
}
showOrientation(Foo())
/**
2015-12-14 15:36:35.943 Protocols[77955:7131216] *** NSForwarding: warning: object 0x7fa592426b40 of class '__lldb_expr_328.Foo' does not implement methodSignatureForSelector: -- trouble ahead
Unrecognized selector -[__lldb_expr_328.Foo layoutOrientation]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment