Thursday, September 29, 2022

[FIXED] Why can't I use UIProgressViewStyle.bar in tvOS?

Issue

I'm writing a tvOS app using Xcode 9.2, targeting tvOS 11.

I have a UIProgressView and I'm trying to set it's style to .bar but Xcode says ".bar is not available".

How can I use the .bar style for the UIProgressView on my tvOS app?


Solution

The style bar of UIProgressView is only defined in the iOS SDK. It is defined as __TVOS_PROHIBITED in UIKit:

typedef NS_ENUM(NSInteger, UIProgressViewStyle) {
    UIProgressViewStyleDefault,     // normal progress bar
    UIProgressViewStyleBar __TVOS_PROHIBITED,     // for use in a toolbar
};

Also described like that in the documentation: https://developer.apple.com/documentation/uikit/uiprogressviewstyle/1619835-bar

Bar Style Documentation



Answered By - David Cordero
Answer Checked By - Candace Johnson (PHPFixing Volunteer)

No comments:

Post a Comment

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