Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created October 15, 2018 11:21
Show Gist options
  • Save vialyx/bfe78b89492b75a62dc6fda171b4b4ac to your computer and use it in GitHub Desktop.
Save vialyx/bfe78b89492b75a62dc6fda171b4b4ac to your computer and use it in GitHub Desktop.
class Media {
var url: String
init(url: String) {
self.url = url
}
}
class Video: Media {
var thumb: String
init(url: String, thumb: String) {
self.thumb = thumb
super.init(url: url)
}
}
let media: Media = Video(url: "http://[email protected]", thumb: "http://[email protected]")
print("Media is Video? \(media is Video)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment