Skip to content

Commit

Permalink
Fix 'deprecated' compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaRU committed Jan 12, 2024
1 parent 85d72ba commit ce79840
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import UIKit

protocol BackgroundWatchProtocol: class {
protocol BackgroundWatchProtocol: AnyObject {
func didEnterBackground()
func willEnterForeground()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class DashboardViewController: UIViewController, RTPSConnectionMonitorProtocol,
backgroundWatch = BackgroundWatch(delegate: self)
addCircularProgressView(to: view)
connectTrident()
if CLLocationManager.authorizationStatus() == .notDetermined {
locationManager = CLLocationManager()
locationManager = CLLocationManager()
if locationManager?.authorizationStatus == .notDetermined {
locationManager?.requestWhenInUseAuthorization()
}
}
Expand Down
10 changes: 3 additions & 7 deletions TridentCockpitiOS/DiveViewController/DiveViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,13 @@ class DiveViewController: UIViewController {
throttleJoystickView.isHidden = true
yawPitchJoystickView.isHidden = true
#else
if let window: UIWindow = {
if #available(iOS 13, *) {
return UIApplication.shared.windows.first{ $0.isKeyWindow }
} else {
return UIApplication.shared.keyWindow
}
}() {
if let window = view.window?.windowScene?.keyWindow {
let bounds = window.bounds
let offset: CGFloat = UITraitCollection.current.verticalSizeClass == .compact ? 185 : 250
throttleJoystickView.center = CGPoint(x: bounds.minX + offset, y: bounds.maxY - offset)
yawPitchJoystickView.center = CGPoint(x: bounds.maxX - offset, y: bounds.maxY - offset)
} else {
print("Window not found!")
}

#endif
Expand Down
2 changes: 1 addition & 1 deletion TridentCockpitiOS/Etc/Alerts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Alamofire

extension UIAlertController {
func presentOntop() {
let window = UIApplication.shared.windows.first{ $0.isKeyWindow }
let window = view.window?.windowScene?.keyWindow
var controller = window?.rootViewController
if let navController = controller as? UINavigationController {
controller = navController.presentedViewController ?? navController.viewControllers.first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import UIKit

protocol DiveCollectionViewCellDelegate: class {
protocol DiveCollectionViewCellDelegate: AnyObject {
func playButtonAction(cell: DiveCollectionViewCell)
func downloadButtonAction(cell: DiveCollectionViewCell)
}
Expand Down

0 comments on commit ce79840

Please sign in to comment.