explaingit

johnno1962/injectioniii

4,608Objective-CAudience · developerComplexity · 3/5Setup · moderate

TLDR

Developer tool for iOS and macOS that reloads changed Swift or Objective-C source files into a running app instantly, skipping the full rebuild and relaunch cycle.

Mindmap

mindmap
  root((repo))
    What it does
      Hot reload changed files
      Skip full rebuild
      Instant code updates
    How it works
      Mac app installed
      Linker flags added
      Save triggers inject
    Supported platforms
      iOS Simulator
      macOS apps
      Real device extra steps
    Limits
      No new stored properties
      No method add or remove
      Private symbols edge cases
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Speed up iOS UI iteration by seeing layout or color changes without restarting the simulator

USE CASE 2

Force a SwiftUI view to redraw on save using the injection property wrapper

USE CASE 3

Reduce the feedback loop during macOS app development by injecting changed files on every save

USE CASE 4

Implement the injected() callback in a view controller to refresh state automatically after code injection

Tech stack

Objective-CSwiftXcodeiOSmacOS

Getting it running

Difficulty · moderate Time to first run · 30min

Xcode 16.3 and later require EMIT_FRONTEND_COMMAND_LINES to be enabled manually in build settings for injection to work.

In plain English

InjectionIII is a developer tool for iOS and macOS apps that lets you update code in a running application without stopping it, recompiling everything, and relaunching. When you save a source file in Xcode, the tool recompiles just that file and loads the new version directly into the running simulator. Changes take effect immediately, skipping the wait that normally comes from a full rebuild. This is called hot reloading. For interface work, where you might be adjusting colors, fonts, layouts, or logic through many small iterations, the time savings add up quickly. Normally a developer saves a file, waits for the full project to compile, relaunches the simulator, navigates back to the screen they were working on, and checks the result. InjectionIII removes all but the last step. Setup involves downloading the Mac app, adding a few lines of code to your project that load the injection bundle at startup, and adding two linker flags to your debug build settings. After that, every file save triggers an automatic injection. Classes can implement a special method called injected() that runs immediately after code is updated, which you use to force a visual refresh. For SwiftUI projects, there are property wrappers available that observe injections and trigger view redraws automatically. The tool works in the iOS simulator out of the box. Running it on a real device requires additional steps and a specific app release. macOS apps require temporarily disabling the app sandbox during development. The README notes a compatibility change in Xcode 16.3: a build setting called EMIT_FRONTEND_COMMAND_LINES must be explicitly enabled for InjectionIII to work, because Xcode stopped logging the information it needs by default. There are limits to what can be injected. You cannot add, remove, or reorder stored properties, and you cannot add or remove methods on non-final classes. Private symbols in extensions may also behave unexpectedly. The README is detailed about these constraints and the workarounds available.

Copy-paste prompts

Prompt 1
How do I set up InjectionIII for my iOS Swift project to enable hot reloading in the Xcode simulator?
Prompt 2
What linker flags and startup code do I need to add to my Xcode project to use InjectionIII?
Prompt 3
Show me how to implement the injected() method in a UIViewController so my view refreshes after a file save.
Prompt 4
How do I use InjectionIII with SwiftUI property wrappers to trigger view redraws on code injection?
Prompt 5
What is the EMIT_FRONTEND_COMMAND_LINES build setting in Xcode 16.3 and why is it required for InjectionIII?
Open on GitHub → Explain another repo

← johnno1962 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.