AXStackableViewContainer error after Xcode 14.0 update

Viewed 14
@objc public class AXStackableViewContainer: UIView {

weak var delegate: AXStackableViewContainerDelegate?

/// The inset of the contents of the `StackableViewContainer`.
/// For internal use only.
var contentInset: UIEdgeInsets = .zero

@objc fileprivate(set) var anchorPoint: AXStackableViewContainerAnchorPoint
@objc enum AXStackableViewContainerAnchorPoint: Int {
    case top, bottom
}

Error Message:

Setter for 'anchorPoint' with Objective-C selector 'setAnchorPoint:' conflicts with setter for 'anchorPoint' from superclass 'UIView' with the same Objective-C selector

After the latest Xcode update, this error occurs and cannot be executed. How do I solve it?

1 Answers

For iOS 16.0+ there is a new instance property called anchorPoint in UIView class. So your compiler is unable to distinguish between them. Changing the name for your property will solve the issue.

For more details about the new anchorPoint property read this.

The anchor point of the view’s bounds rectangle.

Related