1

I've created a UIProgressView:

ProgressBar.frame = CGRect(x: 0, y: 0, width: width, height: height)
ProgressBar.center = ProgressPos
ProgressBar.trackImage = UIImage(named: "Ak")
ProgressBar.progress = 0.5
ProgressBar.transform = CGAffineTransformScale(ProgressBar.transform, 1, scale)
self.view?.addSubview(ProgressBar)

Now what I'm trying to do is, let say the progress bar is at 20%, then I want to show the first 20% of that image, I'll try to describe it with a picture:

But it isn't working, I'm not sure what code to use for that, can anybody help me out here?

Benja0906
  • 1,437
  • 2
  • 15
  • 25
  • What is this progressbar about? And does your image available before you present progressbar? – Santosh Jun 22 '16 at 23:00
  • The progressbar is for a loading screen, while I'm getting data from my database. And what do you mean by: "does your image available before you present progressbar?" – Benja0906 Jun 22 '16 at 23:07
  • @Benja0906 any update on this? – s g Jul 29 '22 at 18:45

0 Answers0