PlaceChanger
class PlaceChanger
The PlaceChanger
-
The places configuration
Declaration
Swift
private let placesConfiguration: STLocationRequestController.Configuration.Places -
OnChangePlace Closure
Declaration
Swift
private let onChangePlace: ChangePlace -
The random numbers array
Declaration
Swift
private var randomNumbers: [Int] -
The timer
Declaration
Swift
private var timer: Timer? -
The places
Declaration
Swift
private lazy var places: [CLLocationCoordinate2D] { get set }
-
Default initializer with places configuration and onChangePlace closure
Declaration
Swift
init(placesConfiguration: STLocationRequestController.Configuration.Places, onChangePlace: @escaping ChangePlace)Parameters
placesConfigurationThe places configration
onChangePlaceThe onChangePlace closure
-
Start PlaceChanger
Declaration
Swift
func start() -
Stop PlaceChanger
Declaration
Swift
func stop()
-
Change place with random selected place
Declaration
Swift
@objc private func changePlace(timer: Timer?)Parameters
timerThe timer
-
Get a random Index from an given array without repeating an index
Declaration
Swift
private func randomSequenceGenerator(min: Int, max: Int) -> () -> IntParameters
minmin. value
maxmax. value
Return Value
random integer (without a repeating random int)
View on GitHub
PlaceChanger Class Reference