Today, I ran into a little problem while working on an iOS app. It was about the size of the app. You know, when you’re building an app, you gotta keep an eye on how big it’s getting. If it gets too big, users might not want to download it, especially if they’re on a slow internet connection or have limited storage space on their phones.
So, I started digging into it. First, I built the app for a release to see the actual size. Then I started looking at all the files in the project. It’s like going through your closet and finding stuff you didn’t even know you had.
Checking Assets
The first thing I checked was the assets catalog. You know, the place where you put all your images and stuff. Sometimes, you might have images in there that are way bigger than they need to be. I used to use a bunch of png images. But this time, I tried to convert most of them into webp. The result was pretty good, size reduced to almost half of its original size. I also went through and made sure all the images were optimized. Like, if an image was being used at a smaller size in the app, I made a smaller version of it instead of using the full-resolution one.
Code Size
Next, I looked at the code. Sometimes, you might have code in your app that you’re not even using anymore. It’s like having old clothes in your closet that you never wear. So, I went through and cleaned up any unused code.
I also checked the third-party libraries I was using. Sometimes, those libraries can be pretty big. If I was only using a small part of a library, I looked for a smaller alternative or just wrote the code myself. That can really help cut down on size.
Build Settings
Another thing I did was check the build settings. There are some settings in Xcode that can affect the size of your app. For example, there’s a setting called “Strip Debug Symbols.” When you build your app for release, it’s a good idea to turn that on. It removes some extra information from the app that’s only needed for debugging. It doesn’t make a huge difference, but every little bit helps.
Result
After doing all that, I built the app again, and guess what? The size was smaller! It wasn’t a crazy difference, but it was enough to make me feel good. Plus, I learned a lot about how to optimize an app’s size. It’s something I’ll definitely keep in mind for future projects. As my friend once told me, every byte counts!
So, that’s my story about trying to reduce the size of an iOS app. Hope you found it helpful!