From 6105a9454adb2184abc4134c92af12cee8f9799f Mon Sep 17 00:00:00 2001 From: Alexander Heinrich Date: Fri, 6 Aug 2021 11:19:04 +0200 Subject: [PATCH] Updating preview for better control of Screenshots --- .../HaystackApp/Model/PreviewData.swift | 16 +++++++++++++--- OpenHaystack/OpenHaystack/OpenHaystackApp.swift | 5 +++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/OpenHaystack/OpenHaystack/HaystackApp/Model/PreviewData.swift b/OpenHaystack/OpenHaystack/HaystackApp/Model/PreviewData.swift index faa6c3d..a76815e 100644 --- a/OpenHaystack/OpenHaystack/HaystackApp/Model/PreviewData.swift +++ b/OpenHaystack/OpenHaystack/HaystackApp/Model/PreviewData.swift @@ -19,10 +19,10 @@ struct PreviewData { static let latitude: Double = 49.878046 static let longitude: Double = 8.656993 - static func randomLocation() -> CLLocation { + static func randomLocation(lat: Double = latitude, lng: Double = longitude, distance: Double = 0.005) -> CLLocation { return CLLocation( - latitude: latitude + Double.random(in: 0..<0.005) * (Bool.random() ? -1 : 1), - longitude: longitude + Double.random(in: 0..<0.005) * (Bool.random() ? -1 : 1) + latitude: lat + Double.random(in: 0..