<commit_before>//
//  DPScrollableView.h
//  EventGenie
//
//  Created by <NAME> on 14/01/2014.
//  Copyright (c) 2014 GenieMobile. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DPScrollableViewCell.h"


@class DPScrollableView;


@protocol DPScrollableViewDatasource <NSObject>

@optional
- (UIView *)scrollableView:(DPScrollableView *)view getViewForIndex:(NSInteger)index;
- (UIImage *)scrollableView:(DPScrollableView *)view getImageForIndex:(NSInteger)index;
- (NSString *)scrollableView:(DPScrollableView *)view getTitleForIndex:(NSInteger)index;
- (void)scrollableView:(DPScrollableView *)view didAddCell:(DPScrollableViewCell *)cell;
- (void)scrollableView:(DPScrollableView *)view willSelectCellAtIndex:(NSInteger)index;
- (void)scrollableView:(DPScrollableView *)view didSelectCellAtIndex:(NSInteger)index;
- (void)scrollableView:(DPScrollableView *)view didLongPressCellAtIndex:(NSInteger)index;

@required
- (NSInteger)numberOfCellsforScrollableView:(DPScrollableView *)view;

@end


@interface DPScrollableView : UIView <UIScrollViewDelegate>
{
    UIScrollView *_scrollView;
    CGPoint _contextOffsetAtStartOfDrag;
    BOOL _scrollViewDraggedBeyondContentBoundary;
    
    NSInteger _selectedIndex;
    NSInteger _scrolledToIndex;
    CGFloat _cellWidth;
}


@property (nonatomic, weak) id <DPScrollableViewDatasource> datasource;
@property (nonatomic, strong) UIColor *textColor;

- (id)initWithFrame:(CGRect)frame datasource:(id <DPScrollableViewDatasource>)datasource;
- (DPScrollableViewCell *)cellAtIndex:(NSUInteger)index;
- (UIView *)viewAtIndex:(NSUInteger)index;
- (void)setHighlightOnAllRows:(BOOL)high;
- (void)reloadTabAtIndex:(NSInteger)index;
- (void)setSelectedIndex:(NSInteger)index;
- (void)setSelectedIndex:(NSInteger)index animated:(BOOL)animated;
- (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
- (void)scrollTabIntoViewIfNeededWithIndex:(NSInteger)index;
- (void)flashLeftScrollIndicator;
- (void)flashRightScrollIndicator;
- (void)flashBothScrollIndicators;
- (void)removeScrollIndicators;

@end
<commit_msg>exposing the selected index:<commit_after>//
//  DPScrollableView.h
//  EventGenie
//
//  Created by <NAME> on 14/01/2014.
//  Copyright (c) 2014 GenieMobile. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DPScrollableViewCell.h"


@class DPScrollableView;


@protocol DPScrollableViewDatasource <NSObject>

@optional
- (UIView *)scrollableView:(DPScrollableView *)view getViewForIndex:(NSInteger)index;
- (UIImage *)scrollableView:(DPScrollableView *)view getImageForIndex:(NSInteger)index;
- (NSString *)scrollableView:(DPScrollableView *)view getTitleForIndex:(NSInteger)index;
- (void)scrollableView:(DPScrollableView *)view didAddCell:(DPScrollableViewCell *)cell;
- (void)scrollableView:(DPScrollableView *)view willSelectCellAtIndex:(NSInteger)index;
- (void)scrollableView:(DPScrollableView *)view didSelectCellAtIndex:(NSInteger)index;
- (void)scrollableView:(DPScrollableView *)view didLongPressCellAtIndex:(NSInteger)index;

@required
- (NSInteger)numberOfCellsforScrollableView:(DPScrollableView *)view;

@end


@interface DPScrollableView : UIView <UIScrollViewDelegate>
{
    UIScrollView *_scrollView;
    CGPoint _contextOffsetAtStartOfDrag;
    BOOL _scrollViewDraggedBeyondContentBoundary;
    
    NSInteger _selectedIndex;
    CGFloat _cellWidth;
}


@property (nonatomic, weak) id <DPScrollableViewDatasource> datasource;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic) NSInteger selectedIndex;

- (id)initWithFrame:(CGRect)frame datasource:(id <DPScrollableViewDatasource>)datasource;
- (DPScrollableViewCell *)cellAtIndex:(NSUInteger)index;
- (UIView *)viewAtIndex:(NSUInteger)index;
- (void)setHighlightOnAllRows:(BOOL)high;
- (void)reloadTabAtIndex:(NSInteger)index;
- (void)setSelectedIndex:(NSInteger)index;
- (void)setSelectedIndex:(NSInteger)index animated:(BOOL)animated;
- (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
- (void)scrollTabIntoViewIfNeededWithIndex:(NSInteger)index;
- (void)flashLeftScrollIndicator;
- (void)flashRightScrollIndicator;
- (void)flashBothScrollIndicators;
- (void)removeScrollIndicators;

@end

{'fraction_non_alphanumeric': 0.12158927716610819, 'fraction_numerical': 0.0057443752991862135, 'mean_word_length': 8.369955156950672, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4538900', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1348, 'n_words': 207}