Skip to content

RuntimeModifiable

0x41c edited this page Jun 7, 2022 · 2 revisions

RuntimeModifiable

A structure that allows the dynamic get/set of a swift structs stored properties.

public protocol RuntimeModifiable: AnyRuntimeModifiable 

This exists for the purpose of internal use, but is public for limited use as seen fit.

Inheritance

AnyRuntimeModifiable

Default Implementations

allKeyPaths

static var allKeyPaths: [String: PartialKeyPath<Self>] 

allKeyPathsOrdered

static var allKeyPathsOrdered: [Int: (String, PartialKeyPath<Self>)] 

writableKeyPaths

var writableKeyPaths: [String: PartialKeyPath<Self>] 

readOnlyKeyPaths

var readOnlyKeyPaths: [String: PartialKeyPath<Self>] 

get(_:_:)

func get<MemberType>(
        _ member: String,
        _ type: MemberType.Type? = nil
    ) -> MemberType? 

set(_:_:)

mutating func set<MemberType>(
        _ member: String,
        _ newValue: MemberType
    ) 

Requirements

allKeyPaths

All the keypaths belonging to the structure.

static var allKeyPaths: [String: PartialKeyPath<Self>] 

Every variable marked with let or var wil be included in this list. However, computed variables are not on the list as the API retreiving them doesn't have enough metadata to do so.

allKeyPathsOrdered

An ordered version of all the keypaths belonging to the structure.

static var allKeyPathsOrdered: [Int: (String, PartialKeyPath<Self>)] 

Every variable marked with let or var wil be included in this list. However, computed variables are not on the list as the API retreiving them doesn't have enough metadata to do so.

This will represent the order the values were declared in, from the top of the structure to the bottom.

writableKeyPaths

All the writable key paths belonging to the structure

var writableKeyPaths: [String: PartialKeyPath<Self>] 

A filtered version of allKeyPaths that only includes ones that are castable to WritableKeyPath. This directly corelates to the vars defined on the structure.

readOnlyKeyPaths

All the read only keypaths belonging to the structure

var readOnlyKeyPaths: [String: PartialKeyPath<Self>] 

A filtered version of allKeyPaths that only includes ones that aren't castable to WritableKeyPath. This directly corelates to the lets defined on the structure.

Types
Protocols
Global Typealiases
Global Functions
Clone this wiki locally