<commit_before># JLAccordion
An accordion controller based on UITableView.



## Usage
Please check out the demo project in the repository.



#### Structure

[![](https://raw.github.com/buhikon/JLAccordion/master/img01.png)](https://raw.github.com/buhikon/JLAccordion/master/img01.png)

There are 2 types of cell, Parent and Child.
You need to create parent data and child data for each cells.



#### Set data

- Create Parent Data
```
[JLAccordionData parentDataWithIdentifier:@"parent_001"
                                 userData:@{@"title":@"Hello"}];
```

- Create Child Data                                 
```
[JLAccordionData childDataWithIdentifier:@"child_001"
                        parentIdentifier:@"parent_001"
                                userData:@{@"title":@"World"}];
```
                                
- Set parent data and child data
```
self.accordionDataController = [JLAccordionDataController alloc] init];
self.accordionDataController.accordionDelegate = self;
[self.accordionData setParentDataArray:(array of parent data)
                        childDataArray:(array of child data)];
```
                        

#### Implement below 3 protocols.

> UITableViewDataSource
> UITableViewDelegate
> JLAccordionDelegate


```
#pragma mark - <UITableViewDataSource>

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.accordionDataController numberOfRows];
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{<commit_msg>fixed mistyped text.<commit_after># JLAccordion
An accordion controller based on UITableView.



## Usage
Please check out the demo project in the repository.



#### Structure

[![](https://raw.github.com/buhikon/JLAccordion/master/img01.png)](https://raw.github.com/buhikon/JLAccordion/master/img01.png)

There are 2 types of cell, Parent and Child.
You need to create parent data and child data for each cells.



#### Set data

- Create Parent Data
```
[JLAccordionData parentDataWithIdentifier:@"parent_001"
                                 userData:@{@"title":@"Hello"}];
```

- Create Child Data                                 
```
[JLAccordionData childDataWithIdentifier:@"child_001"
                        parentIdentifier:@"parent_001"
                                userData:@{@"title":@"World"}];
```
                                
- Set parent data and child data
```
self.accordionDataController = [JLAccordionDataController alloc] init];
self.accordionDataController.accordionDelegate = self;
[self.accordionDataController setParentDataArray:(array of parent data)
                                  childDataArray:(array of child data)];
```
                        

#### Implement below 3 protocols.

> UITableViewDataSource
> UITableViewDelegate
> JLAccordionDelegate


```
#pragma mark - <UITableViewDataSource>

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.accordionDataController numberOfRows];
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
{'fraction_non_alphanumeric': 0.10956741395642564, 'fraction_numerical': 0.00947268708556994, 'mean_word_length': 3.010126582278481, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6898034', 'n_tokens_mistral': 987, 'n_tokens_neox': 844, 'n_words': 198}