<commit_before># RaisinToast

[![CI Status](http://img.shields.io/travis/adamhrz/RaisinToast.svg?style=flat)](https://travis-ci.org/adamhrz/RaisinToast)
[![Version](https://img.shields.io/cocoapods/v/RaisinToast.svg?style=flat)](http://cocoadocs.org/docsets/RaisinToast)
[![License](https://img.shields.io/cocoapods/l/RaisinToast.svg?style=flat)](http://cocoadocs.org/docsets/RaisinToast)
[![Platform](https://img.shields.io/cocoapods/p/RaisinToast.svg?style=flat)](http://cocoadocs.org/docsets/RaisinToast)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

RaisinToast is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

    pod "RaisinToast"

## Configuration options
### Out of the box configuration

In app delegate add to imports:

    @class RZMessagingWindow;

Add new property:

    @property (strong, nonatomic) RZMessagingWindow *errorWindow;

In implementation add private method:

    - (void)setupMessagingWindow
    {
        self.errorWindow = [RZMessagingWindow defaultMessagingWindow];
        [RZErrorMessenger setDefaultMessagingWindow:self.errorWindow];
        [RZErrorMessenger setDefaultErrorDomain:[NSString stringWithFormat:@"%@.error",[[NSBundle mainBundle] bundleIdentifier]]];
    }

### Style override

Subclass RZErrorMessagingViewController 

    @interface MyErrorMessagingViewController : RZErrorMessagingViewController <RZMessagingViewController>

Override init and provide an alternative color definition for each level of error

    - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if ( self ) {
            self.colorForLevelDictionary = @{
                kRZLevelError :[UIColor redColor],
                kRZLevelInfo : [UIColor blueColor],
                kRZLevelWarning : [UIColor orangeColor],
                kRZLevelPositive : [UIColor greenColor]
            };
            self.errorMessagingViewVerticalPadding = -200.0f;
        }
        return self;
    }

In app delegate use your custom class

    self.errorWindow = [RZMessagingWindow messagingWindow];
    self.errorWindow.messageViewControllerClass = [MyErrorMessagingViewController class];	


### Custom View Controller 
Implement protocol RZMessagingViewController

    - (void)rz_configureWithError:(NSError *)error;
    - (void)rz_presentAnimated:(BOOL)animated completion:(RZMessagingWindowAnimationCompletionBlock)completion;
    - (void)rz_dismissAnimated:(BOOL)animated completion:(RZMessagingWindowAnimationCompletionBlock)completion;

## Demo 

## Author

adamhrz, <EMAIL>

## License

RaisinToast is available under the MIT license. See the LICENSE file for more info.<commit_msg>Working configurable raisin toast<commit_after># RaisinToast

[![CI Status](http://img.shields.io/travis/adamhrz/RaisinToast.svg?style=flat)](https://travis-ci.org/adamhrz/RaisinToast)
[![Version](https://img.shields.io/cocoapods/v/RaisinToast.svg?style=flat)](http://cocoadocs.org/docsets/RaisinToast)
[![License](https://img.shields.io/cocoapods/l/RaisinToast.svg?style=flat)](http://cocoadocs.org/docsets/RaisinToast)
[![Platform](https://img.shields.io/cocoapods/p/RaisinToast.svg?style=flat)](http://cocoadocs.org/docsets/RaisinToast)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

RaisinToast is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

    pod "RaisinToast"

## Configuration options
### Out of the box configuration

In app delegate add to imports:

```objc
@class RZMessagingWindow;
```

Add new property:

```objc
@property (strong, nonatomic) RZMessagingWindow *errorWindow;
```

In implementation add private method:

```objc
- (void)setupMessagingWindow
{
    self.errorWindow = [RZMessagingWindow defaultMessagingWindow];
    [RZErrorMessenger setDefaultMessagingWindow:self.errorWindow];
    [RZErrorMessenger setDefaultErrorDomain:[NSString stringWithFormat:@"%@.error",[[NSBundle mainBundle] bundleIdentifier]]];
}
```

### Style override

Subclass RZErrorMessagingViewController 

```objc
@interface MyErrorMessagingViewController : RZErrorMessagingViewController <RZMessagingViewController>
```

Override init and provide an alternative color definition for each level of error

```objc
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if ( self ) {
        self.colorForLevelDictionary = @{
            kRZLevelError :[UIColor redColor],
            kRZLevelInfo : [UIColor blueColor],
            kRZLevelWarning : [UIColor orangeColor],
            kRZLevelPositive : [UIColor greenColor]
        };
        self.errorMessagingViewVerticalPadding = -200.0f;
    }
    return self;
}
```

In app delegate use your custom class

```objc
self.errorWindow = [RZMessagingWindow messagingWindow];
self.errorWindow.messageViewControllerClass = [MyErrorMessagingViewController class];	
```

### Custom View Controller 
Implement protocol RZMessagingViewController

```objc
- (void)rz_configureWithError:(NSError *)error;
- (void)rz_presentAnimated:(BOOL)animated completion:(RZMessagingWindowAnimationCompletionBlock)completion;
- (void)rz_dismissAnimated:(BOOL)animated completion:(RZMessagingWindowAnimationCompletionBlock)completion;
```

## Demo 

## Author

adamhrz, <EMAIL>

## License

RaisinToast is available under the MIT license. See the LICENSE file for more info.
{'fraction_non_alphanumeric': 0.1083982683982684, 'fraction_numerical': 0.0013852813852813853, 'mean_word_length': 4.936279547790339, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, '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': '5636641', 'n_tokens_mistral': 1919, 'n_tokens_neox': 1753, 'n_words': 361}