Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- class Model {
- func action() {
- genericPrint(self.dynamicType.self, self)
- }
- }
- class Child: Model {
- func indirect() {
- action()
- }
- }
- func genericPrint<T: Model>(type: T.Type, input: T) -> T? {
- dump(NSStringFromClass(type))
- dump(NSStringFromClass(T))
- return input
- }
- Child().indirect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement