Post

Replies

Boosts

Views

Activity

StoreKit 2: cancellation button
I have auto-renewable subscriptions in my app. I've been using .manageSubscriptionsSheet to present a user with a variety of subscriptions and a possibility to cancel the current subscription. Now, I'm trying out the new StoreKit 2 (available in iOS 17.0+) - and it works great (and also looks nice), but it doesn't seem to support cancellation... I tried different options and couldn't make it show anything related to "unsubscribing". One of the options I've tried was adding .storeButton(.visible, for: .cancellation) - but it doesn't seem to do anything. So the question is: is it not possible to let users unsubscribe from within the app with StoreKit 2? And if so, what's the recommended approach?
4
0
2.3k
Sep ’23
Get coordinates in the onLongPressGesture on the Map
I've asked this question at SO, but there are no replies there, so I decided to give it a try here. Basically, I want to be able to capture the coordinates of a long press on the Map component (not the geo-coordinates - that's a separate task - just local to the app coordinates). The problem is that the .onLongPressGesture doesn't provide the coordinates of where the long press happened. .onTapGesture does - but I don't want to register taps, I want to register long presses. One of the work-arounds suggested at SO was to leverage the DragGesture, and it kinda works for other views, but when applied to a Map, it breaks the default dragging functionality of the Map component (so that it becomes impossible to scroll the map region). Also this work-around provides the coordinates only when the finger is released (at the end of the .onLongPressGesture), but I want to capture the long-press location before the finger was released (but after some time of holding, for example 1 second).
3
1
2.7k
Jun ’23