iOS UI utility classes
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


UIUtilis is a collection of iOS classes for rendering frequently encountered UI elements. The classes are ARC compliant.


UTModalActivityIndicatorView A modal view in center of screen to show a message and a spinner.
Perfect for display while processing an intensive task (plus restricts user input).
Limitation: Works for non-blocking tasks like an async url request. Requires the containing thread to be alive so it wont, for example work on a sleep or dataWithContentsOfURL call

Example Usage


// Before Invoking Task
// Create and Display Modal View Controller in Center of Screen
CGRect viewFrame = [self.view frame];
UTModalActivityIndicatorView *grayView = [[UTModalActivityIndicatorView alloc] 
                                          initWithLabel:@"Processing ..."
                                             atPosition:CGPointMake(viewFrame.size.width/2 - 75.0f, 
                                                                    viewFrame.size.height/2 - 75.0f)];
[self.view addSubview:grayView];
[grayView startAnimating];

// Invoke Awesome Task ...

// To Dismiss Modal View Controller
// Remove Modal View Controller (i.e. the last subview that was added)
[grayView stopAnimating];
[grayView removeFromSuperview];

// Or if in a different method
// Remove Modal View Controller (i.e. the last subview that was added)
[((UTModalActivityIndicatorView*)[[self.view subviews]objectAtIndex:[[self.view subviews]count]-1]) stopAnimating];
[((UTModalActivityIndicatorView*)[[self.view subviews]objectAtIndex:[[self.view subviews]count]-1]) removeFromSuperview];


UIUtilis is available under the MIT license. See the LICENSE file for more info.