CooperRS / RMPickerViewController

This is an iOS control for selecting something using UIPickerView in an UIAlertController like manner
MIT License
381 stars 51 forks source link

Subclass constructors need to have the same nullability annotations as RMActionController 1.0.5 #40

Closed mkalinowski closed 8 years ago

mkalinowski commented 8 years ago

In RMActionController 1.0.5 convenience factory methods have extra nullability annotations:

+ (nullable instancetype)actionControllerWithStyle:(RMActionControllerStyle)style title:(nullable NSString *)aTitle message:(nullable NSString *)aMessage selectAction:(nullable RMAction *)selectAction andCancelAction:(nullable RMAction *)cancelAction {

while in RMPickerViewController 2.0.2 annotations are missing:

+ (instancetype)actionControllerWithStyle:(RMActionControllerStyle)style title:(NSString *)aTitle message:(NSString *)aMessage selectAction:(RMAction *)selectAction andCancelAction:(RMAction *)cancelAction {

When the picker is created from the Swift code like the following, only RMActionController constructor is called, leaving the RMPickerViewController in partially initialised state:

let picker: RMPickerViewController? = RMPickerViewController(style: .White,
    title: "Title",
    message: "",
    selectAction: RMAction(title: "Select", style: .Done) { _ in  },
    andCancelAction: RMAction(title: "Cancel", style: .Cancel) { _ in })

With RMActionController 1.0.4 and RMPickerViewController 2.0.2 it works properly.

CooperRS commented 8 years ago

Hi,

working on it. Thanks for pointing me at the problem :)

Best regards, Roland

CooperRS commented 8 years ago

OK just pushed version 2.0.3 of RMPickerViewController. this version should solve your problem. If it does, please close the ticket :)

mkalinowski commented 8 years ago

Works as advertised. Thank you!