Skip to content

Instantly share code, notes, and snippets.

View gmoraleda's full-sized avatar

Guillermo Moraleda gmoraleda

View GitHub Profile
func setup(date: Date) {
self.date = date
updateInterface() // Setup view with strings, colours, etc.
}
init(date: Date, frame: CGRect) {
super.init(frame: frame)
// Do stuff with Date
}
@gmoraleda
gmoraleda / Car.swift
Last active October 3, 2018 09:35
Car.swift
internal var oldImageUrl: URL? {
return URL(string: carImageUrl ?? "")
}
internal var newImageUrl: URL? {
let urlString = Constants.URL.images
.replacingOccurrences(of: "{modelIdentifier}", with: modelIdentifier ?? "")
.replacingOccurrences(of: "{color}", with: color ?? "")
return URL(string: urlString)