

Users know that when GPS location is pulled too often, battery life can be affected. It will also better highlight the trade-off between what the app offers you (e.g., nearby recommendations as with Foursquare, lost item tracking as with Tile, etc.), and the location data it needs. You would know something was up because the blue bar would appear and flash, naming and shaming the app in the process. This change could also help you uncover sneaky tactics developers use – like if a game you were playing had location-based ads, for instance. You can see it right after you leave Facebook, for example – the blue bar warns you for a couple of seconds that Facebook is actively using your location, even though you’ve returned to your homescreen. In practice, this means you’re going to see this bar a lot more. This is going to crush entire businesses. *ANY* time a background app uses your location in iOS 11 the blue bar is on. This dramatically increases the visibility of apps’ use of your location data, potentially highlighting troublesome apps to end users who may not have been aware of what permissions the app had been given. That means the blue status bar displays when those apps are using the continuous background location service – sort of like how the green bar shows up when a phone call is active, but you’ve exited from the Phone app to go to your home screen. In iOS 11, the blue bar functionality has been expanded to those apps that are set to “Always,” too. In iOS 10, if an app was set to use location “Only While Using the App”, and you pressed the Home button, a blue bar would appear. The more interesting change is with the blue status bar. This will better represent to users exactly when and how often an app is actually using location – and, in fact, may mean that many apps will display the solid arrow less often. And when the app actually receives location, that arrow becomes filled for a few seconds. Now, when an app requests location, a hollow arrow displays. In iOS 11, Apple has changed how the arrow works. That didn’t seem fair, as one app was receiving far more location data than the other. For example, an app receiving continuous background location would look the same – that is, it would display a solid arrow continuously – as another app that only received location data when the device was moved a significant distance or was being triggered by a geofence. However, Apple felt this former setup over-represented the privacy exposure associated with apps using location data in some apps. Most services would result in the app displaying a solid arrow both on the homescreen and in iOS Settings. This arrow would be either hollow or solid, based on which location services were being used. In iOS 10, users would know if an app was using their location by way of a small arrow icon that appeared at the top right of the home screen. The blue bar goes a step further to actually warn users when apps set to “Always” are actively tracking location. With iOS 11, the third option – “While Using the App” – can be selected for any app, even if the developer didn’t make it available before. Obviously, by selecting “Never,” certain apps that needed location to work would simply be unusable. If let navigationBar = self.navigationController?.Many apps prior to today only allowed users to pick between “Always” and “Never,” when it came to sharing their location data. You can get more complicated with your gradient by adding more colors and positions. Since this is a simple left-to-right gradient, I don’t need to specify a Y coordinate for my position. The positions are specified as percentages. It also sets up a simple red/blue gradient, where the red is at the left and the blue at the right.
Solid status bar ios code#
The following code gets the bounds of the navigation bar and adds the height of the status bar to those bounds.

We want our gradient image to extend into the status bar.
Solid status bar ios plus#
To get the proper size, we need to know the size of the navigation bar plus the size of the status bar (the area where the carrier signal and clock is). The first step of creating a gradient is to construct a CAGradientLayer class and give it the proper size, colors, and positions.
Solid status bar ios how to#
In this post, I will show you how to add a gradient background to your UINavigationBar that works for both portrait and landscape orientations. At first, I thought it would be easy, but I soon discovered a problem when I rotated my device to landscape orientation and the gradient on the navigation bar did not resize.

On a recent project, I had to add a gradient background to a UINavigationBar.
