How R.swift can save your project’s time

Photo by Djim Loic on Unsplash

Original post

iOS swift project gives you a dozen of ways to share your color, fonts, configs. I started my iOS career a few years ago and as an average programmer, I want to share some global data and I wrote my custom stuff for this.

It is not a problem, to create a custom manager for sharing global data, but it needs additional setup, and it has some disadvantages.

And this is time for R.swift library. You can easily download this pod to your project. The installation you can find in GitHub repo. R.swift automatically generates resources for all added images, texts in Localizable files, fonts, nib files, some resource files like JSON files, storyboards, and cells.

So you can simply add fonts to some folder and add data to info.plist about them, and that’s all. (Or add colors and images to Assets.xcassets folder. This data will be available in globally generated R struct. You can use these data like below:

For more convenient use, you can add typealias for more shorthand form.

I recommend using R.swift in your iOS projects, it will save your time, and gives you the ability to avoid creating some custom managers for fonts, colors, images, etc. Leave this routine work for this awesome tool.

R.swift library

--

--

--

iOS Software Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

REST vs SOAP

How to Let Other People Add Events Directly to a Designated Calendar

8 Must Have Extensions for Flutter Developers

Flask vs Django

Breaking barriers of ViewPager 2

Ways to Make Money as a Developer — Videos, Job Boards, and More

How to install Arduino IDE on your Chromebook

Data Flow Diagram

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Almost Engineer

Almost Engineer

iOS Software Developer

More from Medium

How to start iOS Development

Adding iPad support to your iOS app

Supporting Accessibility in your iOS app

How I Made $20,000 With My First iOS Development Course On Udemy