GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Juny0117/HotSwiftUI: Utilities for Hot Reloading SwiftUI apps.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
Sources/HotSwiftUI
Sources/HotSwiftUI
 
 
Tests
Tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 

Repository files navigation

HotSwiftUI

Utilitiy methods for use with HotReloading or InjectionIII to make live code updates to fully functional SwiftUI Applictions.

Add this repo to your project and add the following to a source file.

@_exported import HotSwiftUI

This will make the .eraseToAnyView() method on SwiftUI.View used to erase their type available throughout the app along with the global injectionObserver variable you can observe to force the View to update when code has been injected. SwiftUI is very well suited to injection as, provided you observe the injectionObserver which has an @Published injection counter, you can rest assured your views will update as required.

In short, modify the end of your SwiftUI View body properties to look like this:

    var body: some View {
        // Your SwiftUI code...
        .eraseToAnyView()
    }

    #if DEBUG
    @ObservedObject var iO = injectionObserver
    #endif

You need to do this for all view properties you'd like to inject and have refesh on injection which is a bit tedious but the InjectionIII or HotReloading app can make these changes automatically using the "Prepare Project" Menu Item. You can check in these changes as, in a "Release" build, these functions compile to a null operation.

About

Utilities for Hot Reloading SwiftUI apps.

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.