-
Notifications
You must be signed in to change notification settings - Fork 220
Swift 6: complete concurrency checking for StreamChatUI #3660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: swift-6
Are you sure you want to change the base?
Changes from all commits
3a2ecd2
1716b46
2b9e30d
2ccbc6d
1e3641d
1c7bbf8
e0777cf
31f663f
4624c79
abaffab
09066fd
1e64b77
ab404ab
f3f8e90
1892c22
0290926
b2e3fd9
a9b37ee
d6dc7e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import Foundation | |
import StreamChat | ||
|
||
/// An object containing visual configuration for whole application. | ||
public struct Appearance { | ||
public struct Appearance: @unchecked Sendable { | ||
/// A color pallete to provide basic set of colors for the Views. | ||
/// | ||
/// By providing different object or changing individual colors, you can change the look of the views. | ||
|
@@ -29,7 +29,7 @@ public struct Appearance { | |
public var formatters = Formatters() | ||
|
||
/// Provider for custom localization which is dependent on App Bundle. | ||
public var localizationProvider: (_ key: String, _ table: String) -> String = { key, table in | ||
public var localizationProvider: @Sendable(_ key: String, _ table: String) -> String = { key, table in | ||
Bundle.streamChatUI.localizedString(forKey: key, value: nil, table: table) | ||
} | ||
|
||
|
@@ -39,5 +39,16 @@ public struct Appearance { | |
// MARK: - Appearance + Default | ||
|
||
public extension Appearance { | ||
static var `default`: Appearance = .init() | ||
static var `default`: Appearance { | ||
get { | ||
MainActor.ensureIsolated { _default } | ||
} | ||
set { | ||
MainActor.ensureIsolated { _default = newValue } | ||
} | ||
} | ||
|
||
// Shared instance is mutated only on the main thread without explicit | ||
// main actor annotation for easier SDK setup. | ||
nonisolated(unsafe) private static var _default: Appearance = .init() | ||
Comment on lines
-42
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At first I was thinking about making it |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Review if MainActor is more approriate here