Reconfigure custom content configuration

I can't fit the post here, so here's the link to it on stack overflow: https://stackoverflow.com/questions/78419812/reconfigure-custom-content-configuration

Answered by Filippo02 in 786793022

Change

var configuration: UIContentConfiguration 

to

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

and remove the subviews in the content view initialization:

subviews.forEach {
    $0.removeFromSuperview()
}
Accepted Answer

Change

var configuration: UIContentConfiguration 

to

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

and remove the subviews in the content view initialization:

subviews.forEach {
    $0.removeFromSuperview()
}
Reconfigure custom content configuration
 
 
Q