yonat / MultiSelectSegmentedControl

UISegmentedControl remake that supports selecting multiple segments, vertical stacking, combining text and images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

using new swift pod to use in objective c

bindiManek opened this issue · comments

Hello,
I have an old project where I was using the Objective C version of your pod. but somehow app was crashing in iOS 13, so I removed the old Objective C files and installed the pod.

When I tried running it, it builds fine, I created bridging headers and all to make it work. but the following delegate method is not getting executed.

  • (void)multiSelect:(MultiSelectSegmentedControl *)multiSelectSegmentedControl didChange:(BOOL)value at:(NSInteger)index {
    }

What I can do achieve the same..

I'm not sure what's the problem, maybe add _Nonnull. This code works for me:

- (void)multiSelect:(MultiSelectSegmentedControl * _Nonnull)multiSelectSegmentedControl didChange:(BOOL)value at:(NSInteger)index {
    NSLog(@"multiSelect didChange");
}

- (void)viewDidLoad {
    [super viewDidLoad];

    MultiSelectSegmentedControl *multiSegment = [[MultiSelectSegmentedControl alloc] initWithItems: @[@"One", @"Two", @"Three"]];
    multiSegment.delegate = self;
    multiSegment.frame = CGRectMake(32, 64, 240, 32);

    [self.view addSubview:multiSegment];
}