Thursday, September 29, 2022

[FIXED] Why CAShapeLayerLineJoin doesn't compile on tvOS?

Issue

This doesn't compile:

let a: CAShapeLayerLineJoin = CAShapeLayerLineJoin.miter

Error:

Type 'CAShapeLayerLineJoin' (aka 'NSString') has no member 'miter'

neither round or bevel

The same code compiles using iOS target. tvOS has deployment target 9.0. Here is the documentation for CAShapeLayerLineJoin: https://developer.apple.com/documentation/quartzcore/cashapelayerlinejoin It says available on tvOS 9.0+ Also, when I cmd-click on it, it leads me to the same definition as the iOS target.

Edit: I linked to the wrong doc. The correct one says CAShapeLayerLineJoin available from tvOS 12+.

Any ideas?


Solution

Yes but this has nothing to do with deployment target or SDK. It depends on the Swift language version. You have two different projects or targets, and they are using two different versions of Swift. On the tvOS target, the Swift version is older and this is a constant String, kCALineJoinMiter.



Answered By - matt
Answer Checked By - Cary Denson (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.