<commit_before>


## PubSub-iOS

PubSub-iOS is a very simple, block based wrapper around `NSNotificationCenter`.

The goal is minimal syntax, strong typing, and automatic unregistering.

Here's what it looks like:

    // Declare your notification
    PubSub(nameChanged, NSString)

    // Subscribe
    [Sub while:self nameChanged:^(NSString* name){
        NSLog(@"New Name: %@", name);
    }];
    
    // Publish
    [Pub nameChanged:@"Josh"];



## Getting Started

This library has no dependencies and requires arc.

### Copy 3 Files

Copy `PubSub.h`, `PubSub.m`, and `Notifications.h` into your XCode project. The PubSub files
do all the work and `Notifications.h` is where you declare your notifications.

If your project doesn't have ARC enabled, add the `-fobjc-arc` flag for `PubSub.m`.

### Import Notifications.h

In your `AppName-Prefix.pch` file, add `#import "Notifications.h"`. This makes it available
in all your classes. You can skip this step if you want to do it differently.

### Declare your Notifications

In `Notifications.h` you will use a preprocessor statement to declare your notifications. Declare one per line. For example:

    PubSub(nameChanged, NSString)
    
This generates two strongly typed methods that look kinda like this:

    @interface Pub
    + (void) nameChanged:(NSString*)arg;
    @end
    @interface Sub
    + (void) while:(id)obj nameChanged:(void(^)(NSString*))callback;
    @end
<commit_msg>update readme with zero arguments sample<commit_after>


## PubSub-iOS

PubSub-iOS is a very simple, block based wrapper around `NSNotificationCenter`.

The goal is minimal syntax, strong typing, and automatic unregistering.

Here's what it looks like:

    // Declare your notification
    PubSub(nameChanged, NSString)

    // Subscribe
    [Sub while:self nameChanged:^(NSString* name){
        NSLog(@"New Name: %@", name);
    }];
    
    // Publish
    [Pub nameChanged:@"Josh"];



## Getting Started

This library has no dependencies and requires arc.

### Copy 3 Files

Copy `PubSub.h`, `PubSub.m`, and `Notifications.h` into your XCode project. The PubSub files
do all the work and `Notifications.h` is where you declare your notifications.

If your project doesn't have ARC enabled, add the `-fobjc-arc` flag for `PubSub.m`.

### Import Notifications.h

In your `AppName-Prefix.pch` file, add `#import "Notifications.h"`. This makes it available
in all your classes. You can skip this step if you want to do it differently.

### Declare your Notifications

In `Notifications.h` you will use a preprocessor statement to declare your notifications. Declare one per line. For example:

    PubSub(somethingHappened) // zero arguments

    PubSub(nameChanged, NSString*) // one arguments

    /*
    NOT supported yet (but would be cool)
    PubSub(multipleArgsCommand, NSString*, BOOL, NSString*) // multiple arguments...
    */

This generates two strongly typed methods that look kinda like this:

    @interface Pub
    + (void) somethingHappened;
    + (void) nameChanged:(NSString*)arg;
    @end
    @interface Sub
    + (void) while:(id)obj somethingHappened:(void(^)(void))callback;
    + (void) while:(id)obj nameChanged:(void(^)(NSString*))callback;
    @end

{'fraction_non_alphanumeric': 0.1031055900621118, 'fraction_numerical': 0.0006211180124223603, 'mean_word_length': 3.7298091042584436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1711247', 'n_tokens_mistral': 972, 'n_tokens_neox': 912, 'n_words': 362}