Skip to content

EamonTracey/NomaePreferences

Repository files navigation

NomaePreferences

A SwiftUI preferences framework for iOS tweak development

Usage

PreferencesController.swift

class PreferencesController: NomaePreferencesController {
    override var suiView: AnyView {
        get { AnyView(RootPreferences()) }
        set { super.suiView = newValue }
    }
}

RootPreferences.swift

let identifier = "com.somedomain.sometweak"

struct RootPreferences: View {
    @Preference("enabled", identifier: identifier) var enabled = true

    var body: some View {
        Form {
            Toggle("Enabled", isOn: $enabled)
        }
        .navigationBarTitle("SomeTweak")
    }
}

Link NomaePreferences in the Makefile

SomeTweak_FRAMEWORKS += NomaePreferences

Add NomaePreferences as a dependency in the control file

Depends: com.eamontracey.nomaepreferences

Credits

Huge thank you to Kabir for help debugging and fixing various Swift/Xcode problems

About

A SwiftUI preferences framework for iOS tweak development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published