ios14

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(

Apple Sign-in not working on iOS 14 Simulator

倾然丶 夕夏残阳落幕 提交于 2021-02-18 10:39:11
问题 When I try to log in for the simulator in iOS 14, the loading spinner just spins forever. There is a thread for this on the Apple developer forums here but no solutions and no response from Apple. I can certainly test on the device, but testing on the simulator is obviously easier for iteration. Does anyone have a solution for this problem? 回答1: This is one of the known issues in iOS 14, that has not been solved by Apple as of today yet. (almost 4 months old) The problem has not been fixed in

Is there any way to call SceneDelegate methods in iOS 14 app life cycle?

天涯浪子 提交于 2021-02-11 12:26:48
问题 We know Apple has drastically simplified the SwiftUI app life cycle (WWDC20). I have seen the video of Mr.Paul Hudson about the new changes in SwiftUI in which he has explained how to access AppDelegate methods in "@main or :App" struct. I want to know if there is any way to access the SceneDelegate methods? Thanks in advance. :) 回答1: There is no access for SceneDelegate now in SwiftUI 2.0 life-cycle. Some of callbacks you can use with .onChange for [.active, .inactive, .background] states as

CNCopyCurrentNetworkInfo not working with iOS 14

懵懂的女人 提交于 2021-02-10 12:56:32
问题 I have an app that connects to an external device using WIFI and I used to validate that the iPhone is connected to the device by checking the WIFI SSID. This was blocked when iOS 13 was released and I fixed it by requesting location permission to get the SSID. I tried now with iOS 14 beta with location service enabled but couldn't get the WIFI SSID, however the same code works with iOS 13. Here is the log I get when I call CNCopyCurrentNetworkInfo nehelper sent invalid result code [1] for Wi

CNCopyCurrentNetworkInfo not working with iOS 14

与世无争的帅哥 提交于 2021-02-10 12:56:10
问题 I have an app that connects to an external device using WIFI and I used to validate that the iPhone is connected to the device by checking the WIFI SSID. This was blocked when iOS 13 was released and I fixed it by requesting location permission to get the SSID. I tried now with iOS 14 beta with location service enabled but couldn't get the WIFI SSID, however the same code works with iOS 13. Here is the log I get when I call CNCopyCurrentNetworkInfo nehelper sent invalid result code [1] for Wi

Is this intended @State var behaviour in iOS14 or is it a bug?

瘦欲@ 提交于 2021-02-08 02:04:46
问题 When I run the following code compiled for iOS14 on iOS14 sim or device, the updated @State variable "selection" doesn’t get passed to a view displayed as .sheet(… The exact code runs OK on iOS 13.5 sim or 13.6 device The code runs as expected on iOS 14, if I place somewhere in the view a Text(“”) and display the variable being updated. It seems that only if I display the value, the .sheet get's rendered again updating the MyView(tenum: selection) with the correct value. In the code below

How to detect if Local Network permissions are granted in iOS 14

最后都变了- 提交于 2021-02-07 19:14:46
问题 How to detect if the user has granted the local network permission in the app for iOS 14? I have to show an error screen if the user has denied permission and redirects to os settings to grant permission. Has Apple provided any way to find out just like location permission? 回答1: I wrote up this class that can be used if you're not on iOS 14.2. This class will prompt user for permission to access local network (first time). Verify existing permission state if already denied/granted. Just

How to reset intent extension configurations in WidgetKit

╄→гoц情女王★ 提交于 2021-02-06 10:21:05
问题 I have an application where a user can login. If a user is logged in, then I display a placeholder for my widget and it's configurable through an intent extension. The configuration has two options: the first option depends on the username of the user currently logged in. the second option depends on the value of the first option. This works fine for 1 user, however, if the user logs out, then logs in with a different account, the old selected options are still selected when they try to

How to reset intent extension configurations in WidgetKit

旧街凉风 提交于 2021-02-06 10:18:08
问题 I have an application where a user can login. If a user is logged in, then I display a placeholder for my widget and it's configurable through an intent extension. The configuration has two options: the first option depends on the username of the user currently logged in. the second option depends on the value of the first option. This works fine for 1 user, however, if the user logs out, then logs in with a different account, the old selected options are still selected when they try to

How to use PHAuthorizationStatusLimited in iOS 14

夙愿已清 提交于 2021-02-04 19:46:16
问题 In order to fetch photo's creationDate, so use requestAuthorizationForAccessLevel before show PHPickerViewController. PHAccessLevel level = PHAccessLevelReadWrite; [PHPhotoLibrary requestAuthorizationForAccessLevel:level handler:^(PHAuthorizationStatus status) { if (status == PHAuthorizationStatusLimited || status == PHAuthorizationStatusAuthorized) { dispatch_async(dispatch_get_main_queue(), ^{ PHPickerConfiguration *configuration = [[PHPickerConfiguration alloc] initWithPhotoLibrary: