Unity to Xcode Semantic Issue Error please assist

26 views Asked by At

Hello guys this is my first time trying to publish an App on iOS. I am using Xcode version 13.0 beta

I am getting this Semantic Issue error while archiving and building the App on Xcode
enter image description here.

if (@available(iOS 15.0, tvOS 15.0, *)) _displayLink.preferredFrameRateRange = CAFrameRateRangeMake(targetFPS, targetFPS, targetFPS);

You can check the image.

Its been days I am trying to solve this error. Please help.

1

There are 1 answers

0
narek.sv On

To properly set the var preferredFrameRateRange: CAFrameRateRange property you can simply use this initializer init(minimum: Float, maximum: Float, preferred: Float?). Here is a usage example:

_displayLink.preferredFrameRateRange = CAFrameRateRange(minimum: minFPS, maximum: maxFPS, preferred: targetFPS)

As the official documentation states

If the range contains the same minimum and maximum frame rate, this property is identical as preferredFramesPerSecond. Otherwise, the actual callback rate will be dynamically adjusted to better align with other animation sources.

So in your case you can simply do this:

_displayLink.preferredFrameRateRange = CAFrameRateRange(minimum: targetFPS, maximum: targetFPS)