Unverified Commit 845dfecf authored by ASAHI OCEAN's avatar ASAHI OCEAN Committed by GitHub
Browse files

Merge pull request #24 from asahiocean/develop

Develop
parents 64e7b9f1 72521e8d
......@@ -110,7 +110,7 @@ extension ViewController: ModelDelegate {
// MARK: вершины соединены ребрами при условии, что расстояние между вершинами не более 5км
// condition: vertices are connected by edges, provided that the distance between the vertices is no more than 5 km
if locations.distance < 5000 {
let dashline = DashLine(locations: locations)
let dashline = DashLine(with: locations)
// you can also delegate the storage of all vertices and graphs
// to into a separate class in which can their compare for find matches
......
......@@ -4,14 +4,14 @@ import CoreLocation
extension CLLocationCoordinate2D {
public var location: CLLocation {
return CLLocation(latitude: latitude, longitude: longitude)
return .init(latitude: latitude, longitude: longitude)
}
public static func ==(lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool {
public static func ==(lhs: Self, rhs: Self) -> Bool {
return (lhs.latitude == rhs.latitude && lhs.longitude == rhs.longitude)
}
public static func !=(lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool {
public static func !=(lhs: Self, rhs: Self) -> Bool {
return !(lhs == rhs)
}
}
......
......@@ -2,7 +2,7 @@ import Foundation
import MapKit.MKPolyline
extension MKPolyline {
convenience init(locations: [CLLocationCoordinate2D]) {
convenience init(with locations: [CLLocationCoordinate2D]) {
self.init(coordinates: locations, count: locations.count)
}
}
......@@ -5,7 +5,7 @@ extension UIButton {
let animation = CAKeyframeAnimation(keyPath: "transform.translation.x")
animation.timingFunction = .init(name: .linear)
animation.duration = 0.5
animation.values = [-15, 15, -15, 15, -5, 5, -2.5, 2.5, 0]
animation.values = [-15,15,-15,15,-5,5,-2.5,2.5,0]
layer.add(animation, forKey: "shake")
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment