UIProgressView has two parts, part progress and part track. If you use Reveal, you can see that it has only two subtitles. The hierarchy of representations of progress is very simple. so that...
Objective-c
- (void)layoutSubviews { [super layoutSubviews]; [self.progressView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { obj.layer.masksToBounds = YES; obj.layer.cornerRadius = kProgressViewHeight / 2.0; }]; }
Swift 3
override func layoutSubviews() { super.layoutSubviews() subviews.forEach { subview in subview.layer.masksToBounds = true subview.layer.cornerRadius = kProgressViewHeight / 2.0 } }
I acknowledge that subclassing or advanced progress is the recommended way. In case you do not want to do this for such a simple effect, this can do the trick. Keep the situation when Apple changes the hierarchy of views, and something may go wrong.
source share