Skip to content

Commit

Permalink
Remove retain cycles (#1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischreiber committed Nov 17, 2022
1 parent 7b969ee commit 4d8816c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ios/FluentUI/SegmentedControl/SegmentedControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ open class SegmentedControl: UIView, TokenizedControlInternal {
}

public typealias TokenSetKeyType = SegmentedControlTokenSet.Tokens
lazy public var tokenSet: SegmentedControlTokenSet = .init(style: { self.style })
lazy public var tokenSet: SegmentedControlTokenSet = .init(style: { [weak self] in
return self?.style ?? .primaryPill
})
var tokenSetSink: AnyCancellable?

var selectionChangeAnimationDuration: TimeInterval { return 0.2 }
Expand Down
4 changes: 3 additions & 1 deletion ios/FluentUI/Shimmer/ShimmerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ open class ShimmerView: UIView, TokenizedControlInternal {

// MARK: - TokenizedControl
public typealias TokenSetKeyType = ShimmerTokenSet.Tokens
public lazy var tokenSet: ShimmerTokenSet = .init(style: { self.style })
public lazy var tokenSet: ShimmerTokenSet = .init(style: { [weak self] in
return self?.style ?? .concealing
})

var tokenSetSink: AnyCancellable?

Expand Down
4 changes: 3 additions & 1 deletion ios/FluentUI/Table View/TableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ open class TableViewCell: UITableViewCell, TokenizedControlInternal {
class var labelVerticalMarginForOneAndThreeLines: CGFloat { return TableViewCellTokenSet.defaultLabelVerticalMarginForOneAndThreeLines }

public typealias TokenSetKeyType = TableViewCellTokenSet.Tokens
public lazy var tokenSet: TableViewCellTokenSet = .init(customViewSize: { self.customViewSize })
public lazy var tokenSet: TableViewCellTokenSet = .init(customViewSize: { [weak self] in
return self?.customViewSize ?? .default
})

var tokenSetSink: AnyCancellable?

Expand Down

0 comments on commit 4d8816c

Please sign in to comment.