GitXplorerGitXplorer
r

Asterism

public
226 stars
12 forks
8 issues

Commits

List of commits on branch master.
Verified
fb58e079f33136e66f8fda8fe9b3dbbc0473fb18

Merge pull request #60 from monkeydom/fix/doc_warnings

rrobb committed 5 years ago
Unverified
1b605c381082352c89ffa531f52eb7660eec69a3

Enabled documentation warnings and fixed the ones that occured

mmonkeydom committed 5 years ago
Verified
8ab964508c0c1cc06b47df5a1abc3273d3f48f64

Merge pull request #59 from robb/no-escape

rrobb committed 5 years ago
Unverified
a62f14be06a1ce889a60fdaa4e6cd6cd0433f76c

Move annotation before caret, revert ASTNegate

rrobb committed 5 years ago
Unverified
a60d9412e9129b9ce72e3142d174221dedd26118

Add NS_NOESCAPE annotations to blocks

rrobb committed 5 years ago
Verified
ef04e187d70eab7a7c95fbd75b53aaefb427148a

Remove travis badge from README

rrobb committed 5 years ago

README

The README file for this repository.

Asterism ⁂

Asterism is yet another functional toolbelt for Objective-C. It tries to be typesafe and simple.

Using common higher-order functions such as map, reduce and filter, Asterism allows you to manipulate Foundation's data structures with ease.

It makes use of overloaded C-Functions to keep its interface simple while maintaining compile-time safety. For instance, ASTEach takes different blocks depending on the data structure it operates on:

ASTEach(@[ @"a", @"b", @"c" ], ^(NSString *letter) {
    NSLog(@"%@", letter);
}];

ASTEach(@[ @"a", @"b", @"c" ], ^(NSString *letter, NSUInteger index) {
    NSLog(@"%u: %@", index, letter);
}];

ASTEach(@{ @"foo": @"bar" }, ^(NSString *key, NSString *value) {
    NSLog(@"%@: %@", key, value);
}];

This page provides extensive documentation on all of Asterism's methods.

Asterism was written by Robert Böhnke and is MIT licensed.

==============================

Getting Started

Using Carthage

Install Carthage if you don't have it. The easiest way is to use HomeBrew: brew update brew install carthage (or if you already have it installed) brew upgrade carthage

Create a Cartfile at the root directory of your project and add the following to its contents...

github 'robb/Asterism'

Run Carthage...

carthage update
If you're building for OS X

On your application targets’ “General” settings tab, in the “Embedded Binaries” section, drag and drop the Asterism.framework from the Carthage/Build/Mac folder.

Additionally, you'll need to copy debug symbols for debugging and crash reporting on OS X.

  1. On your application target’s “Build Phases” settings tab, click the “+” icon and choose “New Copy Files Phase”.
  2. Click the “Destination” drop-down menu and select “Products Directory”.
  3. Now drag and drop the Asterism.framework's corresponding dSYM file.
If you're building for iOS

On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop the Asterism.framework from the Carthage/Build/iOS folder.

On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:

/usr/local/bin/carthage copy-frameworks

and add the path to the Asterism.framework under “Input Files”, e.g.:

$(SRCROOT)/Carthage/Build/iOS/Asterism.framework

For a more detailed background of this script and it's intent, see the Carthage readme.

Using CocoaPods

First, update CocoaPods if you haven't in a while.

Then, add Asterism to your Podfile. Be sure to include use_frameworks!:

# Podfile

use_frameworks!

target 'My-OSX-App' do
    platform :osx, '10.9'
    
    pod 'Asterism'
end

target 'My-iOS-App' do
    platform :iOS, '9.2'
    
    pod 'Asterism'
end

Finally, tell CocoaPods to download and link Asterism in your project:

pod install

Using the Amalgamation header/source file pair

Checkout this repo at the version you desire.

script/gen_amalgamation.sh

cp Amalgamation/* <PathToYourProjectSourcesHere>

And just add the .m file to the targets you desire and #import "Asterism.h" when you use it or in your .pch