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.).
Related
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;
I'm debugging an app that requires full accessibility using VoiceOver and one feature ask the user to select songs to play. The app uses MPMediaPicker. The problem is that MPMediaPicker does not really meet VoiceOver accessibility requirements, for example it does not announce whether an element of the list is selected or not, it does not clearly announce when the user select an element, when searching it does not announce the number of selected elements in the list as the list get pruned down and, worse of all cases, it does not announce anything at all when the button Add All Song is selected (it just stay silent).
It seems to me that these are pretty big oversights for a standard component so widely used and i'm wondering what can i do to fix these for my client as it explicitly says in the Apple documentation that i can't subclass MPMediaPickerController nor manipulate its private view hierarchy.
Of concern is also the fact that the my app also uses the standard component to select contacts which also seems to have similar issues.
Thank you.
Edit:
The app present the MPMediaPickerViewController using this code, which i believe it is fairly standard (perhaps a bit outdated since it still uses retain/releases)
MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAnyAudio];
[picker setDelegate: self];
[picker setAllowsPickingMultipleItems: YES];
picker.prompt = NSLocalizedString (#"...", "...");
[[myAppDelegate instance] presentModalViewController: picker animated: YES];
[picker release];
where presentModalViewController is this:
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated {
UIViewController *c = self.window.rootViewController;
while ([c presentedViewController]) {
c = [c presentedViewController];
}
[c presentModalViewController:modalViewController animated:animated];
}
The missing announcements in the voice over belong to components shown as part of the selection process and in the hierarchy of MPMediaPickerController, so i don't know how to access them.
The above code is called inside the IBAction of a simple (+) right bar button of a ViewController that belongs to a NavigationController.
Further note:
Minimal proof of concept: create a default single page iOS application in Xcode. Add #import MediaPlayer; and then add this code to the ViewController.
- (void)viewDidAppear:(BOOL)animated {
MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAnyAudio];
[picker setDelegate: self];
[picker setAllowsPickingMultipleItems: YES];
picker.prompt = NSLocalizedString (#"...", "...");
[self presentViewController:picker animated:true completion:^{
}];
}
Launch the app with VoiceOver activated, then select or navigate to the cell "Add All Song": the item is not announced by VoiceOver in any way.
I think this summarize things pretty well. From Apple Documentation in reference to the MPMediaPickerController:
This is a preliminary document for an API or technology in development. Apple is supplying this information to help you plan for the adoption of the technologies and programming interfaces described herein for use on Apple-branded products. This information is subject to change, and software implemented according to this document should be tested with final operating system software and final documentation. Newer versions of this document may be provided with future betas of the API or technology.
This control is not complete, and probably never will be complete, given that this has been considered a "beta" API since iOS 3.0.
Also, to summarize my findings, it is not possible to make this control accessible. I was able to play around with its views a bit, and every time I was able to add additional labelling it was soon overridden and reset. Finding the correct callbacks to reset the labels every time they were overridden by the controls default behaviors would be difficult (impossible) and obviously we cannot override the UIAccessibilityProtocol methods of the individual elements, because they are not controls we instantiated. We have instantiated the global control, and it is drawing everything for us. Finally, this would be considered by a reviewer to be accessing private APIs and so would not be allowed on the App Store regardless.
Conclusion: In order to provide the accessibility support you wish, you will have to implement a similar control manually.
I am trying to use the iOS file picker to select text files but when I instantiate and present (modally) a UIDocumentMenuViewController or a UIDocumentPickerViewController the UI takes a while to show up.
This is the code I tried to use for the UIDocumentMenuViewController the one for the UIDocumentPickerViewController would be fairly similar:
UIDocumentMenuViewController *menuVC = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:#[(NSString *)kUTTypeText] inMode:UIDocumentPickerModeOpen];
menuVC.delegate = self;
[self presentViewController:menuVC animated:YES completion:nil];
If I try to call this code 3 or more times then the lag disappears.
I understand that when working with iCloud documents there are synchronous operations that takes time but I didn't find a way to kind of preload that so by the time I present the view controller it happens instantly. I even tried to instantiate the view controllers much before presenting them, but the initialisation doesn't seam to be the bottleneck.
Did anyone experienced the same problem?
It turns out the problem was related to using appearance on a UISegmentController with a custom Font. It may be related to other UIKit controls as well.
Here the way I reproduced it on a clean project:
NSDictionary *attributes = #{NSFontAttributeName: [UIFont fontWithName:#"Pacifico" size:16]};
[[UISegmentedControl appearance] setTitleTextAttributes:attributes forState:UIControlStateNormal];
I filed a radar. Please go and dupe, especially if you find this is affected by other appearance calls.
I haven't worked with iAd ads and this is the first time i am going to implement them. Went though googling a lot of tutorials but they most of them are so old and done programmatically. What i want is to learn how to add them in the StoryBoard.
I can see the ad banner view in my StoryBoard. Although when i add the "Ad BannerView" by dragging it in my view controller and run it, it just crash saying uncaught exception. What else i need to do other than just dragging it in the StoryBoard, in order for it to work?
I think the best way to achieve this is to take a look at apple sample code. The iAd suite has many different approaches and one of the is integrating the iAd with story board. Here is the link to the sample code: https://developer.apple.com/LIBRARY/IOS/samplecode/iAdSuite/Introduction/Intro.html
Also here is the link to the iAd class reference for further study. https://developer.apple.com/library/ios/documentation/userexperience/Reference/iAd_ReferenceCollection/_index.html
I hope that clears the way for you to solve this issue.
You can just put this into -viewDidLoad:
ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:adView];
Don't forget to import the iAd Framework. If I was you I should use Google's AdMob.
This is a good link.
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.