bundle

Jameskrauser Lee
3 min readNov 15, 2017

--

What is Bundle?
A bundle is a directory in file system that groups executable code and related resources such as executable code, images, sounds, nib files, private frameworks and libraries, plug-ins , loadable bundles.
event contain runtime-configuration file called the information property list(Info.plist)

feature
1.easy to install or relocate an application.
2. internationalization. you can setting English GUI and easy change to French GUI.
3.App can dynamically load code and resource from main bundle or subordinate bundles as require.

PS:
nib file
a special type of resource file use to store user interface of iOS and Mac Apps.
(like older storyboard)

Demo
use bundle switch storyboard in different Device
purpose:
iphone device use Main.storyboard automatically
ipad device use ipad.storyboard automatically

Detect method 1:
use userinterfaceIdiom to detect screen

add ipad.storyboard
use currentDevice to switch storyboard in different device
chose iphone device
show the main.storyboard automatically
show ipad.storyboard automatically
add PressMe code
add class ViewController in ipad.storyboard
drag Outlets to GUI connect code
drag Outlets to GUI connect code
now Press Me button will show ipad storyboard on Top

Detect method 2 :
use [[UIScreen mainScreen] bounds].size.height to check device

SourceCode

Data From
https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/Bundle.htmlhttp://blog.csdn.net/startexcel/article/details/7099234

Edit:
20171121: add bundle example code

--

--

Jameskrauser Lee

For the last few years. i was involved mostly in the development of Automatic Fare collection system for the Chennai Metro. Familiar with C++ and iOS.