Make the progress view have rounded ends.

This commit is contained in:
Maurice Parker
2019-10-29 19:52:21 -05:00
parent 2fa43fb1e9
commit 91d5e809e4
3 changed files with 26 additions and 1 deletions

View File

@@ -13,7 +13,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="60"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<progressView hidden="YES" opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="gKH-fc-zh7">
<progressView hidden="YES" opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="gKH-fc-zh7" customClass="RoundedProgressView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="27.5" width="375" height="5"/>
<constraints>
<constraint firstAttribute="height" constant="5" id="OCl-qi-owb"/>

View File

@@ -0,0 +1,21 @@
//
// RoundedProgressView.swift
// NetNewsWire
//
// Created by Maurice Parker on 10/29/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
class RoundedProgressView: UIProgressView {
override func layoutSubviews() {
super.layoutSubviews()
subviews.forEach { subview in
subview.layer.masksToBounds = true
subview.layer.cornerRadius = bounds.height / 2.0
}
}
}