My first Cocoapod is here 🎉 — Jelly 1.0

Yay, my first Pod is available for everyone. Jelly 1.0, a Viewcontroller-Transition-Animation framework that is super easy to use. No need to create your own Presentation-Controllers or Animator-Objects to realize fancy and rich transtions. Jelly will do the heavy lifting for you.

I always wanted to have a public Github repository other people can contribute to and I found myself writing custom Viewcontroller-Transition-Code over and over again. So wouldn’t it be a great idea to create an easy to use Pod for that?

This is the story about how I created Jelly 1.0 including all the problems I had and solutions and tools I found.

Scaffolding 🛠

Until the time I started constructing Jelly 1.0 I worked a lot with Pods created by other people but I never build one by myself. So I started googling around on how to generate one. Creating a Workspace using pod lib create [NAME] was the first thing I did.

pod lib create Jelly

This command created everything I needed to get started. I just had to answer some questions about which language I use, what testing frameworks I want to include etc.

What language do you want to use? [ Swift / ObjC ]
> Swift
Would you like to include a demo app with your library? [ Yes / No ]
> Yes
Which testing frameworks will you use? [ Quick / None ]
> Quick
Would you like to do view based testing? [ Yes / No ]
> No

After CocoaPods created a scaffold for me I opened the workspace file and Xcode immediatly prompted me with the typical Swift 3 Conversion dialog. So it seems that the Cocoapods Template isn’t Swift 3 ready for some reason. I converted the code by myself and tried to build the Project but as you can see it didn’t work. An error appeared❗️

I knew this one. Phew! Xcode needs the SWIFT_VERSION to be set for each target. So I added a post install phase to the Podfile that does the job for me.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings[‘SWIFT_VERSION’] = ‘3.0’
    end
  end
end

I tried to build it again. But .. ❌ (Buzzy Error Sound)

Come on… really !?! A lot of Swift syntax errors appeared inside the Nimble target, so I updated the Nimble-Pod up to 5.1.1 to support Swift 3 
and everything was setup and ready to go 🎉

Creating a Repository 📦

Then I had to create a Github repository for my project in order to connect it to my Cocoapod later. Nothing easier than that. I allready had a Github account so I created a repository with just a few clicks and added it as a remote origin.

Code, code, code ⌨️

Know it was the time to actually build the Pod, creating the classes, designing the interfaces etc. I won’t talk about the code here because this post should focus on the top level steps I took to create the Pod. You can go through each of the source files by yourself on my Github page over here Jelly on Github. Feel free to suggest changes or even make Pull-Request if you want to. Basically my Pod provides an easy to use API for creating basic custom Viewcontroller-Transitions. You can customize a lot of things to make it adapt to your needs.

  • Duration
  • Size for presented ViewController
  • BackgroundStyle (blurred or dimmed)
  • Corner-radius
  • Curve for presentation
  • Curve for dismissal
  • Slide in direction
  • Slide out direction
  • Bounciness

Cool right? 😎

Documentation

After I’ve finished coding I began to document the whole thing. Before I started I looked at other Repositories and the Badges on Top of a lot of Repositories were the first thing that attracted my attention.

Badges ✅ Badges ⚠️ Badges ❌

A badge for everything! http://shields.io lets you create nice badges for your Readme File. You can create your own badge for nearly everything. I decided to chose the following ones.

The first Badge is directly connected to the Travis-CI Service i use for building and testing my Projects. It shows the current build status. The second one is connected to my CocoaPods repository and shows the version number of the Pod. I also added Badges that display the Licence, Operating System and a link to my Twitter Account. I also used GIFRocket and Quicktime to create animated GIFs like the one above and added them to the Readme file.

Travis

As I said before I use Travis to continiously building and testing my Project. Travis is super easy to setup. I just created an account using Github and added a Yaml file called .travis.yml to my Repository that specifies the Environment and commands that should be executed. Pod Lib allready created one for me so I just needed to adapt it to my needs.

I had to play around a little bit to make everything work. Especially getting the right Xcode running wasnt that easy. I opened an issue on Github and immediatly received a response that solved my issue. You can read more about it over here: Travis-Issue. So alltogether it was a good initial experience.

Releasing the Beast 🦁

CocoaPods provides a thing called Trunk. This is the place where all Cocoapods are collected. I only needed to specify a version number and some other things inside my Projects Podspec file. After I linted it locally on my machine to test if everything is setup correctly I pushed it to the Trunk using the following command.

pod trunk push Jelly.podspec

Finally I tried to integrate it into an App to see if it really works and it worked 🎉. Hell yeah, I deployed my first Cocoapod to the Trunk.

Try it yourself: https://github.com/SebastianBoldt/Jelly

What’s next?

  • More Transitions
  • Alignment Options
  • Unit Tests & UI/Snapshot-Tests
  • Bettter Code Documentation
  • Jelly-AlertViews

Tools & Sources

  • GIFRocket and Quicktime to create animated pictures of the Pod
  • Travis for automatically and continiously building and testing the Project
  • Shields.io for creating the Badges on top of the Readme file
  • Github for hosting my shit
  • “Making a Pod“ Article from Cocoapods.org
  • “Specs and the Specs Repo” Article from Cocoapods.org

UPDATE:

After posting this Article some blogs and pages, including Natasha the Robot and iOS Dev Weekly wrote about Jelly and it became one of the most trending Github Projects for more than two weeks now 🎉🎉🎉. I also was Trending Dev for some days. Thanks to everyone who shared or recommended this article.

After two weeks I already got 812 Likes 🎉🎉 and Jelly is still trending
I also was listed next to google and apple in the trending developer list😎

If you have any questions feel free to add me on github, twitter, linkedin or xing. If you like electronic music you can also listen to my Tracks on SoundCloud 😀