control-center

How do we detect when control center on iOS 7?

笑着哭i 提交于 2020-01-04 08:26:18
问题 I am having an issue when the control center appears on iOS 7. Basically, the applicationDidEnterBackground is fired when the control center appears. However in my method, I would like to detect if it's just the control center opening or the notification center since I would treat the applicationDidEnterBackground differently in that state. Any help would be appreciated. 回答1: I just published a little UIWindow subclass that does exactly that. You simply subscribe to an NSNotification and can

check if control center is used

感情迁移 提交于 2019-12-31 03:59:13
问题 My app is using internet access, and I want to know if there were used control center. If was used, I want to do some action, like start to update. I am stuck at this question. There are different guides, about "check if app is in background" or "check if wifi status changed", but no information about this. Any advices? 回答1: You can't do it. The most you can know is that your app was deactivated and then activated again, but you have no way of finding out why. It could be because of the

UIAlertView Strange Behaviour with Shortcut Control center

空扰寡人 提交于 2019-12-24 13:54:06
问题 i am facing the problem with the UIAlertview behaviour,i Know when alertview is raised except the external controls all the controls will get inactive. My app on of the functionality will work only on airplain mode,My client wanted to use the control center to enable airplain mode.In my appUntil unless user activating the airplain mode Alertview will keep raise. But for the first Alert display i am unable to open the shortcut control center.If i hit okey without activation then app waill

How to set audio details with an image on control center in Objective-C for iOS11?

[亡魂溺海] 提交于 2019-12-24 03:03:59
问题 I am trying to display audio details on control center as shown in the screenshot attached. With the below code it is working as expected in all the versions of iOS except in iOS11: if ([MPNowPlayingInfoCenter class]) { NSString *progress = (appDelegate.audioPlayer.progress == 0 || appDelegate.audioPlayer == nil ) ? @"0.0" : [NSString stringWithFormat:@"%f",appDelegate.audioPlayer.progress]; NSString *duration = (appDelegate.audioPlayer.progress == 0 || appDelegate.audioPlayer == nil ) ? @"0

Can't use Control Center when UIAlertView displayed (iOS 7)

寵の児 提交于 2019-12-21 21:41:21
问题 So i set up a retry connection when reachability detects no connection. I want the user to be able to use the Control Center to re-enable WiFi while the UIAlertView is presented. Anyway I can do this? Picture Of What Control Center Looks Like Picture Of A UIAlertView 来源: https://stackoverflow.com/questions/20225928/cant-use-control-center-when-uialertview-displayed-ios-7

AudioPlayer and lockscreen/control center control Swift [closed]

最后都变了- 提交于 2019-12-21 15:15:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm new on Swift. I write because I want to ask a question. Me and my friend we are developing an audio player, but we have a problem. The player also works in background and remote controls from the lockscreen and the control center work, but if music is interrupted by one of these two controls, the play/pause

How to disable all the MPRemoteCommand objects from MPRemoteCommandCenter

时光怂恿深爱的人放手 提交于 2019-12-19 10:07:06
问题 Apple doc says "you can disable the corresponding MPRemoteCommand object by setting its enabled property to NO." I referred Is there a public way to force MPNowPlayingInfoCenter to show podcast controls? and I was able to disable/enable a particular command on lock screen control. However I want to disable all the controls from lock screen control since I am playing a radio and it do not support either of the action - "Play/Pause/Next/Previous" I tried following code snippet:

Customize Control center Swift and IOS 9+

眉间皱痕 提交于 2019-12-12 02:42:29
问题 friends I am working on an ios app using Swift, I am suppose to add app icon in Control Center and also on any web page user should be able to select text or paragraph and save that text in the application. I just need a hint or starting point, I am sort of new to IOS, have built 3-4 apps but never worked on Control Center and adding service which allow copy and save text and images from iphone browser. 回答1: Control Center is not extensible in iOS. There is no api for it. 来源: https:/

How to block iOS 7 control centre from controlling music app?

有些话、适合烂在心里 提交于 2019-12-08 09:50:38
问题 Our app explicitly blocks user form using remote-control, e.g., old springboard from pre-iOS7, earbud, by becoming the first responder to the remote-control events. However, on iOS7, the same code fails to bypass the control centre music controls. From out tests, control centre seems to have bypassed ALL music control events including UIEventSubtypeRemoteControlPause and UIEventSubtypeRemoteControlPlay, and UIEventSubtypeRemoteControlTogglePlayPause. Is it that control centre has its own

Reacting to ControlCenter events when using AVPlayer for HLS audio playback

て烟熏妆下的殇ゞ 提交于 2019-12-08 08:37:12
问题 I am looking for a way to handle the play/pause events from the iOS ControlCenter when playing audio (HLS) using AVPlayer. I have it all working, but it is based on "named" notifications which are not exposed in the header files. Is there an "official" way to do this? Currently the following code works: - (void) removeControlCenterNotifications { [[UIApplication sharedApplication] endReceivingRemoteControlEvents]; } - (void) addControlCenterNotifications { [[UIApplication sharedApplication]