Loading a ViewController inside a Container View

You need to tell your BannerContainer view controller that it has a new child controller, and to tell the Child that it has a parent VC. This is described in the Apple Docs here. Like this: [self addChildViewController:vc]; vc.view.frame = CGRectMake(0, 0, self.container.frame.size.width, self.container.frame.size.height); [self.container addSubview:vc.view]; [vc didMoveToParentViewController:self]; Or in Swift: self.addChildViewController(vc) vc.view.frame = CGRectMake(0, … Read more

iOS ScrollView needs constraint for y position or height

Whenever using ScrollView with auto layout always follow below steps, ScrollView constraints: leadingSpace, topSpace, TrailingSpace, bottomSpace to superView and make sure when you control drag to add constraint, add it by pressing alt so that the constraint would be set without margin. Add UIView inside scroll view as container view and set its constraints: leadingSpace, … Read more

Can’t assign multiple Buttons to UINavigationItem when using Storyboard with iOS 5

I found an easy solution. 1) Add the folowing category: @interface UINavigationItem(MultipleButtonsAddition) @property (nonatomic, strong) IBOutletCollection(UIBarButtonItem) NSArray* rightBarButtonItemsCollection; @property (nonatomic, strong) IBOutletCollection(UIBarButtonItem) NSArray* leftBarButtonItemsCollection; @end @implementation UINavigationItem(MultipleButtonsAddition) – (void) setRightBarButtonItemsCollection:(NSArray *)rightBarButtonItemsCollection { self.rightBarButtonItems = [rightBarButtonItemsCollection sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@”tag” ascending:YES]]]; } – (void) setLeftBarButtonItemsCollection:(NSArray *)leftBarButtonItemsCollection { self.leftBarButtonItems = [leftBarButtonItemsCollection sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@”tag” ascending:YES]]]; } – (NSArray*) rightBarButtonItemsCollection { … Read more

Is it possible to update a localized storyboard’s strings?

There are two options: Option 1 Xcode can “reload” the file by converting the file to either an [Interface Builder Cocoa Touch Storyboard] file type or a [Localizable Strings] file type. Select your base storyboard file from the Project Navigator Find the Localization section in the File Inspector If your file is currently a [Localizable … Read more