I updated to Xcode 8 beta 5, and now get the following error on a class that inherits from UIView:
Method does not override any method from its superclass
override public func intrinsicContentSize() -> CGSize
{
...
}
Is there a workaround?
I updated to Xcode 8 beta 5, and now get the following error on a class that inherits from UIView:
Method does not override any method from its superclass
override public func intrinsicContentSize() -> CGSize
{
...
}
Is there a workaround?
Please check the latest reference. (You can easily find it just putting the word "intrinsicContentSize" in the searchbar of Apple's developer site.)
intrinsicContentSize
has become a computed property, so you need to override it in this way:Or simply:
While transitioning from one version of Xcode to another, there is different ways to find out why your code does not compile anymore. Here are a few resources for
intrinsicContentSize
:intrinsicContentSize
from developer.apple.com.intrinsicContentSize
straight from Apple Developer API Reference page for UIView.intrinsicContentSize
with your browser's find menu (shortcut: cmd + F).intrinsicContentSize
from Xcode's Documentation and API Reference (path: Help > Documentation and API Reference, shortcut: shift + cmd + 0).UIView
initializer in your Xcode code (for example,UIView()
), select Jump to Definition and then perform a search forintrinsicContentSize
.These searches will show you that
intrinsicContentSize
, with Swift 3 and iOS 10, is no more a method but a computed property ofUIView
that has the following declaration:As a consequence, you will have to replace your
intrinsicContentSize()
method implementation with the following code snippet: