iOS 6 UITabBarController supported orientation with current UINavigation controller

Subclass your UITabBarController overriding these methods: -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // You do not need this method if you are not supporting earlier iOS Versions return [self.selectedViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation]; } -(NSUInteger)supportedInterfaceOrientations { return [self.selectedViewController supportedInterfaceOrientations]; } -(BOOL)shouldAutorotate { return YES; } Subclass your UINavigationController overriding these methods: -(NSUInteger)supportedInterfaceOrientations { return [self.topViewController supportedInterfaceOrientations]; } -(BOOL)shouldAutorotate { return YES; } … Read more

Dynamically getting height of UILabel according to Text return different Value for iOS 7.0 and iOS 6.1

You have to dynamically set the frame, like below: Tested on iOS 6 to iOS 12.2 Swift: let constrainedSize = CGSize(width: self.titleLable.frame.size.width, height:9999) let attributesDictionary = [NSAttributedString.Key.font: UIFont.init(name: “HelveticaNeue”, size: 11.0)] let string = NSAttributedString.init(string: “textToShow”, attributes: attributesDictionary as [NSAttributedString.Key : Any]) var requiredHeight = string.boundingRect(with: constrainedSize, options: .usesLineFragmentOrigin, context: nil) if (requiredHeight.size.width > self.titleLable.frame.size.width) … Read more

Interface orientation in iOS 6.0

Deprecated method in iOS 5: // Override to allow orientations other than the default portrait orientation. – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); } Replacement in iOS 6 and equivalent of this deprecated iOS 5 method above: – (BOOL) shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeRight; } … Read more

Make UICollectionView zoomable?

I think what you’re asking for looks like what is done in the WWDC1012 video entitled Advanced Collection Views and Building Custom Layouts (demo starts at 20:20). You basically have to add pinchGesture to you UICollectionView, then pass the pinch properties (scale, center) to the UICollectionViewLayout (which is a subclass of UICollectionViewFlowLayout), your layout will … Read more

UITabBarController Rotation Issues in ios 6

Zack, I ran into this same issue. It’s because you have your viewController embedded inside of a TabBar Controller or UINavigationController and the calls to these methods are happening inside those instead of your normal View (Changed in iOS6). I ran into this issue because I was presenting a viewController embedded inside a UINavigationController on … Read more