• Stars
    star
    226
  • Rank 176,514 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

Cartography

A declarative Auto Layout DSL for Swift 📱📐
Swift
7,338
star
2

hamburger-button

A hamburger button transition
Swift
2,308
star
3

RBBAnimation

Block-based animations made easy, comes with easing functions and a CASpringAnimation replacement.
Objective-C
2,061
star
4

Underscore.m

A DSL for Data Manipulation
Objective-C
1,465
star
5

FLXView

A UIView that uses Flexbox for layouting. ✨
Objective-C
481
star
6

Swim

A DSL for writing HTML in Swift
Swift
310
star
7

RBBJSON

Flexible JSON traversal for rapid prototyping.
Swift
164
star
8

Fantastical-Alfred-Workflow

A simple Alfred 2 workflow for Fantastical.
158
star
9

NES.swift

An NES emulator written in Swift
Swift
149
star
10

dotfiles

Dotfiles to make computing personal.
Shell
87
star
11

Stubbilino

Simple stubbing for Objective-C
Objective-C
86
star
12

swamp

icon stamping in Swift
Swift
85
star
13

Peel-Off-Animation-Example-Code

Example code for https://robb.is/working-on/a-peel-off-animation
Swift
62
star
14

Monocle

Pretty much only a Lens
Swift
45
star
15

ShaderBugs

Some isssues I ran into with SwiftUI.Shader
Swift
36
star
16

robb.swift

My personal website ported to Swift
Swift
34
star
17

Xcode-Configurations

Useful tweaks to Xcode
Objective-C
30
star
18

jekyll-embedly-client

No longer maintained
Ruby
23
star
19

URLRequest-AWS

An extension on URLRequest to sign it for AWS.
Swift
20
star
20

Marbleo.us

A marbleous project
CoffeeScript
18
star
21

Digitale-Zivilgesellschaft

Recommendations from multiple civil society organisations that fight for independent digital infrastructure and open access to knowledge.
HTML
11
star
22

laughing-man

The Laughing Man logo implemented in pure HTML/CSS
6
star
23

monome.js

A library for writing monome apps with node.js
C++
5
star
24

slang

The pxl effect in the browser
CoffeeScript
4
star
25

spinamp

Winamp inside Spotify – it really whips the moose's ass
CoffeeScript
2
star
26

FeedImporter

Import RSS feeds into SoundCloud
Ruby
1
star
27

thedickensbar.com

Put a Dickensbar on top of every page. Lost all its meaning now that the dickbar is gone…
CSS
1
star
28

6strings

Guitar synthesis in the browser!
CoffeeScript
1
star
29

Future

A simple, cold Future.
Swift
1
star