iOS App Maximise Disappears - ios

I have developed an iOS app and everything is working as expected apart from the "maximise" icon in the detail view when it is turned sideways has disappeared.
I can't seem to find any documentation on this feature and suspect I have either not initialized something in the code or missed a setting on the story board.
Using objective C.

Knowing what it was called helps a lot :-)
Issue was the below code missing from viewDidLoad in the DetailViewController
UINavigationController *navigationController = [self.splitViewController.viewControllers lastObject];
navigationController.topViewController.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem;

Related

Xcode 7 navigationcontrller issue

I am facing some kind of issue in my when I compile my code with xcode 7.
Here is my code:
UIViewController *vcSomeObj = [self.storyboard instantiateViewControllerWithIdentifier:#"vcSOmeClass"];
vcSomeObj.channelID = detailOfUserTable.ID;
[self.navigationController setViewControllers:#[vcSomeObj] animated:NO];
This is working fine when I compile and run my code from xcode6.4.
This thing hang my application. And when I goes to any app and come agian to my app it will take to main controller and after sometime app crashes.
I can't find anything in debug.
In storyboard file We need to select English check box also otherwise application will hang an crash.
In my opinion.you set the current navigation's viewcontroller.what's happen to current viewController in navigation stack when you in current viewController,so ,I guess you can do like this
[self.navigationController setViewControllers:#[vcSomeObj,self] animated:NO];

WKWebview fail to open WKActionsSheet on presented UINavigationController

I have a problem with my WKWebViewController.
I use this code to present:
SRWebWKViewController *webcontroller = [self.storyboard instantiateViewControllerWithIdentifier:#"SRWebViewControllerWKWebview"];
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:webcontroller];
[self presentViewController:navController animated:YES completion:nil];
It is presented correctly, but when I press on any link I get this error:
Warning: Attempt to present <WKActionSheet: 0x7fc4f4c6f5e0> on <UINavigationController: 0x7fc4f4b9d9e0> whose view is not in the window hierarchy!
I searched a lot on the web but I can not find any solution that solves my problem
Thanks in advance
This is a bug in UIKit from iOS 8.0 until at least iOS 9.3.1.
We've seen this issue in PSPDFKit and after investigating the UIKit assembly and WKWebView sources we found a workaround that is still horrible, but not invasive.
The main strategy is to be selective and apply a workaround just in time - then clean up again. You can read the source code here:
https://gist.github.com/steipete/b00fc02aa9f1c66c11d0f996b1ba1265
And please dupe rdar://26295020 so this will get hopefully fixed in time for iOS 10. (The bug exists since iOS 8 and was first reported on iOS 8b5.)

What's causing the massive changes in autorotation in 8.1 compared to 8.0.2?

I'm coding a video processing app and was just about to submit it to the app store when ios 8.1 came out. I updated my iPhone as well as XCode and all hell broke loose. In my simple single viewcontroller interface nothing is rotating anymore except for the statusbar, which also doesn't get automatically hidden anymore in landscape mode...
I figured it was because I was using the deprecated willAnimateRotationToInterfaceOrientation: for what little custom rotation actions I had, so I implemented traitCollectionDidChange: and viewWillTransitionToSize: to specs instead. However viewWillTransitionToSize never gets called in my app and traitCollectionDidChange: is only called once, at startup. The device simply isn't telling the app that the device has rotated.
After googling I've also tried using name:UIDeviceOrientationDidChangeNotification. At least my selector does get called for that one but I don't know how to manually handle all rotation.
My didFinishLaunching... and viewDidLoad are very simple. alloc UIWindow, storyboard, set my viewcontroller from there, make it rootviewcontroller, makekeyandvisible. All based on one of Apple's AVFoundation demo apps.
Then in didload I add some subviews and a toolbar etc, nothing out of the ordinary and obviously it did work on 8.0 and 8.0.2 on all kinds of devices as well as the 7.1 simulator etc. Still runs flawlessly on my iPad with 8.0.2... Reason I haven't posted any code is I'm 100% sure everything is correct on that end.
Main weird thing is I can't seem to find anyone with this problem.
No errors in console or elsewhere either.
Does anyone have any idea of what might be causing this? I didn't think a point release would make such massive differences and again, no one else seems to be having this. Could it be an issue/bug in the actual storyboard file?
And, mainly, since I can get rotation notifications through UIDeviceOrientationDidChangeNotification, how do I manually handle all rotation/resizing stuff? I have been looking all over for answers but to no avail and am out of time to spend on this project currently :(
Cheers!
alloc'ing UIWindow will be the problem.
First, Make sure your navigation controller (or whatever you're using) is set as "Initial View Controller" in your storyboard.
Secondly, in your AppDelegate.m file, remove any references to UIWindow and rootViewController that appear in application didFinishLaunchingWithOptions. In my case, removing the following two lines fixed my issues.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];
You also don't need to set the window's rootViewController if using storyboards.
They're simply not needed when using storyboards, but until 8.1 there was never any harm using them. It took my 2 days to figure this out, so hopefully it will help you and others too.

Aviary ios SDK memory not released after dismiss

I am using Aviary SDK 3.0 in my app, I put the Aviary code in a popover like this, but after I dismissed the popover using [popover dismissPopoverAnimated], the Aviary is still in the memory Heap, this is even true, even after I dismissed the parent viewcontroller. is it expected that the Aviary code is cleaned up after I dismiss?
in the action when use tap the photo. I present it here
AFPhotoEditorController *editorController = [[AFPhotoEditorController alloc] initWithImage:imageToEdit];
[editorController setDelegate:self];
if (popover == nil)
popover = [[UIPopoverController alloc] initWithContentViewController:editorController];
else
[popover setContentViewController:editorController animated:YES];
https://dl.dropboxusercontent.com/u/23238574/Screenshots/aviarypopover.png
From the docs:
"Note that pushing the controller onto a UINavigationController's stack is not recommended, since the Photo Editor itself uses a subclass of UINavigationController."
try presenting it modally, then what I do just to make me feel better about all memory getting cleaned is to make a strong property and go through the checklist
[editorController removeFromParentViewController];
editorController.delegate = nil;
editorController = nil;
something about clearing the delegate seems to clear my memory better, although, I don't think you need it.
also, don't forget:
"By default, Aviary keeps a small number of OpenGL objects loaded to optimize launches of Aviary products."
[AFOpenGLManager requestOpenGLDataPurge];
// to request a clear,
// "Calls to requestOpenGLDataPurge only apply to the currently loaded OpenGL data,"
You can set it to clear regularly with
[AFPhotoEditorCustomization purgeGPUMemoryWhenPossible:YES];
if you're doing this, it's a good idea to preload some of the editor if you know they'll be using it soon
[AFOpenGLManager beginOpenGLLoad];
This memory leak has been addressed in subsequent releases of the SDK. Please visit developers.aviary.com to get the latest version.

How to integrate the InAppSettingsKit?

I have just downloaded the InAppSettingsKit and I'm trying to integrate it with my app however I'm having some issues with it since I can't find any documentation to help me out. So far I've done the following steps...
I added the InAppSettingsKit directory to my Xcode project.
I created a new UIViewController class for my settings (which I named settingViewController).
At this point I have become a bit stuck as I'm not sure what needs to be done. If someone could offer some steps on how to integrate this it would be really really helpful as I can't find any up to date documentation online.
Usually, you don't need 2. You just configure a button action to display IASKAppSettingsViewController. This could look like this (in this case for a modal presentation):
appSettingsViewController = [[[IASKAppSettingsViewController alloc] initWithNibName:#"IASKAppSettingsView" bundle:nil] autorelease];
appSettingsViewController.delegate = self;
appSettingsViewController.showDoneButton = YES;
UINavigationController *aNavController = [[[UINavigationController alloc] initWithRootViewController:appSettingsViewController] autorelease];
[self presentModalViewController:aNavController animated:YES];
Check MainViewController.m in the sample app for different ways to present it (navigation push, tabBarItem, etc.).

Resources