kolisko kolisko - 1 year ago 82
iOS Question

iOS add fixed footer UIView to multiscreen app

I have a simple question - is possible to add to an iOS application a simple UIView to the bottom of the app (like a footer view) to be on fixed position all time the app is running? When moving from one screen to another the footer still be there on fixed position? It means the footer is on top z-order and screens are changing under the footer.

The purpose of that footer bar is to show a progress bar of downloading huge amount of data in footer all time the data are downloaded independently on using the app and changing screens using navigation controller.

Any tips how to do that?

Thanks Michal

Answer Source

You can add your custom UIView to keyWindow with some constraints. EG:

let progressView: ProgressView = // Instance from nib or sth
let window = UIApplication.sharedApplication().keyWindow! as UIView

// Add leading constraint between window and progress view
// Add trailing constraint between window and progress view
// Add bottom constraint between window and progress view
// Add height constraint to progress view

I think you will need to offset your others views to be over your progress view.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download