Skip to content

Commit

Permalink
Merge branch 'master' into alternate-icons-asset-catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal authored Dec 27, 2023
2 parents d25d6c3 + e9c85b3 commit 2e598b1
Show file tree
Hide file tree
Showing 98 changed files with 261 additions and 849 deletions.
2 changes: 1 addition & 1 deletion Configuration/HomeAssistant.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*] = $(PROVISIONING_PROFILE_SPECIFIER
SDKROOT = iphoneos
SWIFT_VERSION = 5.0
TARGETED_DEVICE_FAMILY = 1,2,6
IPHONEOS_DEPLOYMENT_TARGET = 12.0
IPHONEOS_DEPLOYMENT_TARGET = 15.0
MACOSX_DEPLOYMENT_TARGET = 10.15
WATCHOS_DEPLOYMENT_TARGET = 5.0

Expand Down
31 changes: 13 additions & 18 deletions HomeAssistant.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6498,7 +6498,6 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Widgets/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -6519,7 +6518,6 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Widgets/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -6540,7 +6538,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Widgets/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6597,7 +6595,7 @@
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
INFOPLIST_FILE = Sources/Extensions/PushProvider/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
PROVISIONING_SUFFIX = .PushProvider;
};
name = Debug;
Expand All @@ -6608,7 +6606,7 @@
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
INFOPLIST_FILE = Sources/Extensions/PushProvider/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
PROVISIONING_SUFFIX = .PushProvider;
};
name = Release;
Expand All @@ -6619,7 +6617,7 @@
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
INFOPLIST_FILE = Sources/Extensions/PushProvider/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
PROVISIONING_SUFFIX = .PushProvider;
};
name = Beta;
Expand Down Expand Up @@ -6667,7 +6665,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/NotificationContent/Resources/Info.plist;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -6685,7 +6683,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/NotificationContent/Resources/Info.plist;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6795,7 +6793,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/NotificationContent/Resources/Info.plist;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6852,8 +6850,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Intents/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -7062,8 +7059,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Intents/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -7088,8 +7084,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Intents/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -7114,7 +7109,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Today/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -7133,7 +7128,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Today/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -7152,7 +7147,7 @@
CODE_SIGN_ENTITLEMENTS = "Configuration/Entitlements/Extension-ios.entitlements";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "Configuration/Entitlements/Extension-catalyst.entitlements";
INFOPLIST_FILE = Sources/Extensions/Today/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
129 changes: 2 additions & 127 deletions Sources/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
setupWatchCommunicator()
setupiOS12Features()

if #available(iOS 13, *) {
} else {
// window must be created before willFinishLaunching completes, or state restoration will not occur
sceneManager.compatibility.willFinishLaunching()
}

return true
}

Expand All @@ -129,11 +123,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}

if #available(iOS 13, *) {
} else {
sceneManager.compatibility.didFinishLaunching()
}

lifecycleManager.didFinishLaunching()

checkForUpdate()
Expand All @@ -142,7 +131,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}

@available(iOS 13, *)
override func buildMenu(with builder: UIMenuBuilder) {
if builder.system == .main {
let manager = MenuManager(builder: builder)
Expand All @@ -157,13 +145,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}

@available(iOS 13, *)
@objc internal func openAbout() {
precondition(Current.sceneManager.supportsMultipleScenes)
sceneManager.activateAnyScene(for: .about)
}

@available(iOS 13, *)
@objc internal func openMenuUrl(_ command: AnyObject) {
guard let command = command as? UICommand, let url = MenuManager.url(from: command) else {
return
Expand All @@ -175,13 +161,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}

@available(iOS 13, *)
@objc internal func openPreferences() {
precondition(Current.sceneManager.supportsMultipleScenes)
sceneManager.activateAnyScene(for: .settings)
}

@available(iOS 13, *)
@objc internal func openActionsPreferences() {
precondition(Current.sceneManager.supportsMultipleScenes)
let delegate: Guarantee<SettingsSceneDelegate> = sceneManager.scene(for: .init(activity: .settings))
Expand All @@ -195,7 +179,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
)
}

@available(iOS 13, *)
func application(
_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
Expand All @@ -207,58 +190,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return activity.configuration
}

func application(_ application: UIApplication, shouldRestoreSecureApplicationState coder: NSCoder) -> Bool {
if #available(iOS 13, *) {
return false
} else {
if OnboardingNavigationViewController.requiredOnboardingStyle != nil {
Current.Log.info("disallowing state to be restored due to onboarding")
return false
}

if Current.appConfiguration == .FastlaneSnapshot {
Current.Log.info("disallowing state to be restored due to fastlane snapshot")
return false
}

if NSClassFromString("XCTest") != nil {
return false
}

Current.Log.info("allowing state to be restored")
return true
}
}

