Post

Replies

Boosts

Views

Activity

Reply to CloudKit Operation Speeds
I'm not seeing long times. However, I'm seeing some records are not posting. I'm new to CloudKit, so I'm probably doing something wrong. However, if I'm doing something wrong, why are the records sometimes posting and sometimes not? Note that in the case where it doesn't post, I am getting a return record with a recordID when I call save. Also, I'm printing the result of the save only if error is nil. So why doesn't the record show up when I do a query using the CloudKit online query tool? It's not a problem with a filter I created, because I'm querying all records of the record type in question and clicking on the created field to sort the most recent to the top. Seems like if I got a record ID, it must have posted, but then why doesn't it show up? Edit: never mind. I see now the issue is that the results in the dashboard are paged and that clicking a heading to sort the results sorts only that page of results. The records were there, just on a different page.
Dec ’21
Reply to Animation slowdown when building to M1 Mac
I have no idea about the frame rate. It is the speed that is lower - WAAY lower. Just like when you set the slow animations item on the iOS simulator. I'd not thought of running instruments. I'll try that when I have some time. There is more than one way the animations are kicked off. The main one, the one that recenters the maze is done with a property of type UIViewPropertyAnimator. I call it mainAnimator. The basic logic goes like this: if mainAnimator.isRunning { mainAnimator.stopAnimation(true) // some logic to set the bounds of my maze view. self.mainAnimator = UIViewPropertyAnimator(duration: newDuration, curve: .easeOut, animations: { self.fieldView.bounds.origin = CGPoint(x: relativeToPuzzleCenter.x, y: relativeToPuzzleCenter.y) }) } else { // some logic to calculate the duration of the animation self.mainAnimator = UIViewPropertyAnimator(duration: duration, curve: .easeInOut, animations: { self.fieldView.bounds.origin = CGPoint(x: relativeToPuzzleCenter.x, y: relativeToPuzzleCenter.y) } } mainAnimator.addCompletion ... The completion block has a UIView.animate(withDuration) call in it. However, this is called only if the maze is completed. So this is not really relevant, since the issue happens before the maze is finished. For the popup scores that animate off, the logic goes like this: Instantiate a view with appropriate label and add it as a subview. Use a timer to let it stay in place for some period of time before animating it off: timer = Timer.scheduledTimer(withTimeInterval: delay, repeats: false) { // logic to do the popup animation } Popup animation: sup.addSubview(labelHolder) let animator = UIViewPropertyAnimator(duration: 2.0, curve: .linear) { labelHolder.center = endingPositionInSup labelHolder.alpha = 0 } animator.addCompletion { (position) in label.removeFromSuperview() } animator.startAnimation() For moving the token on the board, I use UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseInOut) { token.center = CGPoint(x: token.center.x + movement.x, y: token.center.y + movement.y) } completion: { (finished) in // some stuff unrelated to animation. } Having said all this, I can play multiple games with hundreds of movements per game without the slowdown happening. When the slowdown happens, it's sudden. Possibly a clue: when the slowdown happens, the popups originate from the wrong place. I'll add an appropriate assert there, although, I don't see how a location error would cause unrelated animations to slow down. Note that when the animation slowdowns happen it is ALL animations, including system animations that I didn't code. I should have mentioned that earlier. P.S. I've been meaning to eliminate all instances of UIView.animate.... with property animators. But that's still a to-do.
Dec ’21
Reply to Animation slowdown when building to M1 Mac
You need not delve into this further. I've found a clue that will surely lead to the problem. I added a print for starting and ending positions of the popups, and I got this sample output. Will animate popup mystery score from (168.5, 534.5) to (404.81994284151176, 487.23601143169765) Will animate popup mystery score from (473.5, 473.5) to (nan, nan) Obviously, I have a bug in calculating the destination. Thanks for looking. Interesting that this would slow animations. With that clue, I solved the problem. I animate the popups from the token location to the center of the board. The problem was happening when the token location is at the center of the board. That caused a divide by zero when calculating the direction to the center. So in that case, I just go some other direction.
Dec ’21
Reply to Animation slowdown when building to M1 Mac
Unrelated, but an interesting observation I made today, trying to find out what was causing hesitation in the Mac version. It turns out the hesitation is caused by label.removeFromSuperview() shown above. Removing that line eliminated the hesitation. I moved the cleanup of those views to idle time or when the maze is completed. This is interesting to me because adding the view doesn't cause the hesitation. only removing it does.
Dec ’21
Reply to Public Link says 'No Builds available' even though they are
Ihor, that is the way it is SUPPOSED to work. What's happening though is that it is not possible to add external testers to the new build. That is what I am trying to do in order to trigger a waiting for review. Ironically, I can trigger it for the app store version but not the testflight version. I've gone through this process many times with several versions of several apps. This is the first time I can remember not being able to trigger the testflight review. Edit: I figured out my issue. In Xcode, when clicking Distribute App, you get a number of options. If you select the Testflight option, it is for internal groups only. To use external groups, you have to select App Store Connect. I guess I never ran into that before. In that case, the build will show internal under the build number in the iOS Builds section. In that case, simply click Distribute App again. The build number should increment, and if App Store Connect is selected, it should resolve the problem.
Jun ’24