Posts

Post not yet marked as solved
0 Replies
221 Views
In a new document-based UIKit app, specifying in the Info.plist an import type identifier of public.log that conforms to public.content, public.data, public.item accomplishes this. In a new document-based SwiftUI multi-platform app, doing the same crashed at the DocumentGroup initializer with the error _SwiftData_SwiftUI/Documents.swift:91: Fatal error: The document type is public.log which does not conform to com.apple.package. This initializer expects the document type to be a package.
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
2 Replies
553 Views
I created a distinct icon set for visionOS, and specified its name in build settings. This is a Designed for iPad app. When I run it in the simulator, only the existing app icon shows. Is this supported for existing iPad apps, or am I missing something? There are no warnings in the asset catalog for this.
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
1 Replies
1.5k Views
I'm new to async/await, and am currently migrating my completion handler code to Swift 5.5's concurrency features. After generating an sync alternative in Xcode to my function func fetchMatchRecords(completion: @escaping ([Match]) -> Void), it becomes func fetchMatchRecords() async -> [Match]. I'm not sure how it would be used in the context of UIKit and diffable data sources. In a viewDidLoad, previously it would be MatchHistoryController.shared.fetchMatchRecords() { matches in DispatchQueue.main.async { self.dataSource.apply(self.initialSnapshot(), animatingDifferences: false) } } But I'm not sure how it would be used now Task { await MatchHistoryController.shared.fetchMatchRecords() } self.dataSource.apply(self.initialSnapshot(), animatingDifferences: false) How would I make sure that the snapshot is applied only after awaiting a successful fetch result? Here's the definition of initialSnapshot() that I used: func initialSnapshot() -> NSDiffableDataSourceSnapshot<Section, Match> { var snapshot = NSDiffableDataSourceSnapshot<Section, Match>() snapshot.appendSections([.main]) snapshot.appendItems(MatchHistoryController.shared.matches) return snapshot }
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
2 Replies
3.3k Views
I encountered this error 2023-01-24T22:14:41.500565325Z Installing ri documentation for cocoapods-catalyst-support-0.2.1 2023-01-24T22:14:41.500827390Z Done installing documentation for colored2, concurrent-ruby, i18n, tzinfo, zeitwerk, activesupport, nap, fuzzy_match, httpclient, algoliasearch, ffi, ethon, typhoeus, netrc, public_suffix, addressable, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-trunk, cocoapods-try, molinillo, atomos, nanaimo, rexml, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods, cocoapods-catalyst-support after 50 seconds 2023-01-24T22:14:41.500997230Z 35 gems installed 2023-01-24T22:14:42.023353910Z [in /Volumes/workspace/repository] 2023-01-24T22:14:42.023798292Z 2023-01-24T22:14:42.024448317Z [!] Invalid `Podfile` file: cannot load such file -- cocoapods-catalyst-support. 2023-01-24T22:14:42.024714192Z 2023-01-24T22:14:42.024976712Z # from /Volumes/workspace/repository/Podfile:1 2023-01-24T22:14:42.025200239Z # ------------------------------------------- 2023-01-24T22:14:42.025463448Z > require 'cocoapods-catalyst-support' 2023-01-24T22:14:42.025663811Z # 2023-01-24T22:14:42.025900158Z # ------------------------------------------- from my post-clone script, which is #!/bin/sh # ci_post_clone.sh export GEM_HOME="$HOME/.gem" gem install bundler brew install cocoapods gem install cocoapods-catalyst-support # Install dependencies managed with CocoaPods. pod install
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
0 Replies
402 Views
I have a watchOS app (not independent) that I'm trying to bring StoreKit support to purchasing subscriptions. When I make my existing StoreKit manager for iOS target watchOS, the productsRequest(_:didReceive:) delegate callback returns an empty response.products array but I don't understand why. One guess as to the cause is that when I initialize the SKProductsRequest, the products identifiers I pass ones with prepended bundle identifiers, which may different between iOS and watchOS? The existing iOS code has the format static let subscriptionKindOne = Bundle.main.bundleIdentifier!.lowercased() + ".subscriptionKindOne" static let subscriptionKindTwo = Bundle.main.bundleIdentifier!.lowercased() + ".subscriptionKindTwo" static let subscriptionKindThree = Bundle.main.bundleIdentifier!.lowercased() + ".subscriptionKindThree" Is this right? If so, what would be the correct way to start a products request on watchOS, so that the SKProductsResponse products array is populated?
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
0 Replies
866 Views
What might be a good way to constrain a view's top anchor to be just at the edge of a device's Face ID sensor housing if it has one? This view is a product photo that would be clipped too much if it ignored the top safe area inset, but if it was positioned relative to the top safe area margin this wouldn't be ideal either because of the slight gap between the sensor housing and the view (the view is a photo of pants cropped at the waist). What might be a good approach here?
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
1 Replies
452 Views
For an example like: someOptionalDouble = aDecoder.decodeDouble(forKey: "SomeKey") I'm not sure how to avoid a crash if the double was encoded as nil, while also avoiding Apple's console warning that decoding primitives as an object will become an error in the future.
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
0 Replies
581 Views
override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return [.landscapeRight, .landscapeLeft] } My modal view controller overrides this property, as its a complex custom video player that needs to be restricted to landscape. However, when it's dismissed, there is a jarring bug in the transition where the presenting VC is portrait in the device's landscape state for a second while half of the screen is black. It returns to normal (portrait) after a second, but I would like to avoid this transition bug. What might I be missing as to the root cause, or recommended way to have a portrait app (set in project navigator) present a landscape-only view controller?
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
1 Replies
4.7k Views
On Xcode 13.4.1, when specifically trying to run unit tests, I get an error Undefined symbol: _OBJC_CLASS_$_DDLog. After clicking on it in the Issue navigator, a longer error message says Undefined symbols for architecture arm64:   "_OBJC_CLASS_$_DDLog", referenced from:       objc-class-ref in How might I fix this? I tried running both Xcode and the Simulator in Rosetta, but I get the same error message but for x86.
Posted
by Curiosity.
Last updated
.