ios10

How do I prevent a WKWebView from presenting the Camera modal if a user has denied access to the camera?

时间秒杀一切 提交于 2019-11-28 08:50:58
问题 In my app, I have a WKWebView loading a website with file input that allows a user to upload images via the Camera or the Photo Library. My app has both privacy usage descriptions for the Camera and Photo Library. If a user has denied access to the Camera, the WKWebView will still show the option to upload images via the Camera, and the Camera modal presents (though it only shows black where you'd normally see an image of what the camera is showing). If a user swipes to the Video option in

How to send form data in POST request in Swift 3

心不动则不痛 提交于 2019-11-28 08:42:16
问题 I am trying to post form-data using webservice, userName & password, but in response it's showing an error stating "Could not connect to the server.". Please help me to send form data in the POST request. let dict:[String:String] = ["userName": userName as! String, "password": password as! String] do { let jsonData = try JSONSerialization.data(withJSONObject: dict, options: .prettyPrinted) let url = URL(string: "(some url)")! var request = URLRequest(url: url) request.httpMethod = "POST"

Universal Links not working on iOS10

一世执手 提交于 2019-11-28 08:34:58
Just updated my iPhone to iOS10 and the Universal links stopped working. If I run my app in an iPhone with iOS9, or lower, the Universal Links work fine, but the are just not working at all in iOS10. Any clues? It sounds like you inadvertently deactivated Universal Links. This usually happens if you tap the bypass link in the top right corner of the screen after opening a Universal Link. This is a per-app setting that is saved on each unique device. The setting is preserved even if you delete the app and reinstall it, so the only way to reverse this is by intentionally re-enabling Universal

Get the filename of image saved to photos album

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 07:16:01
问题 Gain a huge bounty with this seemingly easy question that has no attention. In modern iOS (2017), here's actually the only way I know to save an image to the iOS photos system, and get the filename/path. import UIKit import Photos func saveTheImage... () { UIImageWriteToSavedPhotosAlbum(yourUIImage, self, #selector(Images.image(_:didFinishSavingWithError:contextInfo:)), nil) } func image(_ image: UIImage, didFinishSavingWithError error: NSError?, contextInfo: UnsafeRawPointer) { guard error =

What does deployment target mean?

可紊 提交于 2019-11-28 07:07:46
this is a very simple question I'm assuming. Can someone tell me what deployment target means. If I choose IOS 10, does that mean only users with iOS 10 can download the app. Is it bad to choose a lower deployment target? ALSO, continuing on deployment target, is it not recommended to run on a lower deployment target. Lets say you have set minimum deployment target to iOS 9. This means your application is compatible for iOS 9 and above devices. The application won't run on below 9.0 devices but can run on any iOS version greater than iOS 9.0. Deployment Target . This identifies the earliest OS

How I can set a notification which UserNotifications Framework

瘦欲@ 提交于 2019-11-28 06:10:34
问题 I can set a notification in a time interval but I don't know how make it in a specific time and date, I try this but don't work let center = UNUserNotificationCenter.current() func notificationSender(){ center.requestAuthorization([.sound, .alert]) { (granted, error) in // We can register for remote notifications here too! } var date = DateComponents() date.hour = 13 date.minute = 57 let trigger = UNCalendarNotificationTrigger.init(dateMatching: date , repeats: false) let content =

iOS 10 Rich Media Push Notification (Media Attachment) in Objective-C

可紊 提交于 2019-11-28 06:02:43
I want to add Media especially images and videos in iOS 10 Push notification but images are not working in push. How to do that in Objective-C? My Code is as follows: AppDelegate.h #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> #import <UserNotifications/UserNotifications.h> @interface AppDelegate : UIResponder <UIApplicationDelegate,CLLocationManagerDelegate,UNUserNotificationCenterDelegate> @property (strong, nonatomic) UIWindow *window; @end AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if(SYSTEM

Navigationbar coloring in ViewWillAppear happens too late in iOS 10

╄→гoц情女王★ 提交于 2019-11-28 05:57:05
I am facing a weird bug, that happens only on iOS 10. I have a application with several screens, and each screen colors the navigationBar in viewWillAppear . So when you go to the next screen, it will be properly colored. However, when testing on iOS 10 I suddenly see the following behaviour when going back to a previous screen: When the previous screen appears the navigationBar still has the color of the previous screen and then flashes to the proper color. It almost looks like viewWillAppear somehow behaves as viewDidAppear . Relevant code: ViewController: - (void)viewWillAppear:(BOOL

Handling user notifications on iOS 10

让人想犯罪 __ 提交于 2019-11-28 05:51:07
I have troubles determining when the user taps on a user push notification on iOS 10. So far, I have been using the -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] which is called when Case 1 : the application is active and the push is received Case 2 : when the user launched the app after taping a received notification This method comments explicitly say Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented. All this work as

clipsToBounds causes UIImage to not display in iOS10 & XCode 8

守給你的承諾、 提交于 2019-11-28 05:20:38
I switched my project over to new beta versions of iOS 10 and XCode 8. In all three areas of my app where I use: imageView.layer.cornerRadius = imageView.frame.size.width/2 imageView.clipsToBounds = true The associated images are not displaying at all. I have attempted cleaning the project as well as the build folder, restarting the device, trying on various simulators, re-adding the imageView, programmatically setting the associated UIImage instead of choosing one from the assets. Removing the clipsToBounds line shows the rectangular image regardless of whether masksToBounds is true or false