Reputation: 37
Code that previously ran fine under Xcode 13.4 will no longer compile under Xcode 14. I get the error:
Property 'anchorPoint' with type "UserResizableViewAnchorPoint?' cannot override a property with type 'CGPoint'
Property cannot be declared public because its type uses and internal type
Could it be a Cocoa Pods issue? How do I troubleshoot this?
Upvotes: 0
Views: 566
Reputation: 21
This was happening to me and I figured it out. Code was working fine on latest Xcode13 and presents this error on latest Xcode14. Not sure if it's the same issue you're having but hope it helps you isolate it.
This was the error I was seeing which matches yours: Xcode14 error message
Do you happen to be using a file that is dealing with resizing a view and manipulation of touches such as this which is defining a struct "UserResizableViewAnchorPoint"? And/Or using a variable called "anchorPoint" here?
public struct UserResizableViewAnchorPoint {
var adjustsX: CGFloat = 0
var adjustsY: CGFloat = 0
var adjustsH: CGFloat = 0
var adjustsW: CGFloat = 0
}
public class UserResizableView: UIView {
public weak var delegate: UserResizableViewDelegate?
var borderView: GripViewBorderView?
// Used to determine which components of the bounds we'll be modifying, based upon where the user's touch started.
public var anchorPoint: UserResizableViewAnchorPoint?
The issue seems to be that anchorPoint
is now used inside of CGPoint by Apple when it wasn't before. I was able to fix this by changing our variable simply to this so it wouldn't match:
public var anchorPointer: UserResizableViewAnchorPoint?
Then changing every reference in that file where I was originally using anchorPoint
. For example it was originally anchorPoint
here and I updated it to anchorPointer
:
func isResizing() -> Bool {
return (anchorPointer!.adjustsH != 0 || anchorPointer!.adjustsW != 0 || anchorPointer!.adjustsX != 0 || anchorPointer!.adjustsY != 0);
}
You need to make sure to only update it where you're actually using your own variable though and not using anchorPoint within an existing function call or parameter because those should stay the same. You should just go through one by one where it was your variable and update it until you remove all the errors.
Upvotes: 2