• Stars
    star
    250
  • Rank 162,397 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 9 years ago

Reviews

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

Repository Details

Instant Cocoa is a framework for making iOS apps.

Instant Cocoa

What is Instant Cocoa?

Instant Cocoa is an Objective-C framework for making iPhone apps. Instant Cocoa makes intelligent guesses about how your system is set up using introspection, and provides convenient points to override those guesses when you need to.

Instant Cocoa cuts down on the amount of boilerplate you have to write when creating your app by leveraging the powerful dynamic features of Objective-C and generalizing the components that we have to use every day.

What's in Instant Cocoa?

Instant Cocoa is very modular. Each component is only reliant on the components above it.

Dependencies

Instant Cocoa is dependent on Objective-Shorthand, InflectorKit, and AFNetworking.

Instant Core

Instant Cocoa's core provides the shared functionality that all of the other components rely on.

  • Routing - ICRouter does the heavy lifting of mapping urls and paths to view controllers. It supports path matching, variables, and dependencies, and it also provides hooks for custom navigation controllers.
  • Inflector - ICInflector does some of the same work as Rails's inflector, but more specialized for the needs of a modern Objective-C app, such as dynamically building selectors from string components.

Instant Model

Instant Cocoa's model is very powerful. It's built on a lot of the ideas of the RestKit and Mantle frameworks. It has support for:

  • Introspection - Introspection lies at the heart of ICModel. It allows the class to peer into itself to understand its own properties and the attributes they have (such as weak, readonly, copy, etc).
  • Dictionary and JSON Mapping - ICModel can map a dictionary or JSON object to a model object, automatically serializing date and URL objects using the built-in ICSerializers.
  • Coding, Equality, and Hashing - ICModel's introspection enables each model to be able to encode itself using NSCoding, and to automatically provide descriptions, equality checks, and hashing.
  • Remote - Model objects are almost always networking, so ICModel gives you the power to fetch, create, update, delete objects, using REST-based resource conventions. It also gives you the ability to perform REST-like verbs on your objects with a native interface.
  • Serializers - ICSerializer is a protocol that allows value objects to be easily serialized. Date and URL serializers are included. These serializers are automatically used where appropriate, such as in object mapping.
  • Value Objects - more info coming soon!
  • Gateways - more info coming soon!

Instant Data Source

A large amount of the boilerplate in our apps is dealing with table views and collection views and their totally bewildering API. ICDataSource objects are an attempt to simplify that. They are designed to be configured, rather than continually modified. After being configured, they present a straightforward API for table views and collection views to consume.

  • ICSimpleDataSource presents any array of objects to the table view.
  • ICSectionedDataSource takes an array and a sectioning key. It then splits that array into sections based on the sectioning key.
  • ICRemoteDataSource is powered by an API endpoint. It also takes a model for automatic mapping. It provides information to the table view about whether it is loading, had an error, and of course, the objects its presenting.
  • ICPaginatedDataSource is similar to the remote data source, but also takes keys that let it automatically download the next page of objects.
  • ICMultiDataSource is where the true power of data source objects is revealed: It takes several sub-datasources, fetches all of them, and presents them to the table view (or collection view) as they are ready, allowing you to have mixed data types in your table view without the effort of painstakingly synchronizing each of them.

Instant View Controller

Data Source objects are very useful, but without a table view to talk to, they're not doing very much.

  • ICTableViewController provides the basic implementation for a table view. It will agnostically display any Data Source, and will also automatically fetch new pages, if it is displaying a Paginated Data Source.
  • ICCollectionViewController is essentially the same, but with a collection view instead of a table view.

Why Instant Cocoa?

Instant Cocoa is a way of fighting all of boilerplate that we write daily in our apps. The less code we write, the more expressive we can be, the easier code review is, the easier it is to track down bugs, and the faster we can get through the boring stuff and get to the interesting parts of our apps.

Open-source code is extremely important because it allows us to work together on the common code in our code base. Relying on our vendor to provide the framework is risky, since Apple only provides code only when it is absolutely necessary, and the code they provide is usually very conservative. It is up to us to create the frameworks that we need make our app development easier.

More Repositories

1

SKBounceAnimation

A CAKeyframeAnimation subclass that lets you quickly and easily set a number of bounces, and start and end values, and creates an animation for you.
Objective-C
927
star
2

Promise

A Promise library for Swift, based partially on Javascript's A+ spec
Swift
622
star
3

Objective-Shorthand

Objective-Shorthand is a set of categories that make long things in Objective-C short. Additions welcome.
Objective-C
360
star
4

Meridian

Meridian is a web server written in Swift that lets you write your endpoints in a declarative way.
Swift
316
star
5

SKInnerShadowLayer

SKInnerShadowLayer is a CAGradientLayer subclass that adds properties to create an inner shadow on a given layer.
Objective-C
109
star
6

NSArray-LongestCommonSubsequence

This is a category on NSArray that finds the indexes of the longest common subsequence with another array.
Objective-C
73
star
7

swift-sudoku

Swift
40
star
8

NonEmptyArray

An array in Swift that can't be empty
Swift
35
star
9

SchemaSwift

Generate Swift structs from PostgreSQL database schema
Swift
24
star
10

MandrillTransport-CakePHP

This enables using CakeEmail from CakePHP 2.0 with Mandrill.
PHP
19
star
11

SKTabBarController

A clone of UITabBarController to help understand UIViewController containment.
Objective-C
15
star
12

SKNavigationController

A clone of UINavigationController to help understand UIViewController containment.
Objective-C
15
star
13

pepin

JavaScript
12
star
14

SKStateMachine

A simple state machine, written in Objective-C, that uses metaprogramming to define transitions.
Objective-C
12
star
15

ColumnarGroupedTableView

Objective-C
11
star
16

SKReachability

SKReachability is a singleton that gives quick access to information about the connection.
Objective-C
5
star
17

Parser

A small library for parsing JSON in swift
Swift
4
star
18

BigInt

Swift
3
star
19

SwiftgreSQL

A synchronous blocking wrapper around libpq with no dependencies. Forked and modified from `vapor-community/postgresql`.
Swift
3
star
20

FTWStartupLaunch

A drop-in class that lets you set your program to launch at login.
Objective-C
2
star
21

Tablesum

Automatic table footers in pure JavaScript
JavaScript
1
star
22

FTWCache

Dead simple caching for Mac and iOS
Objective-C
1
star