Skip to content

Commit

Permalink
Merge pull request #2 from scottdensmore/scottdensmore/fix-warnings
Browse files Browse the repository at this point in the history
Fix Swiftlint Warnings
  • Loading branch information
scottdensmore authored Nov 14, 2021
2 parents 5e422c0 + 63317a5 commit 8257af0
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 8 deletions.
78 changes: 78 additions & 0 deletions Hadge.xcodeproj/xcshareddata/xcschemes/Hadge.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4DB3F6732453F7AC004C8BF3"
BuildableName = "Hadge.app"
BlueprintName = "Hadge"
ReferencedContainer = "container:Hadge.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4DB3F6732453F7AC004C8BF3"
BuildableName = "Hadge.app"
BlueprintName = "Hadge"
ReferencedContainer = "container:Hadge.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4DB3F6732453F7AC004C8BF3"
BuildableName = "Hadge.app"
BlueprintName = "Hadge"
ReferencedContainer = "container:Hadge.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion Hadge/Controllers/WorkoutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class WorkoutViewController: EntireTableViewController {
}

// Split calculation (not finished yet)
//Health.shared().splitsDataSource?.calculateSplits(workout: workout!)
// Health.shared().splitsDataSource?.calculateSplits(workout: workout!)
}

func heartRateToString(_ heartRate: HKQuantity?) -> String {
Expand Down
4 changes: 2 additions & 2 deletions Hadge/Helpers/BackgroundTaskHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ class BackgroundTaskHelper {

func sendNotification(_ badge: Int) {
let notificationContent = UNMutableNotificationContent()
//notificationContent.title = "Hadge"
//notificationContent.body = "Steps walked: \(badge)"
// notificationContent.title = "Hadge"
// notificationContent.body = "Steps walked: \(badge)"
notificationContent.badge = NSNumber(value: badge)

let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10.0, repeats: false)
Expand Down
2 changes: 1 addition & 1 deletion Hadge/Models/Health.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Health {
let anchorDate = calendar.date(from: anchorComponents)

let query = HKStatisticsCollectionQuery(quantityType: quantity, quantitySamplePredicate: nil, options: .cumulativeSum, anchorDate: anchorDate!, intervalComponents: interval as DateComponents)
query.initialResultsHandler = {query, results, error in
query.initialResultsHandler = {_, results, _ in
guard let results = results else {
completionHandler(nil)
return
Expand Down
2 changes: 1 addition & 1 deletion Hadge/Models/SplitsDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SplitsDataSource {
var lastEnd = workout.startDate
var splits: [[String]] = []

for (index, element) in distanceSamples.enumerated() { //where element.device?.model == "Watch" {
for (index, element) in distanceSamples.enumerated() { // where element.device?.model == "Watch" {
let duration = self.getDurationAjustedForPauses(pauses, currentSample: element, lastDate: lastEnd)
let distance = element.quantity.doubleValue(for: HKUnit.meter())
let speed = distance / duration
Expand Down
2 changes: 1 addition & 1 deletion Hadge/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Uncomment if we need the scene
//guard let windowScene = (scene as? UIWindowScene) else { return }
// guard let windowScene = (scene as? UIWindowScene) else { return }

// Prepare GitHub Auth
GitHub.shared().prepare()
Expand Down
4 changes: 2 additions & 2 deletions Hadge/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class WorkoutsViewController: UIViewController, UITableViewDataSource, UITableVi
}

// Debug stuff, will remove later
//GitHub.shared().getRepository()
//GitHub.shared().updateFile(path: "README.md", content: "This repo is automatically updated by Hadge.app", message: "Update from Hadge.app")
// GitHub.shared().getRepository()
// GitHub.shared().updateFile(path: "README.md", content: "This repo is automatically updated by Hadge.app", message: "Update from Hadge.app")
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
Expand Down

0 comments on commit 8257af0

Please sign in to comment.