The iOS framework that grows only as fast as its documentation
Nimbus Core

Modules

 Actions
 For attaching actions to objects.
 
 Button Utilities
 For manipulating UIButton objects.
 
 Common Metrics
 For common system metrics.
 
 Data Structures
 For classic computer science data structures.
 
 Debugging Tools
 For inspecting code and writing to logs in debug builds.
 
 Device Orientation
 For dealing with device orientations.
 
 Errors
 For defining various error types used throughout the Nimbus framework.
 
 Foundation Methods
 For filling in gaps in Apple's Foundation framework.
 
 Image Utilities
 For manipulating UIImage objects.
 
 In-Memory Caches
 For storing and accessing objects in memory.
 
 Network Activity
 For showing network activity in the device's status bar.
 
 Non-Empty Collection Testing
 For testing whether a collection is of a certain type and is non-empty.
 
 Non-Retaining Collections
 For collections that don't retain their objects.
 
 Operations
 For writing code that runs concurrently.
 
 Paths
 For creating standard system paths.
 
 Preprocessor Macros
 Preprocessor macros are added to Nimbus with care.
 
 Runtime Class Modifications
 For modifying class implementations at runtime.
 
 SDK Availability
 For checking SDK feature availibility.
 
 Snapshot Rotation
 An object designed to easily implement snapshot rotation.
 
 State
 For modifying Nimbus state information.
 
 View Recyling
 For recycling views in scroll views.
 

Classes

class  NINavigationAppearance
 The NINavigationAppearance provides support for saving and restoring the navigation appearance state. More...
 

Overview

Nimbus' Core defines the foundation upon which all other Nimbus features are built. Within the core you will find common elements used to build iOS applications including in-memory caches, path manipulation, and SDK availability. These features form the foundation upon which all other Nimbus libraries are built.

How Features are Added to the Core

As a general rule of thumb, if something is used between multiple independent libraries or applications with little variation, it likely qualifies to be added to the Core.

Exceptions

Standalone user interface components are rarely acceptable features to add to the Core. For example: photo viewers, pull to refresh, launchers, attributed labels.

Nimbus is not UIKit: we don't have the privilege of being an assumed cost on every iOS device. Developers must carefully weigh whether it is worth adding a Nimbus feature - along with its dependencies - over building the feature themselves or using another library. This means that an incredible amount of care must be placed into deciding what gets added to the Core.

How Features are Removed from the Core

It is inevitable that certain aspects of the Core will grow and develop over time. If a feature gets to the point where the value of being a separate library is greater than the overhead of managing such a library, then the feature should be considered for removal from the Core.

Great care must be taken to ensure that Nimbus doesn't become a framework composed of hundreds of miniscule libraries.

Common autoresizing masks

Nimbus provides the following macros: UIViewAutoresizingFlexibleMargins, UIViewAutoresizingFlexibleDimensions, UIViewAutoresizingNavigationBar, and UIViewAutoresizingToolbarBar.

// Create a view that fills its superview's bounds.
UIView* contentView = [[UIView alloc] initWithFrame:self.view.bounds];
contentView.autoresizingMask = UIViewAutoresizingFlexibleDimensions;
[self.view addSubview:contentView];
// Create a view that is always centered in the superview's bounds.
UIView* centeredView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
centeredView.autoresizingMask = UIViewAutoresizingFlexibleMargins;
// Center the view within the superview however you choose.
[self.view addSubview:centeredView];
// Create a navigation bar that stays fixed to the top.
UINavigationBar* navBar = [[UINavigationBar alloc] initWithFrame:CGRectZero];
[navBar sizeToFit];
navBar.autoresizingMask = UIViewAutoresizingNavigationBar;
[self.view addSubview:navBar];
// Create a toolbar that stays fixed to the bottom.
UIToolbar* toolBar = [[UIToolbar alloc] initWithFrame:CGRectZero];
[toolBar sizeToFit];
toolBar.autoresizingMask = UIViewAutoresizingToolbarBar;
[self.view addSubview:toolBar];

Why they exist

Using the existing UIViewAutoresizing flags can be tedious for common flags.

For example, to make a view have flexible margins you would need to write four flags:

view.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin
| UIViewAutoresizingFlexibleTopMargin
| UIViewAutoresizingFlexibleRightMargin
| UIViewAutoresizingFlexibleBottomMargin);