func application(_ application: UIApplication, shouldSaveSecureApplicationState coder: NSCoder) -> Bool {
if #available(iOS 13, *) {
return false
} else {
if Current.settingsStore.restoreLastURL == false {
// if we let it capture state -- even if we don't use the url -- it will take a screenshot
Current.Log.info("disallowing state to be saved due to setting")
return false
}

Current.Log.info("allowing state to be saved")
return true
}
}

func application(
_ application: UIApplication,
viewControllerWithRestorationIdentifierPath identifierComponents: [String],
coder: NSCoder
) -> UIViewController? {
if #available(iOS 13, *) {
return nil
} else {
return sceneManager.compatibility.windowController?.viewController(
withRestorationIdentifierPath: identifierComponents
)
}
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
notificationManager.didFailToRegisterForRemoteNotifications(error: error)
}
Expand Down Expand Up @@ -308,56 +239,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}

func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
if #available(iOS 13, *) {
fatalError("scene delegate should be invoked on iOS 13")
} else {
return sceneManager.compatibility.urlHandler?.handle(url: url) ?? false
}
}

func application(
_ application: UIApplication,
performActionFor shortcutItem: UIApplicationShortcutItem,
completionHandler: @escaping (Bool) -> Void
) {
if #available(iOS 13, *) {
fatalError("scene delegate should be invoked on iOS 13")
} else {
enum NoHandler: Error {
case noHandler
}

firstly { () -> Promise<Void> in
if let handler = sceneManager.compatibility.urlHandler {
return handler.handle(shortcutItem: shortcutItem)
} else {
throw NoHandler.noHandler
}
}.done {
completionHandler(true)
}.catch { _ in
completionHandler(false)
}
}
}

func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
if #available(iOS 13, *) {
fatalError("scene delegate should be invoked on iOS 13")
} else {
return sceneManager.compatibility.urlHandler?.handle(userActivity: userActivity) ?? false
}
}

func application(
_ application: UIApplication,
handleEventsForBackgroundURLSession identifier: String,
Expand All @@ -373,11 +254,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? {
if #available(iOS 13, *) {
return IntentHandlerFactory.handler(for: intent)
} else {
return nil
}
IntentHandlerFactory.handler(for: intent)
}

// MARK: - Private helpers
Expand Down Expand Up @@ -620,9 +497,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

@objc private func menuRelatedSettingDidChange(_ note: Notification) {
if #available(iOS 13, *) {
UIMenuSystem.main.setNeedsRebuild()
}
UIMenuSystem.main.setNeedsRebuild()
}

// swiftlint:disable:next file_length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,7 @@ final class LocationHistoryDetailViewController: UIViewController, TypedRowContr
),
], animated: false)

if #available(iOS 13, *) {
map.pointOfInterestFilter = .excludingAll
} else {
map.showsPointsOfInterest = false
}

map.pointOfInterestFilter = .excludingAll
map.showsBuildings = true
map.showsCompass = false
map.showsTraffic = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ class LocationHistoryListViewController: HAFormViewController {
$0.cellStyle = .subtitle
$0.title = formatter.string(from: entry.CreatedAt)
$0.cellUpdate { cell, _ in
if #available(iOS 13, *) {
cell.detailTextLabel?.textColor = .secondaryLabel
} else {
cell.detailTextLabel?.textColor = .gray
}

cell.detailTextLabel?.textColor = .secondaryLabel
cell.detailTextLabel?.text = entry.Trigger
cell.accessoryType = .disclosureIndicator
}
Expand Down
Loading

0 comments on commit 2e598b1

Please sign in to comment.