Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions runtimes/apple/apple.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Follow the steps below for a quick start on integrating Rive into your Apple app
</Step>
</Steps>
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
<Steps>
<Step title="Install the Runtime">
**Swift Package Manager**
Expand Down Expand Up @@ -336,7 +336,7 @@ Follow the steps below for a quick start on integrating Rive into your Apple app
```
</CodeGroup>
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let viewModel = RiveViewModel(fileName: "...")
viewModel.pause() // or play() to resume
Expand Down Expand Up @@ -388,7 +388,7 @@ Follow the steps below for a quick start on integrating Rive into your Apple app
```
</CodeGroup>
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let viewModel = RiveViewModel(fileName: "...")
viewModel.setPreferredFramesPerSecond(preferredFramesPerSecond: 30)
Expand All @@ -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.

Expand Down Expand Up @@ -458,7 +458,7 @@ See [Semantics](/runtimes/apple/semantics) for the available modes and more deta
let rive = try await Rive(file: file)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}> borderBottom>
<Tab title={"{{runtimeLegacyNameApple}}"} 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.
</Tab>
</Tabs>
Expand All @@ -469,7 +469,7 @@ See [Semantics](/runtimes/apple/semantics) for the available modes and more deta
<Tab title={"{{runtimeCurrentNameApple}}"}>
The new runtime does not yet include logging, but will be added in the near future.
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
Enabling logging is as simple as setting `RiveLogger.isEnabled` to `true`.

```swift
Expand Down
2 changes: 1 addition & 1 deletion runtimes/apple/artboards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
**SwiftUI**
```swift
struct AnimationView: View {
Expand Down
2 changes: 1 addition & 1 deletion runtimes/apple/caching-a-rive-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
// Cache a RiveFile somewhere to cache for reuse
let file = try! RiveFile(resource: "file", loadCdn: false)
Expand Down
22 changes: 11 additions & 11 deletions runtimes/apple/data-binding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)
let file = riveViewModel.riveModel!.riveFile
Expand Down Expand Up @@ -89,7 +89,7 @@ import { Demos } from "/snippets/demos.jsx";
namedInstance = try await file.createViewModelInstance(.name("Instance", from: .artboardDefault(Artboard)))
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)
let viewModel = riveViewModel.riveModel!.riveFile.viewModelNamed("...")!
Expand Down Expand Up @@ -140,7 +140,7 @@ import { Demos } from "/snippets/demos.jsx";
var rive = try await Rive(file: file, artboard: artboard, stateMachine: stateMachine, dataBind: .none)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)
let artboard = riveViewModel.riveModel!.artboard,
Expand Down Expand Up @@ -176,7 +176,7 @@ import { Demos } from "/snippets/demos.jsx";
var rive = try await Rive(file: file, artboard: artboard, stateMachine: stateMachine)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)
riveViewModel.riveModel?.enableAutoBind { instance in
Expand Down Expand Up @@ -206,7 +206,7 @@ import { Demos } from "/snippets/demos.jsx";
}
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)
let viewModel = riveViewModel.riveModel!.file.viewModelNamed(...)!
Expand Down Expand Up @@ -282,7 +282,7 @@ import { Demos } from "/snippets/demos.jsx";
```
</CodeGroup>
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)

Expand Down Expand Up @@ -365,7 +365,7 @@ import { Demos } from "/snippets/demos.jsx";

See [Properties](#properties) for usage details.
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)

Expand Down Expand Up @@ -432,7 +432,7 @@ import { Demos } from "/snippets/demos.jsx";
}
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)

Expand Down Expand Up @@ -482,7 +482,7 @@ import { Demos } from "/snippets/demos.jsx";
viewModelInstance.setValue(of: imageProperty, to: image)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let riveViewModel = RiveViewModel(...)

Expand Down Expand Up @@ -550,7 +550,7 @@ import { Demos } from "/snippets/demos.jsx";
let size = try await viewModelInstance.size(of: listProperty)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
let listProperty = viewModelInstance.listProperty(fromPath: "list")!

Expand Down Expand Up @@ -587,7 +587,7 @@ import { Demos } from "/snippets/demos.jsx";
viewModelInstance.setValue(of: artboardProperty, to: artboard)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
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.
Expand Down
4 changes: 2 additions & 2 deletions runtimes/apple/layouts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import ResponsiveLayouts from "/snippets/runtimes/layouts/responsive-layouts.mdx
rive.fit = .fitWidth(alignment: .topCenter)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
The runtime provides the following enums to set on layout parameters:

- **Fit**
Expand Down Expand Up @@ -166,7 +166,7 @@ import ResponsiveLayouts from "/snippets/runtimes/layouts/responsive-layouts.mdx
rive.fit = .layout(scaleFactor: .explicit(2.0))
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}> borderBottom>
<Tab title={"{{runtimeLegacyNameApple}}"} borderBottom>
**Examples**

- [SwiftUI](https://github.com/rive-app/rive-ios/blob/main/Example-iOS/Source/Examples/SwiftUI/SwiftLayout.swift)
Expand Down
2 changes: 1 addition & 1 deletion runtimes/apple/loading-assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import Resources from '/snippets/runtimes/loading-assets/resources.mdx'
```
</CodeGroup>
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
### Examples

- [(SwiftUI) Swap out images and fonts](https://github.com/rive-app/rive-ios/blob/main/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAssets.swift)
Expand Down
2 changes: 1 addition & 1 deletion runtimes/apple/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import Overview from '/snippets/runtimes/logging/overview.mdx'
RiveLog.logger = MyLogger()
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```
RiveLogger.isEnabled = true // Enable logging; false by default
RiveLogger.levels = [.debug] // Filter logs; all by default
Expand Down
4 changes: 2 additions & 2 deletions runtimes/apple/playing-audio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<Tabs>
<Tab title={Apple.currentRuntimeName}>
<Tab title={"{{runtimeCurrentNameApple}}"}>
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
Expand All @@ -56,7 +56,7 @@ An artboard is capable of setting its volume. A parent artboard will set the vol
}
```
</Tab>
<Tab title={Apple.legacyRuntimeName}>
<Tab title={"{{runtimeLegacyNameApple}}"}>
```swift
// Set the current artboard's volume to 50%
let viewModel = RiveViewModel(fileName: "my_rive_file")
Expand Down
6 changes: 3 additions & 3 deletions runtimes/apple/semantics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</Note>

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.

<Warning>
Semantics are **opt‑in**. The default mode is `.off`, so no accessibility elements are created until you enable semantics on the view.
Expand All @@ -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 |
| --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion runtimes/apple/state-machines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import PlayingStateMachines from "/snippets/runtimes/state-machines/playing-stat
let rive = try await Rive(file: file, artboard: artboardByName, stateMachine: stateMachine)
```
</Tab>
<Tab title={"{{runtimeLegacyNameApple}}"}>>
<Tab title={"{{runtimeLegacyNameApple}}"}>
#### Autoplay the State Machine

By default, RiveViewModel will automatically play the given state machine.
Expand Down