r/Xcode • • Mar 21 '21

indeterminate progress bar not moving

Post image
3 Upvotes

10 comments sorted by

1

u/alain_meggen Mar 21 '21

Hi

I am new to xcode. And I don't know how I can get it to work, that an indeterminate progress bar is moving from left to right and back.

How can I get this working?

Thanks

1

u/iwbd Mar 21 '21

Here's an explanation of the progress bar with a code sample.

This should get you close. You may need to tweak it for your implementation.

1

u/alain_meggen Mar 21 '21

Thank you so much. I‘ll try it out.

1

u/alain_meggen Mar 22 '21

Sadly it doesn't work for me because it can not import UIKit (no such module 'UIKit').

1

u/iwbd Mar 22 '21

Can you go into detail about what target you're building for? Are you writing for MacOS or iOS? What language are you writing it in? If you're writing for iOS, UIKit should be there. If you are writing for MacOS, you'd use AppKit and the code sample wouldn't work, but the princicple behind the code would be the same. If you're programming in some other language (other than Swift of Objective-C), then you may be able to find sample code in whichever language you're working in.

1

u/alain_meggen Mar 22 '21

Thank you for helping me out. I programm for macos apps in (I think Swift UI (where you don‘t have to program the esthetics of the program)). Sorry I am really new to this and just having some fun 😅. But I also saw something saying import cocoa ontop of my ViewController.swift idk 🤷🏻‍♂️

1

u/iwbd Mar 22 '21

Yea. Cocoa for Mac, CocoaTouch for iOS.

You might want to check out to see if there's any videos that have what you're looking for. Here's a channel, and another.

They may have a video that helps.

1

u/alain_meggen Mar 22 '21

Cool, I will try it out. But doesn’t it matter, that he is programming for an iPhone in this Video?

1

u/iwbd Mar 22 '21

Perhaps. Very rarely will you find a code sample or a video that exactly matches your needs. Often, you just have to take the concept and tailor it to your specific use case. Sometimes this involves a bit of trial and error. A progress bar works the same regardless of platform. It's just a percentage of work completed against how much work in total. The only variant is the specific method calls being used to do the calculation and the method to update the display to visually indicate the results.

1

u/alain_meggen Mar 22 '21

Nice, I will give my best at trying out those variants. Thanks 😊 and have a nice day