iOS 9: How to change volume programmatically without showing system sound bar popup?

For 2018, working on iOS 11.4 You need to change slider.value after a small delay. extension MPVolumeView { static func setVolume(_ volume: Float) { let volumeView = MPVolumeView() let slider = volumeView.subviews.first(where: { $0 is UISlider }) as? UISlider DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.01) { slider?.value = volume } } } Usage: MPVolumeView.setVolume(0.5) Objective-C version

“Application windows are expected to have a root view controller at the end of application launch” error when running a project with Xcode 7, iOS 9

From your error message: Application windows are expected to have a root view controller at the end of application launch How old is this “old” project? If it’s more than a few years, do you still have: [window addSubview:viewController.view]; You should instead replace it with: [window setRootViewController:viewController];

Add views in UIStackView programmatically

Stack views use intrinsic content size, so use layout constraints to define the dimensions of the views. There is an easy way to add constraints quickly (example): [view1.heightAnchor constraintEqualToConstant:100].active = true; Complete Code: – (void) setup { //View 1 UIView *view1 = [[UIView alloc] init]; view1.backgroundColor = [UIColor blueColor]; [view1.heightAnchor constraintEqualToConstant:100].active = true; [view1.widthAnchor constraintEqualToConstant:120].active … Read more

How can I add NSAppTransportSecurity to my info.plist file?

try With this — worked for me in Xcode-beta 4 7.0 <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>yourdomain.com</key> <dict> <!–Include to allow subdomains–> <key>NSIncludesSubdomains</key> <true/> <!–Include to allow HTTP requests–> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <!–Include to specify minimum TLS version–> <key>NSTemporaryExceptionMinimumTLSVersion</key> <string>TLSv1.1</string> </dict> </dict> </dict> Also one more option, if you want to disable ATS you can use this … Read more

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

I have solved it with adding some key in info.plist. The steps I followed are: Opened my Project target’s info.plist file Added a Key called NSAppTransportSecurity as a Dictionary. Added a Subkey called NSAllowsArbitraryLoads as Boolean and set its value to YES as like following image. Clean the Project and Now Everything is Running fine … Read more

CFNetwork SSLHandshake failed iOS 9

iOS 9 and OSX 10.11 require TLSv1.2 SSL for all hosts you plan to request data from unless you specify exception domains in your app’s Info.plist file. The syntax for the Info.plist configuration looks like this: <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>yourserver.com</key> <dict> <!–Include to allow subdomains–> <key>NSIncludesSubdomains</key> <true/> <!–Include to allow insecure HTTP requests–> <key>NSExceptionAllowsInsecureHTTPLoads</key> … Read more