'Is there Hot Reload with Swift

Im researching Swift features and have the Question if there is a Hot Reload Feature or something similar like "instant run".

https://developer.apple.com/xcode/swiftui/ On this Page they say:

"Xcode includes intuitive design tools that make building interfaces with SwiftUI as easy as dragging and dropping. As you work in the design canvas, everything you edit is completely in sync with the code in the adjoining editor. Code is instantly visible as a preview as you type, and any change you make to that preview immediately appears in your code. Xcode recompiles your changes instantly and inserts them into a running version of your app — visible, and editable at all times."

My question to that is if this is only true for UI-Development with Swift but doesnt work with thie normal Logic.



Solution 1:[1]

My question to that is if this is only true for UI-Development with Swift but doesnt work with thie normal Logic.

Are you looking for REPL? If so, you might be looking for Swift Playground. Xcode also has it's own playground system, but I'm having trouble finding good supporting documentations.

Solution 2:[2]

To your question of processing normal logic and not just a preview of the UI components, as of today Apple does not provide that feature however there is an open source project that seeks to accomplish what you're looking for:

https://github.com/krzysztofzablocki/Inject

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ranoiaetep
Solution 2 sean2078