I have developed an iOS app with Objective-C, but it is very heavy. What kinds of things can I do to reduce the size of my app?
In particular I want to improve in these two aspects:
- Images
- code reduction
I have developed an iOS app with Objective-C, but it is very heavy. What kinds of things can I do to reduce the size of my app?
In particular I want to improve in these two aspects:
Well for images you can do 3 things:
1) use the 3 resolutions @1X @2X @3X depending on the phone it compiles the resolution you need.
2) Use sprites as in games, in this way you load a single png image that contains many of your images, this image is accompanied by an XML or JSON file that identifies the coordinates of each of the images that make up the image. image.
3) Have the images in the cloud and define in the application when it is appropriate to start downloading them, in this case you can have them compressed in a Zip folder, once you download them, unzip them and save them locally.
To Reduce the code there are software architectures, generally the most common and used is the Model View Controller but there are others such as the clean architecture Model View Presenter. Personally, what I do to save code is to have a class of constants such as colors, urls and parameters that will not change. Create extensions for many classes such as NSString with validation of formats such as emails, phone numbers, etc. maintain the architecture in each view by creating an XIB, a ViewController(NameClass) and a Model(NameClass). If I require a special business logic in the controller then I create the BusinessLogic(NameClass) class or if I want to connect to the internet for some process or several processes of the same class then I create the Repository(NameClass) class.
I hope this helps you a bit. (Y)