Autolayout adjusts perfect in iOS 7 but not in iOS 6 - xcode

I have a view in my app that is in landscape and I have set upp the UI in my storyboard so it responds as I want to different screen sizes. Now this works exactly as I want in iOS 7 but when I ran it the app in iOS 6 it is like it's not responding to my storyboard settings:
My app is mainly in portrait so this view in the app is set in landscape by subclassing the navigation controller:
// CustomNavigationLandscapeViewController.m
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
So is there something that I'm doing wrong to get this behavior? Why does it work perfectly in iOS 7 but not in iOS 6?

After restarting Xcode and doing a clean the problem was solved. Guess it just was a glitch in Xcode that came in an inappropriate time.

Related

Handling device orientation for iOS 8 Portrait/Upside down

My current code for Portrait/Upside down orientation only works for iOS 7 devices iPhone/iPad. However, for iOS 8 devices it doesn't work. The code I use is ...
-(NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
I'm working in Xcode 6.1, not using size classes and auto layout. Regular storyboard, no navigation controller.
I'm researching this and can't seem to find anything that works.
Is there a different way to do Portrait/Upside down orientation change for iOS 8 right now?

InputAccessoryView does not show on iOS 8 simulator

I have iOS application since iOS 5, it includes a custom UITextView which use its own inputView and inputAccessoryView. It works with iOS 7 simulator, when it becomeFirstResponse, both inputView and inputAccessoryView show, but with iOS 8 simulator, only associated inputView shows, the inputAccessoryView does not show.
I am using Xcode 6 GM seed
HeInput_TextView.m
- (void)awakeFromNib
{
self.text = #"";
heKeyboard4x5 = [[HeKeyboard_ViewController alloc] init];
inputAccessoryVC = [[InputAccessory_ViewController alloc] init];
self.inputView = heKeyboard4x5.view;
self.inputAccessoryView = inputAccessoryVC.view;
}
Is it a bug in iOS 8 simulator or a change for iOS 8?
Edit:
I found more information about this problem.
This problem happens in Page-Based application, if an UITextView in a page of UIPageViewController, then the UITextView.inputAccessoryView doesn't show at iOS 8 simulator, but shows in iOS 7.1 simulator.
I creates two projects: 'Single-View Based application' and 'Page-Based application', and confirmed the problem happens as described above.
it is new behaviour of simulators in xcode 6. to see your custom accessory view or even default one try to uncheck hardware -> simulator -> connect harware keyboard.
It's an iOS8 bug.
You can reproduce it on the simulator in Apple's Contacts App.
Add a new contact and scroll down to "add a date".
Same problem. A colleague has raised an apple rdar.
I've found view accessories in iOS8 don't use the view's frame to offset their height above your InputView (or even the default software keyboard).
You might need to make sure your inputAccessoryView implements
-(CGSize)intrinsicContentSize
eg:
#implementation InputAccessory_View
// .. your code ...
-(CGSize)intrinsicContentSize{
return self.frame.size;
}
#end
My apologies, I misread the item. I've been driven batty by iOS8's keyboard issues.

idleTimerDisabled not working under iOS8 Gold Master

We have a video recording app which has worked fine under iOS6 and 7 and we thought it was working fine under the beta versions of iOS8. Since we have the Gold Master we are often pushed to the background when the iOS idle timer kicks in. We have the line:
[UIApplication sharedApplication].idleTimerDisabled = YES;
in our code and this has been sufficient until now. Does anyone know why this is not working all of a sudden.
Thanks
If you show a keyboard and dismiss keyboard after setIdieTimerDisabled, the idleTimerDisabled will not work automatically on iOS 8.
I don't know why, but these code could fix my problem:
- (void)onKeyboardDidHide:(NSNotification *)notification
{
if (!SystemVersionLessThan(#"8.0")) {
//reset it again.
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
}

ios8 iPad splitview view issue

I am trying to ran my ios app using xcode 6 with ios8. On iOS8 ipad
splitview(basically master and detail screen) not rendering properly
but in ios7 it was able to render properly without any issues. The
issue was the maser view moved bit left since am seeing some unknown
images on right hand side of the master table view. This happens when i do change the orientation from portrait to landscape and vice verse.
Any idea how to fix this on ios8 ipad splitview?. For more info attaching screenshot
use this code in UITableViewController (or higher in hierarchy)
[[UITableViewCell appearance] setBackgroundColor:[UIColor whiteColor]];
Change the [UIColor whiteColor] to the color you want to replace the green with.
Setting background color for cell or content view in storyboard in Xcode does not solve the problem.
This problem occurs only on iPad under iOS 7.1.2 & 8.1 (i use these versions) and does not occur on iPhone (4S with iOS 8.1, 5S with 7.1.2, 6 with 8.1).
May be it happened in combination of Xcode 6.1 iOS 8.1 SDK and UISplitViewController.

iOS Simulator has black Keyboard and Alerts in iOS7

My App runs on iOS 6 and 7, on the devices it looks fine and on the simulator iOS6 it is fine but in iOS7 all alerts, keyboards and parts of table and collection views have elements that are completely black. They are there if you clock on them. It is hard to explain but you can see from the image.
I think it is do with the fact that I run a lot of things in the background and when I do any UI and force to the main thread (but this could be a red herring).
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^(void)
{
[self backgroundbits];
....
....
dispatch_sync(dispatch_get_main_queue(), ^
{
[self updateProgressBar];
});
....
....
....
});
Another options is that I have messed up the transparency and tint somehow.
It is just strange it ONLY does it on the iOS 7 simulator.
I have experienced this before. I just resorted the simulator (iOS Simulator > Restore Content and Settings), cleaned my Xcode Project, and quit and reopened Xcode. This solved the problem for me!

Resources