Latest 0.0.1
License MIT
Platforms ios 8.0

alt text

CI Status

Pomegranate is all about creating easy UI for your applications. Inside
this library you have a bunch of class extensions to help you build
beautiful apps and make hard tasks easy.

Pomegranate is divided in 6 components:


As the name suggests, this is a UIView class extension to add gradients
to views. It works like this:

myView.addGradient(beginningColor: .blue, endingColor: .yellow, type:
.leftToRight, animated: true)

This will create something like this:

The possible gradient types are:

  • .leftToRight
  • .rightToLeft
  • .diagonalLeftToRight
  • .diagonalRightToLeft
  • .topToBottom
  • .bottomToTop

Other functions available:

Function Parameters Use
addGRadientWithMultipleColors() [CGColor], type, animated Adds gradient with multiple colors
deleteGradient() animated Deletes all of the gradients on the current view

Note: This will remove all of the gradients on that view.


Downloading images from a URL can be awkward sometimes, that’s where
Downloaderr comes to the rescue. Downloaderr is a UIImageView extension used
to download images from a URL and even put a placeholder while the download
is happening. Downloaderr also saves your images on a temporary cache so
you don’t download the same image twice.

It works as follows:

 myImageView.downloadImageWith(url: NSURL(string: "")!, placeholder: UIImage(named: "placeholder")!)

Other functions available:

Function Parameters Use
downloadImageFrom(url:) url download Image from a URL without placeholder


This is a Date class extension that provides different options in converitng a string into a Date or vice versa.
It works like this:

Creating Dates:

let date = Date(dateInString: "15/03/2017",dateFormat: "dd/MM/yyyy")!

Converting dates to strings:

string = date.toTimeLanguage()
string = date.toTimeLanguage([.oneDayago:"Yesterday"])
string = date.convertTo(format: .short)
string = date.convertTo(format: .custom("dd-MM-yyyy"))

Possible formats for converting dates to strings:

  • .full
  • .short
  • .medium
  • .long
  • .weekDay
  • .custom(String)

Time language formats to customize:

Format Custom string
.rightNow A moment ago
.oneDayAgo One day ago
.oneYearAgo One year ago
.yearsAgo (years) years ago
.daysAgo (days) days ago
.minutesAgo (minutes) minutes ago
.oneMinuteAgo One minute ago


Adding attributes to a string is pretty weird, let’s face it. We decided
to make it easier like such:

myLabel.attributedText = Attributerr.sharedAttributerr.create(string: "Hello World!", backgroundColor: .red, font: .systemFont(ofSize: 20), color: .blue, underLineStyle: 0)

This will create something like this:

All of the parameters except the string value have default values, so you don’t need to set them
all on the function call.

This are the default values used:

  • backgroundColor = .clear
  • font = UIFont(name: "System", size: 12)!
  • color = .black
  • underLineStyle = 0

This segment comes with other handy functions like the following:

Function Parameters Use
addAttributesToRange() string, NSRange, attributes Add attributes to a NSRange
addAttributesToSubstring() string, substring, attributes Adds attributes to a substring of your string

The attributes parameter is the list of available parameters that have
default values.


This is a UIColor extension that provides popular color options to
create beautiful UI.

Color options:

  • SocialMedia
  • Red
  • Green
  • Purple
  • Blue
  • Gray
  • Yellow
  • Orange
  • Pink

Each color let’s you pick the intensity, for example:


The intensities can be:

  • dark
  • light
  • regular

Page View

This is a head start in creating a page view that is used for an introduction of an application. It looks somthing like this:

To get started in creating one, you can do this:

let vc = PageViewController()
vc.titles = ["Title1","Title2","Title3"]
self.navigationController?.pushViewController(vc, animated: true)


To run the example project, clone the repo, and run pod install from the Example directory first.



Pomegranate is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Pomegranate"




Pomegranate is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "Pomegranate",
    "version": "0.0.1",
    "summary": "This is a library that will help you create beautiful UI with ease, it also make stressful tasks look like a breeze",
    "description": "Pomegranate is an open source project used to create beautiful UI and make stressful tasks easy.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "tonyyasi": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.0.1"
    "platforms": {
        "ios": "8.0"
    "source_files": "Pomegranate/Classes/**/*",
    "resources": "Pomegranate/Assets/**/*.{xib}",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This