This repository is used in conjunction with the Cloudinary Academy training course, Introduction to Cloudinary's iOS SDK.
If you would like to take this 35-minute course, you can enroll for free at training.cloudinary.com.
The information below corresponds with the slides used in Introduction to Cloudinary's iOS SDK.
Course Topics:
- Introduction
- Mobile Development
- iOS Course App
- Environment Setup
- Asset Delivery
- Optimizations
- Transformations
- Upload
- Upload Presets
- Uploading an Asset
- Pre-Processing
- Fetch
- Widgets
- Cloudinary Image Widget
- Cloudinary Upload Widget
- Video
- Cloudinary Native Video Player
- Video Feed
- Further Support
We'll be presenting this content using XCode
This is the entry point to static "runners" that contain code to help you upload, manage and transform your media.
- We are using Swift version 5.9.2 in the course
- You can find instructions for downloading and installing Swift for many environments.
swift -version
Sample output for Version 5.9.2
$ swiftc -version
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
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 Podfile
in your project yet, add it by running the command:
pod init
Add the Cloudinary SDK to your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'MyApp' do
pod 'Cloudinary', '~> 5.0'
end
Then, run the command:
pod install
Create Cartfile
touch Cartfile
Open Cartfile
and enter the following line
github "cloudinary/cloudinary_ios" ~> 5.0
Then, run the command:
carthage update --use-xcframeworks
A Cartfile.resolved
file and a Carthage
directory will appear in the same directory where your .xcodeproj
or .xcworkspace
is.
Drag the built .xcframework
bundles from Carthage/Build
into the Frameworks and Libraries
section of your application’s Xcode project.
- File > Add Packages... >
- Add https://github.com/cloudinary/cloudinary_ios.git
- Select "Up to Next Major" with "5.0.0"
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 https://github.com/cloudinary/cloudinary_ios.git
You will need to register for a free Cloudinary account to work along with this training.
It is recommended that you create a training account for this training to keep this work separate from any work you do in a production Cloudinary account.
You only need an email address that can be verified to set up this account.
Navigate to: https://cloudinary.com/console
CLOUD_NAME and API_KEY can be revealed without creating any security issues, but you must keep API_SECRET private. It’s strongly recommended not to keep your API Secret anywhere within the app code.
Don't check it into GitHub and don't include it in blog posts.
- For this course, you only need your cloud name, so there won't be any risk of security.