Monday 15 September 2014

camera - Hide volume HUD in iOS 8 -



camera - Hide volume HUD in iOS 8 -

in versions prior ios 8, there simple trick hiding scheme volume overlay. you'd create mpvolumeview , embed in view hierarchy somewhere. documented here http://stackoverflow.com/a/7888977/3943258 , in many other stack overflow responses.

however, i'm finding trick doesn't seem work in ios 8. i'm pulling hair out trying figure out how prepare it. know if there's way in ios 8?

one thing of note app i'm doing in has active avcapturesession while i'm trying hide hud (volume buttons deed shutter on camera). not sure if there might side effects of that.

alright, abuses private api i've found works.

- (void)setvolumehidden:(bool)hidden { nsstring *str1 = @"etsystemv"; nsstring *str2 = @"ehudenabled"; nsstring *selectorstring = [nsstring stringwithformat:@"s%@olum%@:foraudiocategory:", str1, str2]; sel selector = nsselectorfromstring(selectorstring); if ([[uiapplication sharedapplication] respondstoselector:selector]) { nsinvocation *invocation = [nsinvocation invocationwithmethodsignature:[uiapplication instancemethodsignatureforselector:selector]]; invocation.selector = selector; invocation.target = [uiapplication sharedapplication]; bool value = !hidden; [invocation setargument:&value atindex:2]; __unsafe_unretained nsstring *category = @"ringtone"; [invocation setargument:&category atindex:3]; [invocation invoke]; } }

ios camera ios8 avcapturesession mpvolumeview

No comments:

Post a Comment