swift

iOS - Streaming and receiving audio from a device to another ends in one only sending and the other only receiving

耗尽温柔 提交于 2021-02-20 03:44:18
问题 My app is basically a phone call over MultipeerConnectivity. Here is how I'm setting up the audio session: Note that recordingSession is of type AVAudioSession and captureSession is of type AVCaptureSession. func setupAVRecorder() { print("\(#file) > \(#function) > Entry") do { try recordingSession.setCategory(AVAudioSessionCategoryPlayAndRecord) try recordingSession.setMode(AVAudioSessionModeVoiceChat) try recordingSession.setPreferredSampleRate(44100.00) try recordingSession

Unable to Handle Local Notification when app has been terminated

主宰稳场 提交于 2021-02-20 02:48:34
问题 The app that I have made keeps track of Goals and Milestones(which belong to a goal) and reminds the user when they are about to reach the due date of a goal or a milestone through a UILocalNotification my app has been successful in handling local notifications when the app is in a background state and when the app is in the foreground. I am aware that if you want to handle local notifications when they are received when the app is terminated you are required to access the local notification

Unable to Handle Local Notification when app has been terminated

浪尽此生 提交于 2021-02-20 02:47:10
问题 The app that I have made keeps track of Goals and Milestones(which belong to a goal) and reminds the user when they are about to reach the due date of a goal or a milestone through a UILocalNotification my app has been successful in handling local notifications when the app is in a background state and when the app is in the foreground. I am aware that if you want to handle local notifications when they are received when the app is terminated you are required to access the local notification

How to detect penetration without physical interaction in ARKit?

不想你离开。 提交于 2021-02-20 00:59:06
问题 I have a fixed laser beam SCNNode and a detecting sphere SCNNode attached in front of a camera. How to detect penetration without physical interaction? I have not found any clue.. EDIT: - as suggested below by maxxFrazer I implemented physical interaction and I'm able to register collision IF my laser beam is .static and detector moved by camera set .kinematic. 回答1: If you need to detect a penetration without physical interaction use trackedRaycast instance method working in iOS 13+: func

How can I parse json with a dictionary in swift?

我的梦境 提交于 2021-02-20 00:48:54
问题 I have the current JSON "updateTime": "2021-02-12T16:41:21.413Z", "dueDate": { "year": 2021, "month": 2, "day": 17 }, "dueTime": { "hours": 4, "minutes": 59 }, ... How can I retrieve the values of dueDate and dueTime (including all of the data in the dictionary) using Swift? Thanks in advance 回答1: My suggestion is to decode the JSON with Decodable into structs and join the date and time parts to a DateComponents instance let jsonString = """ { "updateTime": "2021-02-12T16:41:21.413Z",

How can I parse json with a dictionary in swift?

送分小仙女□ 提交于 2021-02-20 00:44:57
问题 I have the current JSON "updateTime": "2021-02-12T16:41:21.413Z", "dueDate": { "year": 2021, "month": 2, "day": 17 }, "dueTime": { "hours": 4, "minutes": 59 }, ... How can I retrieve the values of dueDate and dueTime (including all of the data in the dictionary) using Swift? Thanks in advance 回答1: My suggestion is to decode the JSON with Decodable into structs and join the date and time parts to a DateComponents instance let jsonString = """ { "updateTime": "2021-02-12T16:41:21.413Z",

Subtitles won't display if closed caption is off in system settings

一世执手 提交于 2021-02-20 00:41:29
问题 I am trying to get subtitles to display regardless of what the device has set under the accessibilities. Currently, if the device is set to English with closed captioning enabled in settings, English subtitles will play, and if the device is set to Spanish, Spanish subtitles will play. I would like subtitles to play regardless of whether or not closed captioning is on. I attempted to add this code from apple's documentation, but it did not help. It seems to be reading the options fine,

Using a SwiftUI List Sidebar in a UISplitViewController

醉酒当歌 提交于 2021-02-20 00:40:30
问题 I am attempting to build my app's navigation such that I have a UISplitViewController (triple column style) with my views built with SwiftUI. My Primary Sidebar is currently quite simple: struct PrimarySidebarView: View { @EnvironmentObject var appModel: AppModel var body: some View { List(PrimarySidebarSelection.allCases, id: \.self, selection: $appModel.primarySidebarSelection) { selection in Text(selection.rawValue) } .listStyle(SidebarListStyle()) .navigationBarItems(trailing: EditButton(

Disable logging from AdMob in Xcode

馋奶兔 提交于 2021-02-20 00:17:01
问题 I am getting a huge amount of of logging when I install the Google-Mobile-Ads-SDK cocoapod. Some seem to be completely unrelated but somehow are because completely removing the Google-Mobile-Ads-SDK pod gets rid of all the logging. Here is what I have: Podfile target 'myapp' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! pod 'Google-Mobile-Ads-SDK' end Here are the pod files: I've tried adding FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED=YES IS_MEASUREMENT

Disable logging from AdMob in Xcode

☆樱花仙子☆ 提交于 2021-02-20 00:16:14
问题 I am getting a huge amount of of logging when I install the Google-Mobile-Ads-SDK cocoapod. Some seem to be completely unrelated but somehow are because completely removing the Google-Mobile-Ads-SDK pod gets rid of all the logging. Here is what I have: Podfile target 'myapp' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! pod 'Google-Mobile-Ads-SDK' end Here are the pod files: I've tried adding FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED=YES IS_MEASUREMENT