From 14330f30e5bc6ffb1134939984b63871c8f2dd7a Mon Sep 17 00:00:00 2001 From: Lance Date: Mon, 6 Jul 2026 15:33:29 -0700 Subject: [PATCH] fix: broken variables --- runtimes/apple/apple.mdx | 12 ++++++------ runtimes/apple/artboards.mdx | 2 +- runtimes/apple/caching-a-rive-file.mdx | 2 +- runtimes/apple/data-binding.mdx | 22 +++++++++++----------- runtimes/apple/layouts.mdx | 4 ++-- runtimes/apple/loading-assets.mdx | 2 +- runtimes/apple/logging.mdx | 2 +- runtimes/apple/playing-audio.mdx | 4 ++-- runtimes/apple/semantics.mdx | 6 +++--- runtimes/apple/state-machines.mdx | 2 +- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/runtimes/apple/apple.mdx b/runtimes/apple/apple.mdx index 8d21f1f9..62e4861c 100644 --- a/runtimes/apple/apple.mdx +++ b/runtimes/apple/apple.mdx @@ -221,7 +221,7 @@ Follow the steps below for a quick start on integrating Rive into your Apple app - > + **Swift Package Manager** @@ -336,7 +336,7 @@ Follow the steps below for a quick start on integrating Rive into your Apple app ``` - > + ```swift let viewModel = RiveViewModel(fileName: "...") viewModel.pause() // or play() to resume @@ -388,7 +388,7 @@ Follow the steps below for a quick start on integrating Rive into your Apple app ``` - > + ```swift let viewModel = RiveViewModel(fileName: "...") viewModel.setPreferredFramesPerSecond(preferredFramesPerSecond: 30) @@ -400,7 +400,7 @@ Follow the steps below for a quick start on integrating Rive into your Apple app ## Semantics -Rive views can expose [semantics defined in the editor](/editor/accessibility/semantics) to VoiceOver. Semantics are available in the {Apple.currentRuntimeName} only. +Rive views can expose [semantics defined in the editor](/editor/accessibility/semantics) to VoiceOver. Semantics are available in the {{runtimeCurrentNameApple}} only. See [Semantics](/runtimes/apple/semantics) for the available modes and more detail. @@ -458,7 +458,7 @@ See [Semantics](/runtimes/apple/semantics) for the available modes and more deta let rive = try await Rive(file: file) ``` - borderBottom> + The legacy runtime is currently single-threaded on the main thread. This means that all Rive calls must be made on the main thread. It is recommended that if you are on a background thread, you should dispatch to the main queue before making any Rive calls. @@ -469,7 +469,7 @@ See [Semantics](/runtimes/apple/semantics) for the available modes and more deta The new runtime does not yet include logging, but will be added in the near future. - > + Enabling logging is as simple as setting `RiveLogger.isEnabled` to `true`. ```swift diff --git a/runtimes/apple/artboards.mdx b/runtimes/apple/artboards.mdx index 8933df05..e85cded7 100644 --- a/runtimes/apple/artboards.mdx +++ b/runtimes/apple/artboards.mdx @@ -43,7 +43,7 @@ import ChoosingAnArtboard from "/snippets/runtimes/artboards/choosing-an-artboar Artboards then become the source of truth for state machines. See [State Machine](/runtimes/apple/state-machines) for more details. - > + **SwiftUI** ```swift struct AnimationView: View { diff --git a/runtimes/apple/caching-a-rive-file.mdx b/runtimes/apple/caching-a-rive-file.mdx index 76386015..e7f7d7b6 100644 --- a/runtimes/apple/caching-a-rive-file.mdx +++ b/runtimes/apple/caching-a-rive-file.mdx @@ -47,7 +47,7 @@ import Overview from "/snippets/runtimes/caching/overview.mdx" let rive5 = try await builder.createRive(artboard: "MainArtboard", stateMachine: "Idle") // Creates a unique artboard and state machine, behaving separately from the first four Rive objects ``` - > + ```swift // Cache a RiveFile somewhere to cache for reuse let file = try! RiveFile(resource: "file", loadCdn: false) diff --git a/runtimes/apple/data-binding.mdx b/runtimes/apple/data-binding.mdx index df0312b5..b47ee47d 100644 --- a/runtimes/apple/data-binding.mdx +++ b/runtimes/apple/data-binding.mdx @@ -41,7 +41,7 @@ import { Demos } from "/snippets/demos.jsx"; These sources are used in conjunction with getting a view model instance. See [View Model Instances](#view-model-instances) for more information. - > + ```swift let riveViewModel = RiveViewModel(...) let file = riveViewModel.riveModel!.riveFile @@ -89,7 +89,7 @@ import { Demos } from "/snippets/demos.jsx"; namedInstance = try await file.createViewModelInstance(.name("Instance", from: .artboardDefault(Artboard))) ``` - > + ```swift let riveViewModel = RiveViewModel(...) let viewModel = riveViewModel.riveModel!.riveFile.viewModelNamed("...")! @@ -140,7 +140,7 @@ import { Demos } from "/snippets/demos.jsx"; var rive = try await Rive(file: file, artboard: artboard, stateMachine: stateMachine, dataBind: .none) ``` - > + ```swift let riveViewModel = RiveViewModel(...) let artboard = riveViewModel.riveModel!.artboard, @@ -176,7 +176,7 @@ import { Demos } from "/snippets/demos.jsx"; var rive = try await Rive(file: file, artboard: artboard, stateMachine: stateMachine) ``` - > + ```swift let riveViewModel = RiveViewModel(...) riveViewModel.riveModel?.enableAutoBind { instance in @@ -206,7 +206,7 @@ import { Demos } from "/snippets/demos.jsx"; } ``` - > + ```swift let riveViewModel = RiveViewModel(...) let viewModel = riveViewModel.riveModel!.file.viewModelNamed(...)! @@ -282,7 +282,7 @@ import { Demos } from "/snippets/demos.jsx"; ``` - > + ```swift let riveViewModel = RiveViewModel(...) @@ -365,7 +365,7 @@ import { Demos } from "/snippets/demos.jsx"; See [Properties](#properties) for usage details. - > + ```swift let riveViewModel = RiveViewModel(...) @@ -432,7 +432,7 @@ import { Demos } from "/snippets/demos.jsx"; } ``` - > + ```swift let riveViewModel = RiveViewModel(...) @@ -482,7 +482,7 @@ import { Demos } from "/snippets/demos.jsx"; viewModelInstance.setValue(of: imageProperty, to: image) ``` - > + ```swift let riveViewModel = RiveViewModel(...) @@ -550,7 +550,7 @@ import { Demos } from "/snippets/demos.jsx"; let size = try await viewModelInstance.size(of: listProperty) ``` - > + ```swift let listProperty = viewModelInstance.listProperty(fromPath: "list")! @@ -587,7 +587,7 @@ import { Demos } from "/snippets/demos.jsx"; viewModelInstance.setValue(of: artboardProperty, to: artboard) ``` - > + Use the `artboardProperty` method on a `RiveDataBindingViewModel.Instance` object to get the artboard property. Then use the `setValue` method on the artboard property object to set the new artboard value. diff --git a/runtimes/apple/layouts.mdx b/runtimes/apple/layouts.mdx index f48ee0c8..88dd5c83 100644 --- a/runtimes/apple/layouts.mdx +++ b/runtimes/apple/layouts.mdx @@ -38,7 +38,7 @@ import ResponsiveLayouts from "/snippets/runtimes/layouts/responsive-layouts.mdx rive.fit = .fitWidth(alignment: .topCenter) ``` - > + The runtime provides the following enums to set on layout parameters: - **Fit** @@ -166,7 +166,7 @@ import ResponsiveLayouts from "/snippets/runtimes/layouts/responsive-layouts.mdx rive.fit = .layout(scaleFactor: .explicit(2.0)) ``` - borderBottom> + **Examples** - [SwiftUI](https://github.com/rive-app/rive-ios/blob/main/Example-iOS/Source/Examples/SwiftUI/SwiftLayout.swift) diff --git a/runtimes/apple/loading-assets.mdx b/runtimes/apple/loading-assets.mdx index 6f2538ff..bdf489c5 100644 --- a/runtimes/apple/loading-assets.mdx +++ b/runtimes/apple/loading-assets.mdx @@ -66,7 +66,7 @@ import Resources from '/snippets/runtimes/loading-assets/resources.mdx' ``` - > + ### Examples - [(SwiftUI) Swap out images and fonts](https://github.com/rive-app/rive-ios/blob/main/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAssets.swift) diff --git a/runtimes/apple/logging.mdx b/runtimes/apple/logging.mdx index e0d558c6..f0184fe8 100644 --- a/runtimes/apple/logging.mdx +++ b/runtimes/apple/logging.mdx @@ -61,7 +61,7 @@ import Overview from '/snippets/runtimes/logging/overview.mdx' RiveLog.logger = MyLogger() ``` - > + ``` RiveLogger.isEnabled = true // Enable logging; false by default RiveLogger.levels = [.debug] // Filter logs; all by default diff --git a/runtimes/apple/playing-audio.mdx b/runtimes/apple/playing-audio.mdx index d425033d..57282612 100644 --- a/runtimes/apple/playing-audio.mdx +++ b/runtimes/apple/playing-audio.mdx @@ -34,7 +34,7 @@ AVAudioSession.sharedInstance().setCategory(category, options: options) An artboard is capable of setting its volume. A parent artboard will set the volume of all component instances; however, setting a component's volume will **not** update the parent's volume. - + Once you have created an `Artboard`, you can set its volume with `setVolume(_:)` and read the current volume with `volume()`. Volume is propagated to all nested artboards. ```swift @@ -56,7 +56,7 @@ An artboard is capable of setting its volume. A parent artboard will set the vol } ``` - + ```swift // Set the current artboard's volume to 50% let viewModel = RiveViewModel(fileName: "my_rive_file") diff --git a/runtimes/apple/semantics.mdx b/runtimes/apple/semantics.mdx index 7a57e681..77f9a2f5 100644 --- a/runtimes/apple/semantics.mdx +++ b/runtimes/apple/semantics.mdx @@ -11,11 +11,11 @@ import { Apple } from "/snippets/constants.mdx" Have feedback? Join the [Early Access community](https://community.rive.app/c/early-access/) to share your thoughts and help shape the feature. -This page covers enabling [semantics](/editor/accessibility/semantics) in the {Apple.currentRuntimeName} so your Rive views are accessible to VoiceOver. To learn what semantics are and how to add them to a graphic, see the [Semantics](/editor/accessibility/semantics) editor documentation. +This page covers enabling [semantics](/editor/accessibility/semantics) in the {{runtimeCurrentNameApple}} so your Rive views are accessible to VoiceOver. To learn what semantics are and how to add them to a graphic, see the [Semantics](/editor/accessibility/semantics) editor documentation. ## Overview -You add semantics to the elements of your graphic in the Rive Editor — roles such as button, checkbox, tab, slider, image, link, list, or dialog, along with their labels, values, states, and actions. At runtime, the {Apple.currentRuntimeName} reads those semantics from the running state machine and exposes them to [VoiceOver](https://support.apple.com/guide/iphone/turn-on-and-practice-voiceover-iph3e2e415f/ios) as the view's `accessibilityElements`, keeping them up to date as the state machine advances. +You add semantics to the elements of your graphic in the Rive Editor — roles such as button, checkbox, tab, slider, image, link, list, or dialog, along with their labels, values, states, and actions. At runtime, the {{runtimeCurrentNameApple}} reads those semantics from the running state machine and exposes them to [VoiceOver](https://support.apple.com/guide/iphone/turn-on-and-practice-voiceover-iph3e2e415f/ios) as the view's `accessibilityElements`, keeping them up to date as the state machine advances. Semantics are **opt‑in**. The default mode is `.off`, so no accessibility elements are created until you enable semantics on the view. @@ -27,7 +27,7 @@ You add semantics to the elements of your graphic in the Rive Editor — roles s ## Availability -Semantics are available in the {Apple.currentRuntimeName} only (not the {Apple.legacyRuntimeName}), on every Apple platform the runtime supports except macOS (AppKit): +Semantics are available in the {{runtimeCurrentNameApple}} only (not the {{runtimeLegacyNameApple}}), on every Apple platform the runtime supports except macOS (AppKit): | Platform | Supported | | --- | --- | diff --git a/runtimes/apple/state-machines.mdx b/runtimes/apple/state-machines.mdx index be298239..a94bca82 100644 --- a/runtimes/apple/state-machines.mdx +++ b/runtimes/apple/state-machines.mdx @@ -48,7 +48,7 @@ import PlayingStateMachines from "/snippets/runtimes/state-machines/playing-stat let rive = try await Rive(file: file, artboard: artboardByName, stateMachine: stateMachine) ``` - > + #### Autoplay the State Machine By default, RiveViewModel will automatically play the given state machine.