39 lines
953 B
Swift
39 lines
953 B
Swift
//
|
|
// EventModel.swift
|
|
// AutoCat
|
|
//
|
|
// Created by Selim Mustafaev on 11.12.2024.
|
|
// Copyright © 2024 Selim Mustafaev. All rights reserved.
|
|
//
|
|
|
|
import CoreLocation
|
|
|
|
struct EventModel: Identifiable, Hashable {
|
|
|
|
let id: String
|
|
var date: String
|
|
var coordinate: CLLocationCoordinate2D
|
|
var address: String
|
|
var isMe: Bool
|
|
|
|
func hash(into hasher: inout Hasher) {
|
|
|
|
hasher.combine(id)
|
|
hasher.combine(date)
|
|
hasher.combine(coordinate.latitude)
|
|
hasher.combine(coordinate.longitude)
|
|
hasher.combine(address)
|
|
hasher.combine(isMe)
|
|
}
|
|
|
|
static func == (lhs: EventModel, rhs: EventModel) -> Bool {
|
|
|
|
lhs.id == rhs.id
|
|
&& lhs.date == rhs.date
|
|
&& lhs.coordinate.latitude == rhs.coordinate.latitude
|
|
&& lhs.coordinate.longitude == rhs.coordinate.longitude
|
|
&& lhs.address == rhs.address
|
|
&& lhs.isMe == rhs.isMe
|
|
}
|
|
}
|