Need help with cloudinary_ios?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

134 Stars 93 Forks MIT License 273 Commits 10 Opened issues


Cloudinary iOS SDK

Services available


Need anything else?

Contributors list

Cloudinary: Image And Video Management In The Cloud

Cloudinary iOS SDK

Cloudinary is a cloud service that offers a solution to an application's entire image management pipeline.


  • Easily upload images and videos to the cloud.
  • Automatically perform smart image resizing, cropping and conversion without installing complex software.
  • Integrate Facebook or Twitter profile images in a snap, in any dimension and style to match your website’s graphics requirements.
  • Media resources are seamlessly delivered through a fast CDN.

and much much more...

Cloudinary offers comprehensive APIs and administration capabilities and is easy to integrate with any web application, existing or new.

Cloudinary provides URL and HTTP based APIs that can be easily integrated with any Web development framework.

For iOS, Cloudinary provides an SDK for simplifying the integration even further.

Complete Documentation


  • iOS 9.0+
  • Compatible with Swift, tested up to version 5.0.
  • Compatible with Objective-C, see usage example.



CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. To install CocoaPods:

sudo gem install cocoapods

If you don't have a

in your project yet, add it by running the command:
pod init

Add the Cloudinary SDK to your

source ''
platform :ios, '9.0'

target 'MyApp' do pod 'Cloudinary', '~> 3.0' end

Then, run the command:

pod install

Working with the Cloudinary iOS SDK Manually

If you prefer not use a dependency manager, you can add Cloudinary manually by adding it as a submodule to your project:

Open Terminal and navigate to your project's top level directory.

If your project is not initialized as a git repository, run the command:

git init

To add cloudinary as a git submodule, run the command:

git submodule add

Embedded Framework

  1. Drag
    into the Project Navigator of your application's Xcode project. It should appear under your application's blue project icon.
  2. Select
    and make sure the deployment target matches that of your application target.
  3. Select your application project. Under 'TARGETS' select your application, open the 'General' tab, click on the
    button under the 'Embedded Binaries' and Select 'Cloudinary.framework'.



To use the API, you will need a CLDCloudinary instance, which is initialized with an instance of CLDConfiguration.

The CLDConfiguration must have its

properties set. Other properties are optional.

See API, URLs and access identifiers for more details.

There are several ways to initialize CLDConfiguration. You can simply call its constructor with the desired params:

let config = CLDConfiguration(cloudName: "CLOUD_NAME", apiKey: "API_KEY")

Another way is by passing a URL of the form: cloudinary://APIKEY:API[email protected]NAME ```swift let config = CLDConfiguration(cloudinaryUrl: "cloudinary://<APIKEY>:@") ```

You can also add the same URL as an environment parameters under

, then initialize CLDConfiguration using its static initializer
let config = CLDConfiguration.initWithEnvParams()

Now you can create a CLDCloudinary instance to work with

let cloudinary = CLDCloudinary(configuration: config)

URL generation

The following example generates a URL on an uploaded

image: ```swift cloudinary.createUrl().generate("sample.jpg")

// ```

The following example generates an image URL of an uploaded

image while transforming it to fill a 100x150 rectangle:
let transformation = CLDTransformation().setWidth(100).setHeight(150).setCrop(.Crop)


Another example, embedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:

let transformation = CLDTransformation().setWidth(90).setHeight(90).setCrop(.Thumb).setGravity(.Face)


You can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.

Embedding a Facebook profile to match your graphic design is very simple:

let url = cloudinary.createUrl().setTransformation(CLDTransformation().setWidth(90).setHeight(130).setGravity(.Face).setCrop(.Fill)).setType(.Facebook).generate("billclinton.jpg")


You can also chain transformations together:

let transformation = CLDTransformation().setWidth(100).setHeight(150).chain().setCrop(.Fit)
let url = cloudinary.createUrl().setTransformation().generate("sample.jpg")


See our documentation for more information about displaying and transforming images.


Uploading to your cloud is very straightforward.

In the following example the file located at

is uploaded to your cloud:
cloudinary.createUploader().upload(file: fileUrl)

can point to either a local or a remote file.

You can also upload data:

cloudinary.createUploader().upload(data: data)

The uploaded image is assigned a randomly generated public ID, which is returned as part of the response.

You can pass an instance of

for extra parameters you'd want to pass as part of the upload request. For example, you can specify your own public ID instead of a randomly generated one.

For a full list of available upload parameters, see the Upload API Reference documentation.

You can also pass a

closure that is called periodically during the data transfer, and a
closure to be called once the request has finished, holding either the response object or the error.

In the following example, we apply an incoming transformation as part of the upload request, the transformation is applied before saving the image in the cloud. We also specify a public ID and pass closures for the upload progress and completion handler.

let params = CLDUploadRequestParams()
let request = cloudinary.createUploader().upload(file: fileUrl, params: params, progress: { (bytes, totalBytes, totalBytesExpected) in
    // Handle progress
    }) { (response, error) in
        // Handle response

Every upload request returns a CLDUploadRequest instance, allowing options such as cancelling, suspending or resuming it.

Safe Mobile Requests

You should avoid keeping the sensitive

on the mobile device. Instead, if you must perform a signed request, generate the authentication signature on the server side.

You can use any server-side Cloudinary SDK (Ruby on Rails, PHP, Django(Python), Java, .NET, etc.) on your server to generate the signature.

After generating the signature on your server, create a

instance and pass it to the desired secure request.


The SDK provides some convenient methods for downloading files from your cloud:


You can also pass a

closure that is called periodically during the data transfer, and a
closure to be called once the request has finished, holding either the fetched UIImage or an error.
let request = cloudinary.createDownloader().fetchImage(url, progress: { (bytes, totalBytes, totalBytesExpected) in
            // Handle progress
            }) { (responseImage, error) in
                // Handle response

Every download request returns an instance implementing CLDNetworkDataRequest, allowing options such as cancelling, suspending or resuming it.

The downloaded image is cached both to the memory and the disk (customizable). The disk cache size is limited and can be changed.

Other APIs

Management APIs are available as well, via CLDManagementApi


See out documentation for further details.

Additional resources

Additional resources are available at:

How to open the example project

To open the example project, follow these steps: 1. Open to "Example" folder 2. Open the "Cloudinary.xcworkspace"


You can open an issue through GitHub.

Contact us at

Stay tuned for updates, tips and tutorials: Blog, Twitter, Facebook.

Join the Community

Impact the product, hear updates, test drive new features and more! Join here.


Cloudinary is released under the MIT license. See LICENSE for details.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.