My app has an action extension that allow users to collect and save links throughout the system. It also has a widget to show these links in the Home Screen.
When adding links from the main app, I call WidgetCenter.shared.reloadAllTimelines() to reload all widgets, and everything works as expected.
But when I add links from the action extension, widgets are not reloaded, even after calling WidgetCenter.shared.reloadAllTimelines(). Only when I go to the main app is that widgets do reload.
How can I refresh my widgets for changes made via the Action Extension from the share sheet?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
Using the Implementing a Store In Your App Using the StoreKit API sample code, I've successfully integrated my new APP with StoreKit 2. There is one problem though: when I call the method Transaction.latest(for:) to get the user’s latest transaction, it always returns nil.
Here's the code snippet:
guard let result = await Transaction.latest(for: myProductId) else {
return false
}
Is this a bug with StoreKit 2, or am I doing something wrong? This happens on a physical device, running from Xcode. Thanks in advance.
I have a screen with two List side by side, inside a NavigationView. The layout is rendered correctly, and I can independently scroll both lists. The problem is that, when I scroll the first list, it goes behind the navigation bar without triggering the effect of applying a background color to it. Here's a gif showing what's going on:
And this is the code I'm using for this view:
struct ContentView: View {
var body: some View {
NavigationView {
HStack(spacing: 0) {
List {
Section(header: Text("Header left")) {
ForEach(0..<600) { integer in
Text("\(integer)")
}
}
}
.listStyle(InsetGroupedListStyle())
.frame(minWidth: 0, maxWidth: .infinity)
List {
Section(header: Text("Header right")) {
ForEach(0..<400) { integer in
Text("\(integer)")
}
}
}
.listStyle(InsetGroupedListStyle())
.frame(minWidth: 0, maxWidth: .infinity)
}
.navigationTitle("Example")
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
Would this be a SwiftUI bug? If not, how can I make the first list correctly interact with the navigation bar when scrolling?
WWDC21 Session Focus on iPad keyboard navigation says that we can use UIFocusHaloEffect to change the appearance of focused items.
On iPadOS, we can use this effect by assigning a UIFocusHaloEffect to the focusEffect property like so:
self.focusEffect = UIFocusHaloEffect()
What wasn't very clear is where should we put this code when working with UICollectionViewCell. I am doing it in the collectionView(_:canFocusItemAt:) method:
func collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath) -> Bool {
guard #available(iOS 15.0, *) else { return false }
guard let cell = collectionView.cellForItem(at: indexPath) as? FeedCollectionViewCell else { return false }
if cell.focusEffect == nil {
cell.focusEffect = UIFocusHaloEffect(roundedRect: cell.artworkImageView.frame,
cornerRadius: cell.cornerRadius,
curve: .continuous)
}
return true
}
Is this the best way to implement it?
I noticed that sometimes, when opening my Mac Catalyst app, the window is not resized to the size I left it the last time.
Should I restore it manually when launching the app, or is the system responsible for it? And if it so, why it doesn't work sometimes?
Before beta 4 this worked as expected. After updating to beta 4, all my UICommands inside UIMenu on NSMenuToolbarItem.itemMenu are now disabled, and I can't figure out how to enable them.
Here's my itemForItemIdentifier method:
func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
		let item = NSMenuToolbarItem(itemIdentifier: itemIdentifier)
		item.itemMenu = UIMenu(title: "", options: .displayInline, children: [UICommand(title: "Test", action: #selector(onTestTap))])
		item.image = UIImage(systemName: "ellipsis.circle")
		return item
}
Am I doing something wrong or is this a bug on macOS Big Sur beta 4?
I'm trying to build my iOS app to macOS Catalyst. Everything works fine when running locally on my machine via Xcode, but an error occurs when I archive and try to upload to the notarisation service:
Cannot create a Mac Catalyst Developer ID provisioning profile for "br.com.marcosatanaka.music-harbor".
The App Groups capability is not available for Mac Catalyst Developer ID provisioning profiles. Disable this feature and try again.
I have the App Groups capability enabled on my app's target Signing & Capabilities tab on Xcode. But, when I go to the Apple Developer portal under Certificates, Identifiers & Profiles > Profiles and select the Mac Catalyst provisioning profile (automatically generated by Xcode), the App Groups capability is not present on the Enabled Capabilities section.
I can work around this issue by removing the com.apple.security.application-groups entitlement when building for Mac Catalyst, but that causes me a runtime error when Core Data tries to access the store located on the shared container. I also need it to be on a shared container because I want to access the database from both the main app and also the new widget extension.
How can I add the App Groups capability to my Mac Catalyst provisioning profile?
On a macOS app generated with Catalyst, the method SKCloudServiceController.requestUserToken(forDeveloperToken:completionHandler:) returns a SKErrorDomain. The error is:
Error Domain=SKErrorDomain Code=0 "Ocorreu um erro desconhecido" UserInfo={NSLocalizedDescription=Ocorreu um erro desconhecido}
Has something changed regarding this method on macOS or is this a bug?