Code Monkey home page Code Monkey logo

hotreloading's Introduction

Yes, HotReloading for Swift & Objective-C

The InjectionIII app available as a Swift Package. i.e.:

Icon

Then you can do this (using the simulator)... Icon

To try out an example project that is already set-up, clone this fork of SwiftUI-Kit.

To use on your project, add this repo as a Swift Package to your project and add the following "Run Script" "Build Phase" to run the HotReloading daemon:

if [ -d $SYMROOT/../../SourcePackages ]; then
    $SYMROOT/../../SourcePackages/checkouts/HotReloading/start_daemon.sh
elif [ -d "$SYMROOT"/../../../../../SourcePackages ]; then
    "$SYMROOT"/../../../../../SourcePackages/checkouts/HotReloading/fix_previews.sh
fi

You should see a message that the app has connected and which directories it is watching for source file changes. The daemon also has an icon on the menu bar you can use to access features such as tracing and remote control. This script also patches your project slightly to add the required "-Xlinker -interposable" "Other Linker Flags" so you will have to run the project a second time after adding the HotReloading package and and the script build phase for hot reloading to start working.

Consult the REAME of the InjectionIII project for more information in paticular how to use it to inject SwiftUI using the HotSwiftUI protocol extension. It's the same code but you no longer need to download or run the app and the project is selected automatically.

If you want to work on the hot reloading code, clone this repo and drag its directory into your project in Xcode and it will take the place of the configured HotReloading Swift Package when you build your app.

Thanks to...

The App Tracing functionality uses the OliverLetterer/imp_implementationForwardingToSelector trampoline implementation via the SwiftTrace project under an MIT license.

SwiftTrace uses the very handy https://github.com/facebook/fishhook as an alternative to dyld_dynamic_interpose. See the project source and header file included in the app bundle for licensing details.

This project includes code for video capture adapted from acj/TimeLapseBuilder-Swift

This release includes a very slightly modified version of the excellent canviz library to render "dot" files in an HTML canvas which is subject to an MIT license. The changes are to pass through the ID of the node to the node label tag (line 212), to reverse the rendering of nodes and the lines linking them (line 406) and to store edge paths so they can be coloured (line 66 and 303) in "canviz-0.1/canviz.js".

It also includes CodeMirror JavaScript editor for the code to be evaluated in the Xprobe browser under an MIT license.

$Date: 2021/05/05 $

hotreloading's People

Contributors

johnno1962 avatar zeveisenberg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.