简体   繁体   中英

Reduce App Size in IOS

I created a xib with one cell contains UIImageView . imageview has leading, trailing, top, bottom constraints. xib is of 4kb and file size is 4kb. I created one more class with same contraints and object programatically. That class have size of 8kb.

I need to know whether programatically creating views will take less space or with xib will take less space and please let me know the ways to reduce app size.

I need to know whether programmatically creating views will take less space or with xib will take less space

The views which your create using interface are automatically converted to code including constraints. So it doesn't matter on how you create your views as per the size is concerned, But if you consider usability, readability and maintenance of code interface builder is of much help.

ways to reduce app size

Apple has given its tips on how application size can be optimized. You can check it here.

There is another way to reduce app size, which is removing unused code. Here is a tool to detect unused code: WBBlades https://github.com/wuba/WBBlades . It can help you find unused classes in Objc & Swift, so you can safely remove them to reduce app size.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM