Reconfigure custom content configuration

Accepted Reply

Change

var configuration: UIContentConfiguration 

to

var configuration: UIContentConfiguration {
    didSet {
        configureSubviews()
    }
}

and remove the subviews in the content view initialization:

subviews.forEach {
    $0.removeFromSuperview()
}

Replies

Change

var configuration: UIContentConfiguration 

to

var configuration: UIContentConfiguration {
    didSet {
        configureSubviews()
    }
}

and remove the subviews in the content view initialization:

subviews.forEach {
    $0.removeFromSuperview()
}