ios11

SLServiceTypeFacebook' was deprecated in iOS 11.0

六眼飞鱼酱① 提交于 2019-12-30 18:00:14
问题 I'm working on a project in xcode 9 and one of my previous codes giving a warning saying the code is been deprecated, where it does not trigger the action. The code as bellow. How can i overcome this ? @IBAction func shareOnFacebookButtonPressed(_ sender: Any) { let shareToFacebook : SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook) shareToFacebook.add(UIImage(named:"pureLightSocial")) self.present(shareToFacebook, animated: true, completion: nil) } 回答1:

How to create a border for SCNNode to indicate its selection in iOS 11 ARKit-Scenekit?

假如想象 提交于 2019-12-30 04:24:08
问题 How to draw a border to highlight a SCNNode and indicate to user that the node is selected? In my project user can place multiple virtual objects and user can select any object anytime. Upon selection i should show the user highlighted 3D object. Is there a way to directly achieve this or draw a border over SCNNode? 回答1: You need to add a tap gesture recognizer to the sceneView . // add a tap gesture recognizer let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(

TopLayoutGuide and BottomLayoutGuide Deprecated in iOS 11

二次信任 提交于 2019-12-29 07:12:17
问题 UIViewController 's topLayoutGuide and bottomLayoutGuide are deprecated in iOS 11. What should be the replacement? 回答1: Previously in your UIViewController : customView.topAnchor.constraint(equalTo: topLayoutGuide.bottomAnchor).isActive = true customView.bottomAnchor.constraint(equalTo: bottomLayoutGuide.topAnchor).isActive = true Now you should use: customView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true customView.bottomAnchor.constraint(equalTo: view

UIButton in Navigation Bar Not Recognizing Taps in iOS 11

痞子三分冷 提交于 2019-12-29 06:56:49
问题 I have a UIButton in a navigation bar that sits over the top of a UIImage and a UILabel . It worked fine in iOS 10, but now in iOS 11 it doesn't recognize any taps from my @IBAction outlet. I tried moving the tap outlet to the bar button item, but that didn't work either. The UIButton has the following constraints: I confirmed that it's there by giving it a green background, so I know it's visible and available. Any idea what's going on? 回答1: I found a solution from another developer. You

UIButton in Navigation Bar Not Recognizing Taps in iOS 11

倖福魔咒の 提交于 2019-12-29 06:56:11
问题 I have a UIButton in a navigation bar that sits over the top of a UIImage and a UILabel . It worked fine in iOS 10, but now in iOS 11 it doesn't recognize any taps from my @IBAction outlet. I tried moving the tap outlet to the bar button item, but that didn't work either. The UIButton has the following constraints: I confirmed that it's there by giving it a green background, so I know it's visible and available. Any idea what's going on? 回答1: I found a solution from another developer. You

iOS 11 dropInteraction performDrop for files

和自甴很熟 提交于 2019-12-29 06:45:08
问题 How can I use dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) to accept other type of files than images? Say for instnce that I drag a PDF or MP3 from the files app. How can I accept this file and get the data? I thought I could use NSURL.self, but that only seems to work for URL's dragged from Safari och a textview. 回答1: An example for PDF ( com.adobe.pdf UTI) implementing NSItemProviderReading could be something like this: class PDFDocument: NSObject,

How to capture depth data from camera in iOS 11 and Swift 4?

≯℡__Kan透↙ 提交于 2019-12-28 12:52:32
问题 I'm trying to get depth data from the camera in iOS 11 with AVDepthData, tho when I setup a photoOutput with the AVCapturePhotoCaptureDelegate the photo.depthData is nil. So I tried setting up the AVCaptureDepthDataOutputDelegate with a AVCaptureDepthDataOutput, tho I don't know how to capture the depth photo? Has anyone ever got an image from AVDepthData? Edit: Here's the code I tried: // delegates: AVCapturePhotoCaptureDelegate & AVCaptureDepthDataOutputDelegate @IBOutlet var image_view:

How to capture depth data from camera in iOS 11 and Swift 4?

≯℡__Kan透↙ 提交于 2019-12-28 12:50:11
问题 I'm trying to get depth data from the camera in iOS 11 with AVDepthData, tho when I setup a photoOutput with the AVCapturePhotoCaptureDelegate the photo.depthData is nil. So I tried setting up the AVCaptureDepthDataOutputDelegate with a AVCaptureDepthDataOutput, tho I don't know how to capture the depth photo? Has anyone ever got an image from AVDepthData? Edit: Here's the code I tried: // delegates: AVCapturePhotoCaptureDelegate & AVCaptureDepthDataOutputDelegate @IBOutlet var image_view:

Can we run firebase realtime listening on ios serviceworker?

余生长醉 提交于 2019-12-28 12:47:03
问题 As of iOS 11.3 there is serviceworker feature supported Even though it has no support for notification. I wonder if it possible to just run any realtime listener, such as firebase database, to receive realtime data and use ServiceWorkerRegistration.showNotification to show local notification instead Is it possible? 回答1: While iOS don't support Web Push notifications yet(as of Apr-2018), all you can do is have an event listener for data from server side(Firebase in your case) and receive that

FCM Push notifications do not work on iOS 11

佐手、 提交于 2019-12-28 04:12:36
问题 I use Firebase as a backend. I also use FCM as one of the provided features from Firebase. FCM worked well in iOS 10, but after switching to iOS 11, push notifications stopped coming to user devices, and I myself did not receive any push notifications sent from the cloud functions or the Notification section in the Firebase Console. How to fix this problem? Update: I sent several push notifications from Firebase Notifcations, but they do not come. // MARK: - Push notification extension