Skip to content

Instantly share code, notes, and snippets.

@hemant3370
Created November 30, 2015 10:16
Show Gist options
  • Save hemant3370/b0abb60578de78d26bb3 to your computer and use it in GitHub Desktop.
Save hemant3370/b0abb60578de78d26bb3 to your computer and use it in GitHub Desktop.
popover initiation
-(void)countryPop{
UIViewController *countryContent = [[UIViewController alloc]init];
UIView *popDataPickerView = [[UIView alloc]init];
popDataPickerView.backgroundColor = [UIColor whiteColor];
UIPickerView *countryPicker = [[UIPickerView alloc]init];
self.countryList = [[UIPopoverController alloc]initWithContentViewController:countryContent];
self.countryList.delegate = self;
countryPicker.delegate=self;
countryPicker.dataSource = self;
[popDataPickerView addSubview:countryPicker];
countryContent.view = popDataPickerView;
[self.countryList setPopoverContentSize:CGSizeMake(320, 240) animated:YES];
[self.countryList presentPopoverFromRect:txtCountry.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment