Post not yet marked as solved
Hello.
My project includes a widget target that provides interactive widget functionalities. The document "Adding Interactivity to Widgets and Live Activities" says the following:
Additionally, note that the perform() function is marked as throws. Be sure to handle errors instead of rethrowing them, and update your app, widget, and Live Activity as needed. For example, update a widget’s interface to indicate that it displays outdated information if it cannot load new data.
https://developer.apple.com/documentation/widgetkit/adding-interactivity-to-widgets-and-live-activities#Implement-the-perform-function, column 3
However, I couldn't find a way how to handle an error in an interactive widget. The Button(intent:) and Toggle(intent:) initializers don't have mechanisms for error handling.
Does anyone know a solution for handling errors in interactive widgets?
Post not yet marked as solved
With NavigationStack, attaching a ToolbarItem(placement: .bottomBar) and doing a back-half-swipe gesture causes a navigation title bug.
Gif
Reproduce Code
import SwiftUI
enum NavigationDestination: Hashable {
case secondView
}
struct ContentView: View {
var body: some View {
NavigationStack {
FirstView()
.navigationDestination(for: NavigationDestination.self) { value in
switch value {
case .secondView:
SecondView()
}
}
}
}
}
struct FirstView: View {
var body: some View {
NavigationLink(value: NavigationDestination.secondView) {
Text("Go Next")
}
.navigationTitle("First View")
.toolbar {
/*
Navigation bar will be broken by .bottom bar when back-half-swipe.
*/
// Bug reproduce .bottomBar toolbar items
//
ToolbarItemGroup(placement: .bottomBar) {
Text("Done")
}
// No ploblem when .topBarTrailing
// ToolbarItemGroup(placement: .topBarTrailing) {
// Text("Done")
// }
}
}
}
struct SecondView: View {
var body: some View {
ZStack {
Color.blue.frame(maxWidth: .greatestFiniteMagnitude, maxHeight: .greatestFiniteMagnitude)
Text("This is second view.")
.navigationTitle("Second View")
.navigationBarTitleDisplayMode(.inline)
}
}
}
Feedback Report Number
FB13284524
Post not yet marked as solved
In CoreData with CloudKit mirroring, only lightweight migration is allowed to database migration. Heavyweight (custom) migration are not recommended.
Are the rules also applied to SwiftData with CloudKit mirroring? (I assume it is true, because cloudkit backend properties are not changed even if SwfitData released)
Post not yet marked as solved
StoreKit2 provide great API AppStore.showManageSubscription(in:) to downgrade, upgrade or cancel the user's subscription, however, can the App detect the cancellation in App? (without server to server notification)
I understand the upgrade and downgrade can be detected in Transaction.updates, but I'm not sure about the cancellation.
I want to update my label's text from Next billing date: \(date) to Expires \(date) if the user cancels the subscription in showManageSubscription(in:) sheet.
Can I implement that?
For implementing a Store functionalities and tests by using StoreKit2, I have a task listener and two testcases.
The first one is waiting the update notification before processing the next SKTestSession operation.The second one is not waiting the update.
I looked update events theree times on first one, and twice on second one.
My question is, "Do multiple transactions created or modified within a certain period be emitted as a single Transaction.updates event?"
Task listener
Testcase1
Testcase2
The status property is described as get async throws, but the details of the error is not described yet.
Is the error Product.PurchaseError?.
Post not yet marked as solved
I have a NSManagedObjectContext instance that have non-nil value in undoManager property, and I have a method to increment integer value of all managed objects like this:
func incrementAllOrderProperty() {
let fetchRequest: NSFetchRequest<Entity> = Entity.fetchRequest()
fetchRequest.sortDescriptor = mySortDescriptors
let entities = try! managedObjectContext.fetch()
for entity in entities {
entity.order += 1
}
}
My question is that the context makes sure reducing each process in the loop makes into one undo operation? or dividing processes to multiple undo operations? and is there a way to set an explicit undo context to the managedObjectContext?
Recently, I've started to learn deep TextKit APIs and concepts, such as typeface, typesetter, Text Layout and so on.
I found APIs named lineFragmentRect and lineFragmentUsedRect, however I can't understand these conceptual difference. (These values are bit of different.)
Cloud you tell me them if you know something about it?
Post not yet marked as solved
Hi.
I've already use press(forDuration:thenDragTo:withVelocity:thenHoldForDuration - https://developer.apple.com/documentation/xctest/xcuicoordinate/3551692-press method to simulate single drag in my XCUITest target, and I want to test multiple drag selection interaction with it. Can I simulate two or more simultaneous user interactions with any public APIs?
Post not yet marked as solved
Can I fire NSPersistentCloudKitContainer update manually? I want to schedule data sending event for server after unrestricting CloudKit restriction by CloudKit Web Service API.
Post not yet marked as solved
Hello.
UITableView provides a drop indicator in mac Catalyst by default, but I want to customize its indentation level and width, or removing it then implementing them by myself.
Can I customize or remove the UITableView's drop indicator in Catalyst?
Post not yet marked as solved
I am trying to implement both ContextMenu and Drag&Drop in UITableView like Apple Note or Photo app, but the contextual menu prevent dragging in iOS.
How to coexist them? I don't have any idea about that so would you give me some ideas?(I had tried to find related articles, but never found...)
Post not yet marked as solved
Does anyone know a way to implement UITextView dynamic height in UICollectionLayoutListConfiguration?(using custom cell)
I've tried it before, but the cell height wasn't changed while editing the UITextView.
Environment
Xcode12 beta4
iOS14 beta4
big Sur beta4
Cannot find NSDiffableDataSourceSectionSnapshot when selecting the target for macOS catalyst, but the document describes it can be used in macOS catalyst 14+.
Can I use it in public Xcode12? (that will be released in tomorrow...)
Environment
Xcode12 GM(12A7209)
Post not yet marked as solved
I want to take dark mode screenshots in XCUITest. How should I set dark/light environment variable?