-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
211 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
#if os(iOS) | ||
import UIKit | ||
|
||
/** | ||
* Window and status-bar (iOS 15 etc) | ||
* Extension to UIApplication to handle window and status-bar related functionalities (iOS 15 etc). | ||
*/ | ||
extension UIApplication { | ||
/** | ||
* - Remark: Key Scene can be found by doing `keyWin.windowScene` | ||
* Key window property. | ||
* - Remark: The key scene can be found by accessing `keyWin.windowScene`. | ||
* - Returns: The key window if it exists, otherwise nil. | ||
*/ | ||
internal var keyWin: UIWindow? { | ||
self | ||
.connectedScenes | ||
// Flatten the array of windows from each UIWindowScene | ||
.flatMap { ($0 as? UIWindowScene)?.windows ?? [] } | ||
// Find the first window that is the key window | ||
.first { $0.isKeyWindow } | ||
} | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
import Foundation | ||
|
||
/** | ||
* - Remark: it's possible to get more info like rating, release date, release notes etc etc see here: https://github.com/amebalabs/AppVersion/blob/master/AppVersion/Source/AppStoreVersion.swift | ||
* - Fixme: ⚠️️ Rename to UAAppInfo? | ||
* - Fixme: ⚠️️ Add doc | ||
* This struct represents the basic information about an application. | ||
* It includes the current version of the application and the URL to the application's page on the App Store. | ||
* | ||
* - Remark: More information such as rating, release date, release notes etc. can be fetched. For more details, see: https://github.com/amebalabs/AppVersion/blob/master/AppVersion/Source/AppStoreVersion.swift | ||
* - Fixme: ⚠️️ Consider renaming this struct to UAAppInfo for better clarity. | ||
* - Fixme: ⚠️️ Add more detailed documentation for this struct and its properties. | ||
*/ | ||
public struct AppInfo: Decodable { | ||
// The current version of the application. | ||
public let version: String | ||
public let trackViewUrl: String // make this optional? since macOS might not use it? | ||
|
||
// The URL to the application's page on the App Store. | ||
// This might be optional for macOS applications as they might not have an App Store page. | ||
public let trackViewUrl: String | ||
|
||
/** | ||
* Initializes a new instance of `AppInfo`. | ||
* - Parameters: | ||
* - version: - Fixme: ⚠️️ add doc | ||
* - trackViewUrl: - Fixme: ⚠️️ add doc | ||
* - version: The current version of the application. | ||
* - trackViewUrl: The URL to the application's page on the App Store. | ||
*/ | ||
public init(version: String, trackViewUrl: String) { | ||
self.version = version | ||
self.trackViewUrl = trackViewUrl | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import Foundation | ||
|
||
/** | ||
* - Fixme: ⚠️️ add doc, used for parsing apple app info I think | ||
* `LookupResult` is a struct that conforms to the `Decodable` protocol. | ||
* It is used to parse the JSON response from the Apple App Store API. | ||
* The parsed data is stored in the `results` array, which contains instances of `AppInfo`. | ||
* | ||
* - Note: This struct is part of the `UpgradeAlert` module, specifically under the `helper` directory. | ||
*/ | ||
struct LookupResult: Decodable { | ||
// `results` is an array of `AppInfo` instances. | ||
// Each `AppInfo` instance represents the information of an app retrieved from the Apple App Store API. | ||
let results: [AppInfo] | ||
} | ||
} |
Oops, something went wrong.