Skip to content
This repository was archived by the owner on Jun 2, 2018. It is now read-only.

Added eachWithIndex: and mapWithIndex: method to iterate arrays#339

Open
draveness wants to merge 1 commit intoBlocksKit:masterfrom
draveness:master
Open

Added eachWithIndex: and mapWithIndex: method to iterate arrays#339
draveness wants to merge 1 commit intoBlocksKit:masterfrom
draveness:master

Conversation

@draveness
Copy link

Sometimes iterate array need index which is similar with ruby syntax like this:

    NSMutableArray *prompts = [@[@"time", @"score", @"fan"] mutableCopy];
    [promptLabels bk_each:^(UILabel *promptLabel, NSUInteger index) {
        promptLabel.text = prompts[index];
    }];

Thx for ur great lib

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant