---
title: "Mantle: Objective-C Model Objects That Don't Suck!"
url: https://deallocatedobjects.com/posts/mantle-objective-c-model-objects-that-don't-suck
author: Jake Marsh
published: 2012-10-22
updated: 2013-12-11
link: https://github.com/blog/1299-mantle-a-model-framework-for-objective-c
topics: ["iOS Development", "Open Source"]
description: "The guys at Github have been rocking some awesome Objective-C open-source stuff lately, and their latest release, Mantle, does not disappoint. Mantle makes it easy to write a simple model layer for your Cocoa or Cocoa Touch application."
---

# Mantle: Objective-C Model Objects That Don't Suck!

By Jake Marsh, October 22, 2012. HTML: https://deallocatedobjects.com/posts/mantle-objective-c-model-objects-that-don't-suck

This is a link post about https://github.com/blog/1299-mantle-a-model-framework-for-objective-c

The guys at Github have been rocking some awesome Objective-C open-source stuff lately, and their latest release, [Mantle, does not disappoint](https://github.com/blog/1299-mantle-a-model-framework-for-objective-c).

> Mantle makes it easy to write a simple model layer for your Cocoa or Cocoa Touch application.

Mantle has the potential (and already does) get rid of a ton of boilerplate model code. It provides default implementations of all the common `<NSCoding>` and `<NSCopying>` methods, as well as `isEqual:` and `hash` methods.

It also provides an awesome little method called `mergeValuesForKeysFromModel:`, which makes it easy to specify how new model data should be integrated.

My favorite feature though is how it cleanly utilizes reversible value transformers to allow for easy re-encoding back in to JSON at any time, not only that, but it even handles migration by automatically saving the version of the model object that was used for archival. Then, upon unarchiving, the `migrateExternalRepresentation:fromVersion:` method is invoked (only if migration is needed), giving you a convenient hook to upgrade old data.

Mantle is still in it's early days, but it looks quite promising.

You can read [Github's blog post about Mantle here](https://github.com/blog/1299-mantle-a-model-framework-for-objective-c), and you can [check out the Mantle Github repository right here](https://github.com/github/Mantle).
