Compare commits
25 Commits
02d8005fa7
...
30e961bfe4
Author | SHA1 | Date |
---|---|---|
Brent Simmons | 30e961bfe4 | |
Brent Simmons | bf02d1d86a | |
Brent Simmons | 16cebcd60a | |
Brent Simmons | 7f042b5d07 | |
Brent Simmons | 19a39ac295 | |
Brent Simmons | 3f8724c9d1 | |
Brent Simmons | 1e80253018 | |
Brent Simmons | 83298770c2 | |
Brent Simmons | 7f545c5a23 | |
Brent Simmons | db9a8c7feb | |
Brent Simmons | 4ea66ee11e | |
Brent Simmons | ea0a827024 | |
Brent Simmons | fdbcf0d84e | |
Brent Simmons | 7d04021415 | |
Brent Simmons | 87fe78f598 | |
Brent Simmons | 9dcfc2b09c | |
Brent Simmons | 22d184c5f6 | |
Brent Simmons | 09cf212057 | |
Brent Simmons | 07091e0d3e | |
Brent Simmons | 0a2b4f7008 | |
Brent Simmons | 9403d81550 | |
Brent Simmons | 78a64c3146 | |
Brent Simmons | 18d0b0e1e7 | |
Brent Simmons | 2418076364 | |
Brent Simmons | a9d50f3a14 |
|
@ -12,13 +12,10 @@ import AppKit
|
|||
///
|
||||
/// The app may or may not be running. It may or may not exist.
|
||||
|
||||
@MainActor public final class UserApp {
|
||||
public final class UserApp {
|
||||
|
||||
public let bundleID: String
|
||||
public var icon: NSImage? = nil
|
||||
public var existsOnDisk = false
|
||||
public var path: String? = nil
|
||||
public var runningApplication: NSRunningApplication? = nil
|
||||
|
||||
public var isRunning: Bool {
|
||||
|
||||
|
@ -29,6 +26,10 @@ import AppKit
|
|||
return false
|
||||
}
|
||||
|
||||
private var icon: NSImage? = nil
|
||||
private var path: String? = nil
|
||||
private var runningApplication: NSRunningApplication? = nil
|
||||
|
||||
public init(bundleID: String) {
|
||||
|
||||
self.bundleID = bundleID
|
||||
|
|
|
@ -29,7 +29,7 @@ public protocol SendToCommand {
|
|||
/// The image for the command.
|
||||
///
|
||||
/// Often the icon of the target application.
|
||||
var image: RSImage? { get }
|
||||
@MainActor var image: RSImage? { get }
|
||||
|
||||
/// Determine whether an object can be sent to the target application.
|
||||
///
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import AppKit
|
||||
import Articles
|
||||
import Core
|
||||
import AppKitExtras
|
||||
@preconcurrency import AppKitExtras
|
||||
|
||||
@MainActor final class SendToMarsEditCommand: SendToCommand {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import AppKit
|
||||
import Articles
|
||||
import Core
|
||||
import AppKitExtras
|
||||
@preconcurrency import AppKitExtras
|
||||
|
||||
// Not undoable.
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ import Web
|
|||
|
||||
struct CacheCleaner {
|
||||
|
||||
static let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "CacheCleaner")
|
||||
nonisolated(unsafe) static let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "CacheCleaner")
|
||||
|
||||
static func purgeIfNecessary() {
|
||||
@MainActor static func purgeIfNecessary() {
|
||||
|
||||
guard let flushDate = AppDefaults.shared.lastImageCacheFlushDate else {
|
||||
AppDefaults.shared.lastImageCacheFlushDate = Date()
|
||||
|
|
|
@ -10,7 +10,7 @@ import Foundation
|
|||
|
||||
struct ShareDefaultContainer {
|
||||
|
||||
static func defaultContainer(containers: ExtensionContainers) -> ExtensionContainer? {
|
||||
@MainActor static func defaultContainer(containers: ExtensionContainers) -> ExtensionContainer? {
|
||||
|
||||
if let accountID = AppDefaults.shared.addFeedAccountID, let account = containers.accounts.first(where: { $0.accountID == accountID }) {
|
||||
if let folderName = AppDefaults.shared.addFeedFolderName, let folder = account.folders.first(where: { $0.name == folderName }) {
|
||||
|
@ -26,7 +26,7 @@ struct ShareDefaultContainer {
|
|||
|
||||
}
|
||||
|
||||
static func saveDefaultContainer(_ container: ExtensionContainer) {
|
||||
@MainActor static func saveDefaultContainer(_ container: ExtensionContainer) {
|
||||
AppDefaults.shared.addFeedAccountID = container.accountID
|
||||
if let folder = container as? ExtensionFolder {
|
||||
AppDefaults.shared.addFeedFolderName = folder.name
|
||||
|
|
|
@ -24,7 +24,7 @@ public final class WidgetDataEncoder {
|
|||
private lazy var containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroup)
|
||||
private lazy var dataURL = containerURL?.appendingPathComponent("widget-data.json")
|
||||
|
||||
static let shared = WidgetDataEncoder()
|
||||
@MainActor static let shared = WidgetDataEncoder()
|
||||
private init () {}
|
||||
|
||||
func encodeWidgetData() throws {
|
||||
|
|
|
@ -11,10 +11,11 @@ import Account
|
|||
import Core
|
||||
|
||||
protocol AddFeedFolderViewControllerDelegate {
|
||||
func didSelect(container: Container)
|
||||
|
||||
@MainActor func didSelect(container: Container)
|
||||
}
|
||||
|
||||
class AddFeedFolderViewController: UITableViewController {
|
||||
final class AddFeedFolderViewController: UITableViewController {
|
||||
|
||||
var delegate: AddFeedFolderViewControllerDelegate?
|
||||
var addFeedType = AddFeedType.web
|
||||
|
|
|
@ -17,7 +17,7 @@ enum AddFeedType {
|
|||
case web
|
||||
}
|
||||
|
||||
class AddFeedViewController: UITableViewController {
|
||||
final class AddFeedViewController: UITableViewController {
|
||||
|
||||
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
|
||||
@IBOutlet weak var addButton: UIBarButtonItem!
|
||||
|
@ -166,6 +166,7 @@ class AddFeedViewController: UITableViewController {
|
|||
// MARK: AddFeedFolderViewControllerDelegate
|
||||
|
||||
extension AddFeedViewController: AddFeedFolderViewControllerDelegate {
|
||||
|
||||
func didSelect(container: Container) {
|
||||
self.container = container
|
||||
updateFolderLabel()
|
||||
|
|
|
@ -31,7 +31,7 @@ final class AppDefaults {
|
|||
|
||||
static let defaultThemeName = "Defaults"
|
||||
|
||||
static let shared = AppDefaults()
|
||||
nonisolated(unsafe) static let shared = AppDefaults()
|
||||
private init() {}
|
||||
|
||||
static let store: UserDefaults = {
|
||||
|
|
|
@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||
}
|
||||
}
|
||||
|
||||
var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
|
||||
nonisolated(unsafe) let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
|
||||
|
||||
var userNotificationManager: UserNotificationManager!
|
||||
var faviconDownloader: FaviconDownloader!
|
||||
|
@ -204,11 +204,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||
}
|
||||
}
|
||||
|
||||
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
||||
nonisolated func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
||||
|
||||
completionHandler([.list, .banner, .badge, .sound])
|
||||
}
|
||||
|
||||
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
||||
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
||||
defer { completionHandler() }
|
||||
|
||||
let userInfo = response.notification.request.content.userInfo
|
||||
|
@ -390,7 +391,9 @@ private extension AppDelegate {
|
|||
do {
|
||||
try BGTaskScheduler.shared.submit(request)
|
||||
} catch {
|
||||
os_log(.error, log: self.log, "Could not schedule app refresh: %@", error.localizedDescription)
|
||||
Task { @MainActor in
|
||||
os_log(.error, log: self.log, "Could not schedule app refresh: %@", error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import Foundation
|
||||
import WebKit
|
||||
import Images
|
||||
@preconcurrency import Images
|
||||
|
||||
protocol ArticleIconSchemeHandlerDelegate: AnyObject {
|
||||
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
@objc protocol SearchBarDelegate: NSObjectProtocol {
|
||||
@objc optional func nextWasPressed(_ searchBar: ArticleSearchBar)
|
||||
@objc optional func previousWasPressed(_ searchBar: ArticleSearchBar)
|
||||
@objc optional func doneWasPressed(_ searchBar: ArticleSearchBar)
|
||||
@objc optional func searchBar(_ searchBar: ArticleSearchBar, textDidChange: String)
|
||||
protocol SearchBarDelegate: AnyObject {
|
||||
@MainActor func nextWasPressed(_ searchBar: ArticleSearchBar)
|
||||
@MainActor func previousWasPressed(_ searchBar: ArticleSearchBar)
|
||||
@MainActor func doneWasPressed(_ searchBar: ArticleSearchBar)
|
||||
@MainActor func searchBar(_ searchBar: ArticleSearchBar, textDidChange: String)
|
||||
}
|
||||
|
||||
|
||||
|
@ -146,7 +146,7 @@ private extension ArticleSearchBar {
|
|||
private extension ArticleSearchBar {
|
||||
|
||||
@objc func textDidChange(_ notification: Notification) {
|
||||
delegate?.searchBar?(self, textDidChange: searchField.text ?? "")
|
||||
delegate?.searchBar(self, textDidChange: searchField.text ?? "")
|
||||
|
||||
if searchField.text?.isEmpty ?? true {
|
||||
searchField.rightViewMode = .never
|
||||
|
@ -156,21 +156,21 @@ private extension ArticleSearchBar {
|
|||
}
|
||||
|
||||
@objc func nextPressed() {
|
||||
delegate?.nextWasPressed?(self)
|
||||
delegate?.nextWasPressed(self)
|
||||
}
|
||||
|
||||
@objc func previousPressed() {
|
||||
delegate?.previousWasPressed?(self)
|
||||
delegate?.previousWasPressed(self)
|
||||
}
|
||||
|
||||
@objc func donePressed(_ _: Any? = nil) {
|
||||
delegate?.doneWasPressed?(self)
|
||||
delegate?.doneWasPressed(self)
|
||||
}
|
||||
}
|
||||
|
||||
extension ArticleSearchBar: UITextFieldDelegate {
|
||||
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||
delegate?.nextWasPressed?(self)
|
||||
delegate?.nextWasPressed(self)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
import UIKit
|
||||
|
||||
@objc public protocol ImageScrollViewDelegate: UIScrollViewDelegate {
|
||||
func imageScrollViewDidGestureSwipeUp(imageScrollView: ImageScrollView)
|
||||
func imageScrollViewDidGestureSwipeDown(imageScrollView: ImageScrollView)
|
||||
|
||||
@MainActor func imageScrollViewDidGestureSwipeUp(imageScrollView: ImageScrollView)
|
||||
@MainActor func imageScrollViewDidGestureSwipeDown(imageScrollView: ImageScrollView)
|
||||
}
|
||||
|
||||
open class ImageScrollView: UIScrollView {
|
||||
|
|
|
@ -42,8 +42,9 @@ class OpenInBrowserActivity: UIActivity {
|
|||
return
|
||||
}
|
||||
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
Task { @MainActor in
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
activityDidFinish(true)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,10 +17,11 @@ import ArticleExtractor
|
|||
import Images
|
||||
|
||||
protocol WebViewControllerDelegate: AnyObject {
|
||||
func webViewController(_: WebViewController, articleExtractorButtonStateDidUpdate: ArticleExtractorButtonState)
|
||||
|
||||
@MainActor func webViewController(_: WebViewController, articleExtractorButtonStateDidUpdate: ArticleExtractorButtonState)
|
||||
}
|
||||
|
||||
class WebViewController: UIViewController {
|
||||
final class WebViewController: UIViewController {
|
||||
|
||||
private struct MessageName {
|
||||
static let imageWasClicked = "imageWasClicked"
|
||||
|
|
|
@ -11,9 +11,10 @@ import os.log
|
|||
|
||||
struct ErrorHandler {
|
||||
|
||||
private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
|
||||
nonisolated(unsafe) private static let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
|
||||
|
||||
public static func present(_ viewController: UIViewController) -> (Error) -> () {
|
||||
public static func present(_ viewController: UIViewController) -> @MainActor (Error) -> () {
|
||||
|
||||
return { @MainActor [weak viewController] error in
|
||||
if UIApplication.shared.applicationState == .active {
|
||||
viewController?.presentError(error)
|
||||
|
|
|
@ -12,7 +12,8 @@ import Tree
|
|||
import Images
|
||||
|
||||
protocol FeedTableViewCellDelegate: AnyObject {
|
||||
func feedTableViewCellDisclosureDidToggle(_ sender: FeedTableViewCell, expanding: Bool)
|
||||
|
||||
@MainActor func feedTableViewCellDisclosureDidToggle(_ sender: FeedTableViewCell, expanding: Bool)
|
||||
}
|
||||
|
||||
class FeedTableViewCell : VibrantTableViewCell {
|
||||
|
|
|
@ -10,7 +10,8 @@ import UIKit
|
|||
import UIKitExtras
|
||||
|
||||
protocol FeedTableViewSectionHeaderDelegate {
|
||||
func FeedTableViewSectionHeaderDisclosureDidToggle(_ sender: FeedTableViewSectionHeader)
|
||||
|
||||
@MainActor func feedTableViewSectionHeaderDisclosureDidToggle(_ sender: FeedTableViewSectionHeader)
|
||||
}
|
||||
|
||||
class FeedTableViewSectionHeader: UITableViewHeaderFooterView {
|
||||
|
@ -139,7 +140,7 @@ class FeedTableViewSectionHeader: UITableViewHeaderFooterView {
|
|||
private extension FeedTableViewSectionHeader {
|
||||
|
||||
@objc func toggleDisclosure() {
|
||||
delegate?.FeedTableViewSectionHeaderDisclosureDidToggle(self)
|
||||
delegate?.feedTableViewSectionHeaderDisclosureDidToggle(self)
|
||||
}
|
||||
|
||||
func commonInit() {
|
||||
|
|
|
@ -669,7 +669,7 @@ extension SidebarViewController: UIContextMenuInteractionDelegate {
|
|||
|
||||
extension SidebarViewController: FeedTableViewSectionHeaderDelegate {
|
||||
|
||||
func FeedTableViewSectionHeaderDisclosureDidToggle(_ sender: FeedTableViewSectionHeader) {
|
||||
func feedTableViewSectionHeaderDisclosureDidToggle(_ sender: FeedTableViewSectionHeader) {
|
||||
toggle(sender)
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@ import UIKit
|
|||
import Core
|
||||
|
||||
protocol AddAccountDismissDelegate: UIViewController {
|
||||
func dismiss()
|
||||
|
||||
@MainActor func dismiss()
|
||||
}
|
||||
|
||||
class AddAccountViewController: UITableViewController, AddAccountDismissDelegate {
|
||||
|
|
|
@ -10,7 +10,8 @@ import UIKit
|
|||
import Account
|
||||
|
||||
protocol ShareFolderPickerControllerDelegate: AnyObject {
|
||||
func shareFolderPickerDidSelect(_ container: ExtensionContainer)
|
||||
|
||||
@MainActor func shareFolderPickerDidSelect(_ container: ExtensionContainer)
|
||||
}
|
||||
|
||||
class ShareFolderPickerController: UITableViewController {
|
||||
|
|
|
@ -12,7 +12,7 @@ import UIKit
|
|||
// Uses a cache.
|
||||
// Main thready only.
|
||||
|
||||
final class SingleLineUILabelSizer {
|
||||
@MainActor final class SingleLineUILabelSizer {
|
||||
|
||||
let font: UIFont
|
||||
private var cache = [String: CGSize]()
|
||||
|
@ -36,7 +36,7 @@ final class SingleLineUILabelSizer {
|
|||
|
||||
}
|
||||
|
||||
static private var sizers = [UIFont: SingleLineUILabelSizer]()
|
||||
@MainActor static private var sizers = [UIFont: SingleLineUILabelSizer]()
|
||||
|
||||
static func sizer(for font: UIFont) -> SingleLineUILabelSizer {
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ struct TimelineAccessibilityCellLayout: TimelineCellLayout {
|
|||
|
||||
private extension TimelineAccessibilityCellLayout {
|
||||
|
||||
static func rectForDate(_ cellData: TimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect {
|
||||
@MainActor static func rectForDate(_ cellData: TimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect {
|
||||
|
||||
var r = CGRect.zero
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ extension TimelineCellLayout {
|
|||
|
||||
}
|
||||
|
||||
static func rectForFeedName(_ cellData: TimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect {
|
||||
@MainActor static func rectForFeedName(_ cellData: TimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect {
|
||||
|
||||
var r = CGRect.zero
|
||||
r.origin = point
|
||||
|
|
|
@ -109,7 +109,7 @@ struct TimelineDefaultCellLayout: TimelineCellLayout {
|
|||
|
||||
extension TimelineDefaultCellLayout {
|
||||
|
||||
static func rectForDate(_ cellData: TimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect {
|
||||
@MainActor static func rectForDate(_ cellData: TimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect {
|
||||
|
||||
var r = CGRect.zero
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
class TimelineTitleView: UIView {
|
||||
final class TimelineTitleView: UIView {
|
||||
|
||||
@IBOutlet weak var iconView: IconView!
|
||||
@IBOutlet weak var label: UILabel!
|
||||
|
|
|
@ -44,7 +44,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 17.0
|
|||
//SDKROOT = macosx
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Off
|
||||
SWIFT_VERSION = 5.10
|
||||
SWIFT_STRICT_CONCURRENCY = complete
|
||||
SWIFT_STRICT_CONCURRENCY = targeted
|
||||
ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS = NO
|
||||
|
||||
// https://forums.swift.org/t/swift-packages-in-multiple-targets-results-in-this-will-result-in-duplication-of-library-code-errors/34892/33
|
||||
|
|
Loading…
Reference in New Issue