Advertisement
Guest User

Untitled

a guest
May 27th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //
  2. // ViewProgressBar.swift
  3. // HackatonAdidas
  4. //
  5. // Created by Charly Maxter on 27/5/18.
  6. // Copyright © 2018 HackatonAdidas. All rights reserved.
  7. //
  8.  
  9. import UIKit
  10.  
  11. class ViewProgressBar: UIView {
  12.  
  13. private var _innerProgress: CGFloat = 0.0
  14.  
  15. var progress:CGFloat{
  16. set(newProgress) {
  17. if(newProgress > 1.0){
  18. _innerProgress = 1.0
  19. }else if(newProgress < 0.0){
  20. _innerProgress = 0.0
  21. }else{
  22. _innerProgress = newProgress
  23. }
  24. setNeedsDisplay()
  25. }
  26. get{
  27. return _innerProgress * 297
  28. }
  29. }
  30.  
  31. override func draw(_ rect: CGRect) {
  32. //drawProgressBar(frame: bounds, progress: progress)
  33. progress = 0.9
  34. DrawProgressBar.drawProgressBar(frame: bounds, resizing: .aspectFit, progress: progress)
  35. //ProgressBarDraw.drawProgressBar(frame: bounds, progress: progress)
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement