Get Updates By E-mail 

Article Written By:
Johann Dowa

Cent – Swift Library That Simplifies Working With Common Data Types

  •  
  •  
  •  
  •  
  •  

Cent is an open source library from Ankur Patel providing helpers extending the features of many Swift data types.

Cent provides helpers for the Array, Date, Dictionary, Int, String and Range data types.

These snippets from the readme demonstrate the included at, each, and fetch commands:

let array = ["foo", "spam", "bar", "eggs"]
let some = array.at(1, 3)
=> ["spam", "eggs"]

let array = ["foo", "spam", "bar", "eggs"]
array.each {
  print($0)
}
=> ["foo", "spam", "bar", "eggs"]

let arr = [1, 2, 3, 4, 5, 6, 7, 8]
arr.fetch(100)
=> nil

arr.fetch(100, orElse: 42)
=> 42

arr.fetch(-1)
=> 8

You can find Cent on Github here.

A handy library for working with Swift data types.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments