Post

Replies

Boosts

Views

Activity

Reply to What would be the best logic for updating a file periodically after an app has been released
Thanks a lot for the good ideas. The one thing I don't think I was clear on, was the fact that the update will always be triggered manually and will be followed by a new AppStore submission. I'll basically decide in what app version/release I want to run the update. In other words, the update could happen sooner than a year. What I was thinking is something like my first example but with the ability to be able to manually forece-change the shouldLoad variable to true for all users, existing and new at any point. Again, the update would need to happen to all users, and new users do not need to know about the original content in the file as long as the latest is loaded.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to Throwing paper/ball animation effect in SwiftUI
I gave up after spending a lot of time trying to do the animation in SwfitUI and ended up reusing the existing UIKit animation using a UIViewRepresentable as suggested in the following thread. http://stackoverflow.com/questions/70553786/animating-a-swiftui-view-with-uiview-animate/70645853#70645853/ import SwiftUI struct WrapUIKitAnimationInSwiftUI: View { @State private var isAnimating = false var body: some View { HStack{ Image(systemName: "circle.fill") .font(.system(size: 65)) .foregroundColor(.blue) .throwAnimation(isAnimating: $isAnimating) .onTapGesture { isAnimating.toggle() } } } } struct ThrowAnimationWrapper<Content: View>: UIViewRepresentable{ @ViewBuilder let content: () -> Content @Binding var isAnimating: Bool func makeUIView(context: Context) -> UIView { UIHostingController(rootView: content()).view } func updateUIView(_ uiView: UIView, context: Context) { if isAnimating{ UIView.animateKeyframes(withDuration: 1.5, delay: 0.0, options: [.calculationModeCubic], animations: { UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 0.2, animations: { uiView.center = CGPoint(x: 250, y: 300) }) UIView.addKeyframe(withRelativeStartTime: 0.0, relativeDuration: 0.9, animations: { uiView.center = CGPoint(x: 100 + 75, y: 100 - 50 ) uiView.transform = CGAffineTransform(scaleX: 0.75, y: 0.75) }) UIView.addKeyframe(withRelativeStartTime: 0.1, relativeDuration: 0.7, animations: { uiView.center = CGPoint(x: 100, y: 100) uiView.transform = CGAffineTransform(scaleX: 0.2, y: 0.2) }) }, completion: { _ in uiView.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) }) } } } extension View { func throwAnimation( isAnimating: Binding<Bool>) -> some View { modifier(ThrowAnimationViewModifier(isAnimating: isAnimating)) } } struct ThrowAnimationViewModifier: ViewModifier { @Binding var isAnimating: Bool func body(content: Content) -> some View { ThrowAnimationWrapper(content: { content }, isAnimating: $isAnimating) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to How to update the CloudKit schema after the app has been released to the AppStore
CloudKit Limitations: Mirroring a Core Data Store with CloudKit | Apple Developer Documentation Determine If Your App Is Eligible for Core Data with CloudKit Apps adopting Core Data can use Core Data with CloudKit as long as the persistent store is an NSSQLiteStoreType store, and the data model is compatible with CloudKit limitations. For example, CloudKit does not support unique constraints, undefined attributes, or required relationships.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to How to turn On/Off iCloudKitSync on a SwiftUI application
Not really a lot of data, about 10-50 objects with 10 properties each. So you think the most appropriate thing to do is use the local container if sync is off and switch to cloudKit container if it's on? My main struggle is not knowing how to structure my code in a way that I can turn On/Off sync on runtime from other views to test it and see if it will work.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22