<commit_before># UIPhotoGallery

**UIPhotoGallery** is a set of extended & customizable views to show Photo Gallery for iOS UIKit. This library contains 2 main components: **UIPhotoGalleryView** & **UIPhotoGalleryViewController**.

### Table of Contents
1. [DataSource, Delegate, Mode & Style](#datasource-delegate-mode--style)
	* [DataSource, Mode & Style](#datasource-mode--style)
	* [Delegate](#delegate)
2. [UIPhotoGalleryView](#uiphotogalleryview)
	* [Properties](#properties)
	* [Methods](#methods)
3. [UIPhotoGalleryViewController](#uiphotogalleryviewcontroller)
4. [Installation & Dependencies](installation--dependencies)
	* [Installation](#installation)
	* [Setup](#setup)
	* [Dependencies](#dependencies)
	* [Requirements & Supports](#requirements--supports)
5. [Licences](#licences)

## DataSource, Delegate, Mode & Style

UIPhotoGallery is implemented in UITableView style, which uses `dataSource` and `delegate` pointers to contruct UI components.

### DataSource, Mode & Style

To declare number of views showing in gallery:

```objective-c
- (NSInteger)numberOfViewsInPhotoGallery:(UIPhotoGalleryView*)photoGallery;
```
	
To declare a view component in specific index:

```objective-c
- (UIImage*)photoGallery:(UIPhotoGalleryView*)photoGallery localImageAtIndex:(NSInteger)index;
- (NSURL*)photoGallery:(UIPhotoGalleryView*)photoGallery remoteImageURLAtIndex:(NSInteger)index;
- (UIView*)photoGallery:(UIPhotoGalleryView*)photoGallery customViewAtIndex:(NSInteger)index;
```

At a moment, **only one** method will be used to contruct view components for gallery, depends on UIPhotoGalleryView's `galleryMode` property. So far, there are 3 modes supported:

```objective-c
UIPhotoGalleryModeImageLocal
UIPhotoGalleryModeImageRemote
UIPhotoGalleryModeCustomView
```

To declare a caption component in specific index:

```objective-c
- (NSString*)photoGallery:(UIPhotoGalleryView*)photoGallery plainTextCaptionAtIndex:(NSInteger)index;
- (NSAttributedString*)photoGallery:(UIPhotoGalleryView*)photoGallery attributedTextCaptionAtIndex:(NSInteger)index;
- (UIView*)photoGallery:(UIPhotoGalleryView*)photoGallery customViewCaptionAtIndex:(NSInteger)index;
```

Similar to view component, **only one** caption contruction method is used at a moment to contruct caption for gallery item, depends on `UIPhotoGalleryView`'s `captionStyle`, including 3 supported styles:

```objective-c
UIPhotoCaptionStylePlainText
UIPhotoCaptionStyleAttributedText
UIPhotoCaptionStyleCustomView
```

### Delegate

So far, UIPhotoGallery provides 3 delegate methods:

```objective-c
- (void)photoGallery:(UIPhotoGalleryView*)photoGallery didTapAtIndex:(NSInteger)index;
- (void)photoGallery:(UIPhotoGalleryView*)photoGallery didDoubleTapAtIndex:(NSInteger)index;
- (UIPhotoGalleryDoubleTapHandler)photoGallery:(UIPhotoGalleryView*)photoGallery doubleTapHandlerAtIndex:(NSInteger)index;
```

Use `photoGallery:didTapAtIndex:` method to handle single tap at gallery item.

Use `photoGallery:doubleTapHandlerAtIndex:` method to set default action for double tap gesture recognizer. Options including:

```objective-c
UIPhotoGalleryDoubleTapHandlerNone
UIPhotoGalleryDoubleTapHandlerZoom
UIPhotoGalleryDoubleTapHandlerCustom
```

If this method return `UIPhotoGalleryDoubleTapHandlerZoom`, current photo item  will be zoomed at tapping position. If `UIPhotoGalleryDoubleTapHandlerCustom` returned, action will be dispatched to `photoGallery:didDoubleTapAtIndex:` if  implemented. Otherwise, if `UIPhotoGalleryDoubleTapHandlerNone` returned, nothing happens.

## UIPhotoGalleryView

### Properties
<commit_msg>[#9] Update README - add new delegate from jstubenrauch's pull request<commit_after># UIPhotoGallery

**UIPhotoGallery** is a set of extended & customizable views to show Photo Gallery for iOS UIKit. This library contains 2 main components: **UIPhotoGalleryView** & **UIPhotoGalleryViewController**.

### Table of Contents
1. [DataSource, Delegate, Mode & Style](#datasource-delegate-mode--style)
	* [DataSource, Mode & Style](#datasource-mode--style)
	* [Delegate](#delegate)
2. [UIPhotoGalleryView](#uiphotogalleryview)
	* [Properties](#properties)
	* [Methods](#methods)
3. [UIPhotoGalleryViewController](#uiphotogalleryviewcontroller)
4. [Installation & Dependencies](installation--dependencies)
	* [Installation](#installation)
	* [Setup](#setup)
	* [Dependencies](#dependencies)
	* [Requirements & Supports](#requirements--supports)
5. [Licences](#licences)

## DataSource, Delegate, Mode & Style

UIPhotoGallery is implemented in UITableView style, which uses `dataSource` and `delegate` pointers to contruct UI components.

### DataSource, Mode & Style

To declare number of views showing in gallery:

```objective-c
- (NSInteger)numberOfViewsInPhotoGallery:(UIPhotoGalleryView*)photoGallery;
```
	
To declare a view component in specific index:

```objective-c
- (UIImage*)photoGallery:(UIPhotoGalleryView*)photoGallery localImageAtIndex:(NSInteger)index;
- (NSURL*)photoGallery:(UIPhotoGalleryView*)photoGallery remoteImageURLAtIndex:(NSInteger)index;
- (UIView*)photoGallery:(UIPhotoGalleryView*)photoGallery customViewAtIndex:(NSInteger)index;
```

At a moment, **only one** method will be used to contruct view components for gallery, depends on UIPhotoGalleryView's `galleryMode` property. So far, there are 3 modes supported:

```objective-c
UIPhotoGalleryModeImageLocal
UIPhotoGalleryModeImageRemote
UIPhotoGalleryModeCustomView
```

To declare a caption component in specific index:

```objective-c
- (NSString*)photoGallery:(UIPhotoGalleryView*)photoGallery plainTextCaptionAtIndex:(NSInteger)index;
- (NSAttributedString*)photoGallery:(UIPhotoGalleryView*)photoGallery attributedTextCaptionAtIndex:(NSInteger)index;
- (UIView*)photoGallery:(UIPhotoGalleryView*)photoGallery customViewCaptionAtIndex:(NSInteger)index;
```

Similar to view component, **only one** caption contruction method is used at a moment to contruct caption for gallery item, depends on `UIPhotoGalleryView`'s `captionStyle`, including 3 supported styles:

```objective-c
UIPhotoCaptionStylePlainText
UIPhotoCaptionStyleAttributedText
UIPhotoCaptionStyleCustomView
```

### Delegate

So far, UIPhotoGallery provides 3 delegate methods:

```objective-c
- (void)photoGallery:(UIPhotoGalleryView*)photoGallery didTapAtIndex:(NSInteger)index;
- (void)photoGallery:(UIPhotoGalleryView*)photoGallery didDoubleTapAtIndex:(NSInteger)index;
- (UIPhotoGalleryDoubleTapHandler)photoGallery:(UIPhotoGalleryView*)photoGallery doubleTapHandlerAtIndex:(NSInteger)index;
- (void)photoGallery:(UIPhotoGalleryView *)photoGallery didMoveToIndex:(NSInteger)index;
```

Use `photoGallery:didTapAtIndex:` method to handle single tap at gallery item.

Use `photoGallery:doubleTapHandlerAtIndex:` method to set default action for double tap gesture recognizer. Options including:

```objective-c
UIPhotoGalleryDoubleTapHandlerNone
UIPhotoGalleryDoubleTapHandlerZoom
UIPhotoGalleryDoubleTapHandlerCustom
```

If this method return `UIPhotoGalleryDoubleTapHandlerZoom`, current photo item  will be zoomed at tapping position. If `UIPhotoGalleryDoubleTapHandlerCustom` returned, action will be dispatched to `photoGallery:didDoubleTapAtIndex:` if  implemented. Otherwise, if `UIPhotoGalleryDoubleTapHandlerNone` returned, nothing happens.

Use `photoGallery:didMoveToIndex:` method to get notified if the currentIndex changes. (thanks to [**jstubenrauch**](https://github.com/jstubenrauch))

## UIPhotoGalleryView

### Properties

{'fraction_non_alphanumeric': 0.10176282051282051, 'fraction_numerical': 0.0025373931623931625, 'mean_word_length': 8.625964010282777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '6656712', 'n_tokens_mistral': 2438, 'n_tokens_neox': 2120, 'n_words': 535}