Posts

Sort by:
Post not yet marked as solved
0 Replies
17 Views
When I run the code below, the trace, "Called", is shown 3-4 times initially. If I click on a color row, the trace shows 9 times. Why is that? If I comment out the line, @Environment(\.dismiss) private var dismiss, the trace shows only 1 time, as expected. I've read a number of reports regarding dismiss() which seems to be very brittle. It often causes an infinite loop. But I need to dismiss a view. Its older counterpart, @Environment(\.presentationMode), seems to cause infinite loop at times. Are there other ways to dismiss a view without suffering these issues? struct TestNavigationLink: View { @Environment(\.dismiss) private var dismiss var body: some View { let _ = print("Called") NavigationStack { List { NavigationLink("Mint") { ColorDetail(color: .mint) } } .navigationTitle("Colors") } } // body struct ColorDetail: View { var color: Color var body: some View { color.navigationTitle(color.description) } } }
Posted
by
Post not yet marked as solved
0 Replies
28 Views
Hey everyone, I'm facing a bit of a puzzling issue with the review of my app, particularly with the in-app purchase functionality for message extension/sticker packs. I've implemented the entire store using StoreKit for in-app purchases, using exactly the same code like it is in Apple's demo application (https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api). Here's the problem: the products appear correctly according to what's set up in App Store Connect (In-App Purchases section), and the purchase process works flawlessly in sandbox and TestFlight environments. However, during the review process, I received the following feedback: "Guideline 2.1 - Performance - App Completeness We found that your in-app purchase products exhibited one or more bugs which create a poor user experience. Specifically, the app kept loading indefinitely when we tapped on “Shop”. Please review the details and resources below and complete the next steps." It seems that the products are not loading properly in the environment used by the reviewers. What's most puzzling is that another app with the exact same store implementation has passed the review and is available in the store (https://apps.apple.com/pl/app/the-prince-frog/id6478831171?l=pl). I'm running out of ideas on what could be causing this discrepancy, especially since everything is functioning correctly in sandbox and TestFlight. Could someone please take a look at the code in Store.swift in this demo project and point out what might be missing? Any help or insights would be greatly appreciated! Thanks in advance. @MainActor func requestProducts() async { do { //Request products from the App Store using the identifiers that the Products.plist file defines. let storeProducts = try await Product.products(for: productIdToEmoji.keys) for product in productIdToEmoji.keys { toDebug = toDebug + ", " + product } var newCars: [Product] = [] var newSubscriptions: [Product] = [] var newNonRenewables: [Product] = [] var newFuel: [Product] = [] //Filter the products into categories based on their type. for product in storeProducts { switch product.type { case .consumable: newCars.append(product) case .nonConsumable: newCars.append(product) case .autoRenewable: newSubscriptions.append(product) case .nonRenewable: newNonRenewables.append(product) default: //Ignore this product. print("Unknown product") } } //Sort each product category by price, lowest to highest, to update the store. cars = sortByPrice(newCars) subscriptions = sortByPrice(newSubscriptions) nonRenewables = sortByPrice(newNonRenewables) fuel = sortByPrice(newFuel) } catch { print("Failed product request from the App Store server: \(error)") errorMessage = error.localizedDescription } }
Posted
by
Post not yet marked as solved
0 Replies
23 Views
Fairly new to SwiftUI and using it for a school project. I keep getting this error and I have no idea how to fix it. // AddToCartButton.swift // ProducePal // import SwiftUI struct AddToCartButton: View { @EnvironmentObject var multicart: MultiCartManager var product: Product var body: some View { VStack { Button { multicart.addToCart2(product: product) } label: { Text("Add to Cart") .font(.headline) .fontWeight(.semibold) .foregroundColor(.white) .padding() .padding(.horizontal, 20) .background(Color.blue) .cornerRadius(10) .shadow(radius: 20) } } .buttonStyle(PlainButtonStyle()) } } struct AddToCartButton_Previews: PreviewProvider { static var previews: some View { AddToCartButton(product: productList[0]) .environmentObject(MultiCartManager()) } }
Posted
by
Post not yet marked as solved
0 Replies
19 Views
Hello There!, I'm currently working on an App with an implemented timer. It was initially planned, that the User will get a notification when the timer ends. Everything works fine until the timer ends and the phone doesn't gets any notification... This is my code: import SwiftUI import Combine import UserNotifications struct TimerView: View { @State private var timeRemaining: TimeInterval @State private var timerActive = false @Binding var studyTime: Int @Binding var selectedExam: Exam init(studyTime: Binding<Int>, selectedExam: Binding<Exam>) { _studyTime = studyTime _selectedExam = selectedExam _timeRemaining = State(initialValue: TimeInterval(studyTime.wrappedValue * 60)) } var body: some View { VStack { ZStack { Circle() .trim(from: 0, to: CGFloat(timeRemaining / (TimeInterval(studyTime * 60)))) .stroke(Color.purple, lineWidth: 15) .rotationEffect(.degrees(-90)) .animation(.linear(duration: 1)) .padding(40) Text("\(timeRemaining.formattedTime)") .font(.system(size: 50)) } Button(action: { self.timerActive.toggle() }) { Text(timerActive ? "Stop" : "Start") .font(.title) .padding() } .foregroundColor(.white) .background(timerActive ? Color.red : Color.green) .cornerRadius(10) .padding() } .onReceive(timer) { _ in guard self.timerActive else { return } if self.timeRemaining > 0 { self.timeRemaining -= 1 } else { self.timerActive = false sendNotification() } print("Time Remaining: \(self.timeRemaining)") } .navigationTitle($selectedExam.wrappedValue.subject) .navigationBarBackButtonHidden(true) .onDisappear { // Actions if the timer View disappears } } var timer: AnyPublisher<Date, Never> { Timer.TimerPublisher(interval: 1.0, runLoop: .main, mode: .default) .autoconnect() .eraseToAnyPublisher() } func sendNotification() { let content = UNMutableNotificationContent() content.title = "Lernzeit vorbei" content.body = "Deine Lernzeit für \(selectedExam.subject) ist abgelaufen!" content.sound = UNNotificationSound.default let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) let request = UNNotificationRequest(identifier: "timerNotification", content: content, trigger: trigger) UNUserNotificationCenter.current().add(request) { error in if let error = error { print("Fehler beim Hinzufügen der Benachrichtigung zur Warteschlange: \(error.localizedDescription)") } else { print("Benachrichtigung zur Warteschlange hinzugefügt") } } } } extension TimeInterval { var formattedTime: String { let minutes = Int(self) / 60 % 60 let seconds = Int(self) % 60 return String(format: "%02i:%02i", minutes, seconds) } } I looked it up and the app is allowed to send every type of notification... (this is initialized in another part of the code)
Posted
by
Post not yet marked as solved
0 Replies
26 Views
I have a question regarding in-app purchasing and subscriptions for an app that interfaces with a custom hardware product. Say there is a custom electronic product that communicates over BLE to an app. The custom hardware is sending different types of sensor data collected on the device to the ios app and that data is stored on a backend. If the mobile app plans to have a paid subscription, but still allow users to use the app without a paid subscription but simply limit access to view some of that collected data (for example, locked/greyed out screens or limits features available in the app), does that fall under the IAP requirements of Apple? In the described case, would Apple mandate the app use the App Store's in-app purchasing system and take the 15-30% cut for the paid subscriptions? Or does that not apply since the data is collected by a custom hardware product? I am a little unclear on this. Any guidance would be appreciated.
Posted
by
Post not yet marked as solved
0 Replies
20 Views
Hi, I bought second-hand iphone 11 pro. I update firmware to ios 17.4.1 but network not connected. In setting its show network name and 58.0 and No network but phone keep searching for network. I tried all remedies found online. Today I update IOS to 17.5 RC but have a same problem. Please advice me any solution for this problem. Thanks in advance. Kaushik
Posted
by
Post not yet marked as solved
0 Replies
22 Views
I am trying to save data files between runs of an iOS App from Xcode on a real iPad (not the simulator). NSHomeDirectory gives me a different directory every time I run the app on the iPad (from XCode). I cannot write a file on one run and then retrieve it on the next run. How do I get around this annoying problem?
Posted
by
Post not yet marked as solved
0 Replies
36 Views
Hello, I've been trying to update my application since days, tried everything, all my environment is unchanged except update to the latest xcode version, I only fixed a bug in my code, and updated my expired certifacates with the same IDs. I've also been able to test the app with testflight. The app is built successfuly, validated, uploaded to the apple connect, submited for review, accepted and published online on the mac app store. I've been able to update the application with the mac app store. Now here is the problem: if I delete the application, and try to reinstall it from the app store, it says: unable to install, try again later - then the mac app store is stuck, I need to quit / restart to be able to try a new install. I also distribute my application outside of the mac app store, I've also signed and notarized my app successfully, with my developer id certificate, I tried with organizer, and also with xcrun notary on the command line, all is ok, but when I run the exported application, it says that the application is damaged (so right click/open works, and the app works well). The only thing that I can see is this (compared with my previous version): spctl -a -vvv -t install myapp.app: myapp.app: rejected (invalid destination for symbolic link in bundle) I don't have the error on my previous version. I've checked all the links inside the package, I don't see any problem or invalid link (and the app can run perfectly.... ) I've also check the logs.json file after the notary result, no problem appears. the whole structure of the application and files inside the .app is exactly the same between the previous version, and the new one with that problem. hope that someone could help me to solve this problem :)
Posted
by
Post not yet marked as solved
0 Replies
64 Views
Hi, I try to create some machine learning model for each stock in S&P500 index. When creating the model(Boosted tree model) I try to make it more successfully by doing hyper parameters using GridSearchCV. It takes so long to create one model so I don't want to think of creating all stocks models. I tried to work with CreateML and swift but it looks like it takes longer to run than sklearn on python. My question is how can I make the process faster? is there any hyper parameters on CreateML on swift (I couldn't find it at docs) and how can I run this code on my GPU? (should be much faster).
Posted
by
Post not yet marked as solved
0 Replies
35 Views
When I go to Settings and tap on the account, choose iCloud>manage account storage and try to delete the storage associated with an app id developer mode, it doesn't give me the option to delete the data. I have tried using the CloudKit Console to delete the container data, but the entry for the app is still there. How do I delete it?
Posted
by
Post not yet marked as solved
0 Replies
45 Views
I unintentionally turned off iCloud Drive on iPhone. iCloud deleted all my Desktop and Documents files Then sync deleted all my Documents files from all other devices iCloud.com website shows an empty folder. I don’t have any files in the restorable section. I don’t see any iCloud Archive folder created anywhere on my devices to restore. The total amount of information stored was quite large, over 25 GB. I turned back on the iCloud Drive feature, but no data shows up. I have paid extended storage capacity. There is no way that with the push of a button, data that was stored on iCloud servers would be lost. Nothing they say seems to help. Can someone please advise - How to recover data?
Posted
by
Post not yet marked as solved
0 Replies
37 Views
Hello, It is possible to encrypt a mac's hard-drive with Filevault. All home user folders are encrypted with the same encryption key. (This is the same encryption key for the whole hard-drive). This encryption key is encrypted with user password. But i don't understand how it works when there are multiple user accounts. Maybe there is a table: The same encryption key is stored several times (one per user account) ? Is there a way for a user to read the filevault encryption key ? Thanks
Posted
by
Post not yet marked as solved
0 Replies
64 Views
Hello. My game, which I have been preparing for a long time on Unity, has been completed. But I have a big problem. My game is a game focused on constantly drawing lines. For this reason, I need to draw lines in the safe area at the bottom of the iPhone. However, due to the shortcuts on the iPhone, my game is constantly put in the background or switched to another application. Since there are so many levels in my game, it is almost impossible to redesign the levels and since I am a game with lines drawn, I will always have this problem again. What I want is to cancel the shortcut to switch to another application and put it in the background when I swipe from left to right or right to left when my game opens. When my game opens, the priority is on the lines in my game. I also marked the defer system gestures on edges section on Unity for postponement, but it did not help. Also, postponing it will not solve the problem. For example, they disabled these shortcuts in the (mini metro) game and you can never use these shortcuts in the game. I did a lot of research on forum sites and chatgpt and tried different codes, but I couldn't find a solution. Can you help me with this? When my game is opened, I want to prevent and cancel the transition to another application by drawing a line left and right in the safe area section at the bottom and the game from being placed in the background. I would be very happy if you could help me with a hint or a code on what to do.
Posted
by
Post not yet marked as solved
0 Replies
32 Views
I have an iOS SwiftUI app which uses some extensions like NotificationServiceExtension, NotificationContentExtension, WidgetExtension etc. I noticed that each extension uses its own process and has its own bundle with the .appex extension... and is packaged within the app bundle, with .app extension. In my case, most of my logic is in C++ and when the app starts up, it needs to 'startup' the C++ layer. Now, in WidgetExtension, if it's going to read data from disk and update its interface, I need to initialise my C++ layer first. The same can be said for NotificationServiceExtension. This is leading me to include all my C++ artefacts into the extension target as well. Here's my problem: If the size of my app (containing all my C++ artefacts) is 10MB and I'm using 20 extensions (say), the final size of the shipped app bundle is 10MB + (20 * 10MB) = 210MB, since extension bundle (.appex) is packaged within the app bundle (.app). Since the app and the extensions are using the same C++ artefacts, I was hoping to have one binary in the bundle. The app and its extensions will point to this binary. When the app is launched, the app entry point (struct conforming to App protocol) is invoked, in case of widget, the widget entry point (WidgetBundle) is invoked and so on for each extension. This will reduce the final size of the app bundle. Is it possible to have one binary and the app target, all extension targets would use this binary for there functioning?
Posted
by
Post not yet marked as solved
0 Replies
42 Views
Hi, I have a watchOS app which is able to control Sonos speakers. So people set it to stay active for 1 hour. Unfortunately, the system kills the application every time after 5 to 15 min. I have made many system diagnosis and the pattern is always the same. Carousel decides that the app must be suspended. runnungboardd suspends the app. filecoordinationd kills with SIGKILL because it detected it has been suspended. launchd reports that the app has been killed. The issue is that I don't understand why Carousel wants to suspend the app. I have disabled all animations while the app is in Always on mode. The app does not perform any operations. If anyone has any idea on what do try, I would be glad for help. Here are some of the related logs. There are thousands around that but I could not deduce anything useful from them. The app gets suspended and then the filecoordinationd decides to kill it. But why is it suspended ? Just before, the app invalidates the timelines. But the timelines here are from the Backlight service. debug 2024-05-11 10:19:47.116194 +0200 WatchSonos WatchKit Extension 0x16d57dd0 invalidateAllTimelinesForReason:Host update. for environment:de.heinrich.alexander.WatchSonos.watchkitapp default 2024-05-11 10:19:47.116285 +0200 WatchSonos WatchKit Extension [(FBSceneManager):de.heinrich.alexander.WatchSonos.watchkitapp] Sending action(s): BLSInvalidateFrameSpecifiersAction Here an error occurs when setting the darwin gpu. This could be related default 2024-05-11 10:19:47.176223 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Shutdown sockets (ALL) default 2024-05-11 10:19:47.176259 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Set darwin role to: None default 2024-05-11 10:19:47.176264 +0200 runningboardd 1706 Set Darwin GPU to "deny" error 2024-05-11 10:19:47.176292 +0200 runningboardd 1706 setGPURole failed with result = e00002c7 Here the carousel requests suspension which then later performed by the runningoardd default 2024-05-11 10:19:47.177176 +0200 Carousel [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Setting process task state to: Suspended info 2024-05-11 10:19:47.177309 +0200 Carousel Client requesting suspension of PID:1706 Name:<redacted> info 2024-05-11 10:19:47.177407 +0200 Carousel Update delivered for [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] with taskState 3 Suspending the process default 2024-05-11 10:21:13.851752 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Suspending task. info 2024-05-11 10:21:13.851963 +0200 runningboardd Process: [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] has changes in inheritances: {( <RBSInheritance| environment:UIScene:@com.apple.frontboard.systemappservices/FBSceneManager:de.heinrich.alexander.WatchSonos.watchkitapp name:com.apple.frontboard.visibility origID:74-186-52947 payload 646688203>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53033 0> )} info 2024-05-11 10:21:13.852269 +0200 runningboardd Current inheritances: {( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53032 0>, <RBSInheritance| environment:UIScene:@com.apple.frontboard.systemappservices/FBSceneManager:de.heinrich.alexander.WatchSonos.watchkitapp name:com.apple.frontboard.visibility origID:74-186-52947 payload 646688203>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-52948 0>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53033 0> )} default 2024-05-11 10:21:13.852375 +0200 runningboardd Process: [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707]: Sending inheritance changeset: <RBSInheritanceChangeSet| gained:{( )} lost:{( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53032 0>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-52948 0> )}> default 2024-05-11 10:21:13.852794 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Shutdown sockets (SVC) default 2024-05-11 10:21:13.852829 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Set darwin role to: None Killing the process: default 2024-05-11 10:19:48.441773 +0200 filecoordinationd Detected process suspension: 1706 info 2024-05-11 10:19:48.441776 +0200 filecoordinationd Update delivered for [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] with taskState 4 default 2024-05-11 10:19:48.441776 +0200 filecoordinationd Claim 562AB55E-CE67-46FA-A080-798F89013643 observed suspension of client with 1706 error 2024-05-11 10:19:48.444295 +0200 filecoordinationd SimulateCrash() on another process is not supported default 2024-05-11 10:19:48.444361 +0200 filecoordinationd Claim 562AB55E-CE67-46FA-A080-798F89013643 was revoked Reporting the kill default 2024-05-11 10:19:48.455485 +0200 launchd exited due to SIGKILL | sent by filecoordinationd[316], ran for 7913ms
Posted
by
Post not yet marked as solved
0 Replies
42 Views
I have a UITableView with 1 section and 3 rows, and each row is 1000 height, the UITableView height is 832, such as below: but when I click the right button, the visibleCells has 2 items(row-0 and row-1), but the indexPathsForVisibleRows only has 1 item(row-0). In my expectation, I set UITableView contentOffset with 168.8, the row-1 cell is visible. but indexPathsForVisibleRows does not correct. Well then, I try to read the assembly of indexPathsForVisibleRows, I found that the UITableView use _visibleBounds to compute indexPathsForVisibleRows, but the _visibleBounds.height is reduced by one when compute, why? the assembly code looks like below:
Posted
by

TestFlight Public Links

Get Started

Pinned Posts

Categories

See all