1

I've seen some demos where UIPopoverController is used and would like to use it in my apps.

So does anyone have any good tutorials that you could link me?

Is it possible to use it in relation to UISegmentedControl where different popover windows are summoned when different segments are selected as a type of a switch view function?

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • 3
    Welcome to Stack Overflow, Jacob. I've edited your questions to include appropriate tags for the platform you're asking about (iOS). This will help you attract the attention of the right people here. Also, I've removed the Xcode tag because that really should only be used when asking about the Xcode IDE itself. – Brad Larson Apr 21 '11 at 16:14
  • In regards to this question some of the resources at this question might help you out: [Where can I find iPad Sample Code](http://stackoverflow.com/questions/2276513/where-can-i-find-ipad-sample-code) – Brad Larson Apr 21 '11 at 16:15

2 Answers2

14

Here are some tutorials:

Segmented Popover:

Community
  • 1
  • 1
Nick Weaver
  • 47,228
  • 12
  • 98
  • 108
0
  1. For popover in iPad we can use ActionSheetStringPicker, and for implementing it in your project you need to import ActionSheetStringPicker into your controller. like - #imaport "ActionSheetStringPicker.h"

  2. After importing this you have to create an array which has only string type value.

e.g.

   NSArray *sourceArray=[[NSArray alloc]initWithObjects:@"Take Photo",@"Choose Photo", nil];
  1. And last you have to implement below method.

    [ActionSheetStringPicker showPickerWithTitle:@"Any title"
                                                rows:sourceArray
                                    initialSelection:yourInitialSelectionIntValue
                                           doneBlock:^(ActionSheetStringPicker *picker, NSInteger selectedIndex, id selectedValue) {
    
                                           NSLog(@" Index : %ld, value : %@",
                                                 (long)selectedIndex, selectedValue);
                                           if ([selectedValue isEqualToString:@"Choose Photo"]) {
    
                                               // open photo lib
                                               [self youerMethdeOpenPhotoLib];
    
                                           }
                                           else
                                           {
                                               // open Camera
                                               [self yourMethodOpenCamera];
                                           }
    
    
    
                                       }
                                     cancelBlock:^(ActionSheetStringPicker *picker) {
                                         NSLog(@"Select photo Cancel");
    
                                     }origin:YourTapButtonObject];