Skip to content

Commit

Permalink
Make properties in layout attributes subclasses nonisolated
Browse files Browse the repository at this point in the history
UICollectionViewLayoutAttributes has been isolated to the main actor,
but isEqual(object:) and copy(with:zone) is still non-isolated. Fixed
for now, by making our own properties nonisolated.
  • Loading branch information
rechsteiner committed Aug 22, 2024
1 parent e224f4a commit 5d7ed95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Parchment/Classes/PagingBorderLayoutAttributes.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import UIKit

open class PagingBorderLayoutAttributes: UICollectionViewLayoutAttributes {
open var backgroundColor: UIColor?
open var insets: UIEdgeInsets = UIEdgeInsets()
nonisolated(unsafe) open var backgroundColor: UIColor?
nonisolated(unsafe) open var insets: UIEdgeInsets = UIEdgeInsets()

open override func copy(with zone: NSZone? = nil) -> Any {
let copy = super.copy(with: zone) as! PagingBorderLayoutAttributes
Expand Down
2 changes: 1 addition & 1 deletion Parchment/Classes/PagingCellLayoutAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import UIKit
/// A custom `UICollectionViewLayoutAttributes` subclass that adds a
/// `progress` property indicating how far the user has scrolled.
open class PagingCellLayoutAttributes: UICollectionViewLayoutAttributes {
open var progress: CGFloat = 0.0
nonisolated(unsafe) open var progress: CGFloat = 0.0

open override func copy(with zone: NSZone? = nil) -> Any {
let copy = super.copy(with: zone) as! PagingCellLayoutAttributes
Expand Down
2 changes: 1 addition & 1 deletion Parchment/Classes/PagingIndicatorLayoutAttributes.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit

open class PagingIndicatorLayoutAttributes: UICollectionViewLayoutAttributes {
open var backgroundColor: UIColor?
nonisolated(unsafe) open var backgroundColor: UIColor?

open override func copy(with zone: NSZone? = nil) -> Any {
let copy = super.copy(with: zone) as! PagingIndicatorLayoutAttributes
Expand Down

0 comments on commit 5d7ed95

Please sign in to comment.