Get global tint color from code

Easy. Objective C: UIColor *tintColor = [[self view]tintColor]; Swift: let tintColor = self.view.tintColor; This should get the tintColor set on the app. If you change it, this property should get updated. This assumes you’re inside a viewController or a subclass of one and that you haven’t overridden the tintColor in some superView between this view … Read more

UISearchBar text color change in iOS 7

In iOS 7 to access Text Field you have to reiterate on level more. Change your code like this for (UIView *subView in self.searchBar.subviews) { for (UIView *secondLevelSubview in subView.subviews){ if ([secondLevelSubview isKindOfClass:[UITextField class]]) { UITextField *searchBarTextField = (UITextField *)secondLevelSubview; //set font color here searchBarTextField.textColor = [UIColor blackColor]; break; } } } Note : This … Read more

UILabel and NSLinkAttributeName: Link is not clickable

I can answer my own question now: I am using UITextView instead of UILabel now. I have formatted the UITextView to look and behave like my labels and added: UITextView *textView = [[UITextView alloc] init]; textView.scrollEnabled = NO; textView.editable = NO; textView.textContainer.lineFragmentPadding = 0; textView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0); textView.delegate = self; Don’t forget … Read more

UIImagePickerController breaks status bar appearance

None of the solutions above worked for me, but by combining Rich86man’s and iOS_DEV_09’s answers I’ve got a consistently working solution: UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; and – (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { [[UIApplication sharedApplication] setStatusBarHidden:YES]; } Regarding this awesome solution. For 2014 / iOS8 I found in some cases … Read more

Springs in Auto Layout: Distribute views evenly, with constraints, in Xcode 5

EDIT Note that in iOS 9 this technique will become unnecessary, because a UIStackView will perform distribution automatically. I’ll add another answer explaining how that works. How to Perform Even Distribution Using Autolayout The simplest way to do this in Interface Builder alone (rather than constructing constraints in code) is to use “spacer” views: Position … Read more