After some searching, I found the problem is somehow related with Optimization Level. If I run this on simulator with Scheme - Run - Build Configuration set to Debug, it works just fine. If Run - Build Configuration set to Release, the bug appears, but if I configure Build Settings - Optimization Level to none, it works again. But with the same “Release, Optimization Level none”settings submitted to App Connect, the bug still persists.
Here is an example:
Put a red circle at the bottom of the screen. When dragged up, this circle gradually fades until it reaches the top and turns to completely transparent. In order to make sure this process is linear, I need to know the exact y position of this circle. So I set .anchorPreference
to the CircleView to monitor the bounds of this circle, and .backgroundPreferenceValue
to the ParentView to update the observable instance which stores the bounds information of this circle.
Under Debug Mode, it works just fine, the circle fades as it goes up. However, under release mode with optimization on, and in distributed version, this circle can be dragged, but the color remains the same, unchanged. No crash, no crashlog.