Post

Replies

Boosts

Views

Activity

Privacy Solution for Apps in iOS (Please Read)
Hear me out, developers at Apple! You've done an amazing job with privacy so far. The introduction of ContactAccess and the Contact Access Button this year is truly an amazing work of art. Well done. However, all the way back to the first iPhone I got in 2007, I wished Apple would make API's available to access the users installed apps (in a privacy way). This would (further) open up apps in the category of App Managers and App Launchers. Back in the early days the trick was to use deep link, but that was also awkward, since you needed to know the deeplink upfront and the apps needed to support it. Not ideal. It also had a side effect that Apple noticed, that evil party's used it to scan your device to know which apps you had installed and create a profile from that. Apple fixed that by using LSApplicationQueriesSchemes. Now you have to tell the App upfront which apps you will be calling (up to 50), or use Universal Link to be freed from this limitation again. Again not ideal. Why not turn it around and let the user decide? User central. Imagine an App Launcher app. There is a button in the launcher app where you as a user can click on to add an app. It calls an api available from Apple to launch a privacy shielded sheet with the apps the user got installed on its device. These are not exposed to the launcher app. When the user clicks on the installed app (or apps) it likes to add, the launcher app will get identifiers to launch the app. That's it. This would be limited access, perhaps the api could also expose full access, so permission could be granted once and the app will get all identifiers available. The choice will be up to the user. One step further, but this would be more nice-to-have, is the ability to access meta data of the app, such as icon, title, last launched, app size, etc. This way App Launchers can make decisions such as putting the most recent launched app in front or App Managers can use this to decide which apps you are not using and can advise to remove them to clean up space. Love to hear everyone's opinion. So let it be the start of the discussion.
3
0
713
Jun ’24
NWMulticastGroup returns POSIXErrorCode error
let localhost: NWEndpoint.Host = NWEndpoint.Host("127.0.0.1") let port: NWEndpoint.Port = NWEndpoint.Port(integerLiteral: 555) do { let multicast = try NWMulticastGroup(for: [.hostPort(host: localhost, port: port)]) print(multicast) } catch { print(error) return } Returns the error POSIXErrorCode(rawValue: 22): Invalid argument. Running on macOS. (Follow up question, does only receiving multicast also require entitlements for iOS?) How can I make NWMulticastGroup work?
6
0
571
Jun ’24
How to get collapsable sections as shown in 'Stacks, Grids, and Outlines in SwiftUI'?
I tried to replicate the code as shown in Stacks, Grids, and Outlines in SwiftUI - https://developer.apple.com/videos/play/wwdc2020/10031/ (12:35). They make it feel like it's a very easy thing to do. Just insert a Section and as you could see in the video it will immediately become a collapsable view. Add a header to the section and it will get the bolder text style. I wasn't able to replicate this. xCode Version 12.0 beta (12A6159) Below you can find the code I used. The expected result would be nicely styled, collapsable section headers. The actual result is a non-collapsable section with a weird underline under the name and no arrow.   let model: Model = Model()       @State private var selection: Set<String> = []   var body: some View {     NavigationView {       List(selection: $selection) {         ForEach(model.canvases) { canvas in           Section(header: Text(canvas.name)) {             OutlineGroup(canvas.graphics, children: \.children) { graphic in               Label(graphic.name, systemImage: graphic.icon)             }           }         }       }       .listStyle(SidebarListStyle())       .navigationTitle("Graphics")     }   } } struct ContentView_Previews: PreviewProvider {   static var previews: some View {     ContentView()   } } It uses this simple model to hold the canvases and graphics: struct Model: Identifiable {   let id: String = UUID().uuidString   let canvases: [Canvas] = [     Canvas(name: "Main", graphics: [       Graphic(name: "Rectangle", icon: "rectangle.fill"),       Graphic(name: "Oval", icon: "circle.fill"),       Graphic(name: "Group", icon: "rectangle.3.offgrid", children: [         Graphic(name: "Rectangle", icon: "rectangle.fill"),         Graphic(name: "Rectangle", icon: "rectangle.fill"),         Graphic(name: "Rectangle", icon: "rectangle.fill")       ]),       Graphic(name: "Group", icon: "rectangle.3.offgrid", children: [         Graphic(name: "Rectangle", icon: "rectangle.fill"),         Graphic(name: "Rectangle", icon: "rectangle.fill"),         Graphic(name: "Rectangle", icon: "rectangle.fill")       ])     ]),     Canvas(name: "Highlights", graphics: [       Graphic(name: "Triangle", icon: "triangle.fill"),       Graphic(name: "Triangle", icon: "triangle.fill")     ]),     Canvas(name: "Version 2", graphics: [       Graphic(name: "Rectangle", icon: "triangle.fill"),       Graphic(name: "Oval", icon: "circle.fill"),       Graphic(name: "Triangle", icon: "triangle.fill")     ]),   ] } struct Canvas: Identifiable {   var id: String = UUID().uuidString   var name: String   let graphics: [Graphic] } struct Graphic: Identifiable {   var id: String = UUID().uuidString   var name: String   var icon: String   var children: [Graphic]? }
3
0
4k
Jul ’20
How to set PreviewProvider to landscape?
I am developing a SwiftUI iPad app and I like to see how the interface looks when the device is held in landscape mode. I am using the latest Version 12.0 beta (12A6159). However there seems to be no setting to switch between landscape and portrait for the SwiftUI PreviewProvider. Is this not implemented yet?
0
0
607
Jul ’20
How to get a notification when a USB drive is being connected/disconnected?
I have an iOS-app that users can select a folder via UIDocumentPickerViewController - https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller to add it under the Favorites section. This folder can also be a Volume, such as the USB drive. The good thing. When I subclass NSFilePresenter - https://developer.apple.com/documentation/foundation/nsfilepresenter and use the Volume-URL, every change to that Volume is reported. The bad thing. It seems like there is no way to figure out if that volume is available or not. I overwritten every subclass method in NSFilePresenter - https://developer.apple.com/documentation/foundation/nsfilepresenter. However if I unplug the USB nothing is reporter, nor if I plug it in again. The reason as to why I want to get reported is to hide the location from the Favorites section if it is unplugged and unavailable, vice versa I like to show the location when the USB is plugged in again.
0
0
733
Jun ’20
What happened to GKGameSession?
So I watched the 2016 session 'What's New in Game Center' a great update on the 2011 and 2013 Game Center sessions. Moving from a restricted Game Center approach to a more Cloud Based approach.What I liked about the GKGameSession framework:Larger player count limits. 2-16 Real-Time players opposed to 2-4 in GKMatch. 2-100 players Turn Based instead of 2-16 players with GKTurnedBasedMatch. Opening the door for more real time party type of games.Combine Turn Based with Real-Time (This is amazing).No specific structure. In GKTurnBasedMatch it was very specific in which order the messages were being sent, you had all the freedom in GKGameSession which opened the door to all kinds of use cases.Easy way to get people into your game by sharing the URL.I got so excited after watching that video (from 2016) I wanted to make all sorts of cool things with it only to find out now in iOS13 it is totally deprecated. Did they ever mention why? I am so dissapointed!!!I know it didn't have Match Making, but that was limited anyways to "whoever wanted to play a game". I saw potential to have a public Cloud Kit database that holds the ELO-ranking of Game Kit players playing my game, then when a player likes to play a game you could retrieve the players marked with wanting to play a game and do your own algoritm to see if it's a match and if so fetch the URL and join the game. Or have a closed session where you shared the URL with your friends over iMessage or WhatsApp. GKGameSession had so much potential especially in the bridge between Turn Based and Real Time. Hopefully they will give it some love soon.So, again, my question.. What happened to GKGameSession?
2
0
899
Apr ’20