Skip to content

Commit c3d85a7

Browse files
fixup! Fix swift lint build warnings
1 parent ce8a8e6 commit c3d85a7

7 files changed

+28
-12
lines changed

OpenGpxTracker/AppDelegate.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
117117

118118
var failureReason = "There was an error creating or loading the application's saved data."
119119
do {
120-
try coordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: url, options: [NSMigratePersistentStoresAutomaticallyOption: true, NSInferMappingModelAutomaticallyOption: true])
120+
try coordinator.addPersistentStore(ofType: NSSQLiteStoreType,
121+
configurationName: nil,
122+
at: url,
123+
options: [NSMigratePersistentStoresAutomaticallyOption: true,
124+
NSInferMappingModelAutomaticallyOption: true])
121125
} catch {
122126
// Report any error we got.
123127
var dict = [String: AnyObject]()

OpenGpxTracker/CoreDataHelper.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,9 @@ class CoreDataHelper {
660660
DispatchQueue.main.sync {
661661
print(root.gpx())
662662
// main action sheet setup
663-
let alertController = UIAlertController(title: NSLocalizedString("CONTINUE_SESSION_TITLE", comment: "no comment"), message: NSLocalizedString("CONTINUE_SESSION_MESSAGE", comment: "no comment"), preferredStyle: .actionSheet)
663+
let alertController = UIAlertController(title: NSLocalizedString("CONTINUE_SESSION_TITLE", comment: "no comment"),
664+
message: NSLocalizedString("CONTINUE_SESSION_MESSAGE", comment: "no comment"),
665+
preferredStyle: .actionSheet)
664666

665667
// option to cancel
666668
let cancelAction = UIAlertAction(title: NSLocalizedString("CANCEL", comment: "no comment"), style: .cancel) { _ in

OpenGpxTracker/Date+timeAgo.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ extension Date {
2929

3030
let unitFlags: Set<Calendar.Component> = [.minute, .hour, .day, .weekOfMonth, .month, .year, .second]
3131
let components: DateComponents = calendar.dateComponents(unitFlags, from: earliest, to: latest)
32-
//print("")
33-
//print(components)
3432
if let year = components.year {
3533
if year >= 2 {
3634
return String(format: NSLocalizedString("T_YEARS_AGO", comment: "no comment"), year)
@@ -42,7 +40,9 @@ extension Date {
4240
if month >= 2 {
4341
return String(format: NSLocalizedString("T_MONTHS_AGO", comment: "no comment"), month)
4442
} else if month >= 1 {
45-
return numericDates ? NSLocalizedString("T_MONTH_AGO", comment: "no comment") : NSLocalizedString("T_LAST_MONTH", comment: "no comment")
43+
let monthAgo = NSLocalizedString("T_MONTH_AGO", comment: "no comment")
44+
let lastMonth = NSLocalizedString("T_LAST_MONTH", comment: "no comment")
45+
return numericDates ? monthAgo : lastMonth
4646
}
4747
}
4848
if let weekOfMonth = components.weekOfMonth {

OpenGpxTracker/GPXFilesTableViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ class GPXFilesTableViewController: UITableViewController, UINavigationBarDelegat
6262
addNotificationObservers()
6363

6464
// Button to return to the map
65-
let shareItem = UIBarButtonItem(title: NSLocalizedString("DONE", comment: "no comment"), style: UIBarButtonItem.Style.plain, target: self, action: #selector(GPXFilesTableViewController.closeGPXFilesTableViewController))
65+
let shareItem = UIBarButtonItem(title: NSLocalizedString("DONE", comment: "no comment"),
66+
style: UIBarButtonItem.Style.plain,
67+
target: self,
68+
action: #selector(GPXFilesTableViewController.closeGPXFilesTableViewController))
6669

6770
self.navigationItem.rightBarButtonItems = [shareItem]
6871

OpenGpxTracker/PreferencesTableViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ class PreferencesTableViewController: UITableViewController, UINavigationBarDele
205205
let dateFormatter = DefaultDateFormat()
206206
cell = UITableViewCell(style: .subtitle, reuseIdentifier: "DefaultNameCell")
207207
cell.textLabel?.text = preferences.dateFormatPreset == -1 ? preferences.dateFormatInput : preferences.dateFormatPresetName
208-
let dateText = dateFormatter.getDate(processedFormat: preferences.dateFormat, useUTC: preferences.dateFormatUseUTC, useENLocale: preferences.dateFormatUseEN)
208+
let dateText = dateFormatter.getDate(processedFormat: preferences.dateFormat,
209+
useUTC: preferences.dateFormatUseUTC,
210+
useENLocale: preferences.dateFormatUseEN)
209211
cell.detailTextLabel?.text = dateText
210212
cell.accessoryType = .disclosureIndicator
211213
}

OpenGpxTracker/ViewController.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate {
737737
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
738738
super.viewWillTransition(to: size, with: coordinator)
739739

740-
DispatchQueue.main.async() {
740+
DispatchQueue.main.async {
741741
// set the new position of the compass.
742742
self.map.compassRect = CGRect(x: size.width/2 - 18, y: 70.0, width: 36, height: 36)
743743
// update compass frame location
@@ -1174,13 +1174,18 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate {
11741174
if isDisplayingLocationServicesDenied {
11751175
return // display it only once.
11761176
}
1177-
let alertController = UIAlertController(title: NSLocalizedString("ACCESS_TO_LOCATION_DENIED", comment: "no comment"), message: NSLocalizedString("ALLOW_LOCATION", comment: "no comment"), preferredStyle: .alert)
1178-
let settingsAction = UIAlertAction(title: NSLocalizedString("SETTINGS", comment: "no comment"), style: .default) { (action) in
1177+
let alertController = UIAlertController(title: NSLocalizedString("ACCESS_TO_LOCATION_DENIED", comment: "no comment"),
1178+
message: NSLocalizedString("ALLOW_LOCATION", comment: "no comment"),
1179+
preferredStyle: .alert)
1180+
let settingsAction = UIAlertAction(title: NSLocalizedString("SETTINGS", comment: "no comment"),
1181+
style: .default) { _ in
11791182
if let url = URL(string: UIApplication.openSettingsURLString) {
11801183
UIApplication.shared.openURL(url)
11811184
}
11821185
}
1183-
let cancelAction = UIAlertAction(title: NSLocalizedString("CANCEL", comment: "no comment"), style: .cancel) { (action) in }
1186+
let cancelAction = UIAlertAction(title: NSLocalizedString("CANCEL",
1187+
comment: "no comment"),
1188+
style: .cancel) { _ in }
11841189

11851190
alertController.addAction(settingsAction)
11861191
alertController.addAction(cancelAction)

OpenGpxTrackerTests/OpenGpxTrackerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class OpenGpxTrackerTests: XCTestCase {
2828

2929
func testPerformanceExample() {
3030
// This is an example of a performance test case.
31-
self.measure() {
31+
self.measure {
3232
// Put the code you want to measure the time of here.
3333
}
3434
}

0 commit comments

Comments
 (0)