Giter Site home page Giter Site logo

mmpickerview's People

Contributors

madjid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmpickerview's Issues

fix screen Width

I think your picker's width don't use 320, eg.
ScreenW = [[UIScreen mainScreen] bounds].size.width,
_pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0, 44.0, ScreenW, 216.0)];

if I use iPhone6 or width more than 320,the pickerView will can't full my View

Width on iPad

Thanks for great PickerView!

can you guide me, how to set its width = screen width on iPad?

trouble with @{selectedObject: key}

I have trouble when use @{selectedObject: key}

   [MMPickerView showPickerViewInView:self.view 
                           withStrings:countArray
                           withOptions:@{selectedObject: someSmokedPerDay1}
                            completion:^(NSString *selectedString) {
                                cell.value.text = selectedString;
                                [userDefaults setObject:cell.value.text forKey:@"someSmokedPerDay"];]

Xcode write error:
2014-04-24 18 18 32

I want to select row. How i can do this?

Dismiss PickerView

How can I dismiss the PickerView when going back a segue programmatically?

Reload picker view with new data

how to load new data array after selection of row of 1st data array. The new data array should appear in picker view based on selection of 1st data array.

Add Images

Is it possible or know how to add an image to each row of the UIPickerView?

Syntax for using MMPickerView in a swift project

I'm attempting to use MMPickerView in a swift project. I've got my bridging header in place but the syntax required to use MMPickerView with with swift is escaping me.

Has anyone done this successfully?

Problem with custom objects, objectToStringConverter and completion

This is my object class:

@class RKObjectMapping;

@interface MVCountryModel : NSObject

@property (strong, nonatomic) NSNumber *countryId;
@property (strong, nonatomic) NSString *countryName;

+ (RKObjectMapping *) responseMapping;

- (int) integerValue;

@end

First of all, i had to implement "integerValue" for displaying the picker in this way:

    [MMPickerView showPickerViewInView:self.view
                           withObjects:_countries
                           withOptions:nil
               objectToStringConverter:^NSString *(id object) {
                   return ((MVCountryModel *)object).countryName;
               }
                            completion:^(id selectedObject) {
                                MVCountryModel *country = (MVCountryModel *)selectedObject;
                                [_labelCountry setText:country.countryName];
                                _selectedCountryId = country.countryId;
                            }];

But when a option where selected the app crash on my completion block because it only receive a NSString not an instance of my custom object class.

For make it work i had to change this method in this way:

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
  if (self.objectToStringConverter == nil) {
      /* self.onDismissCompletion ([_pickerViewArray objectAtIndex:row]); */
      self.onDismissCompletion (self.objectToStringConverter ([self selectedObject]));
  } else{
      /* self.onDismissCompletion (self.objectToStringConverter ([self selectedObject])); */
      self.onDismissCompletion ([_pickerViewArray objectAtIndex:row]);
  }
}

It looks so simple that i think i'm doing something wrong, but don't! Hope it helps.

MMTextAlignment Missing

I don't have MMTextAlignment. I added it myself but it didn't come down with the CocoaPod.

Only execute completion when Done pressed.

When I select a row in MMPickerView the completion callback is executed. When I press Done too.

Is there any way to execute completion callback only when Done is pressed and not when select a row?

More than ONE component

Is there any possibility to add more than one component in the pickerview?
That would be perfect for all uses.

Thank you very much.

frame issue

Please fix hard-coded width frame size
//PickerView Container with top bar
_pickerContainerView = [[UIView alloc] initWithFrame:CGRectMake(0.0, _pickerViewContainerView.bounds.size.height - 260.0, [[UIScreen mainScreen]bounds].size.width, 260.0)]; // before width was 320.0

Crash on integerValue

I see a crash on selectedRow = [[_pickerViewArray objectAtIndex:0] integerValue]; but I don't understand why pickerView tries to take an integerValue from objects array that I pass via +(void)showPickerViewInView:(UIView *)view withObjects:(NSArray *)objects withOptions:(NSDictionary *)options objectToStringConverter:(NSString *(^)(id))converter completion:(void (^)(id))completion

Selector not displayed on iOS6

The blue current selector image is not being displayed on iOS6, on iOS7 everything works

    UIColor *colorbg = bgColor;
    NSDictionary *options;
    // iOS7
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
        options = @{MMbackgroundColor: colorbg,
                    MMtextColor: [UIColor whiteColor],
                    MMtoolbarColor: [UIColor grayColor],
                    MMbuttonColor: [UIColor blackColor],
                    MMselectedObject: categoriaActual
                    };
    // iOS6
    } else {
        options = @{MMbackgroundColor: colorbg,
                    MMtextColor: [UIColor blackColor],
                    MMtoolbarColor: [UIColor blackColor],
                    MMbuttonColor: [UIColor blackColor],
                    MMselectedObject: categoriaActual
                    };
    }

    [MMPickerView showPickerViewInView:self.view
                           withStrings:self.categorias
                           withOptions:options
                            completion:^(NSString *selectedString){
                                self.categoriaActual = selectedString;}
                   doneCompletionBlock:^{
                       //NSLog(@"doneCompletion");
                       [self actualizarCategoria:self.categoriaActual];
                   }];

SCREENSHOT

Memory Usage

I've noticed that memory usage continues to grow each time MMPickerView is activated. I noticed this on the app I am developing and in the example provided with the project.

Crash on dismiss

Whenever I try to dismiss the picker the app crashes.
It seems the problem is in this line:

callBack([self selectedObject]);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.