Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Targeted concurrency
Browse files Browse the repository at this point in the history
bourvill committed Jan 30, 2024
1 parent 4a80797 commit 591af8c
Showing 9 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion App/Features/Entry/Picture/ImageCache.swift
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import Foundation
import UIKit

actor ImageCache {
static var shared = ImageCache()
static let shared = ImageCache()

private var memoryCache: NSCache<NSString, UIImage> = {
let cache = NSCache<NSString, UIImage>()
20 changes: 10 additions & 10 deletions App/Features/PasteBoard/PasteBoardViewModel.swift
Original file line number Diff line number Diff line change
@@ -23,16 +23,16 @@
private var cancellableNotification: AnyCancellable?

init() {
cancellableNotification = NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)
.map { _ -> Bool in
guard let pasteBoardUrl = UIPasteboard.general.url,
pasteBoardUrl.absoluteString != WallabagUserDefaults.previousPasteBoardUrl
else {
return false
}
return true
}
.assign(to: \.showPasteBoardView, on: self)
// cancellableNotification = NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)
// .map { _ -> Bool in
// guard let pasteBoardUrl = UIPasteboard.general.url,
// pasteBoardUrl.absoluteString != WallabagUserDefaults.previousPasteBoardUrl
// else {
// return false
// }
// return true
// }
// .assign(to: \.showPasteBoardView, on: self)
}

deinit {
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

import Foundation

public protocol WallabagKitEndpoint {
public protocol WallabagKitEndpoint: Sendable {
associatedtype Object: Decodable
func method() -> HttpMethod
func endpoint() -> String
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct WallabagCollection<T: Decodable>: Decodable {
public struct WallabagCollection<T: Decodable>: Decodable, Sendable {
public let limit: Int
public let page: Int
public let pages: Int
2 changes: 1 addition & 1 deletion WallabagKit/Sources/WallabagKit/Model/WallabagConfig.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct WallabagConfig: Decodable {
public struct WallabagConfig: Decodable, Sendable {
public let id: Int
public let itemsPerPage: Int
public let language: String
2 changes: 1 addition & 1 deletion WallabagKit/Sources/WallabagKit/Model/WallabagEntry.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct WallabagEntry: Decodable {
public struct WallabagEntry: Decodable, Sendable {
public let id: Int
public let userId: Int?
public let uid: String?
2 changes: 1 addition & 1 deletion WallabagKit/Sources/WallabagKit/Model/WallabagTag.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct WallabagTag: Decodable {
public struct WallabagTag: Decodable, Sendable {
public let id: Int
public let label: String
public let slug: String
2 changes: 1 addition & 1 deletion WallabagKit/Sources/WallabagKit/Model/WallabagToken.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct WallabagToken: Decodable {
public struct WallabagToken: Decodable, Sendable {
public let accessToken: String
public let expiresIn: Int
public let tokenType: String
2 changes: 2 additions & 0 deletions wallabag.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -1281,6 +1281,7 @@
ONLY_ACTIVE_ARCH = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
};
name = Debug;
};
@@ -1338,6 +1339,7 @@
MTL_FAST_MATH = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_STRICT_CONCURRENCY = complete;
};
name = Release;
};

0 comments on commit 591af8c

Please sign in to comment.