Complete Beginner - Any help is greatly appreciated
Apple Developer Forums » Swift
by
1w ago
Hello everyone, So I will start off by saying I am a very amateur developer with some experience in C++ mostly. Over the summer I want to build an app similar to a board game and launch it on the App Store for me and my friends to play when we don't have the game's physical board. Basically, there would be one person who hosts a "game" while everyone else joins through a code or something like that (maybe there's an easier way if you know everyone would be playing in person with each other). Once a game begins I want cards to show up on peoples's screens and that's it, no fancy graphics or any ..read more
Visit website
IOS LiveActivity dynamic island compile error
Apple Developer Forums » Swift
by
1w ago
i'm struct dynamic island detail content dynamicIsland: { context in DynamicIsland { expandedContent(context: context) } compactLeading: { .... } compactTrailing: { ... } i want show different content based on context. private func expandedContent(context: ActivityViewContext)->DynamicIslandExpandedContent { if (context.state.style == 0) { return expandedControlContent1(context: context) } else if (context.state.style == 1) { return expandedControlContent2(context: context) } else { return expandedControlContent3(context: context) } } compiles error Function declares an opaque return type ..read more
Visit website
NWPathMonitor and mobile router WiFi without SIM always get connected
Apple Developer Forums » Swift
by
1w ago
Hello, I'm looking for a way to detect using NWPathMonitor when the iOS device is connected to a router but not to the internet. As an example a mobile router WiFi without SIM. In settings I'm able to switch the connection to its WiFi, once connected a label below the SSID shows Not connected to the internet. I would like to show the same thing to the user inside my app, but unfortunately I always get the satisfied answer. Am I missing something in configuring NWPathMonitor or reading the answer? final class InternetConnectionMonitor { lazy var internetConnectionStatusPublisher: AnyPublisher&l ..read more
Visit website
How to add this button side by side with Tab in Vision OS
Apple Developer Forums » Swift
by
1w ago
I want to add this button with some space in a tab bar I don't know what this button is called and how to add it in Vision Pro app ..read more
Visit website
Superclass - subclass - init(from: decoder Decoder) - how to
Apple Developer Forums » Swift
by
1w ago
Hello together, i want to us some classes to manage informations, which get fetched from a firestore database. My idea was, that I will have different classes for the different state of informations. The information which will be common for the different states should have the same properties. Therefore it made sense for me to have a super class which stores the main informations and derive a subclass with extra properties to store the more informations. My question is, how to define the initializer method properly, so that I can store these data informations fetched from firestore at once wit ..read more
Visit website
SwiftUI sheet/fullscreenCover memory leak with TextField on iOS 17
Apple Developer Forums » Swift
by
1w ago
I've found a strange leak, that looks like a bug. When we open two sheets, or fullscreenCovers and the last one has a TextField, then after closing both, @StateObject property is not released. If you delete TextField, there will be no memory leak. It works well and memory is releasing on iOS 16 built with Xcode 15 (simulators) Memory is leaking and not releasing on iOS 17 built with Xcode 15 (simulators, device 17.4.1) import SwiftUI struct ContentView: View { @State var isFirstOpen: Bool = false var body: some View { Button("Open first") { isFirstOpen = true } .sheet(isPresented: $isFirstOpen ..read more
Visit website
Swift performance, debug build hundreds of times slower than release
Apple Developer Forums » Swift
by
1w ago
As an exercise in learning Swift, I rewrote a toy C++ command line tool in Swift. After switching to an UnsafeRawBufferPointer in a critical part of the code, the Release build of the Swift version was a little faster than the Release build of the C++ version. But the Debug build took around 700 times as long. I expect a Debug build to be somewhat slower, but by that much? Here's the critical part of the code, a function that gets called many thousands of times. The two string parameters are always 5-letter words in plain ASCII (it's related to Wordle). By the way, if I change the loop ranges ..read more
Visit website
Does IOS support WebTransport yet?
Apple Developer Forums » Swift
by
1w ago
Hi, wondering if IOS supports WebTransport (HTTP/3) yet? If so, where can I find information on implementing it in my app ..read more
Visit website
Camera Feed is not working using AVFoundation
Apple Developer Forums » Swift
by
1w ago
In this code, I aim to enable users to select an image from their phone gallery and display it with less opacity on top of the z-index. The selected image should appear on top of the user's phone camera feed, allowing them to see the canvas on which they are drawing as well as the low-opacity image. The app's purpose is to enable users to trace an image on the canvas while simultaneously seeing the camera feed. CameraView.swift import SwiftUI import AVFoundation struct CameraView: View { let selectedImage: UIImage var body: some View { ZStack { CameraPreview() Image(uiImage: selectedImage) .re ..read more
Visit website
Multiple commands produce Error When I've added Privacy.Info file in my react native app.
Apple Developer Forums » Swift
by
2w ago
In my react native app deployed on appstore. I've added Privacy.Info file to declare privacy manifest as requested by Apple. But as soon as I added this file in my project using xcode, I am getting the Multiple commands produce Error when I make the build. Below is the code for my privacy.info file, which I've added in the root ios folder of my react native project. NSPrivacyAccessedAPITypesNSPrivacyAccessedAPITypeNSPrivacyAccessedAPICategoryDiskSpaceNSPrivacyAccessedAPITypeReasonsE174.1NSPrivacyAccessedAPITypeNSPrivacyAccessedAPICategoryUserDefaultsNSPrivacyAccessedAPITypeReasonsCA92.1NSPriva ..read more
Visit website

Follow Apple Developer Forums » Swift on FeedSpot

Continue with Google
Continue with Apple
OR