Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewProgressBar.swift
- // HackatonAdidas
- //
- // Created by Charly Maxter on 27/5/18.
- // Copyright © 2018 HackatonAdidas. All rights reserved.
- //
- import UIKit
- class ViewProgressBar: UIView {
- private var _innerProgress: CGFloat = 0.0
- var progress:CGFloat{
- set(newProgress) {
- if(newProgress > 1.0){
- _innerProgress = 1.0
- }else if(newProgress < 0.0){
- _innerProgress = 0.0
- }else{
- _innerProgress = newProgress
- }
- setNeedsDisplay()
- }
- get{
- return _innerProgress * 297
- }
- }
- override func draw(_ rect: CGRect) {
- //drawProgressBar(frame: bounds, progress: progress)
- progress = 0.9
- DrawProgressBar.drawProgressBar(frame: bounds, resizing: .aspectFit, progress: progress)
- //ProgressBarDraw.drawProgressBar(frame: bounds, progress: progress)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement