Show/hide UIToolbar, “match finger movement”, precisely as in for example iOS7 Safari

There is no open-source that does this, but I don’t see it as that difficult to implement. It may be somewhat more difficult to have the exact 1:1 behavior as Safari, but it can still be done. MobileSafar can be attached to in the debugger and, using breakpoints and the Objective C runtime, debugged and … Read more

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

Is there a way since (iOS 7’s release) to get the UDID without using iTunes on a PC/Mac?

Navigate to http://get.udid.io/ from Safari on your iOS device. It works like a charm and requires neither iTunes nor any other computer. No app installed either. EDIT: Also, have a look at Getting a device UDID from .mobileconfig if you (understandably) would rather have this .mobileconfig certificate hosted on a server of yours. MAKE YOUR … 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

Access Asset Catalog pathForResource

Same problem, but I don’t think we could access it via pathForResource:, except below: UIImage* image = [UIImage imageNamed:@”name-in-asset-catalog”]; It has been clearly documented: Each set in an asset catalog has a name. You can use that name to programmatically load any individual image contained in the set. To load an image, call the UIImage:imageNamed: … 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