CooperRS/RMPickerViewController

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

mkalinowski opened this issue · 3 comments

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.

Hi,

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

Best regards,
Roland

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

Works as advertised. Thank you!