Returns the preferred size of the layer in the coordinate space of its superlayer.
SDKs
- iOS 2.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Core Animation
Declaration
- (CGSize)preferredFrameSize;
Return Value
The layer’s preferred frame size.
Discussion
In macOS, the default implementation of this method calls the preferredSizeOfLayer: method of its layout manager—that is, the object in its layout
property. If that object does not exist or does not implement that method, this method returns the size of the layer’s current bounds
rectangle mapped into the coordinate space of its superlayer
.