How can I set the UINavigationbar with gradient color?

Details Xcode 11.4 (11E146), swift 5 Tested on iOS 13.1, 12.2, 11.0.1 Solution class UINavigationBarGradientView: UIView { enum Point { case topRight, topLeft case bottomRight, bottomLeft case custom(point: CGPoint) var point: CGPoint { switch self { case .topRight: return CGPoint(x: 1, y: 0) case .topLeft: return CGPoint(x: 0, y: 0) case .bottomRight: return CGPoint(x: 1, … Read more

How to properly format currency on ios

You probably want something like this (assuming currency is a float): NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; [numberFormatter setNumberStyle: NSNumberFormatterCurrencyStyle]; NSString *numberAsString = [numberFormatter stringFromNumber:[NSNumber numberWithFloat:currency]]; From your requirements to treat 52 as .52 you may need to divide by 100.0. The nice thing about this approach is that it will respect the current locale. … Read more

Checkbox in iOS application

this has been driving me mad too and I found a different solution that works well for me and avoids having to use images. Add a new label object to Interface Builder. Create an IBOutlet property in Xcode and connect it up to it. In the code below I’ve called it ‘fullyPaid’ as I want … Read more

How to Install Older iOS Simulators in XCode 4.2.1 (SDK5.0)

X-Code 4.2 will have iOS 5 simulator and library only. If you want lower version simulator and library with X-Code just goto X-Code->Prefrences-> Downloads Tab. In downloads tab you’ll have two tabs: 1) Components – Here you will have option to download iOS 4.3 simulator(~600 Mb), iOS 4.0-4.1(~670 MB) Device debugging support, iOS 3.0-3.2.2(686.3 MB) … Read more

iOS11 photo library access is possible even if settings are set to “never”

Okay, you can sort of piece this together from answers and comments already, but to try to tell a more complete story… In iOS 11, UIImagePickerController runs as a separate process from your app. That means: Your app can’t see the user’s whole Photos library — it gets read-only access just for whichever asset(s) the … Read more

Atos cannot get symbols from dSYM of archived application

To properly get symbols from your archived app’s dSYM file and get useful information from your BugSense crash reports (or any other crash reports for that matter): Copy the stack trace from BugSense into TextEdit or any other text editor. Make sure to use the “clipboard” icon, rather than simply copying the text. Otherwise you … Read more