Coder Social home page Coder Social logo

sugers3 / asterism Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robb/asterism

0.0 0.0 0.0 431 KB

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

Home Page: http://robb.github.io/Asterism/

License: MIT License

Ruby 0.32% Objective-C 95.98% Shell 2.90% Awk 0.59% C 0.20%

asterism's Introduction

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

asterism's People

Contributors

grgcombs avatar monkeydom avatar ole avatar robb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.