Fabian Canas

8pods

FFCPieChart

Dead-simple pie and donut charts for iOS

License: MIT

  • Objective C

FFCStorage

Auth and Network handling so you can store models in a RESTful API.

License: MIT

  • Objective C

FFCTemplate

A simple template renderer in Objective-C. Fill templates with object properties, methods, and key paths.

Given ``` @interface MYObject : NSObject @property (nonatomic, copy) NSString *color; @property (nonatomic, copy) NSNumber *favoriteNumber; @property (nonatomic, assign) NSInteger leastFavoriteNumber; @end

...

obj = [[MYObject alloc] init]; obj.color = @"red"; obj.favoriteNumber = @47; obj.leastFavoriteNumber = -12; ```

and

NSString *templateString = @"My favorite color is {{ color }} and my favorite number is {{ favoriteNumber }} and my least favorite number is {{ leastFavoriteNumber }}!";

``` template = [[FFCTemplate alloc] initWithTemplate:templateString]; template.valueSource = obj;

NSString *result = [template render]; //@"My favorite color is red and my favorite number is 47 and my least favorite number is -12!" ```

License: MIT

  • Objective C

FFCTextField

FFCTextField is a small collection of features for implementing elegane text fields suitable for use in forms, and elsewhere.

The text field's placeholder text animates into a floating title label.

The text field also features validation functions that provide feedback to the user via the same floating label mechanism.

License: MIT

  • Swift

Formulary

Formulary is a library for creating dynamic, declarative, table view forms for iOS.

Formulary is inspired by XLForm, written in Swift, and designed for developer flexibility. It is intended to stay small and possibly as a foundation for ther libraries.

Development-oriented features include:

  • Form components are Swift protocols
  • Lots of points of control to override default behavior
  • Easy to integrate with existing model classes

Other cool features:

  • "Floating Labels" for form fields.
  • Composable validation functions

```swift self.form = Formulary.ConcreteForm(sections: [ Formulary.ConcreteFormSection(rows: [ Formulary.ConcreteFormRow(name:"Name", tag: "name", type: .Text, validation: RequiredString("Name")), Formulary.ConcreteFormRow(name:"Email", tag: "email", type: .Text), Formulary.ConcreteFormRow(name:"Age", tag: "age", type: .Number, validation: MinimumNumber("Age", 13))], name:"Profile"), Formulary.ConcreteFormSection(rows: [ Formulary.ConcreteFormRow(name:"Favorite Number", tag: "favoriteNumber", value: nil, type: .Decimal, validation: MinimumNumber("Your favorite number", 47) && MaximumNumber("Your favorite number", 47)), Formulary.ConcreteFormRow(name:"Ice Cream?", tag: "wantsIceCream", value: false, type: .Switch), Formulary.ConcreteFormRow(name:"Beer?", tag: "wantsBeer", value: true, type: .Switch), Formulary.ConcreteFormRow(name:"Other Thoughts?", tag: "thoughts", type: .Text),], name:"Preferences", footerName: "Fin"), Formulary.ConcreteFormSection(rows: [ Formulary.ConcreteFormRow(name:"Show Values", tag: "show", type: .Button, action: { _ in

let data = NSJSONSerialization.dataWithJSONObject(values(self.form) as NSDictionary, options: nil, error: nil)!
let s = NSString(data: data, encoding: NSUTF8StringEncoding)

let alert = UIAlertController(title: "Form Values", message: s, preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
})

]) ] ) ```

License: MIT

  • Swift

iOS-Color-Picker

A reusable, simple color picker for iOS.

  • Works on iPhone
  • Works on iPad

License: MIT

  • Objective C

OHMKit

Map service responses to objects.

OHMKit is a mixin to make any Objective-C class easier to hydrate from a dictionary representation, such as you might get from a RESTful web service.

It exists because RestKit encompasses far too many concerns, and Mantle likewise takes on too much.

There is no networking layer. There is no entity relationship management. There are other tools for that.

License: MIT

  • Objective C

SafeCast

  • Cast in Objective-C, not in C
  • Be Safe
  • Be Concice

Objective-C is C, and C can be perilous. Don't blindly cast objects. Stick to high-level language features, and write more readable code.

Quite simply, you can do things like this:

NSMutableArray *mArray = [NSMutableArray safe_cast:array]; // `mArray` is `nil` if `array` is not a mutable array, and is `array` if it is mutable.

Or only perform a selector if the target responds to it without an explicit check:

[array safe_makeObjectsSafelyPerformSelector:@selector(method)];

Or enumerate with a block on objects that are of a specific kind:

[array safe_enumerateObjectsOfKind:[MyObject class] usingBlock:^(MyObject *obj, NSUInteger idx, BOOL *stop) { [obj setNumber:@3]; }];

And lots of other similar methods on collections.

License: MIT

  • Objective C