Reputation: 1516
I wonder why hot reload feature is currently possible in Flutter but not in native platforms?
I tried to find resources to explain this, but couldn't find good ones.
Upvotes: 1
Views: 1690
Reputation: 4476
Hot reloading is a very difficult feature to implement. Additionally, it is easier to implement such a feature when building an app development framework from the ground up than it is to add it to an already existing framework.
In iOS development, the closest thing to hot reloading is Xcode Previews. Apple released it last year as a day-one feature of SwiftUI, instead of implementing it for their existing 13 year old UIKit framework.
Upvotes: 2
Reputation: 68440
I'm not sure if Apple has something in the making for xcode but native Android does have hot reload. It works the same or very similar as flutter hot reload.
More information about how hot reload works for native Android here
For swift I only found a non official library called InjectionIII
I suppose that the fact that swift compiles directly to machine code ahead of time is the biggest problem to implement hot reload as other languages relies heavily on the virtual machine to do it.
In Flutter
Hot reload works by injecting updated source code files into the running Dart Virtual Machine (VM). After the VM updates classes with the new versions of fields and functions, the Flutter framework automatically rebuilds the widget tree, allowing you to quickly view the effects of your changes.
Upvotes: 0