-1

I have a scenario where the user presses on a button in FirstViewController to upload an image, when that happens a custom view will show up with a custom activity indicator with the upload progress.. The problem is that I want this custom view and activity indicator to keep showing up in my application even if the user presented or pushed a new viewcontroller(s).

mfaani
  • 33,269
  • 19
  • 164
  • 293
Jaafar Barek
  • 420
  • 3
  • 9
  • What have you tried so far? Where is your code? What research have you don online? What exact issues are you facing trying to achieve this? There are many articles about this stuff online. – Simon McLoughlin Feb 10 '17 at 15:03
  • I couldn't find anything related on the internet :) so if you please can tell me were to find some of these many articles would be better than come and talk like this because it is clear that my issue is not with code , but with the concept it self :) – Jaafar Barek Feb 10 '17 at 15:05
  • I **wouldn't** use an activity indicator, instead I would use a toast message as mentioned [here](http://stackoverflow.com/questions/31540375/how-to-toast-message-in-swift). Toast message are like the blue ribbons that pop up at top of your screen, saying No GPS connection and then go away the second the GPS is back again. Activity indicator is something that should be a loosely coupled to your **viewController**. Toast messages are more applicable because they are about the **app** – mfaani Feb 10 '17 at 16:44

2 Answers2

2

You should be able to add it to the window like self.window.addSubview(yourActivityView)

Brian K
  • 51
  • 3
0

You haven't provided much information, but you could store the data in your appDelegate so that it can be read from any view controller using the:

let appDelegate = UIApplication.shared.delegate as! AppDelegate

Then you would just need to reproduce a view on that controller to show the status of the upload.

However, this might not be the easiest way of getting what you want.

Edit:

Brian K's answer above is likely better.

Logan
  • 1,047
  • 10
  • 33