GKGameCenterViewController Bug In IOS8 - ios

Has anybody else suffered this - Loading GKGameCenterViewController on devices running IOS8 fails to return Game Center data or present Navigation Buttons for dismissing view. Code is standard from Game Center Programming Guide and has worked for months on devices running IOS7. Update IOS from 7 to 8 and BOOM!, the GKGameCenterViewController loads white transparent background only and no other content. User is trapped in view with no Game Center data and no "Done" button to dismiss the view. My app was released 5/14 and this happened when I updated iPad to IOS8 on Sep, 19th, 2014

Looks like GKGameCenterViewControllerStateDefault is the culprit (a bug). Add this prior to presenting the view:
gc.viewState = GKGameCenterViewControllerStateLeaderboards;

I am also experiencing this issue since updating to iOS8. The workaround posted by dugbug seems to be incomplete - although information is displayed in the main tab with this workaround, the user is still not able to dismiss the game center view as the top bar navigation button to do this is replaced with a white area.

Related

Swift: Touch not immediately registered for UIButtons located at bottom of UIViewController

I run into a strange behaviour I am not able to solve. If I place a UIButton at the bottom of the UIViewController of the Main Storyboard, touching it is not immediately registered. It takes about 0.5 seconds till the touch gets registered. You can see than from standard UIButtons when they change the text color. I don't have this issue with buttons anywhere else in the UIViewController.
All I did is adding a Vertical Stack View with 15 UIButtons to the Main View Controller of a new App. When I execute the App on an iPhone 6 or iPhone 8 (the actual devices), the lowest button behaves differently. Touching it doesn't change the text color immediately, while it does for all the other buttons.
Did anyone experience the same issue? Is there a way to solve this or did I just find a bug in the framework? I'm using Xcode 9.2 and deployment target is iOS 11.2.
Go to AppDelegate and try adding:
for gesture in self.window.gestureRecognizers {
gesture.delaysTouchesBegan = NO;
}
It will stop the system from checking to see if you are trying to open control centre.

How to use setHidesBottomBarWhenPushed correctly?

I used the setHidesBottomBarWhenPushed to hide tabBar when A viewController pushed to B viewController,but in the process ,the navigationBar displayed black background color and then became normal quickly.
I have spent a day to trying to solve this problem,but all ways not working.
Appreciating your help.
Thank you.
I just created a very simple "Tabbed Application" project like this.
Pust to viewController when clicked push barButtonItem,and the "Hide Bottom Bar On Push " property of viewController was checked in storyboard.
The result was :
I met the same problem while using old MacBook (about 2011 early) before. I think it is the render issue of the simulator while using some out-of-dated devices. But actually, when you run your code on real device (iPhone 5 above), this issue is unusual.

UITabBar has NO background color after transition

I've got this app. When it launches, it asks the user to log in. When you log in, it uses UIViewAnimationOptionTransitionFlipFromRight to transition to a new UIViewController. The issue is, the UITabBar on the view controller has no background color. It is completely transparent. The UITabBar icons are there and it is otherwise fully functional, except that it has no background color.
This happened after I updated for iOS 7.1. Has anyone see this happen? If so, do you know how to fix it?
Apparently this issue has a "fix". This is obviously a bug on Apple's side.
Here is it
This is a bug in iOS 7.1 on Apples's side. The work around is to toggle the translucency on and off. Not the best fix, but it works. We will have to wait until Apple fixes this in 7.2 or later.
tabBar.translucent = NO;
tabBar.translucent = YES;
As answered in this question

Views converted to ios7 flow under navigation/bottom bars in ios6

I have an app that uses stroryboards, a navigation controller and autolayout that runs fine under io6 and I would like to enable to run under both ios6 and ios7.
I have converted the app using xcode5 and it now runs fine under ios7, but when I run it under ios 6 the navigation bar and bottom bar are now transparent (they were not originally) and the view flows under them - hiding some of the controls. This persists even if I convert the ios7 app not to flow under these bars (by setting Extend Edges / Under Top Bars and Under Bottom Bars OFF).
I have worked around it by allowing ios7 to flow the view under the bars (what Apple wants us to do anyway) and then adding the following code to the viewDidLoad method of the fist view controller to force ios6 not to use transparent bars.
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
self.navigationController.toolbar.barStyle = UIBarStyleBlackOpaque;
}
This seems to be working, but I don't understand why I need to do this and I am concerned that I am missing something fundamental.
Edit: The other concern I have with this 'solution' is that the Preview in xcode5 under ios6 doesn't accurately reflect the layout as it runs under a simulator under ios 6 (I don;t have a real ios6 device handy to test it at the moment). The new preview feature in xcode5 appears to assume that the ios 6 will not flow the view under the top and bottom bars and thus squashes the controls together to fit into the available space.
Ali
Try this regardless of the OS version (it solved me a similar issue recently):
self.navigationController.navigationBar.translucent = NO;
self.navigationController.toolbar.translucent = NO;
I am not sure if this will help you, but there is another option to your situation: try using the __IPHONE_6_1 macro. I have an example:
if(__IPHONE_7_0) {
NSLog(#"Hello");
}
so you could just do
if(__IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_6_1) {
self.navigationController.navigationBar.translucent = NO;
self.navigationController.toolbar.translucent = NO;
}
hope this helps you

UIView Rotation Magically Happening

I was given a project that was started by someone else who no longer works here.
I have a UITabBarController which holds some UIViewControllers.
If the application is running on iOS 6, everything runs fine, However as soon as I run it on iOS 5, all UIViews are rotated 90 degrees and given an origin value of something around -100 to -300
I have been able to loop through all view controllers of the tabBar and set
myView.transform = CGAffineTransformMakeRotation(0.0);
myView setFrame:CGRectMake(0,0,1024,748);
The initial view controllers on UITabBarController appear correctly, However, if I ever try to launch a modal view controller, everything is stuffed again. including the modal.
I am running out of ideas on how I could fix this once and for all. I couldn't find anything in the code that rotates the views.
What I could deduce is
on iOS 6, the first subview of the main view holding the UITabBarController is UILayoutContainerView
but on iOS 5 the first subview is of class UIView
If this is an issue with UILayoutContainerView not being supported in iOS5, how can I make the application backwards compatible now?
Note: we only support Landscape (Right/Left) and only on iPad.
Also, I have noticed that if the user rotates the application before initialiazing the UITabBarController and its sub controllers. everything works fine. Even if you re-run the application and not rotate again, still works.
Thanks in advance
If you want your application to stick in landscape mode you the blow code, the issue resides in iOS 5, many people face this issue
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
BOOL returningValue=NO;
if (interfaceOrientation==UIInterfaceOrientationIsPortrait(interfaceOrientation))
{
returningValue=NO;
}
else if(UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
returningValue=YES;
}
return returningValue;
}
Apparently, this is where I went wrong
For iOS 5
when setting the view of the main window of the application, one must use
[self.window addSubview: tabBarController.view];
Instead of (iOS6 only)
[self.window setRootViewController: tabBarController];
I am unsure how that changes everything, and the reason it won't work for iOS 5. Nevertheless, it worked.
Thanks everyone :)

Resources