ios10

Programmatically create SKTileMapNode in Swift

不羁的心 提交于 2019-11-29 22:24:22
问题 does anyone know how to create an SKTileMapNode programmatically using Swift please? (NOTE: I do not want to do this using the editor, I want to achieve this programmatically only) I have tried the following but does not render my tile map let bgTexture = SKTexture(imageNamed: "background") let bgDefinition = SKTileDefinition(texture: bgTexture, size: bgTexture.size()) let bgGroup = SKTileGroup(tileDefinition: bgDefinition) let tileSet = SKTileSet(tileGroups: [bgGroup]) let bgNode =

How to get the body of a push notification sent from Firebase console in iOS 10 and Swift 3?

爱⌒轻易说出口 提交于 2019-11-29 20:36:36
问题 I'm developing an iOS app that should receive push notifications sent from the Firebase console. I'm using Swift 3 and iOS 10. As recommended by the Firebase documentation, we must assign our delegate object to the UNUserNotificationCenter object to receive and display notifications, and the FIRMessaging object to receive data messages, before our app finishes launching. This has been done in the didFinishLaunchingWithOptions method. I followed all the steps in order to configure Firmessaging

How to make phone call in iOS 10 using Swift? [duplicate]

跟風遠走 提交于 2019-11-29 19:48:37
This question already has an answer here: Calling a phone number in swift 20 answers I want my app to be able to call a certain number when a button is clicked. I've tried to google it but there doesn't seem to have one for iOS 10 so far (where openURL is gone). Can someone put an example for me on how to do so? For instance like: @IBAction func callPoliceButton(_ sender: UIButton) { // Call the local Police department } You can call like this: if let url = URL(string: "tel://\(number)") { UIApplication.shared.openURL(url) } For Swift 3+ , you can use like guard let number = URL(string: "tel:/

iOS 10 Safari: Prevent scrolling behind a fixed overlay and maintain scroll position

可紊 提交于 2019-11-29 19:33:55
I'm not able to prevent the main body content from scrolling while a fixed position overlay is showing. Similar questions have been asked many times, but all of the techniques that previously worked do not seem to work on Safari in iOS 10. This seems like a recent issue. Some notes: I can disable scrolling if I set both html and body to overflow: hidden , however that makes the body content scroll to the top. If the content in the overlay is long enough so that it can be scrolled, scrolling is correctly disabled for the main page content. If the content in the overlay is not long enough to

Safe area layout guides in xib files - iOS 10

末鹿安然 提交于 2019-11-29 19:25:09
I started adapting my app for iPhone X and found an issue in Interface Builder. The safe area layout guides are supposed to be backwards compatible, according to official Apple videos. I found that it works just fine in storyboards. But in my XIB files, the safe area layout guides are not respected in iOS 10. They work fine for the new OS version, but the iOS 10 devices seem to simply assume the safe area distance as zero (ignoring the status bar size). Am I missing any required configuration? Is it an Xcode bug, and if so, any known workarounds? Here is a screenshot of the issue in a test

Swift UIViewReportBrokenSuperviewChain cause by Layer manipulation

[亡魂溺海] 提交于 2019-11-29 18:01:29
问题 I run into a problem after migrating my code to Swift 3. I guess iOS10 raises new issues now and it's actually not related to Swift itself. The error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'View has lost track of its superview, most likely through unsupported use of CALayer API on the view's layer. If this isn't a crash yet, it will be in the near future. Problem view: <UIToolbar: 0x102552d80; frame = (0 0; 375 683); alpha = 0.97; opaque =

Why push notification is shown when app is foreground? (iOS10 / iPhone 7)

戏子无情 提交于 2019-11-29 17:51:34
I'm having weird experience. Why push notification is shown (in native banner) when app is foreground? It's only reproduced on iPhone 7 (iOS10.1.1). I tested on the other iPhones like a iPhone 5 and iPhone 6s with same app, same iOS version. It's not shown when app is in foreground as normal. Push banner appears only on iPhone 7. Is this normal? My app is created by Xamarin.forms. (For now, Xamarin convert c# code to objective C, so it's basically objective c) Thanks. If an application is upgraded to iOS10, and developers of their app have used the UserNotifications framework.Then there are

AVAssetExportSession in ios 10 not working for iPhone 7

风格不统一 提交于 2019-11-29 16:58:46
When I am blending two videos with AVAssetExportSession in ios 9 its working perfectly. but when i blend with AVAssetExportSession in iOS 10, it in not working. Please help me if any know the reason, Thank you. actualy code is working for iphone 6s and earlier, but not for working for iPhone 7 for example -(void) blendVideoOverVideo:(NSURL*)mainVideoUrl andBlendVideoUrl:(NSURL*)liveEffectUrl { AVURLAsset *mainVideoUrlAsset =[AVURLAsset URLAssetWithURL:mainVideoUrl options:nil]; // AVPlayerItem* mainVideoPlayerItem =[[AVPlayerItem alloc]initWithAsset:mainVideoUrlAsset]; AVAssetTrack*

My button's titleLabel become “…” on iOS10

橙三吉。 提交于 2019-11-29 16:40:14
When I use iOS 10 some button label's text become "...". I found the same string (e.x:我是人) in iOS9 uses 48 width. In iOS10 it uses 48.96 width. How to fix? KSR You have to use "adjustsFontSizeToFitWidth" property of titleLabel of your button Example: myButton.titleLabel.adjustsFontSizeToFitWidth = YES; This line will automatically adjust font size for the text of myButton based on the width of the button. Use this link: adjust UIButton font size to width Another solution is to increase the width of the button, by adjusting constraints. 来源: https://stackoverflow.com/questions/39422382/my

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

我只是一个虾纸丫 提交于 2019-11-29 15:36:02
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 the Camera modal, the app crashes. The relevant stack trace shows: 3 TCC __TCCAccessRequest_block_invoke