Skip to content

Instantly share code, notes, and snippets.

View Agarunov's full-sized avatar

Anton Agarunov Agarunov

View GitHub Profile
let array1: [String?] = ["Jon", "Snow", nil]
let array2: [String?] = ["Winter", "is", "coming", "!", nil]
array1 == array2 // false
struct Pet {
let name: String
}
let pets = [Pet(name: "Beethoven")]
let encoder = JSONEncoder()
try! encoder.encode(pets)
protocol Sequence {
associatedtype SubSequence: Sequence
where Iterator.Element == SubSequence.Iterator.Element, SubSequence.SubSequence == SubSequence
// code
}