Skip to content

Instantly share code, notes, and snippets.

View nandodelauni's full-sized avatar

Miguel Ferrando nandodelauni

View GitHub Profile
@nandodelauni
nandodelauni / UIScrollView+Images.m
Last active December 31, 2015 05:59
UIScrollView category to add images using auto layout (visual format) to handle contentSize automatically
#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 December 18, 2015 12:09
UIViewController category for creating a custom back button
- (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;