Fixing Avatar and AvatarGroup build warnings caused by the deprecated animation modifier.
Platforms Impacted
- [x] iOS
- [ ] macOS
Description of changes
The animation(_:) modifier is now deprecated for iOS 15. This means that when the target deployment version is bumped to iOS 15, deprecation warnings will be issued by the compiler.
Because some of our client apps have the compiler configured to treat warnings as errors, we have to fix these warnings in advance so they won't get build breaks when the target deployment version is updated.
This PR addresses the use of the animation modifier in the Avatar and AvatarGroup SwiftUI controls.
The fix for the AvatarGroup is just a matter of removing the animation modifier as the transition modifier is doing the job of animating the position and visibility of avatars.
The fix for the Avatar control consists of calling individual animation modifier based on all the values of the state object that need to be monitored to trigger those animations.
Verification
Basic sanity validation of Avatar scenarios. Verified all animations remain working properly.
Pull request checklist
This PR has considered:
- [ ] Light and Dark appearances
- [x] iOS supported versions (all major versions greater than or equal current target deployment version)
- [ ] VoiceOver and Keyboard Accessibility
- [ ] Internationalization and Right to Left layouts
- [ ] Different resolutions (1x, 2x, 3x)
- [ ] Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
- [ ] iPad Pointer interaction
- [x] SwiftUI consumption (validation or new demo scenarios needed)
- [ ] Objective-C exposure (provide it only if needed)