ios8

AVAudioEngine playing multi channel audio

匆匆过客 提交于 2019-12-18 03:01:09
问题 Simple question. How do I play multi channel audio files (>2 channels) using AVAudioEngine so that I can hear all channels on default 2-channel output (headphones/speaker). Following code (stripped of error checking for presenting) plays the file first two channels but I can only hear it when headphones are plugged in. AVAudioFile *file = [[AVAudioFile alloc] initForReading:[[NSBundle mainBundle] URLForResource:@"nums6ch" withExtension:@"wav"] error:nil]; AVAudioEngine *engine = [

IOS 8 UITableView self-sizing cells jump/shift visually when a new view controller is pushed

社会主义新天地 提交于 2019-12-18 02:18:05
问题 Here's how I set my table: self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds]; self.tableView.delegate = self; self.tableView.dataSource = self; self.tableView.estimatedRowHeight = 150; [self.view addSubview:self.tableView]; Within my cells, I call - (CGSize)sizeThatFits:(CGSize)size to programmatically return the height (which is set in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath . I'm not using constraints or

Presenting semi-transparent viewcontroller that works both in iOS7 and iOS8

谁说我不能喝 提交于 2019-12-17 23:44:40
问题 I had the following code that worked perfectly in iOS7. [UIView animateWithDuration:0.5 animations:^(void) { self.view.alpha = 0.5; [self.navigationController.navigationBar setAlpha:0.3]; }]; //to make the background view controller semi-transparent UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController; [rootViewController setModalPresentationStyle:UIModalPresentationCurrentContext]; OverlayViewController *ctlr = [storyBoard

How to make popup like keyboard characters in iOS8 custom keyboard?

放肆的年华 提交于 2019-12-17 22:40:49
问题 I want to create popup in iOS8 custom keyboard as shown below image. Some code are working but can't access outer window of keyboard and occures issue as shown in below image-2 回答1: This what i have done in my custom Keyboard its working //adding pop up when character is tapped - (void)addPopupToButton:(UIButton *)button { CGRect frame,frame1; if(self.view.frame.size.width == 320) { //Keyboard is in Portrait frame = CGRectMake(0, -25, 28, 43); frame1=CGRectMake(0, 0, 28, 43); } else{ /

Height of iOS8 Today Extension using Only Auto Layout Gives Broken Constraints

柔情痞子 提交于 2019-12-17 22:29:52
问题 Apple documentation suggests setting the height of Today Extensions using autolayout. If a widget has additional content to display, you can rely on Auto Layout constraints to adjust the widget’s height as appropriate. If you don’t use Auto Layout, you can use the UIViewController property preferredContentSize to specify the widget’s new height. However, every example and tutorial I have seen ends up using preferredContentSize . All of my attempts to set the height via autolayout lead to

Underline part of a string using NSMutableAttributedString in iOS 8 is not working

一世执手 提交于 2019-12-17 22:19:29
问题 I try to underline part of a string, for example, a ' string ' part in ' test string ' string. I'm using NSMutableAttributedString and my solution was working well on iOS7 . NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"test string"]; [attributedString addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:NSMakeRange(5, 6)]; myLabel.attributedText = attributedString; The problem is that my solution is not working

“Please wait” dialog in iOS8

浪子不回头ぞ 提交于 2019-12-17 22:16:26
问题 I used to have a "Please wait" dialog in my app for long time. It was quite simple thing using UIActivityIndicatorView and adding it to UIAlertView . However iOS8 introduced UIAlertController . Is it possible to add anything to it to have similiar effect? Is there another way of doing such thing with iOS8? I have searched a lot of sites and still have no idea how it can be done with the new API. I would appreciate any answers - links to libs, tutorials etc., which could be helpful. Regards,

Hiding the master view controller with UISplitViewController in iOS8

我的梦境 提交于 2019-12-17 22:07:29
问题 I have an iOS7 application, which was based on the Xcode master-detail template, that I am porting to iOS8. One area that has changed a lot is the UISplitViewController . When in portrait mode, if the user taps on the detail view controller, the master view controller is dismissed: I would also like to be able to programmatically hide the master view controller if the user taps on a row. In iOS 7, the master view controller was displayed as a pop-over, and could be hidden as follows: [self

Fit width in iOS 8 Today Extensions

a 夏天 提交于 2019-12-17 21:57:49
问题 When I make any iOS 8 Today Extension, there is an empty space on the left of approximately 48px, even if in Interface Builder I place a label on the left side at x=0. I have seen that some apps, however, use a full-width widget. How can I achieve something similar? Thanks! UPDATE: SOLVED I put here the sample code because I guess it will be useful to someone. As suggested by @matteo-lallone, the correct way to do this is: -(UIEdgeInsets)widgetMarginInsetsForProposedMarginInsets:(UIEdgeInsets

Changing the frame of an inputAccessoryView in iOS 8

橙三吉。 提交于 2019-12-17 21:53:22
问题 Long time lurker - first time poster! I am having an issue while recreating a bar with a UITextView like WhatsApp does it. I am using a custom UIView subclass, and lazily instantiating it on: - (UIView *)inputAccessoryView and returning YES on: - (BOOL)canBecomeFirstResponder Now, I want to change the size of the inputAccessoryView when the UITextView grows in size. On iOS 7, I would simply change the size of the frame of said view - and not it's origin -, and then call reloadInputViews and