diff --git a/OutRun/Controllers/Settings/DebugController.swift b/OutRun/Controllers/Settings/DebugController.swift index a270012f..fe566cf4 100644 --- a/OutRun/Controllers/Settings/DebugController.swift +++ b/OutRun/Controllers/Settings/DebugController.swift @@ -99,8 +99,8 @@ class DebugController: SettingsViewController { subTitle: String(Config.hasMobileProvision) ), TitleSubTitleSetting( - title: "hasSanboxReceipt", - subTitle: String(Config.hasSanboxReceipt) + title: "hasSandboxReceipt", + subTitle: String(Config.hasSandboxReceipt) ) ] ) diff --git a/OutRun/Controllers/Settings/SettingsViewController.swift b/OutRun/Controllers/Settings/SettingsViewController.swift index eef4c938..03621798 100644 --- a/OutRun/Controllers/Settings/SettingsViewController.swift +++ b/OutRun/Controllers/Settings/SettingsViewController.swift @@ -72,7 +72,7 @@ class SettingsViewController: UITableViewController { if var keyboardAvoidingSetting = setting as? KeyboardAvoidanceSetting { keyboardAvoidingSetting.registerForKeyboardAvoidanceClosure = { cell in - self.cellShouldBeVisisble = cell + self.cellShouldBeVisible = cell } } @@ -107,13 +107,13 @@ class SettingsViewController: UITableViewController { } } - public var cellShouldBeVisisble: UITableViewCell? + public var cellShouldBeVisible: UITableViewCell? private var formerContentOffset: CGPoint? @objc private func keyboardWillShow(_ notification: Notification) { self.formerContentOffset = self.tableView.contentOffset - if let cell = self.cellShouldBeVisisble, let indexPath = self.tableView.indexPath(for: cell), let keyboardHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.height { + if let cell = self.cellShouldBeVisible, let indexPath = self.tableView.indexPath(for: cell), let keyboardHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.height { let offsetHeight = keyboardHeight - self.view.safeAreaInsets.bottom self.tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: offsetHeight, right: 0) self.tableView.scrollToRow(at: indexPath, at: .bottom, animated: true) @@ -133,7 +133,7 @@ class SettingsViewController: UITableViewController { self.tableView.reloadData() } - /// NOTE: This function is supposed to be overridded + /// NOTE: This function is supposed to be overridden func notifyOfPresentation(_ settingsViewController: SettingsViewController) {} } diff --git a/OutRun/Controllers/Workout/EditWorkoutController.swift b/OutRun/Controllers/Workout/EditWorkoutController.swift index cb13651c..3d0d622b 100644 --- a/OutRun/Controllers/Workout/EditWorkoutController.swift +++ b/OutRun/Controllers/Workout/EditWorkoutController.swift @@ -79,7 +79,7 @@ class EditWorkoutController: SettingsViewController { TextInputSetting( title: LS["Workout.Distance"], textFieldText: { - let value = UserPreferences.distanceMeasurementType.convert(fromValue: self.distance ?? 0, toPrefered: true) + let value = UserPreferences.distanceMeasurementType.convert(fromValue: self.distance ?? 0, toPreferred: true) return CustomNumberFormatting.string(from: value, fractionDigits: 2) }(), keyboardType: .decimalPad, @@ -88,7 +88,7 @@ class EditWorkoutController: SettingsViewController { guard let distance = CustomNumberFormatting.number(from: newValue) else { return } - let newValue = UserPreferences.distanceMeasurementType.convert(fromValue: distance, toPrefered: false, rounded: false) + let newValue = UserPreferences.distanceMeasurementType.convert(fromValue: distance, toPreferred: false, rounded: false) self.distance = newValue self.validateData() } @@ -280,7 +280,7 @@ class EditWorkoutController: SettingsViewController { func getWeightBeforeWorkout(for type: Workout.WorkoutType, with distance: Double) -> Double { guard let weight = UserPreferences.weight.value else { return 0.0 } let burnedCalories = BurnedEnergyCalculator.calculateBurnedCalories(for: type, distance: distance, weight: weight) - return BurnedEnergyCalculator.calculeWeightBeforeWorkout(for: type, distance: distance, burnedCal: burnedCalories.doubleValue) + return BurnedEnergyCalculator.calculateWeightBeforeWorkout(for: type, distance: distance, burnedCal: burnedCalories.doubleValue) } func showWorkoutController(workout: Workout) { diff --git a/OutRun/Extensions/Double.swift b/OutRun/Extensions/Double.swift index ab93bc01..864f8cb0 100644 --- a/OutRun/Extensions/Double.swift +++ b/OutRun/Extensions/Double.swift @@ -23,7 +23,7 @@ import Foundation extension Double { /** - Rounds this value to a specified decimal place using the specifed `FloatingPointRoundingRule` + Rounds this value to a specified decimal place using the specified `FloatingPointRoundingRule` - parameter decimalPlaces: the maximum number of decimal places the value should have - parameter rule: the rule by which the value will be rounded */ @@ -33,7 +33,7 @@ extension Double { } /** - Returns this value rounded to a specified decimal place using the specifed `FloatingPointRoundingRule` + Returns this value rounded to a specified decimal place using the specified `FloatingPointRoundingRule` - parameter decimalPlaces: the maximum number of decimal places the value should have - parameter rule: the rule by which the value will be rounded - returns: the rounded value diff --git a/OutRun/Extensions/URL.swift b/OutRun/Extensions/URL.swift index a5330606..79ca2d88 100644 --- a/OutRun/Extensions/URL.swift +++ b/OutRun/Extensions/URL.swift @@ -32,7 +32,7 @@ extension URL { } catch { - print("Failed to calculate size of file at \(self.absoluteString) because an error occured:", error) + print("Failed to calculate size of file at \(self.absoluteString) because an error occurred:", error) return nil } diff --git a/OutRun/Models/Config.swift b/OutRun/Models/Config.swift index bbdad6f3..00f1af38 100644 --- a/OutRun/Models/Config.swift +++ b/OutRun/Models/Config.swift @@ -26,7 +26,7 @@ enum Config { static var releaseStatus: ReleaseStatus { if Config.isDebug || Config.isRunOnSimulator { return ReleaseStatus.debug - } else if /*Config.hasMobileProvision &&*/ Config.hasSanboxReceipt { + } else if /*Config.hasMobileProvision &&*/ Config.hasSandboxReceipt { return ReleaseStatus.beta } else { return ReleaseStatus.release @@ -75,13 +75,13 @@ enum Config { #endif } - /// A boolean indicating wheather the app bundle contains a certain file generated when building and packaging an App for App Store Connect + /// A boolean indicating whether the app bundle contains a certain file generated when building and packaging an App for App Store Connect static var hasMobileProvision: Bool { return (Bundle.main.path(forResource: "embedded", ofType: "mobileprovision") != nil) } /// A boolean indicating whether or not the receipt provided through by the App Store was generated for a sandbox / non-release environment; in other words: it indicates if the app was downloaded through another way than the App Store - static var hasSanboxReceipt: Bool { + static var hasSandboxReceipt: Bool { return Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt" } diff --git a/OutRun/Models/Data/ShareManager.swift b/OutRun/Models/Data/ShareManager.swift index 5e989f19..bcc3f8b0 100644 --- a/OutRun/Models/Data/ShareManager.swift +++ b/OutRun/Models/Data/ShareManager.swift @@ -23,7 +23,7 @@ import CoreGPX enum ShareManager { - /// A funtion displaying the iOS share menu on top of the given controller for a file at the given directory (provided it exists); if `shouldDeleteFileAfter` is set to true, the file at the given path will get deleted once the menu is dismissed, this might be useful if the file is saved at the temporary directory + /// A function displaying the iOS share menu on top of the given controller for a file at the given directory (provided it exists); if `shouldDeleteFileAfter` is set to true, the file at the given path will get deleted once the menu is dismissed, this might be useful if the file is saved at the temporary directory static func displayShareMenu(forFileAt url: URL?, on controller: UIViewController, shouldDeleteFileAfter shouldDelete: Bool = true) { guard let url = url else { diff --git a/OutRun/Models/HealthKit/HealthObserver.swift b/OutRun/Models/HealthKit/HealthObserver.swift index 71f71585..3c67e53e 100644 --- a/OutRun/Models/HealthKit/HealthObserver.swift +++ b/OutRun/Models/HealthKit/HealthObserver.swift @@ -80,8 +80,8 @@ enum HealthObserver { } var count = 0 queryObjects.forEach { (queryObject) in - HealthQueryManager.getAndAttatchRoute(to: queryObject) { - HealthQueryManager.getAndAttatchSteps(to: queryObject) { + HealthQueryManager.getAndAttachRoute(to: queryObject) { + HealthQueryManager.getAndAttachSteps(to: queryObject) { // not fully implemented yet //HealthQueryManager.getAndAttachHeartRate(to: queryObject) { count += 1 diff --git a/OutRun/Models/HealthKit/HealthQueryManager.swift b/OutRun/Models/HealthKit/HealthQueryManager.swift index 1044ec98..353a8f38 100644 --- a/OutRun/Models/HealthKit/HealthQueryManager.swift +++ b/OutRun/Models/HealthKit/HealthQueryManager.swift @@ -77,8 +77,8 @@ enum HealthQueryManager { return } queryObjects.append(queryObject) - HealthQueryManager.getAndAttatchRoute(to: queryObject) { - HealthQueryManager.getAndAttatchSteps(to: queryObject) { + HealthQueryManager.getAndAttachRoute(to: queryObject) { + HealthQueryManager.getAndAttachSteps(to: queryObject) { // not fully implemented //HealthQueryManager.getAndAttachHeartRate(to: queryObject) { count += 1 @@ -101,8 +101,8 @@ enum HealthQueryManager { } } - // MARK: Query Steps and Attatch to Query Object - static func getAndAttatchSteps(to queryObject: HKWorkoutQueryObject, completion: @escaping () -> Void) { + // MARK: Query Steps and Attach to Query Object + static func getAndAttachSteps(to queryObject: HKWorkoutQueryObject, completion: @escaping () -> Void) { let predicate = HKAnchoredObjectQuery.predicateForObjects(from: queryObject.hkWorkout) let stepsQuery = HKAnchoredObjectQuery(type: HealthStoreManager.objectTypeRouteType, predicate: predicate, anchor: nil, limit: HKObjectQueryNoLimit) { (query, stepsSamples, _, _, error) in @@ -124,8 +124,8 @@ enum HealthQueryManager { } - // MARK: Query Route and Attatch to Query Object - static func getAndAttatchRoute(to queryObject: HKWorkoutQueryObject, completion: @escaping () -> Void) { + // MARK: Query Route and Attach to Query Object + static func getAndAttachRoute(to queryObject: HKWorkoutQueryObject, completion: @escaping () -> Void) { let predicate = HKAnchoredObjectQuery.predicateForObjects(from: queryObject.hkWorkout) let routeObjectQuery = HKAnchoredObjectQuery(type: HealthStoreManager.objectTypeRouteType, predicate: predicate, anchor: nil, limit: 1) { (query, routeSamples, _, _, error) in diff --git a/OutRun/Models/HealthKit/HealthStoreManager.swift b/OutRun/Models/HealthKit/HealthStoreManager.swift index af4c9811..dba1cde7 100644 --- a/OutRun/Models/HealthKit/HealthStoreManager.swift +++ b/OutRun/Models/HealthKit/HealthStoreManager.swift @@ -217,7 +217,7 @@ enum HealthStoreManager { } } - // MARK: Attatch Route To Health Workout + // MARK: Attach Route To Health Workout static func attachRoute(to hkWorkout: HKWorkout, with workout: TempWorkout) { let locations = workout.locations.compactMap { (sample) -> CLLocation? in @@ -238,7 +238,7 @@ enum HealthStoreManager { } - // MARK: Attatch Heart Rates To Health Workout + // MARK: Attach Heart Rates To Health Workout static func attachHeartRates(to hkWorkout: HKWorkout, with workout: TempWorkout) { func add(_ samples: [HKSample]) { @@ -495,7 +495,7 @@ enum HealthStoreManager { } - // MARK: Sync All Unsycned Workouts With Apple Health + // MARK: Sync All Unsynced Workouts With Apple Health /// Function to sync all unsynced workouts with the health store, completion returning the success state and the state if all workouts have been synced already static func syncAllUnsyncedWorkoutsWithAppleHealth(completion: @escaping (Bool, Bool?) -> Void) { diff --git a/OutRun/Models/LS.swift b/OutRun/Models/LS.swift index 7008bf9c..7a16c697 100644 --- a/OutRun/Models/LS.swift +++ b/OutRun/Models/LS.swift @@ -20,7 +20,7 @@ import Foundation -/// A struct containg only static subscripts and needed enumerations to enable easier localisation. +/// A struct containing only static subscripts and needed enumerations to enable easier localisation. struct LS { /** @@ -34,7 +34,7 @@ struct LS { let errorValue = "NIL" var localizedString = Bundle.main.localizedString(forKey: key, value: errorValue, table: sourceType.tableName) - // falling back on base language if string for key is not availabe + // falling back on base language if string for key is not available if localizedString == "NIL" { localizedString = sourceType.fallbackBundle.localizedString(forKey: key, value: errorValue, table: sourceType.tableName) } diff --git a/OutRun/Models/ORBanner/ORBannerQueue.swift b/OutRun/Models/ORBanner/ORBannerQueue.swift index 3fe04950..1f1c88d8 100644 --- a/OutRun/Models/ORBanner/ORBannerQueue.swift +++ b/OutRun/Models/ORBanner/ORBannerQueue.swift @@ -69,7 +69,7 @@ public class ORBannerQueue { } /** - Removes an `ORBaseBanner` from the queu + Removes an `ORBaseBanner` from the queue - parameter banner: The banner being removed from the queue */ public func remove(_ banner: ORBaseBanner) { @@ -83,7 +83,7 @@ public class ORBannerQueue { } /** - Displayes (or resumes) the next banner after removing the current banner from the queue + Displays (or resumes) the next banner after removing the current banner from the queue */ public func displayNext() { diff --git a/OutRun/Models/Preferences/MeasurementUserPreference.swift b/OutRun/Models/Preferences/MeasurementUserPreference.swift index 57ba32d7..8ea310a4 100644 --- a/OutRun/Models/Preferences/MeasurementUserPreference.swift +++ b/OutRun/Models/Preferences/MeasurementUserPreference.swift @@ -83,13 +83,13 @@ class MeasurementUserPreference where UnitType: Unit { } } - func convert(fromValue value: Double, toPrefered: Bool, rounded: Bool = true) -> Double { + func convert(fromValue value: Double, toPreferred: Bool, rounded: Bool = true) -> Double { guard let standardUnit = self.standardValue else { return -1 } - let preferedUnit = self.safeValue - let sourceUnit = toPrefered ? standardUnit : preferedUnit - let targetUnit = toPrefered ? preferedUnit : standardUnit + let preferredUnit = self.safeValue + let sourceUnit = toPreferred ? standardUnit : preferredUnit + let targetUnit = toPreferred ? preferredUnit : standardUnit let value = UnitConversion.conversion(of: value, from: sourceUnit, to: targetUnit) return rounded ? ((value * 100).rounded() / 100) : value } diff --git a/OutRun/Models/Settings/SettingsModel.swift b/OutRun/Models/Settings/SettingsModel.swift index 499e4882..2d02f490 100644 --- a/OutRun/Models/Settings/SettingsModel.swift +++ b/OutRun/Models/Settings/SettingsModel.swift @@ -112,7 +112,7 @@ class SettingsModel { guard let weight = UserPreferences.weight.value else { return nil } - let value = UserPreferences.weightMeasurementType.convert(fromValue: weight, toPrefered: true) + let value = UserPreferences.weightMeasurementType.convert(fromValue: weight, toPreferred: true) return CustomNumberFormatting.string(from: value, fractionDigits: 2) }, textFieldPlaceholder: { LS["Settings.Weight"] }, @@ -123,7 +123,7 @@ class SettingsModel { setting.refresh() return } - let weightValue = UserPreferences.weightMeasurementType.convert(fromValue: newValue, toPrefered: false) + let weightValue = UserPreferences.weightMeasurementType.convert(fromValue: newValue, toPreferred: false) UserPreferences.weight.value = weightValue setting.refresh() diff --git a/OutRun/Models/Workout/BurnedEnergyCalculator.swift b/OutRun/Models/Workout/BurnedEnergyCalculator.swift index 0d236b26..49006bd6 100644 --- a/OutRun/Models/Workout/BurnedEnergyCalculator.swift +++ b/OutRun/Models/Workout/BurnedEnergyCalculator.swift @@ -36,7 +36,7 @@ class BurnedEnergyCalculator { return measurement } - static func calculeWeightBeforeWorkout(for type: Workout.WorkoutType, distance: Double, burnedCal: Double) -> Double { + static func calculateWeightBeforeWorkout(for type: Workout.WorkoutType, distance: Double, burnedCal: Double) -> Double { /// burnedCal = kilometers * type.METSpeedMultiplier * weight /// (kilometers * type.METSpeedMultiplier)weight = burnedCal diff --git a/OutRun/Models/Workout/MapManagement/Images/WorkoutMapImageManager.swift b/OutRun/Models/Workout/MapManagement/Images/WorkoutMapImageManager.swift index 381bfc03..082ab84c 100644 --- a/OutRun/Models/Workout/MapManagement/Images/WorkoutMapImageManager.swift +++ b/OutRun/Models/Workout/MapManagement/Images/WorkoutMapImageManager.swift @@ -35,7 +35,7 @@ enum WorkoutMapImageManager { private static let processQueue = DispatchQueue(label: "processQueue", qos: .userInitiated) private static let snapshotQueue = DispatchQueue(label: "snapshotQueue") - /// A funtion for the execution of a WorkoutMapImageRequest, adding it to the running WorkoutMapImageQueue. If cached this method directly executes the closure, not rendering the image again. + /// A function for the execution of a WorkoutMapImageRequest, adding it to the running WorkoutMapImageQueue. If cached this method directly executes the closure, not rendering the image again. /// /// - Parameter request: An instance of WorkoutMapImageRequest indicating the type of image being requested public static func execute(_ request: WorkoutMapImageRequest) { @@ -58,7 +58,7 @@ enum WorkoutMapImageManager { internalStatus = .suspended } - /// A Funtion resuming the rendering process of new map images after it was suspended by `suspendRenderProcess()`. + /// A Function resuming the rendering process of new map images after it was suspended by `suspendRenderProcess()`. public static func resumeRenderProcess() { processQueue.resume() snapshotQueue.resume() diff --git a/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AltitudeManagement.swift b/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AltitudeManagement.swift index 68d8cd2f..26a8b9f2 100644 --- a/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AltitudeManagement.swift +++ b/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AltitudeManagement.swift @@ -92,7 +92,7 @@ extension WorkoutBuilder { /// the data collected by the altimeter consisting of an array of timestamps and their relative altitudes private var altitudeData: [(timestamp: Date, relativeAltitude: Double)] = [] - /// an instance of `CMAltimeter` to measure releative altitude changes + /// an instance of `CMAltimeter` to measure relative altitude changes private let altimeter = CMAltimeter() /** diff --git a/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AutoPauseDetection.swift b/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AutoPauseDetection.swift index 3e459ba3..9c39d359 100644 --- a/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AutoPauseDetection.swift +++ b/OutRun/Models/Workout/WorkoutBuilder/Components/WorkoutBuilder+AutoPauseDetection.swift @@ -30,7 +30,7 @@ extension WorkoutBuilder { /** Updates the AutoPauseDetection instance with new values during a recording - parameter timestamp: the exact date when the data provided was received - - parameter workoutType: the workout type of the current workout being recorded used for further analysis of the cenario and to discard auto pause detection when appropriate + - parameter workoutType: the workout type of the current workout being recorded used for further analysis of the scenario and to discard auto pause detection when appropriate - parameter speed: the speed at the provided moment in meters per second */ public func update(timestamp: Date, workoutType: Workout.WorkoutType, speed: Double) { diff --git a/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+AutoPause.swift b/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+AutoPause.swift index fd1574df..7c3a5464 100644 --- a/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+AutoPause.swift +++ b/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+AutoPause.swift @@ -68,7 +68,7 @@ extension WorkoutBuilder { } /** - Initialises an `AutoPause` object with the provided datesif the start is earlier than the end + Initialises an `AutoPause` object with the provided dates if the start is earlier than the end - parameter start: the start date of the automatic pause - parameter end: the end date of the automatic pause */ diff --git a/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+Status.swift b/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+Status.swift index 661a8126..8359c871 100644 --- a/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+Status.swift +++ b/OutRun/Models/Workout/WorkoutBuilder/WorkoutBuilder+Status.swift @@ -24,7 +24,7 @@ import UIKit extension WorkoutBuilder { /** - Enumaration of the different kind of status the `WorkoutBuilder` can take on + Enumeration of the different kind of status the `WorkoutBuilder` can take on */ enum Status { diff --git a/OutRun/Views/ORBanner/ORBaseBanner.swift b/OutRun/Views/ORBanner/ORBaseBanner.swift index 49c3fd87..dbc66f59 100644 --- a/OutRun/Views/ORBanner/ORBaseBanner.swift +++ b/OutRun/Views/ORBanner/ORBaseBanner.swift @@ -83,7 +83,7 @@ public class ORBaseBanner: UIView { /** Initialises the `ORBaseBanner` with a modified content view - parameter customise: a block being called with reference to this `ORBaseBanner` and the content view of it; this should be used to customise the content view - - note: Views added to the content view inside the customise block should have propper constraints set up or the content view should be assigned a frame + - note: Views added to the content view inside the customise block should have proper constraints set up or the content view should be assigned a frame */ public init(customise: ((ORBaseBanner, UIView) -> Void)? = nil, isDismissable: Bool = true) { @@ -202,7 +202,7 @@ public class ORBaseBanner: UIView { } self.isSuspended = true - self.cancleAutoDismiss() + self.cancelAutoDismiss() self.animate(animations: { @@ -292,7 +292,7 @@ public class ORBaseBanner: UIView { return CGPoint(x: self.spacing, y: self.spacing + (UIApplication.shared.keyWindow?.safeAreaInsets.top ?? 0)) } - /// The start frame of the banner, being the first and last postion of the banner in the display process + /// The start frame of the banner, being the first and last position of the banner in the display process private var calculatedStartFrame: CGRect { return CGRect(origin: self.calculatedStartOrigin, size: self.calculatedSize) } @@ -327,9 +327,9 @@ public class ORBaseBanner: UIView { } /** - Cancles perviously scheduled auto dismisses + Cancels previously scheduled auto dismisses */ - private func cancleAutoDismiss() { + private func cancelAutoDismiss() { NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(dismiss), object: nil)