Swift extensions to make your life easier

Muhammad Awais
Apr 22, 2021

Today I’ll show you Swift extensions I use in almost every iOS project.

🏁 Here we go:

1. UIImage

Resize the image

While uploading image to server we have to compress the image. With these two powerful extension you can achieve your goal.

Change the Color of Image into Gradient

Add Gradient with start and end color on transparent icon

Change the orientation of Image

This extension will change the orientation of image to up

Result

2. UICollectionView

Scroll to last item of the CollectionView

3. UIButton

Change Image tint color or the Button

4. UIView

Add shadow to UIView with corner radius.

--

--

Muhammad Awais

I am IOS Developer with 6+ years of experience in using IOS SDK, Objective C, Swift, Cocoa Touch framework and XCode. I work hard to write good, reliable code