Skip to content

Commit

Permalink
Fix warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBarnegren committed Sep 11, 2021
1 parent f0a1ce8 commit 9e0e29b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 26 deletions.
16 changes: 6 additions & 10 deletions PhysicsDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,13 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = VAA3W4LPY2;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = PhysicsDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = stevebarnegren.PhysicsDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -610,15 +608,13 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = VAA3W4LPY2;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = PhysicsDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = stevebarnegren.PhysicsDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -639,7 +635,7 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = stevebarnegren.PhysicsDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -661,7 +657,7 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = stevebarnegren.PhysicsDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion PhysicsDemo/Input Handlers/InputHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct InputHandlerContext {
let simulationSize: Vector2D
}

protocol InputHandlerDelegate: class {
protocol InputHandlerDelegate: AnyObject {
func inputHandlerDidFinish(handler: InputHandler)
}

Expand Down
2 changes: 0 additions & 2 deletions PhysicsDemo/Input Handlers/InputHandlerAddPolyline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ class InputHandlerAddPolyline: InputHandler {
enterPressed(simulation: simulation)
case .esc:
escapePressed()
default:
break
}
}

Expand Down
2 changes: 1 addition & 1 deletion PhysicsDemo/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import AppKit

protocol KeyHandler: class {
protocol KeyHandler: AnyObject {
func keyDown(with event: NSEvent)
func flagsChanged(with event: NSEvent)
func cancelOperation(_ sender: Any?)
Expand Down
2 changes: 1 addition & 1 deletion PhysicsDemo/SimulationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SBSwiftUtils

private let lineThickness = 2.0

protocol SimulationViewDelegate: class {
protocol SimulationViewDelegate: AnyObject {
func mouseDown(at location: Vector2D)
func mouseDragged(to location: Vector2D)
func mouseUp(at location: Vector2D)
Expand Down
16 changes: 8 additions & 8 deletions PhysicsDemo/UIVariable/UIVariableViewDouble.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class UIVariableViewDouble: NSView {
titleLabel = NSTextField(labelWithString: variable.name)
titleLabel.alignment = .center
addSubview(titleLabel)
titleLabel.pinToSuperviewLeft(margin: 0)
titleLabel.pinToSuperviewRight(margin: 0)
titleLabel.pinToSuperviewTop(margin: 0)
titleLabel.pinToSuperviewLeft(0)
titleLabel.pinToSuperviewRight(0)
titleLabel.pinToSuperviewTop(0)

// Slider
slider = NSSlider(value: variable.get(),
Expand All @@ -38,18 +38,18 @@ class UIVariableViewDouble: NSView {
action: #selector(sliderValueChanged))
addSubview(slider)
slider.pinBelowView(titleLabel, separation: 8)
slider.pinToSuperviewLeft(margin: 0)
slider.pinToSuperviewRight(margin: 0)
slider.pinToSuperviewLeft(0)
slider.pinToSuperviewRight(0)
slider.pinWidth(500, priority: UILayoutPriority(251))

// Readout
readoutLabel = NSTextField(labelWithString: "")
readoutLabel.alignment = .center
addSubview(readoutLabel)
readoutLabel.pinBelowView(slider)
readoutLabel.pinToSuperviewLeft(margin: 0)
readoutLabel.pinToSuperviewRight(margin: 0)
readoutLabel.pinToSuperviewBottom(margin: 0)
readoutLabel.pinToSuperviewLeft(0)
readoutLabel.pinToSuperviewRight(0)
readoutLabel.pinToSuperviewBottom(0)

updateReadoutLabel()
}
Expand Down
6 changes: 3 additions & 3 deletions PhysicsDemo/UIVariable/VariablesPanelView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class VariablesPanelView: NSView {
if let last = lastView {
newView.pinBelowView(last)
} else {
newView.pinToSuperviewTop(margin: 0)
newView.pinToSuperviewTop(0)
}

newView.pinToSuperviewLeft(margin: 0)
newView.pinToSuperviewRight(margin: 0)
newView.pinToSuperviewLeft(0)
newView.pinToSuperviewRight(0)
lastView = newView
}

Expand Down

0 comments on commit 9e0e29b

Please sign in to comment.