Posts

Sort by:
Post not yet marked as solved
0 Replies
2 Views
Hi I'm getting this issue: Crashed: com.apple.network.connections 0 libsystem_kernel.dylib 0xa974 __pthread_kill + 8 1 libsystem_pthread.dylib 0x60ec pthread_kill + 268 2 libsystem_c.dylib 0x75b80 abort + 180 3 libsystem_malloc.dylib 0x2bc68 malloc_vreport + 896 4 libsystem_malloc.dylib 0x2bf10 malloc_zone_error + 104 5 libsystem_malloc.dylib 0x21a44 nanov2_guard_corruption_detected + 44 6 libsystem_malloc.dylib 0x7f84 nanov2_find_block_and_allocate + 402 7 libc++abi.dylib 0x16b84 operator new(unsigned long) + 52 8 Network 0x7e8c void std::__1::vector<nw_object_wrapper_t, std::__1::allocator<nw_object_wrapper_t> >::__emplace_back_slow_path<nw_object*&>(nw_object*&) + 124 9 Network 0x7dd8 nw_array_append + 280 10 Network 0xc3d0 __nw_resolver_insert_endpoint_locked_block_invoke + 1036 11 Network 0xbd80 nw_array_apply + 124 12 Network 0x77250 nw_resolver_insert_endpoint_locked + 256 13 Network 0x770b8 nw_resolver_insert_address + 1356 14 Network 0x29a850 __nw_resolver_create_dns_getaddrinfo_locked_block_invoke.187 + 7836 15 libdns_services.dylib 0x1000 ___dnssd_getaddrinfo_activate_block_invoke + 216 16 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20 17 libdispatch.dylib 0x72d8 _dispatch_continuation_pop + 600 18 libdispatch.dylib 0x1b1c8 _dispatch_source_latch_and_call + 420 19 libdispatch.dylib 0x19d8c _dispatch_source_invoke + 832 20 libdispatch.dylib 0xd284 _dispatch_workloop_invoke + 1756 21 libdispatch.dylib 0x16cb4 _dispatch_root_queue_drain_deferred_wlh + 288 22 libdispatch.dylib 0x16528 _dispatch_workloop_worker_thread + 404 23 libsystem_pthread.dylib 0x1f20 _pthread_wqthread + 288 24 libsystem_pthread.dylib 0x1fc0 start_wqthread + 8
Posted
by
Post not yet marked as solved
0 Replies
11 Views
Hey 2 years ago I joined WWDC and had the pleasure to have 1 on 1 call with some1 from dev team from Apple to help me solve some at the time GPU rendering problems on Apple iPad. I wonder if u guys know if this year Apple will also let us book meetings like that to help solve dev problems?
Posted
by
Post not yet marked as solved
1 Replies
18 Views
Using SwiftUI how can I get the click of a "Button" to change the wording of a "Label" and/or "Text" Field? I have tried:- let myLabel = Label { Text("Text to be Changed" .foregrorundStyle ...... } icon: { ...... } .... ..... Button("Change Label Wording"){ myLabel.stringValue = "Changed text" } This gives me two problems (at least): I cannot get the label to display The myLabel.stringValue = "Changed text gives me the error: Type '()' cannot conform to 'View' Value of type 'Label<some View, some View>' has no member 'stringValue' What have I done wrong?
Posted
by
Post not yet marked as solved
0 Replies
13 Views
Hello, fairly new to Swift, I come from a React Native background. One of the hardest things I'm finding is simply customising the screen headers in the navigation. I've managed to do it using a custom modifier that uses .toolbar and ToolbarItem as shown below: struct NavBar: ViewModifier { let title: String let showBackButton: Bool? @Environment(\.dismiss) private var dismiss func body(content: Content) -> some View { return content .toolbar { if showBackButton == true { ToolbarItemGroup(placement: .navigationBarLeading) { Button(action: { dismiss() }) { Image("BackButton") }.padding(.top, 18) } } ToolbarItem(placement: .principal) { Text(title) .font(Font.custom("Knight Vision", size: 28)) .foregroundColor(.white).padding(.top, 20) } } .navigationBarBackButtonHidden(true) } } This is all fine and suits my needs however I'm finding that the toolbar does not slide in with the rest of the screen when navigating to as screen with it on. I would expect the title to slide in with the other items on the screen. Especially since the toolbar does animate out, it just does not animate in. Heres a video so you can see what I mean. Am I doing something wrong here? Is there a better way to do this? [linkText](https://www.youtube.com/shorts/6M-glapBZz0 /)
Posted
by
Post not yet marked as solved
1 Replies
31 Views
Criticism of the use of the Minimed Mobile App, problem with the update interval of the Apple Watch iOS Subject: Error event - Minimed Mobile App . Triggered by insufficient update interval of the Watch iOS system of only 50 updates/day Dear Sir or Madam, I use the Minimed Mobile App in conjunction with my Medtronic 780 G insulin pump and am generally very satisfied with the app. However, I have noticed a point here that is caused by the Apple Watch iOS operating system. I would like to pass this on and ask that you please fix this problem with an update. Updating the sensor values on watch faces on the Apple Watch I use the Modular widget on my Apple Watch in conjunction with the Minimed mobile app to quickly and easily keep an eye on the current sensor value. Unfortunately, the sensor value in this widget is not updated automatically according to someone in the know, Apple only updates widget information 50 times a day. After a short time, a rotating arrow appears instead of the current value, which I have to press to get a sensor value displayed again in order to see the current value. This is very inconvenient as I have to perform several actions each time to see the current value: 1.Open widget 2.Press the rotary arrow 3.Read the value Close widget by pressing the spin button at the top right to return to the main screen I would very much welcome it if the sensor value in Apple Watch watch faces were updated automatically, the problem is obvious - the watch faces only update 50 times a day. This would prevent me from seeing the current sensor value quickly and easily at any time without having to perform additional and cumbersome actions. The Minimed Mobile App has been tested and approved by Medtronic through Apple. However, it must have been overlooked that this sensor value app updates the sensor value every 5 minutes, but it does not do this on the dial because, according to my friend, it only updates 50 times a day. Now it is the case that the sensor value can change every 5 minutes, but this is not shown on the watch face, which means that the Apple Watch iOS would need 288 updates for this Minimed Mobile App per day instead of only 50 updates per day. Can you please advocate for a new update that allows an update interval of up to 288 updates per day? So that thousands of diabetics worldwide can see current values on their Apple Watch dials at any time? Without having to take several steps each time? I switched to I Phone and Apple Watch because I thought this would be possible for me. I would be very happy to hear back if this is technically possible for all diabetics worldwide who will benefit from it. With kind regards
Posted
by
Post not yet marked as solved
0 Replies
22 Views
Hello, Prior to iOS 17, it was possible to request user discoverability by calling ‚requestApplicationPermission‘. But now it is deprecated. How is the intended way to do this now? How this is for example handled in the Music App? I think this should be a similar approach. Currently the only option for me seems to save the Email-Address (and maybe phone number) in the CloudKit public database, that other user can discover by this. But that the problem exists, that we need to fetch for changes at phone numbers and mail addresses that are linked to the iCloud account (because user might change anything). Is there a more elegant solution, than just checking the current email addresses and phone numbers at each start of the application (if that is even possible)? For example the Music App has that Switch "Find my by Apple-ID" but I don't know how this is handled in the background. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
33 Views
大发彩票app下载【筷三凝聚梦想】【永盈成就辉煌】【购彩首选】【全网第一】 【誉响彩界】【 问鼎巅峰】 没有那么多天赋异禀,优秀的人总是努力的翻山越岭,要么不做,要做就做第一!没有做不到的事只有你愿不愿意做,做的人已经上岸了,若你还是不敢做只能看著他们上岸,已经有个理想的计划,但从未有赴之行动的举动,那你永远都只能是想像,你想成为上岸的那个人,还是想成为看人上岸的那个人,这些都决定于你。专业的事留给专业的人做,才是获得成功的捷径。我想帮助更多的人,互联网是一个开放性平台,上面充斥着各式各样的优惠,如何在铺面而来的诱惑中选出心仪的方向。 一个好的平台可以让你后顾无忧,可以尽情释放自己的手脚,不会存在掣肘。穷则思变,差则思勤!没有比人更高的山没有比脚更长的路。 原以为“得不到”和“已失去”是最珍贵的,可…原来把握眼前才是最重要的。 失败是什么?没有什么,只是更走近成功一步;成功是什么?就是走过了所有通向失败的路,只剩下一条路,那就是成功的路
Posted
by
Post not yet marked as solved
1 Replies
48 Views
Preface Upon rotating the interface, the UICollectionViewCells overlap, generating an unpleasant animation that for sure can't be used in production. The code The code was executed on iPhone 6S (NN0W2TU/A A1688) with iOS 15.8.2. I could reproduce the issue on iPhone 15 Pro with iOS 17 on simulator as well. SelfConfiguringCell.swift: import UIKit protocol SelfConfiguringCell: UICollectionViewCell { static var reuseIdentifier: String { get } func configure(with image: String) } ISVImageScrollView.swift: Code here CarouselCell.swift: import UIKit import SnapKit class CarouselCell: UICollectionViewCell, SelfConfiguringCell, UIScrollViewDelegate { static var reuseIdentifier: String = "carousel.cell" internal var image: String = "placeholder" { didSet { self.imageView = UIImageView(image: UIImage(named: image)) self.scrollView.imageView = self.imageView } } let scrollView: ISVImageScrollView = { let scrollView = ISVImageScrollView() scrollView.minimumZoomScale = 1.0 scrollView.maximumZoomScale = 30.0 scrollView.zoomScale = 1.0 scrollView.contentOffset = .zero scrollView.bouncesZoom = true return scrollView }() var imageView: UIImageView = { let image = UIImage(named: "placeholder")! let imageView = UIImageView(image: image) return imageView }() func setImage(_ image: String) { self.image = image } func configure(with image: String) { self.setImage(image) self.scrollView.snp.makeConstraints { make in make.left.top.right.bottom.equalTo(contentView) } } override init(frame: CGRect) { super.init(frame: frame) contentView.backgroundColor = UIColor.black scrollView.delegate = self scrollView.imageView = self.imageView contentView.addSubview(scrollView) } required init?(coder: NSCoder) { fatalError("Cannot init from storyboard") } func viewForZooming(in scrollView: UIScrollView) -> UIView? { return self.imageView } } ViewController: import UIKit class ViewController: UICollectionViewController { var currentPage: IndexPath? = nil let images = ["police", "shutters", "depot", "cakes", "sign"] init() { let compositionalLayout = UICollectionViewCompositionalLayout { sectionIndex, environment in let absoluteW = environment.container.effectiveContentSize.width let absoluteH = environment.container.effectiveContentSize.height // Handle landscape if absoluteW > absoluteH { print("landscape") let itemSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1) ) let item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1) ) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) let section = NSCollectionLayoutSection(group: group) return section } else { // Handle portrait print("portrait") let itemSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .absolute(absoluteW * 9.0/16.0) ) let item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .absolute(absoluteW * 9.0/16.0) ) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) let section = NSCollectionLayoutSection(group: group) return section } } let config = UICollectionViewCompositionalLayoutConfiguration() config.interSectionSpacing = 0 config.scrollDirection = .horizontal compositionalLayout.configuration = config super.init(collectionViewLayout: compositionalLayout) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() collectionView.delegate = self collectionView.dataSource = self collectionView.isPagingEnabled = true // Register cell for reuse collectionView.register(CarouselCell.self, forCellWithReuseIdentifier: CarouselCell.reuseIdentifier) } override func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return self.images.count } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let reusableCell = collectionView.dequeueReusableCell(withReuseIdentifier: CarouselCell.reuseIdentifier, for: indexPath) as? CarouselCell else { fatalError() } let index : Int = (indexPath.section * self.images.count) + indexPath.row reusableCell.configure(with: self.images[index]) return reusableCell } } Notes I found a similar unanswered question here. I'm sure something can be done about it because if I switch to SwiftUI with a TabView, that according to SwiftUI Introspect documentation for TabViewWithPageStyleType, is using UICollectionView under the hood, I'm not getting that ugly animation anymore. Though I can't switch to SwiftUI to use TabView because on interface rotation it loses the page index (well known bug, see here), which probably is even trickier to workaround.
Posted
by
Post not yet marked as solved
1 Replies
67 Views
Since yesterday when I try to open App Store Connect app on iOS I get: app store connect is temporarily unavailable due to planned maintenance On the desktop website there's no problem and also on Apple Services status website there's no outages. Someone having the same problem?
Posted
by
Post not yet marked as solved
0 Replies
29 Views
Environment Apple Silicon M1 Pro macOS 14.4 Xcode 15.3 (15E204a) visionOS simulator 1.1 Step Create a new visionOS app project and compile it through xcodebuild: xcodebuild -destination "generic/platform=visionOS" It fails on RealityAssetsCompile with log : error: Failed to find newest available Simulator runtime But if I open the Xcode IDE and start building, it works fine. This error only occurs in xcodebuild. More I noticed that in xcrun simctl list the vision pro simulator is in unavailable state: -- visionOS 1.1 -- Apple Vision Pro (6FB1310A-393E-4E82-9F7E-7F6D0548D136) (Booted) (unavailable, device type profile not found) And i can't find the vision pro device type in xcrun simctl list devicetypes, does it matter? I have tried to completely reinstall Xcode and simulator runtime, but still the same error.
Posted
by
Post not yet marked as solved
1 Replies
24 Views
I have generated FCPXML, but i can't figure out issue: <?xml version="1.0"?> <fcpxml version="1.11"> <resources> <format id="r1" name="FFVideoFormat3840x2160p2997" frameDuration="1001/30000s" width="3840" height="2160" colorSpace="1-1-1 (Rec. 709)"/> <asset id="video0" name="11a(1-5).mp4" start="0s" hasVideo="1" videoSources="1" duration="6.81s"> <media-rep kind="original-media" src="file:///Volumes/Dropbox/RealMedia Dropbox/Real Media/Media/Test/Test AE videos, City, testOLOLO/video/11a(1-5).mp4"/> </asset> <asset id="video1" name="12(4)r8 mute.mp4" start="0s" hasVideo="1" videoSources="1" duration="9.94s"> <media-rep kind="original-media" src="file:///Volumes/Dropbox/RealMedia Dropbox/Real Media/Media/Test/Test AE videos, City, testOLOLO/video/12(4)r8 mute.mp4"/> </asset> <asset id="video2" name="13 mute.mp4" start="0s" hasVideo="1" videoSources="1" duration="6.51s"> <media-rep kind="original-media" src="file:///Volumes/Dropbox/RealMedia Dropbox/Real Media/Media/Test/Test AE videos, City, testOLOLO/video/13 mute.mp4"/> </asset> <asset id="video3" name="13x (8,14,24,29,38).mp4" start="0s" hasVideo="1" videoSources="1" duration="45.55s"> <media-rep kind="original-media" src="file:///Volumes/Dropbox/RealMedia Dropbox/Real Media/Media/Test/Test AE videos, City, testOLOLO/video/13x (8,14,24,29,38).mp4"/> </asset> </resources> <library> <event name="Untitled"> <project name="Untitled Project" uid="28B2D4F3-05C4-44E7-8D0B-70A326135EDD" modDate="2024-04-17 15:44:26 -0400"> <sequence format="r1" duration="4802798/30000s" tcStart="0s" tcFormat="NDF" audioLayout="stereo" audioRate="48k"> <spine> <asset-clip ref="video0" offset="0/10000s" name="11a(1-5).mp4" duration="0/10000s" format="r1" tcFormat="NDF"/> <asset-clip ref="video1" offset="12119/10000s" name="12(4)r8 mute.mp4" duration="0/10000s" format="r1" tcFormat="NDF"/> <asset-clip ref="video2" offset="22784/10000s" name="13 mute.mp4" duration="0/10000s" format="r1" tcFormat="NDF"/> <asset-clip ref="video3" offset="34544/10000s" name="13x (8,14,24,29,38).mp4" duration="0/10000s" format="r1" tcFormat="NDF"/> </spine> </sequence> </project> </event> </library> </fcpxml> Any ideas?
Posted
by
Post not yet marked as solved
0 Replies
41 Views
Users of my app are complaining about incorrect GPS location decoding. I found that the bug is in the reverseGeocode, because it returns nonsensical results. Example: The user is located in Oberhausen, Deutschland at coordinates 51.482015, 6.887064. ReverseGeocode decodes the coordinates as "Oberhausen bei Kirn". It is mistaken 250 km! ReverseGeocode works like this: 51.48, 6.88 - Oberhausen (OK) 51.482, 6.887 - Oberhausen bei Kirn (Error) 51.48, 6.89 - Oberhausen (OK) Test result: If the coordinate precision is greater than 2 decimal places, the reverseGeocode does not work properly. From what the user told me, more apps behave like this. Probably all that work with precise coordinates.
Posted
by
Post not yet marked as solved
0 Replies
46 Views
I'm sending a push notification using Noticed Gem during the night when my phone is in airplane mode. When I wake up and disable the airplane mode, I don't get the push notification. These are the settings: ` def ios_format(apn) apn.custom_payload = { universal_link: url } apn.alert = { title: title(recipient), body: message(recipient) } apn.sound = 'default' apn.priority = '10' # Send immediately, bypassing the end ` default expiration is supposed to be 30 days. How can I debug/fix the problem? (with noticed gem) I checked Apple consoleKIT, and I don't see discarded notifications. Thanks
Posted
by
Post not yet marked as solved
0 Replies
51 Views
UPDATED: I determined the line causing the hang was .animation(.default, value: layout). I'm seeing a strange issue when switching between a ScrollView/LazyVGrid and a List with my SwiftData but when toggling the layout it ends up freezing and I can't confirm what's causing the app to hang since there's no crash. I'm not getting much info from the debugger. Any help would be appreciated. struct ContentView: View { @Environment(\.modelContext) private var modelContext @Query private var items: [Item] let gridItemLayout = [ GridItem(.adaptive(minimum: 150))] @State private var layout = Layout.grid var body: some View { NavigationStack { ZStack { if layout == .grid { ScrollView { LazyVGrid(columns: gridItemLayout, spacing: 5) { ForEach(items) { item in } } } } else { List { ForEach(items) { item in } } } } // MARK: HERE'S THE ERROR .animation(.default, value: layout) .navigationTitle("ScrollView") .toolbar { ToolbarItemGroup { Button(action: addItem) { Label("Add Item", systemImage: "plus") } Menu { Picker("Layout", selection: $layout) { ForEach(Layout.allCases) { option in Label(option.title, systemImage: option.imageName) .tag(option) } } .pickerStyle(.inline) } label: { Label("Layout Options", systemImage: layout.imageName) .labelStyle(.iconOnly) } } } } } } @Model public class Item: Codable { public let id: String public enum CodingKeys: String, CodingKey { case id } public init(id: String) { self.id = id } required public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decode(String.self, forKey: .id) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(id, forKey: .id) } }
Posted
by
Post not yet marked as solved
0 Replies
57 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
75 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
62 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
58 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
61 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

TestFlight Public Links

Get Started

Pinned Posts

Categories

See all