Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all compiler warnings #301

Merged
merged 5 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions BeeSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1273,10 +1273,7 @@
DEVELOPMENT_TEAM = 8TW9V9HVES;
ENABLE_TESTABILITY = YES;
EXCLUDED_ARCHS = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/build/Debug-iphoneos",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = BeeSwiftToday/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
Expand All @@ -1303,10 +1300,7 @@
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = 8TW9V9HVES;
EXCLUDED_ARCHS = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/build/Debug-iphoneos",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = BeeSwiftToday/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
Expand Down Expand Up @@ -1558,6 +1552,7 @@
E57BE6F82655EBE100BA540B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -1600,6 +1595,7 @@
E57BE6F92655EBE100BA540B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down
4 changes: 2 additions & 2 deletions BeeSwift/ChooseHKMetricViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ChooseHKMetricViewController: UIViewController {
}()

instructionsLabel.snp.makeConstraints { (make) in
make.top.equalTo(self.topLayoutGuide.snp.bottom).offset(20)
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.topMargin).offset(20)
make.centerX.equalTo(self.view)
make.width.equalTo(self.view).multipliedBy(0.85)
}
Expand All @@ -53,7 +53,7 @@ class ChooseHKMetricViewController: UIViewController {
let saveButton = BSButton()
self.view.addSubview(saveButton)
saveButton.snp.makeConstraints { (make) in
make.bottom.equalTo(self.bottomLayoutGuide.snp.top).offset(-20)
make.bottom.equalTo(self.view.safeAreaLayoutGuide.snp.bottomMargin).offset(-20)
make.centerX.equalTo(self.view)
make.width.equalTo(self.view).multipliedBy(0.5)
make.height.equalTo(Constants.defaultTextFieldHeight)
Expand Down
2 changes: 1 addition & 1 deletion BeeSwift/EditDatapointViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class EditDatapointViewController: UIViewController, UITextFieldDelegate {

self.view.addSubview(self.scrollView)
self.scrollView.snp.makeConstraints { (make) -> Void in
make.top.equalTo(self.topLayoutGuide.snp.bottom)
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.topMargin)
make.left.equalTo(0)
make.right.equalTo(0)
make.bottom.equalTo(0)
Expand Down
2 changes: 1 addition & 1 deletion BeeSwift/EditGoalNotificationsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EditGoalNotificationsViewController : EditNotificationsViewController {
useDefaultsLabel.text = "Use defaults"
self.view.addSubview(useDefaultsLabel)
useDefaultsLabel.snp.makeConstraints { (make) -> Void in
make.top.equalTo(self.topLayoutGuide.snp.bottom).offset(20)
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.topMargin).offset(20)
make.left.equalTo(self.leadTimeLabel)
}

Expand Down
2 changes: 1 addition & 1 deletion BeeSwift/EditNotificationsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class EditNotificationsViewController: UIViewController {
self.view.addSubview(self.leadTimeLabel)
self.leadTimeLabel.snp.makeConstraints { (make) -> Void in
make.left.equalTo(10)
make.top.equalTo(self.topLayoutGuide.snp.bottom).offset(20)
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.topMargin).offset(20)
}

self.leadTimeStepper.minimumValue = 0
Expand Down
2 changes: 1 addition & 1 deletion BeeSwift/GalleryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GalleryViewController: UIViewController, UICollectionViewDelegateFlowLayou
self.view.addSubview(self.lastUpdatedView)
self.lastUpdatedView.backgroundColor = UIColor.beeminder.gray
self.lastUpdatedView.snp.makeConstraints { (make) -> Void in
make.top.equalTo(self.topLayoutGuide.snp.bottom)
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.topMargin)
make.left.equalTo(0)
make.right.equalTo(0)
}
Expand Down
4 changes: 3 additions & 1 deletion BeeSwift/GoalViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,9 @@ class GoalViewController: UIViewController, UITableViewDelegate, UITableViewData
} errorHandler: { (error, errorMessage) in
self.submitButton.isUserInteractionEnabled = true
MBProgressHUD.hideAllHUDs(for: self.view, animated: true)
UIAlertView(title: "Error", message: "Failed to add datapoint", delegate: nil, cancelButtonTitle: "OK").show()
let alertController = UIAlertController(title: "Error", message: "Failed to add datapoint", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .cancel))
self.present(alertController, animated: true)
}
}

Expand Down
4 changes: 2 additions & 2 deletions BeeSwift/HealthKitConfigViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class HealthKitConfigViewController: UIViewController {
self.tableView.snp.makeConstraints { (make) -> Void in
make.left.equalTo(self.margin)
make.right.equalTo(-self.margin)
make.top.equalTo(self.topLayoutGuide.snp.bottom).offset(self.margin)
make.bottom.equalTo(self.bottomLayoutGuide.snp.top)
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.topMargin).offset(self.margin)
make.bottom.equalTo(self.view.safeAreaLayoutGuide.snp.bottomMargin)
}

self.tableView.delegate = self
Expand Down
4 changes: 2 additions & 2 deletions BeeSwift/RemoveHKMetricViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RemoveHKMetricViewController: UIViewController {


currentMetricLabel.snp.makeConstraints { (make) in
make.top.equalTo(self.topLayoutGuide.snp.bottom).offset(20)
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.topMargin).offset(20)
make.centerX.equalTo(self.view)
make.width.equalTo(self.view).multipliedBy(0.85)
}
Expand All @@ -52,7 +52,7 @@ class RemoveHKMetricViewController: UIViewController {
let removeButton = BSButton()
self.view.addSubview(removeButton)
removeButton.snp.makeConstraints { (make) in
make.bottom.equalTo(self.bottomLayoutGuide.snp.top).offset(-20)
make.bottom.equalTo(self.view.safeAreaLayoutGuide.snp.bottomMargin).offset(-20)
make.centerX.equalTo(self.view)
make.width.equalTo(self.view).multipliedBy(0.5)
make.height.equalTo(Constants.defaultTextFieldHeight)
Expand Down
6 changes: 4 additions & 2 deletions BeeSwift/SignInViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SignInViewController : UIViewController, UITextFieldDelegate, SFSafariView
var backToSignUpButton = BSButton()
var signInButton = BSButton()
var divider = UIView()
let resetPasswordButton: BSButton = {
lazy var resetPasswordButton: BSButton = {
let button = BSButton()
button.setTitle("Forgot password?", for: .normal)
button.titleLabel?.font = UIFont.beeminder.defaultFontHeavy
Expand Down Expand Up @@ -269,7 +269,9 @@ class SignInViewController : UIViewController, UITextFieldDelegate, SFSafariView
}

@objc func resetPasswordTapped() {
let safariVC = SFSafariViewController(url: self.passwordResetUrl, entersReaderIfAvailable: true)
let config = SFSafariViewController.Configuration()
config.entersReaderIfAvailable = true;
let safariVC = SFSafariViewController(url: self.passwordResetUrl, configuration: config);
self.present(safariVC, animated: true, completion: nil)
}

Expand Down
4 changes: 3 additions & 1 deletion BeeSwift/TimerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ class TimerViewController: UIViewController {
self.resetButtonPressed()
}) { (error, errorMessage) in
MBProgressHUD.hideAllHUDs(for: self.view, animated: true)
UIAlertView(title: "Error", message: "Failed to add datapoint", delegate: nil, cancelButtonTitle: "OK").show()
let alertController = UIAlertController(title: "Error", message: "Failed to add datapoint", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .cancel))
self.present(alertController, animated: true)
}

}
Expand Down