Fixed labels in the selection bar of a UIPickerView

Create your picker, create a label with a shadow, and push it to a picker’s subview below the selectionIndicator view. It would look something like this UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(135, 93, 80, 30)] autorelease]; label.text = @”Label”; label.font = [UIFont boldSystemFontOfSize:20]; label.backgroundColor = [UIColor clearColor]; label.shadowColor = [UIColor whiteColor]; label.shadowOffset = CGSizeMake (0,1); … Read more

Showing a UIPickerView with UIActionSheet in iOS8 not working

From the reference for UIActionSheet: UIActionSheet is not designed to be subclassed, nor should you add views to its hierarchy. If you need to present a sheet with more customization than provided by the UIActionSheet API, you can create your own and present it modally with presentViewController:animated:completion:. My guess is your seeing exactly why. The … Read more

iOS 7.1 UITapGesture not working with UIPickerView

I had the same problem, and I finally had a revelation 😛 It was like simultaneous gesture rencognizers on uiPickerView don’t work. so I use the gesture delegate < UIGestureRecognizerDelegate> with // add tap gesture UITapGestureRecognizer* gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(pickerViewTapGestureRecognized:)]; [picker addGestureRecognizer:gestureRecognizer]; gestureRecognizer.delegate = self; with -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{ // return return … Read more

How to use two UIPickerViews in one view controller?

Here is my solution: in the storyboard, add two UIPickerView instances to your view set the first picker’s tag as 1 and set 2 for the second picker under the “Attributes Inspector” control + drag from each picker to the top yellow view controller icon and choose dataSource. Repeat the same choosing delegate add UIPickerViewDataSource … Read more

How do I get a list of countries in Swift ios?

You can get a list of countries using the NSLocale class’s isoCountryCodes which returns an array of [String]. From there, you get the country name by using NSLocale‘s displayName(forKey:) method. It looks like this: var countries: [String] = [] for code in NSLocale.isoCountryCodes { let id = NSLocale.localeIdentifier(fromComponents: [NSLocale.Key.countryCode.rawValue: code]) let name = NSLocale(localeIdentifier: “en_UK”).displayName(forKey: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)