ios7

Is there a cellular data usage API in iOS 7?

蓝咒 提交于 2020-01-20 02:20:25
问题 iOS 7 introduced a new user configuration to disable cellular data for specific apps. It can be configured in "Settings"->"Cellular" and then scrolling down. You'll find a switch for each installed app and can see how much cellular data it has consumed. How can I programmatically test if the switch is turned on for my app? Is there an API for that? Can I determine how much data my app has used over cellular? I'm not asking to get the values for all apps. I'm only interested in my apps usage.

Getting interactivePopGestureRecognizer dismiss callback/event

荒凉一梦 提交于 2020-01-20 02:15:08
问题 Is there a clean solution on getting a callback or event on the view controller being dismissed (popped) by an interactivePopGestureRecognizer ? To be clear I need some explicit method getting called on the top most controller (and no other) before the controller will be popped by this gesture recogniser. I do not want to get the event on the navigation controller and send the event to the appropriate controller and I do not want to use viewWillAppear or viewWillDissapear ... The closest

Uipickerview behind item working

落爺英雄遲暮 提交于 2020-01-16 04:33:07
问题 I have pickerview in my view controller. I am displaying it by adding into subview and then changing frame of subview. When my pickerview displayed I have one button behind it. When I click on those area after dispalying pickerview still that button action is called. How to set pickerview proper? 回答1: U subclass the PickerView like below will help u to fix this issue. // // WPCustomPickerView.h // test // // Created by VASANTH K on 08/01/14. // // #import <UIKit/UIKit.h> @interface

MPMediaPickerController customize the colors of the labels and icons

筅森魡賤 提交于 2020-01-16 01:05:12
问题 I need change the labels colors of MPMediaPickerController item, on iOS 7 , im using Xcode5 , what can i do?. My code of the creation of MPMediaPickerController is: - (IBAction)addSongs:(id)sender { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; } I was trying with this but not works: https://gist.github.com/acidlemon/1955332 Examples: Thanks in advance. 回答1: Change your

MPMediaPickerController customize the colors of the labels and icons

南笙酒味 提交于 2020-01-16 01:05:07
问题 I need change the labels colors of MPMediaPickerController item, on iOS 7 , im using Xcode5 , what can i do?. My code of the creation of MPMediaPickerController is: - (IBAction)addSongs:(id)sender { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; } I was trying with this but not works: https://gist.github.com/acidlemon/1955332 Examples: Thanks in advance. 回答1: Change your

Control position of video (MPMoviePlayerController) inside a view

孤人 提交于 2020-01-16 00:43:21
问题 I'm trying to position a view (with an inline video) but I'm a little stuck. I've got the video working and playing well (inside the a view). I'm using storyboards. I've already set the scaling mode to MPMovieScalingModeAspectFill which gives me my great full screen cropped view. Just to clarify - I WANT it to crop, it's not a mistake, but I want it left aligned and not centred. My code is: VideoViewController.h @interface VideoViewController : UIViewController @property (strong, nonatomic)

AVPlayer not going to the next song when it is in background mode

爷,独闯天下 提交于 2020-01-15 11:24:29
问题 I am useing AVPlayer to play setof songs from urls. I can play songs in background mode too. But the problem is in background mode the next song is not playing. It excecute the code and but [player play]; method is not working. But If play 1 song it plays to the end though it goes to the background mode. Please help me Thanks 回答1: You should use AVQueuePlayer instead. This is working fine for me. 回答2: Well, you probably have this figured out by now, but for anyone else who might come across

AVPlayer not going to the next song when it is in background mode

蹲街弑〆低调 提交于 2020-01-15 11:22:42
问题 I am useing AVPlayer to play setof songs from urls. I can play songs in background mode too. But the problem is in background mode the next song is not playing. It excecute the code and but [player play]; method is not working. But If play 1 song it plays to the end though it goes to the background mode. Please help me Thanks 回答1: You should use AVQueuePlayer instead. This is working fine for me. 回答2: Well, you probably have this figured out by now, but for anyone else who might come across

AVPlayer not going to the next song when it is in background mode

天大地大妈咪最大 提交于 2020-01-15 11:22:06
问题 I am useing AVPlayer to play setof songs from urls. I can play songs in background mode too. But the problem is in background mode the next song is not playing. It excecute the code and but [player play]; method is not working. But If play 1 song it plays to the end though it goes to the background mode. Please help me Thanks 回答1: You should use AVQueuePlayer instead. This is working fine for me. 回答2: Well, you probably have this figured out by now, but for anyone else who might come across

SKPhysicsJoint: Contacts and collisions not working

谁说我不能喝 提交于 2020-01-15 07:36:25
问题 On IOS7.1, using SpriteKit, I've created two simple rectangular sprites with corresponding physics bodies. I set up contact and collision bit masks, and all works exactly as I expect: contacts are detected and collisions prevent the two rectangles from overlapping. But when I create an SKPhysicsJointSpring object and join the two rectangles, no contacts are ever detected even though the rectangles sometimes overlap during simulation. (The spring behavior works just as one would expect, though