Skip to content

Instantly share code, notes, and snippets.

Avatar

Miguel Ferrando nandodelauni

View GitHub Profile
@nandodelauni
nandodelauni / UIScrollView+Images.m
Last active Dec 31, 2015
UIScrollView category to add images using auto layout (visual format) to handle contentSize automatically
View UIScrollView+Images.m
#import "UIScrollView+Images.h"
@implementation UIScrollView (Images)
- (void)addImages:(NSArray *)images
{
NSMutableDictionary *viewsDictionary = [NSMutableDictionary dictionary];
NSMutableString *visualFormatString = [NSMutableString stringWithString:@"|"];
NSUInteger index = 0;
for (UIImage *anImage in images) {
@nandodelauni
nandodelauni / UIViewController+CustomBackButton
Last active Dec 18, 2015
UIViewController category for creating a custom back button
View UIViewController+CustomBackButton
- (UIBarButtonItem *)customBackButton
{
return [self customBackButtonWithTitle:nil];
}
- (UIBarButtonItem *)customBackButtonWithTitle:(NSString *)title
{
// if we have no title, search at the current navigation controller stack for the previous title
if (!title) {
id aViewController = nil;