Ios out of band

few bits to sort out
- [x] make our mix of simulator/emulator consistent, settling on emulator
- [x] passing the factory in works great for just in time asset decoding, but its not amazing when you want to decode ahead of time.
- [x] couple of places left to pass this function signature through. (Question) is there a neater way to get this done, feels a bit like we are going back to parameter explosion a bit?
- [x] should do a few examples, i think the complexity grows quite a bit in this one as you add caching, or callbacks
- [x] should get the cached images/fonts to draw on init as well, either warming up cache, or jitting
- [x] examples loading assets from the bundle (also there seem to be actual asset things too? should we use those?!)
- [x] add test
- [x] re-add "preview" project & rev the preview project once this has been deployed. (do this after new ios deploy)
- [x] fix up race condition (see comment)

https://github.com/rive-app/rive/assets/1216025/2c14330f-e8a4-481b-bc27-4807cabe3b82

(simple example, both swift ui and standard)

![CleanShot 2023-11-20 at 16 54 59](https://github.com/rive-app/rive/assets/1216025/a71e207c-30ad-44dd-9e4b-ad7431b22186)

Diffs=
fabb7f97f Ios out of band (#6232)

Co-authored-by: Gordon Hayes <pggordonhayes@gmail.com>
Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
This commit is contained in:
luigi-rosso
2023-12-05 21:23:08 +00:00
parent 4a6b6072dc
commit 27de5abf4b
57 changed files with 1599 additions and 857 deletions

3
.gitignore vendored
View File

@@ -49,6 +49,9 @@ playground.xcworkspace
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
# our previews will install packages from swiftpm, which will result in references here.
Rive.xcworkspace/xcshareddata/swiftpm/Package.resolved
.build/
# CocoaPods

View File

@@ -1 +1 @@
ed4474d1ab3aa1e68d47cfcb2c178f39c376257e
fabb7f97fe7b69368c9a7369febfecbc90be49cd

View File

@@ -1 +1 @@
05e26a46fb68d9de2595c7d21ce8db48a78892e1
7b7595392d849217e43a829b71dfad58ecf29b06

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

View File

@@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>

View File

@@ -11,6 +11,7 @@
04026DC827CE3EE6002B3DBF /* SwiftLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04026DC727CE3EE6002B3DBF /* SwiftLayout.swift */; };
04026DCA27CE3EF6002B3DBF /* SwiftMultipleAnimations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04026DC927CE3EF6002B3DBF /* SwiftMultipleAnimations.swift */; };
04026DCE27CE3F0F002B3DBF /* SwiftStateMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04026DCD27CE3F0F002B3DBF /* SwiftStateMachine.swift */; };
041265222B0BC5A5009400EC /* SwiftSimpleAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041265212B0BC5A5009400EC /* SwiftSimpleAssets.swift */; };
042C88832643D6B900E7DBB2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 042C88822643D6B900E7DBB2 /* Main.storyboard */; };
042C88882643DB7100E7DBB2 /* SimpleAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042C88872643DB7100E7DBB2 /* SimpleAnimation.swift */; };
042C888C2643EEE300E7DBB2 /* Layout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042C888B2643EEE300E7DBB2 /* Layout.swift */; };
@@ -34,8 +35,18 @@
042C88EA2644447500E7DBB2 /* skills.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D82644447500E7DBB2 /* skills.riv */; };
042C88EB2644447500E7DBB2 /* clipping.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D92644447500E7DBB2 /* clipping.riv */; };
042C88EC2644447500E7DBB2 /* vader.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88DA2644447500E7DBB2 /* vader.riv */; };
043025EA2AF9046700320F2E /* asset_load_check.riv in Resources */ = {isa = PBXBuildFile; fileRef = 043025E92AF9046700320F2E /* asset_load_check.riv */; };
043025EB2AF9046700320F2E /* asset_load_check.riv in Resources */ = {isa = PBXBuildFile; fileRef = 043025E92AF9046700320F2E /* asset_load_check.riv */; };
043025EF2AF905B100320F2E /* CachedAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043025EE2AF905B100320F2E /* CachedAssets.swift */; };
043026062B012C5000320F2E /* simple_assets.riv in Resources */ = {isa = PBXBuildFile; fileRef = 043026052B012C5000320F2E /* simple_assets.riv */; };
043026072B012C5000320F2E /* simple_assets.riv in Resources */ = {isa = PBXBuildFile; fileRef = 043026052B012C5000320F2E /* simple_assets.riv */; };
0448838F29F82DD000D7523E /* SimpleHttpAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0448838C29F82DD000D7523E /* SimpleHttpAnimation.swift */; };
0450446126B3F71E007B25CA /* constrained.riv in Resources */ = {isa = PBXBuildFile; fileRef = 0450445E26B3F71E007B25CA /* constrained.riv */; };
0453FCB42B012D17001185C8 /* picture-47982.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 0453FCB02B012D17001185C8 /* picture-47982.jpeg */; };
0453FCB52B012D17001185C8 /* picture-47982.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 0453FCB02B012D17001185C8 /* picture-47982.jpeg */; };
0453FCB92B012DA9001185C8 /* SimpleOutOfBand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0453FCB82B012DA9001185C8 /* SimpleOutOfBand.swift */; };
0453FCBA2B012DA9001185C8 /* SimpleOutOfBand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0453FCB82B012DA9001185C8 /* SimpleOutOfBand.swift */; };
0453FCBF2B014E2F001185C8 /* Inter-45562.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0453FCBC2B014E2F001185C8 /* Inter-45562.ttf */; };
046AFA712673AF04004ED497 /* blendmodes.riv in Resources */ = {isa = PBXBuildFile; fileRef = 046AFA6E2673AF04004ED497 /* blendmodes.riv */; };
046AFA732673B00B004ED497 /* BlendModes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046AFA722673B00B004ED497 /* BlendModes.swift */; };
0480028B2729AA4400F7132B /* clean_icon_set.riv in Resources */ = {isa = PBXBuildFile; fileRef = 048002882729AA4400F7132B /* clean_icon_set.riv */; };
@@ -145,147 +156,11 @@
E5A7874C27E1158E0056F24B /* prop_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5A7874B27E1158E0056F24B /* prop_example.riv */; };
E5CD7D7127DC331900BFE5E2 /* SwiftMeshAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5CD7D7027DC331900BFE5E2 /* SwiftMeshAnimation.swift */; };
E5E87A012AE5A83800E7295F /* SwiftVariableFPS.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5E87A002AE5A83700E7295F /* SwiftVariableFPS.swift */; };
E5E87A022AE5A85E00E7295F /* SwiftVariableFPS.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5E87A002AE5A83700E7295F /* SwiftVariableFPS.swift */; };
F8772A872AD946D500AB5920 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9C73E9724FC471E00EF9516 /* AppDelegate.swift */; };
F8772A882AD946FD00AB5920 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 042C88822643D6B900E7DBB2 /* Main.storyboard */; };
F8772A892AD9470000AB5920 /* ExamplesMaster.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3357CA0280F42EC00F03B6F /* ExamplesMaster.swift */; };
F8772A8A2AD9470700AB5920 /* blendmodes.riv in Resources */ = {isa = PBXBuildFile; fileRef = 046AFA6E2673AF04004ED497 /* blendmodes.riv */; };
F8772A8B2AD9470700AB5920 /* light_switch.riv in Resources */ = {isa = PBXBuildFile; fileRef = 27108F2C282C96E700A99D81 /* light_switch.riv */; };
F8772A8C2AD9470700AB5920 /* wacky.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88C92644447400E7DBB2 /* wacky.riv */; };
F8772A8D2AD9470700AB5920 /* clean_icon_set.riv in Resources */ = {isa = PBXBuildFile; fileRef = 048002882729AA4400F7132B /* clean_icon_set.riv */; };
F8772A8E2AD9470700AB5920 /* switch.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9E040A8264DFCFD009ABC7C /* switch.riv */; };
F8772A8F2AD9470700AB5920 /* leg_day_events_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC29281837B300A81123 /* leg_day_events_example.riv */; };
F8772A902AD9470700AB5920 /* testtext.riv in Resources */ = {isa = PBXBuildFile; fileRef = E577989D2A72C77900FF25C3 /* testtext.riv */; };
F8772A912AD9470700AB5920 /* truck_v7.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9BD3925263B5FC700696C37 /* truck_v7.riv */; };
F8772A922AD9470700AB5920 /* rating_animation.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5964AB02A9CDB2100140479 /* rating_animation.riv */; };
F8772A932AD9470700AB5920 /* energy_bar_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5A7874727E115170056F24B /* energy_bar_example.riv */; };
F8772A942AD9470700AB5920 /* nothing.riv in Resources */ = {isa = PBXBuildFile; fileRef = 04D5B069266A460C004ACA5B /* nothing.riv */; };
F8772A952AD9470700AB5920 /* life_bar.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9D3DE67264F49F4001BA265 /* life_bar.riv */; };
F8772A962AD9470700AB5920 /* progress.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CE2644447500E7DBB2 /* progress.riv */; };
F8772A972AD9470700AB5920 /* artboard_animations.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D42644447500E7DBB2 /* artboard_animations.riv */; };
F8772A982AD9470700AB5920 /* constrained.riv in Resources */ = {isa = PBXBuildFile; fileRef = 0450445E26B3F71E007B25CA /* constrained.riv */; };
F8772A992AD9470700AB5920 /* watch_v1.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3E383472837E6B00029D65E /* watch_v1.riv */; };
F8772A9A2AD9470700AB5920 /* off_road_car_blog.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D72644447500E7DBB2 /* off_road_car_blog.riv */; };
F8772A9B2AD9470700AB5920 /* two_bone_ik.riv in Resources */ = {isa = PBXBuildFile; fileRef = 04F1C80826A8442300CEE6BE /* two_bone_ik.riv */; };
F8772A9C2AD9470700AB5920 /* ui_swipe_left_to_delete.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CB2644447400E7DBB2 /* ui_swipe_left_to_delete.riv */; };
F8772A9D2AD9470700AB5920 /* f22.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D02644447500E7DBB2 /* f22.riv */; };
F8772A9E2AD9470700AB5920 /* play_button_event_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC28281837B300A81123 /* play_button_event_example.riv */; };
F8772A9F2AD9470700AB5920 /* teststatemachine.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3C074AA283FC75900E8EB33 /* teststatemachine.riv */; };
F8772AA02AD9470700AB5920 /* explorer.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D32644447500E7DBB2 /* explorer.riv */; };
F8772AA12AD9470700AB5920 /* basketball.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CF2644447500E7DBB2 /* basketball.riv */; };
F8772AA22AD9470700AB5920 /* flux_capacitor.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D12644447500E7DBB2 /* flux_capacitor.riv */; };
F8772AA32AD9470700AB5920 /* paper.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83C89AD0298870A700044C17 /* paper.riv */; };
F8772AA42AD9470700AB5920 /* loopy.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D62644447500E7DBB2 /* loopy.riv */; };
F8772AA52AD9470700AB5920 /* rope.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CC2644447400E7DBB2 /* rope.riv */; };
F8772AA62AD9470700AB5920 /* clipping.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D92644447500E7DBB2 /* clipping.riv */; };
F8772AA72AD9470700AB5920 /* truck.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3D187F8280770EA008B739A /* truck.riv */; };
F8772AA82AD9470700AB5920 /* juice_v7.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9CE8265263B90E000F98DDB /* juice_v7.riv */; };
F8772AA92AD9470700AB5920 /* Bear.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83DE4CB42AB3974300B88B72 /* Bear.riv */; };
F8772AAA2AD9470700AB5920 /* hero_editor.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3745FCB282AE2320087F4AF /* hero_editor.riv */; };
F8772AAB2AD9470700AB5920 /* bullet_man_game.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3E2B5872833ECB500A8651B /* bullet_man_game.riv */; };
F8772AAC2AD9470700AB5920 /* marty.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83C89ACE2988709400044C17 /* marty.riv */; };
F8772AAD2AD9470700AB5920 /* testanimation.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3C074A7283FC75800E8EB33 /* testanimation.riv */; };
F8772AAE2AD9470700AB5920 /* switch_event_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC2A281837B300A81123 /* switch_event_example.riv */; };
F8772AAF2AD9470700AB5920 /* magic_8-ball_v2.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC222817BE1100A81123 /* magic_8-ball_v2.riv */; };
F8772AB02AD9470700AB5920 /* prop_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5A7874B27E1158E0056F24B /* prop_example.riv */; };
F8772AB12AD9470700AB5920 /* trailblaze.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D52644447500E7DBB2 /* trailblaze.riv */; };
F8772AB22AD9470700AB5920 /* riveslider.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3D187F628075B6C008B739A /* riveslider.riv */; };
F8772AB32AD9470700AB5920 /* vader.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88DA2644447500E7DBB2 /* vader.riv */; };
F8772AB42AD9470700AB5920 /* halloween.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3C074F1284161E400E8EB33 /* halloween.riv */; };
F8772AB52AD9470700AB5920 /* text_test_2.riv in Resources */ = {isa = PBXBuildFile; fileRef = E57798AD2A73264100FF25C3 /* text_test_2.riv */; };
F8772AB62AD9470700AB5920 /* liquid.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9D3DE5A264F3B51001BA265 /* liquid.riv */; };
F8772AB72AD9470700AB5920 /* neostream.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D22644447500E7DBB2 /* neostream.riv */; };
F8772AB82AD9470700AB5920 /* rbutton.riv in Resources */ = {isa = PBXBuildFile; fileRef = C324DB5E280740FB0060589F /* rbutton.riv */; };
F8772AB92AD9470700AB5920 /* mascot.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CD2644447400E7DBB2 /* mascot.riv */; };
F8772ABA2AD9470700AB5920 /* skills.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D82644447500E7DBB2 /* skills.riv */; };
F8772ABB2AD9470700AB5920 /* pull.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CA2644447400E7DBB2 /* pull.riv */; };
F8772ABC2AD9471800AB5920 /* RiveButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C324DB5C280728690060589F /* RiveButton.swift */; };
F8772ABD2AD9471800AB5920 /* RiveSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C324DB5528071EB80060589F /* RiveSwitch.swift */; };
F8772ABE2AD9471800AB5920 /* RiveProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3D187F2280751A8008B739A /* RiveProgressBar.swift */; };
F8772ABF2AD9471800AB5920 /* ClockViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3ECAC2E281840A300A81123 /* ClockViewModel.swift */; };
F8772AC02AD9471800AB5920 /* RiveSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = C324DB5A2807216B0060589F /* RiveSlider.swift */; };
F8772AC12AD9471B00AB5920 /* StateMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C4C83D2646FE410047E614 /* StateMachine.swift */; };
F8772AC22AD9471B00AB5920 /* BlendModes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046AFA722673B00B004ED497 /* BlendModes.swift */; };
F8772AC32AD9471B00AB5920 /* SimpleSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3468E6127FDCBC6008652FD /* SimpleSlider.swift */; };
F8772AC42AD9471B00AB5920 /* SimpleAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042C88872643DB7100E7DBB2 /* SimpleAnimation.swift */; };
F8772AC52AD9471B00AB5920 /* SimpleHttpAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0448838C29F82DD000D7523E /* SimpleHttpAnimation.swift */; };
F8772AC62AD9471B00AB5920 /* MultipleAnimations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042C888F2644250D00E7DBB2 /* MultipleAnimations.swift */; };
F8772AC72AD9471B00AB5920 /* StressTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C89ACA29886ECB00044C17 /* StressTest.swift */; };
F8772AC82AD9471B00AB5920 /* Layout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042C888B2643EEE300E7DBB2 /* Layout.swift */; };
F8772AC92AD9471E00AB5920 /* SwiftTestText.swift in Sources */ = {isa = PBXBuildFile; fileRef = E57798A82A730A9B00FF25C3 /* SwiftTestText.swift */; };
F8772ACA2AD9471E00AB5920 /* SwiftWidgets.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9CB2F12264C92D200E7FF0D /* SwiftWidgets.swift */; };
F8772ACB2AD9471E00AB5920 /* SwiftLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04026DC727CE3EE6002B3DBF /* SwiftLayout.swift */; };
F8772ACC2AD9471E00AB5920 /* SwiftMultipleAnimations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04026DC927CE3EF6002B3DBF /* SwiftMultipleAnimations.swift */; };
F8772ACD2AD9471E00AB5920 /* SwiftMeshAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5CD7D7027DC331900BFE5E2 /* SwiftMeshAnimation.swift */; };
F8772ACE2AD9471E00AB5920 /* SwiftCannonGame.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E2B58B2833ECFE00A8651B /* SwiftCannonGame.swift */; };
F8772ACF2AD9471E00AB5920 /* SwiftStateMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04026DCD27CE3F0F002B3DBF /* SwiftStateMachine.swift */; };
F8772AD02AD9471E00AB5920 /* SwiftTouchEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3ECAC262817BE4600A81123 /* SwiftTouchEvents.swift */; };
F8772AD12AD9471E00AB5920 /* SwiftTestParityAnimSM.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C074ED28414F4600E8EB33 /* SwiftTestParityAnimSM.swift */; };
F8772AD22AD9471E00AB5920 /* SwiftEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5964AAA2A9CD49200140479 /* SwiftEvents.swift */; };
F8772AD32AD9471E00AB5920 /* SwiftSimpleAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04026DC327CE3ED6002B3DBF /* SwiftSimpleAnimation.swift */; };
F8772AD42AD9472100AB5920 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9C73E9D24FC471E00EF9516 /* Assets.xcassets */; };
F8772AD52AD9472400AB5920 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9C73EA024FC471E00EF9516 /* Preview Assets.xcassets */; };
F8772AD62AD9472800AB5920 /* utility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042C888D2644230700E7DBB2 /* utility.swift */; };
F8772AD72AD9472F00AB5920 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9C73E9924FC471E00EF9516 /* SceneDelegate.swift */; };
F8772ADA2AD9483800AB5920 /* RiveRuntime in Frameworks */ = {isa = PBXBuildFile; productRef = F8772AD92AD9483800AB5920 /* RiveRuntime */; };
F8772AE92AD94A0800AB5920 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F8772AE82AD94A0800AB5920 /* Preview Assets.xcassets */; };
F8772AEF2AD94A3900AB5920 /* RiveRuntime in Frameworks */ = {isa = PBXBuildFile; productRef = F8772AEE2AD94A3900AB5920 /* RiveRuntime */; };
F8772AF02AD94A4400AB5920 /* marty.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83C89ACE2988709400044C17 /* marty.riv */; };
F8772AF12AD94A4400AB5920 /* paper.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83C89AD0298870A700044C17 /* paper.riv */; };
F8772AF22AD94A4400AB5920 /* Bear.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83DE4CB42AB3974300B88B72 /* Bear.riv */; };
F8772AF32AD94A4500AB5920 /* light_switch.riv in Resources */ = {isa = PBXBuildFile; fileRef = 27108F2C282C96E700A99D81 /* light_switch.riv */; };
F8772AF42AD94A4500AB5920 /* prop_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5A7874B27E1158E0056F24B /* prop_example.riv */; };
F8772AF52AD94A4500AB5920 /* marty.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83C89ACE2988709400044C17 /* marty.riv */; };
F8772AF62AD94A4500AB5920 /* ui_swipe_left_to_delete.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CB2644447400E7DBB2 /* ui_swipe_left_to_delete.riv */; };
F8772AF72AD94A4500AB5920 /* trailblaze.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D52644447500E7DBB2 /* trailblaze.riv */; };
F8772AF82AD94A4500AB5920 /* testtext.riv in Resources */ = {isa = PBXBuildFile; fileRef = E577989D2A72C77900FF25C3 /* testtext.riv */; };
F8772AF92AD94A4500AB5920 /* testanimation.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3C074A7283FC75800E8EB33 /* testanimation.riv */; };
F8772AFA2AD94A4500AB5920 /* juice_v7.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9CE8265263B90E000F98DDB /* juice_v7.riv */; };
F8772AFB2AD94A4500AB5920 /* nothing.riv in Resources */ = {isa = PBXBuildFile; fileRef = 04D5B069266A460C004ACA5B /* nothing.riv */; };
F8772AFC2AD94A4500AB5920 /* wacky.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88C92644447400E7DBB2 /* wacky.riv */; };
F8772AFD2AD94A4500AB5920 /* clipping.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D92644447500E7DBB2 /* clipping.riv */; };
F8772AFE2AD94A4500AB5920 /* life_bar.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9D3DE67264F49F4001BA265 /* life_bar.riv */; };
F8772AFF2AD94A4500AB5920 /* hero_editor.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3745FCB282AE2320087F4AF /* hero_editor.riv */; };
F8772B002AD94A4500AB5920 /* progress.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CE2644447500E7DBB2 /* progress.riv */; };
F8772B012AD94A4500AB5920 /* constrained.riv in Resources */ = {isa = PBXBuildFile; fileRef = 0450445E26B3F71E007B25CA /* constrained.riv */; };
F8772B022AD94A4500AB5920 /* truck_v7.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9BD3925263B5FC700696C37 /* truck_v7.riv */; };
F8772B032AD94A4500AB5920 /* skills.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D82644447500E7DBB2 /* skills.riv */; };
F8772B042AD94A4500AB5920 /* text_test_2.riv in Resources */ = {isa = PBXBuildFile; fileRef = E57798AD2A73264100FF25C3 /* text_test_2.riv */; };
F8772B052AD94A4500AB5920 /* leg_day_events_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC29281837B300A81123 /* leg_day_events_example.riv */; };
F8772B062AD94A4500AB5920 /* paper.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83C89AD0298870A700044C17 /* paper.riv */; };
F8772B072AD94A4500AB5920 /* riveslider.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3D187F628075B6C008B739A /* riveslider.riv */; };
F8772B082AD94A4500AB5920 /* f22.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D02644447500E7DBB2 /* f22.riv */; };
F8772B092AD94A4500AB5920 /* rating_animation.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5964AB02A9CDB2100140479 /* rating_animation.riv */; };
F8772B0A2AD94A4500AB5920 /* vader.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88DA2644447500E7DBB2 /* vader.riv */; };
F8772B0B2AD94A4500AB5920 /* explorer.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D32644447500E7DBB2 /* explorer.riv */; };
F8772B0C2AD94A4500AB5920 /* Bear.riv in Resources */ = {isa = PBXBuildFile; fileRef = 83DE4CB42AB3974300B88B72 /* Bear.riv */; };
F8772B0D2AD94A4500AB5920 /* halloween.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3C074F1284161E400E8EB33 /* halloween.riv */; };
F8772B0E2AD94A4500AB5920 /* blendmodes.riv in Resources */ = {isa = PBXBuildFile; fileRef = 046AFA6E2673AF04004ED497 /* blendmodes.riv */; };
F8772B0F2AD94A4500AB5920 /* liquid.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9D3DE5A264F3B51001BA265 /* liquid.riv */; };
F8772B102AD94A4500AB5920 /* rope.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CC2644447400E7DBB2 /* rope.riv */; };
F8772B112AD94A4500AB5920 /* clean_icon_set.riv in Resources */ = {isa = PBXBuildFile; fileRef = 048002882729AA4400F7132B /* clean_icon_set.riv */; };
F8772B122AD94A4500AB5920 /* energy_bar_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5A7874727E115170056F24B /* energy_bar_example.riv */; };
F8772B132AD94A4500AB5920 /* truck.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3D187F8280770EA008B739A /* truck.riv */; };
F8772B142AD94A4500AB5920 /* pull.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CA2644447400E7DBB2 /* pull.riv */; };
F8772B152AD94A4500AB5920 /* mascot.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CD2644447400E7DBB2 /* mascot.riv */; };
F8772B162AD94A4500AB5920 /* switch_event_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC2A281837B300A81123 /* switch_event_example.riv */; };
F8772B172AD94A4500AB5920 /* rbutton.riv in Resources */ = {isa = PBXBuildFile; fileRef = C324DB5E280740FB0060589F /* rbutton.riv */; };
F8772B182AD94A4500AB5920 /* neostream.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D22644447500E7DBB2 /* neostream.riv */; };
F8772B192AD94A4500AB5920 /* watch_v1.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3E383472837E6B00029D65E /* watch_v1.riv */; };
F8772B1A2AD94A4500AB5920 /* magic_8-ball_v2.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC222817BE1100A81123 /* magic_8-ball_v2.riv */; };
F8772B1B2AD94A4500AB5920 /* loopy.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D62644447500E7DBB2 /* loopy.riv */; };
F8772B1C2AD94A4500AB5920 /* switch.riv in Resources */ = {isa = PBXBuildFile; fileRef = C9E040A8264DFCFD009ABC7C /* switch.riv */; };
F8772B1D2AD94A4500AB5920 /* flux_capacitor.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D12644447500E7DBB2 /* flux_capacitor.riv */; };
F8772B1E2AD94A4500AB5920 /* two_bone_ik.riv in Resources */ = {isa = PBXBuildFile; fileRef = 04F1C80826A8442300CEE6BE /* two_bone_ik.riv */; };
F8772B1F2AD94A4500AB5920 /* play_button_event_example.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3ECAC28281837B300A81123 /* play_button_event_example.riv */; };
F8772B202AD94A4500AB5920 /* artboard_animations.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D42644447500E7DBB2 /* artboard_animations.riv */; };
F8772B212AD94A4500AB5920 /* basketball.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88CF2644447500E7DBB2 /* basketball.riv */; };
F8772B222AD94A4500AB5920 /* off_road_car_blog.riv in Resources */ = {isa = PBXBuildFile; fileRef = 042C88D72644447500E7DBB2 /* off_road_car_blog.riv */; };
F8772B232AD94A4500AB5920 /* teststatemachine.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3C074AA283FC75900E8EB33 /* teststatemachine.riv */; };
F8772B242AD94A4500AB5920 /* bullet_man_game.riv in Resources */ = {isa = PBXBuildFile; fileRef = C3E2B5872833ECB500A8651B /* bullet_man_game.riv */; };
F8772B252AD94AF900AB5920 /* Example__macOS_App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E51C352A151A1E0075E473 /* Example__macOS_App.swift */; };
F8772B262AD94AF900AB5920 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E51C372A151A1E0075E473 /* ContentView.swift */; };
F8772B272AD94AF900AB5920 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 04E51C392A151A1F0075E473 /* Assets.xcassets */; };
F8DA7B452AF523A800FF3CBF /* DismissableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8DA7B442AF523A800FF3CBF /* DismissableView.swift */; };
F8DA7B462AF523A800FF3CBF /* DismissableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8DA7B442AF523A800FF3CBF /* DismissableView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -335,6 +210,7 @@
04026DC727CE3EE6002B3DBF /* SwiftLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftLayout.swift; sourceTree = "<group>"; };
04026DC927CE3EF6002B3DBF /* SwiftMultipleAnimations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMultipleAnimations.swift; sourceTree = "<group>"; };
04026DCD27CE3F0F002B3DBF /* SwiftStateMachine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftStateMachine.swift; sourceTree = "<group>"; };
041265212B0BC5A5009400EC /* SwiftSimpleAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftSimpleAssets.swift; sourceTree = "<group>"; };
042C88822643D6B900E7DBB2 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
042C88872643DB7100E7DBB2 /* SimpleAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleAnimation.swift; sourceTree = "<group>"; };
042C888B2643EEE300E7DBB2 /* Layout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Layout.swift; sourceTree = "<group>"; };
@@ -358,8 +234,14 @@
042C88D82644447500E7DBB2 /* skills.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = skills.riv; sourceTree = "<group>"; };
042C88D92644447500E7DBB2 /* clipping.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = clipping.riv; sourceTree = "<group>"; };
042C88DA2644447500E7DBB2 /* vader.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = vader.riv; sourceTree = "<group>"; };
043025E92AF9046700320F2E /* asset_load_check.riv */ = {isa = PBXFileReference; lastKnownFileType = file; name = asset_load_check.riv; path = ../../../runtime_wasm/wasm/examples/out_of_band_example/asset_load_check.riv; sourceTree = "<group>"; };
043025EE2AF905B100320F2E /* CachedAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CachedAssets.swift; sourceTree = "<group>"; };
043026052B012C5000320F2E /* simple_assets.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = simple_assets.riv; sourceTree = "<group>"; };
0448838C29F82DD000D7523E /* SimpleHttpAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleHttpAnimation.swift; sourceTree = "<group>"; };
0450445E26B3F71E007B25CA /* constrained.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = constrained.riv; sourceTree = "<group>"; };
0453FCB02B012D17001185C8 /* picture-47982.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "picture-47982.jpeg"; sourceTree = "<group>"; };
0453FCB82B012DA9001185C8 /* SimpleOutOfBand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleOutOfBand.swift; sourceTree = "<group>"; };
0453FCBC2B014E2F001185C8 /* Inter-45562.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Inter-45562.ttf"; sourceTree = "<group>"; };
046AFA6E2673AF04004ED497 /* blendmodes.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = blendmodes.riv; sourceTree = "<group>"; };
046AFA722673B00B004ED497 /* BlendModes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlendModes.swift; sourceTree = "<group>"; };
048002882729AA4400F7132B /* clean_icon_set.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = clean_icon_set.riv; sourceTree = "<group>"; };
@@ -422,11 +304,7 @@
E5A7874B27E1158E0056F24B /* prop_example.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = prop_example.riv; sourceTree = "<group>"; };
E5CD7D7027DC331900BFE5E2 /* SwiftMeshAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMeshAnimation.swift; sourceTree = "<group>"; };
E5E87A002AE5A83700E7295F /* SwiftVariableFPS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftVariableFPS.swift; sourceTree = "<group>"; };
F8772A712AD945FC00AB5920 /* Preview.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Preview.app; sourceTree = BUILT_PRODUCTS_DIR; };
F8772A812AD945FE00AB5920 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F8772ADF2AD94A0500AB5920 /* Preview (macOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Preview (macOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
F8772AE82AD94A0800AB5920 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
F8772AEA2AD94A0800AB5920 /* Preview__macOS_.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Preview__macOS_.entitlements; sourceTree = "<group>"; };
F8DA7B442AF523A800FF3CBF /* DismissableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DismissableView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -446,22 +324,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F8772A6E2AD945FC00AB5920 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8772ADA2AD9483800AB5920 /* RiveRuntime in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F8772ADC2AD94A0500AB5920 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8772AEF2AD94A3900AB5920 /* RiveRuntime in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -476,6 +338,8 @@
046AFA722673B00B004ED497 /* BlendModes.swift */,
04C4C83D2646FE410047E614 /* StateMachine.swift */,
83C89ACA29886ECB00044C17 /* StressTest.swift */,
043025EE2AF905B100320F2E /* CachedAssets.swift */,
0453FCB82B012DA9001185C8 /* SimpleOutOfBand.swift */,
);
path = Storyboard;
sourceTree = "<group>";
@@ -542,6 +406,9 @@
C9696B0E24FC6FD10041502A /* Assets */ = {
isa = PBXGroup;
children = (
043026052B012C5000320F2E /* simple_assets.riv */,
0453FCB02B012D17001185C8 /* picture-47982.jpeg */,
043025E92AF9046700320F2E /* asset_load_check.riv */,
83DE4CB42AB3974300B88B72 /* Bear.riv */,
83C89AD0298870A700044C17 /* paper.riv */,
83C89ACE2988709400044C17 /* marty.riv */,
@@ -561,6 +428,7 @@
C3D187F628075B6C008B739A /* riveslider.riv */,
C324DB5E280740FB0060589F /* rbutton.riv */,
0450445E26B3F71E007B25CA /* constrained.riv */,
0453FCBC2B014E2F001185C8 /* Inter-45562.ttf */,
04D5B069266A460C004ACA5B /* nothing.riv */,
042C88D42644447500E7DBB2 /* artboard_animations.riv */,
042C88CF2644447500E7DBB2 /* basketball.riv */,
@@ -611,6 +479,7 @@
C3C074ED28414F4600E8EB33 /* SwiftTestParityAnimSM.swift */,
E57798A82A730A9B00FF25C3 /* SwiftTestText.swift */,
E5964AAA2A9CD49200140479 /* SwiftEvents.swift */,
041265212B0BC5A5009400EC /* SwiftSimpleAssets.swift */,
);
path = SwiftUI;
sourceTree = "<group>";
@@ -621,8 +490,6 @@
C9696B0E24FC6FD10041502A /* Assets */,
C9C73E9624FC471E00EF9516 /* Source */,
04E51C342A151A1E0075E473 /* Example (macOS) */,
F8772A722AD945FC00AB5920 /* Preview */,
F8772AE02AD94A0500AB5920 /* Preview (macOS) */,
C9C73E9524FC471E00EF9516 /* Products */,
C9C741FF24FC53CF00EF9516 /* Frameworks */,
);
@@ -633,8 +500,6 @@
children = (
C9C73E9424FC471E00EF9516 /* Example (iOS).app */,
04E51C332A151A1E0075E473 /* Example (macOS).app */,
F8772A712AD945FC00AB5920 /* Preview.app */,
F8772ADF2AD94A0500AB5920 /* Preview (macOS).app */,
);
name = Products;
sourceTree = "<group>";
@@ -644,6 +509,7 @@
children = (
042C88822643D6B900E7DBB2 /* Main.storyboard */,
C3357CA0280F42EC00F03B6F /* ExamplesMaster.swift */,
F8DA7B442AF523A800FF3CBF /* DismissableView.swift */,
C3ECAC322818608B00A81123 /* Examples */,
C9C73E9D24FC471E00EF9516 /* Assets.xcassets */,
C9C73E9F24FC471E00EF9516 /* Preview Content */,
@@ -671,31 +537,6 @@
name = Frameworks;
sourceTree = "<group>";
};
F8772A722AD945FC00AB5920 /* Preview */ = {
isa = PBXGroup;
children = (
F8772A812AD945FE00AB5920 /* Info.plist */,
);
path = Preview;
sourceTree = "<group>";
};
F8772AE02AD94A0500AB5920 /* Preview (macOS) */ = {
isa = PBXGroup;
children = (
F8772AEA2AD94A0800AB5920 /* Preview__macOS_.entitlements */,
F8772AE72AD94A0800AB5920 /* Preview Content */,
);
path = "Preview (macOS)";
sourceTree = "<group>";
};
F8772AE72AD94A0800AB5920 /* Preview Content */ = {
isa = PBXGroup;
children = (
F8772AE82AD94A0800AB5920 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -735,46 +576,6 @@
productReference = C9C73E9424FC471E00EF9516 /* Example (iOS).app */;
productType = "com.apple.product-type.application";
};
F8772A702AD945FC00AB5920 /* Preview */ = {
isa = PBXNativeTarget;
buildConfigurationList = F8772A862AD945FE00AB5920 /* Build configuration list for PBXNativeTarget "Preview" */;
buildPhases = (
F8772A6D2AD945FC00AB5920 /* Sources */,
F8772A6E2AD945FC00AB5920 /* Frameworks */,
F8772A6F2AD945FC00AB5920 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Preview;
packageProductDependencies = (
F8772AD92AD9483800AB5920 /* RiveRuntime */,
);
productName = Preview;
productReference = F8772A712AD945FC00AB5920 /* Preview.app */;
productType = "com.apple.product-type.application";
};
F8772ADE2AD94A0500AB5920 /* Preview (macOS) */ = {
isa = PBXNativeTarget;
buildConfigurationList = F8772AEB2AD94A0800AB5920 /* Build configuration list for PBXNativeTarget "Preview (macOS)" */;
buildPhases = (
F8772ADB2AD94A0500AB5920 /* Sources */,
F8772ADC2AD94A0500AB5920 /* Frameworks */,
F8772ADD2AD94A0500AB5920 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Preview (macOS)";
packageProductDependencies = (
F8772AEE2AD94A3900AB5920 /* RiveRuntime */,
);
productName = "Preview (macOS)";
productReference = F8772ADF2AD94A0500AB5920 /* Preview (macOS).app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -791,12 +592,6 @@
C9C73E9324FC471E00EF9516 = {
CreatedOnToolsVersion = 11.6;
};
F8772A702AD945FC00AB5920 = {
CreatedOnToolsVersion = 15.0;
};
F8772ADE2AD94A0500AB5920 = {
CreatedOnToolsVersion = 15.0;
};
};
};
buildConfigurationList = C9C73E8F24FC471E00EF9516 /* Build configuration list for PBXProject "RiveExample" */;
@@ -823,8 +618,6 @@
targets = (
C9C73E9324FC471E00EF9516 /* Example (iOS) */,
04E51C322A151A1E0075E473 /* Example (macOS) */,
F8772A702AD945FC00AB5920 /* Preview */,
F8772ADE2AD94A0500AB5920 /* Preview (macOS) */,
);
};
/* End PBXProject section */
@@ -861,6 +654,7 @@
04E51C4C2A151C230075E473 /* play_button_event_example.riv in Resources */,
04E51C4D2A151C230075E473 /* switch_event_example.riv in Resources */,
04E51C4E2A151C230075E473 /* magic_8-ball_v2.riv in Resources */,
043026072B012C5000320F2E /* simple_assets.riv in Resources */,
04E51C4F2A151C230075E473 /* light_switch.riv in Resources */,
04E51C502A151C230075E473 /* riveslider.riv in Resources */,
04E51C512A151C230075E473 /* rbutton.riv in Resources */,
@@ -874,6 +668,7 @@
04E51C582A151C230075E473 /* explorer.riv in Resources */,
04E51C592A151C230075E473 /* f22.riv in Resources */,
04E51C5A2A151C230075E473 /* flux_capacitor.riv in Resources */,
043025EB2AF9046700320F2E /* asset_load_check.riv in Resources */,
04E51C5B2A151C230075E473 /* juice_v7.riv in Resources */,
04E51C5C2A151C230075E473 /* life_bar.riv in Resources */,
E5964AB22A9CDB2100140479 /* rating_animation.riv in Resources */,
@@ -893,6 +688,7 @@
04E51C682A151C230075E473 /* skills.riv in Resources */,
04E51C692A151C230075E473 /* switch.riv in Resources */,
04E51C6A2A151C230075E473 /* trailblaze.riv in Resources */,
0453FCB52B012D17001185C8 /* picture-47982.jpeg in Resources */,
04E51C6B2A151C230075E473 /* ui_swipe_left_to_delete.riv in Resources */,
04E51C6C2A151C230075E473 /* vader.riv in Resources */,
04E51C6D2A151C230075E473 /* wacky.riv in Resources */,
@@ -917,6 +713,7 @@
C9BD3926263B5FC700696C37 /* truck_v7.riv in Resources */,
042C88DC2644447500E7DBB2 /* pull.riv in Resources */,
042C88E32644447500E7DBB2 /* flux_capacitor.riv in Resources */,
043025EA2AF9046700320F2E /* asset_load_check.riv in Resources */,
E57798A02A72C77900FF25C3 /* testtext.riv in Resources */,
C9CE8266263B90E000F98DDB /* juice_v7.riv in Resources */,
C3ECAC2B281837B300A81123 /* play_button_event_example.riv in Resources */,
@@ -925,6 +722,7 @@
042C88E02644447500E7DBB2 /* progress.riv in Resources */,
C3ECAC252817BE1100A81123 /* magic_8-ball_v2.riv in Resources */,
04D5B06C266A460C004ACA5B /* nothing.riv in Resources */,
0453FCBF2B014E2F001185C8 /* Inter-45562.ttf in Resources */,
042C88E92644447500E7DBB2 /* off_road_car_blog.riv in Resources */,
042C88832643D6B900E7DBB2 /* Main.storyboard in Resources */,
042C88EA2644447500E7DBB2 /* skills.riv in Resources */,
@@ -945,6 +743,7 @@
C3C074F2284161E400E8EB33 /* halloween.riv in Resources */,
C3C074AB283FC75900E8EB33 /* testanimation.riv in Resources */,
C3D187F9280770EA008B739A /* truck.riv in Resources */,
043026062B012C5000320F2E /* simple_assets.riv in Resources */,
C9C73EA124FC471E00EF9516 /* Preview Assets.xcassets in Resources */,
C3E2B58A2833ECB500A8651B /* bullet_man_game.riv in Resources */,
042C88DD2644447500E7DBB2 /* ui_swipe_left_to_delete.riv in Resources */,
@@ -953,6 +752,7 @@
046AFA712673AF04004ED497 /* blendmodes.riv in Resources */,
042C88EC2644447500E7DBB2 /* vader.riv in Resources */,
E5964AB12A9CDB2100140479 /* rating_animation.riv in Resources */,
0453FCB42B012D17001185C8 /* picture-47982.jpeg in Resources */,
83C89AD1298870A700044C17 /* paper.riv in Resources */,
C9C73E9E24FC471E00EF9516 /* Assets.xcassets in Resources */,
0450446126B3F71E007B25CA /* constrained.riv in Resources */,
@@ -966,125 +766,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F8772A6F2AD945FC00AB5920 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F8772AB82AD9470700AB5920 /* rbutton.riv in Resources */,
F8772AAD2AD9470700AB5920 /* testanimation.riv in Resources */,
F8772AB02AD9470700AB5920 /* prop_example.riv in Resources */,
F8772AA22AD9470700AB5920 /* flux_capacitor.riv in Resources */,
F8772A9D2AD9470700AB5920 /* f22.riv in Resources */,
F8772AAB2AD9470700AB5920 /* bullet_man_game.riv in Resources */,
F8772A942AD9470700AB5920 /* nothing.riv in Resources */,
F8772A972AD9470700AB5920 /* artboard_animations.riv in Resources */,
F8772A8C2AD9470700AB5920 /* wacky.riv in Resources */,
F8772A8F2AD9470700AB5920 /* leg_day_events_example.riv in Resources */,
F8772AA02AD9470700AB5920 /* explorer.riv in Resources */,
F8772AAC2AD9470700AB5920 /* marty.riv in Resources */,
F8772A902AD9470700AB5920 /* testtext.riv in Resources */,
F8772A912AD9470700AB5920 /* truck_v7.riv in Resources */,
F8772A8E2AD9470700AB5920 /* switch.riv in Resources */,
F8772A992AD9470700AB5920 /* watch_v1.riv in Resources */,
F8772ABA2AD9470700AB5920 /* skills.riv in Resources */,
F8772AB42AD9470700AB5920 /* halloween.riv in Resources */,
F8772A922AD9470700AB5920 /* rating_animation.riv in Resources */,
F8772A962AD9470700AB5920 /* progress.riv in Resources */,
F8772ABB2AD9470700AB5920 /* pull.riv in Resources */,
F8772AA12AD9470700AB5920 /* basketball.riv in Resources */,
F8772AD52AD9472400AB5920 /* Preview Assets.xcassets in Resources */,
F8772AD42AD9472100AB5920 /* Assets.xcassets in Resources */,
F8772A8A2AD9470700AB5920 /* blendmodes.riv in Resources */,
F8772A9F2AD9470700AB5920 /* teststatemachine.riv in Resources */,
F8772A982AD9470700AB5920 /* constrained.riv in Resources */,
F8772AA42AD9470700AB5920 /* loopy.riv in Resources */,
F8772AAE2AD9470700AB5920 /* switch_event_example.riv in Resources */,
F8772AB92AD9470700AB5920 /* mascot.riv in Resources */,
F8772AA62AD9470700AB5920 /* clipping.riv in Resources */,
F8772AA32AD9470700AB5920 /* paper.riv in Resources */,
F8772A932AD9470700AB5920 /* energy_bar_example.riv in Resources */,
F8772AB72AD9470700AB5920 /* neostream.riv in Resources */,
F8772A8B2AD9470700AB5920 /* light_switch.riv in Resources */,
F8772A882AD946FD00AB5920 /* Main.storyboard in Resources */,
F8772AB12AD9470700AB5920 /* trailblaze.riv in Resources */,
F8772A8D2AD9470700AB5920 /* clean_icon_set.riv in Resources */,
F8772AAF2AD9470700AB5920 /* magic_8-ball_v2.riv in Resources */,
F8772AB52AD9470700AB5920 /* text_test_2.riv in Resources */,
F8772A9C2AD9470700AB5920 /* ui_swipe_left_to_delete.riv in Resources */,
F8772A952AD9470700AB5920 /* life_bar.riv in Resources */,
F8772AB22AD9470700AB5920 /* riveslider.riv in Resources */,
F8772AA92AD9470700AB5920 /* Bear.riv in Resources */,
F8772A9B2AD9470700AB5920 /* two_bone_ik.riv in Resources */,
F8772AAA2AD9470700AB5920 /* hero_editor.riv in Resources */,
F8772AA52AD9470700AB5920 /* rope.riv in Resources */,
F8772AA82AD9470700AB5920 /* juice_v7.riv in Resources */,
F8772AB32AD9470700AB5920 /* vader.riv in Resources */,
F8772AA72AD9470700AB5920 /* truck.riv in Resources */,
F8772A9A2AD9470700AB5920 /* off_road_car_blog.riv in Resources */,
F8772A9E2AD9470700AB5920 /* play_button_event_example.riv in Resources */,
F8772AB62AD9470700AB5920 /* liquid.riv in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F8772ADD2AD94A0500AB5920 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F8772B172AD94A4500AB5920 /* rbutton.riv in Resources */,
F8772B092AD94A4500AB5920 /* rating_animation.riv in Resources */,
F8772B0C2AD94A4500AB5920 /* Bear.riv in Resources */,
F8772B082AD94A4500AB5920 /* f22.riv in Resources */,
F8772B002AD94A4500AB5920 /* progress.riv in Resources */,
F8772B152AD94A4500AB5920 /* mascot.riv in Resources */,
F8772B272AD94AF900AB5920 /* Assets.xcassets in Resources */,
F8772B1D2AD94A4500AB5920 /* flux_capacitor.riv in Resources */,
F8772B202AD94A4500AB5920 /* artboard_animations.riv in Resources */,
F8772B142AD94A4500AB5920 /* pull.riv in Resources */,
F8772B072AD94A4500AB5920 /* riveslider.riv in Resources */,
F8772B242AD94A4500AB5920 /* bullet_man_game.riv in Resources */,
F8772B162AD94A4500AB5920 /* switch_event_example.riv in Resources */,
F8772B1F2AD94A4500AB5920 /* play_button_event_example.riv in Resources */,
F8772AF82AD94A4500AB5920 /* testtext.riv in Resources */,
F8772B182AD94A4500AB5920 /* neostream.riv in Resources */,
F8772B212AD94A4500AB5920 /* basketball.riv in Resources */,
F8772AFB2AD94A4500AB5920 /* nothing.riv in Resources */,
F8772B0F2AD94A4500AB5920 /* liquid.riv in Resources */,
F8772B192AD94A4500AB5920 /* watch_v1.riv in Resources */,
F8772B0B2AD94A4500AB5920 /* explorer.riv in Resources */,
F8772B0E2AD94A4500AB5920 /* blendmodes.riv in Resources */,
F8772B0A2AD94A4500AB5920 /* vader.riv in Resources */,
F8772B042AD94A4500AB5920 /* text_test_2.riv in Resources */,
F8772AFA2AD94A4500AB5920 /* juice_v7.riv in Resources */,
F8772B1E2AD94A4500AB5920 /* two_bone_ik.riv in Resources */,
F8772B1C2AD94A4500AB5920 /* switch.riv in Resources */,
F8772B232AD94A4500AB5920 /* teststatemachine.riv in Resources */,
F8772B032AD94A4500AB5920 /* skills.riv in Resources */,
F8772AF92AD94A4500AB5920 /* testanimation.riv in Resources */,
F8772AFF2AD94A4500AB5920 /* hero_editor.riv in Resources */,
F8772B222AD94A4500AB5920 /* off_road_car_blog.riv in Resources */,
F8772B112AD94A4500AB5920 /* clean_icon_set.riv in Resources */,
F8772B0D2AD94A4500AB5920 /* halloween.riv in Resources */,
F8772AE92AD94A0800AB5920 /* Preview Assets.xcassets in Resources */,
F8772AF52AD94A4500AB5920 /* marty.riv in Resources */,
F8772B062AD94A4500AB5920 /* paper.riv in Resources */,
F8772B052AD94A4500AB5920 /* leg_day_events_example.riv in Resources */,
F8772AF32AD94A4500AB5920 /* light_switch.riv in Resources */,
F8772AF62AD94A4500AB5920 /* ui_swipe_left_to_delete.riv in Resources */,
F8772B022AD94A4500AB5920 /* truck_v7.riv in Resources */,
F8772B1A2AD94A4500AB5920 /* magic_8-ball_v2.riv in Resources */,
F8772B012AD94A4500AB5920 /* constrained.riv in Resources */,
F8772B132AD94A4500AB5920 /* truck.riv in Resources */,
F8772AF72AD94A4500AB5920 /* trailblaze.riv in Resources */,
F8772AFD2AD94A4500AB5920 /* clipping.riv in Resources */,
F8772AFE2AD94A4500AB5920 /* life_bar.riv in Resources */,
F8772B102AD94A4500AB5920 /* rope.riv in Resources */,
F8772AF42AD94A4500AB5920 /* prop_example.riv in Resources */,
F8772B1B2AD94A4500AB5920 /* loopy.riv in Resources */,
F8772B122AD94A4500AB5920 /* energy_bar_example.riv in Resources */,
F8772AFC2AD94A4500AB5920 /* wacky.riv in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -1095,6 +776,8 @@
04E51C382A151A1E0075E473 /* ContentView.swift in Sources */,
E5964AAC2A9CD49200140479 /* SwiftEvents.swift in Sources */,
04E51C362A151A1E0075E473 /* Example__macOS_App.swift in Sources */,
0453FCBA2B012DA9001185C8 /* SimpleOutOfBand.swift in Sources */,
F8DA7B462AF523A800FF3CBF /* DismissableView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1110,8 +793,10 @@
042C888E2644230700E7DBB2 /* utility.swift in Sources */,
C3D187F3280751A8008B739A /* RiveProgressBar.swift in Sources */,
E5CD7D7127DC331900BFE5E2 /* SwiftMeshAnimation.swift in Sources */,
043025EF2AF905B100320F2E /* CachedAssets.swift in Sources */,
042C88902644250D00E7DBB2 /* MultipleAnimations.swift in Sources */,
C3468E6227FDCBC6008652FD /* SimpleSlider.swift in Sources */,
041265222B0BC5A5009400EC /* SwiftSimpleAssets.swift in Sources */,
C3C074EE28414F4600E8EB33 /* SwiftTestParityAnimSM.swift in Sources */,
83C89ACB29886ECB00044C17 /* StressTest.swift in Sources */,
E5E87A012AE5A83800E7295F /* SwiftVariableFPS.swift in Sources */,
@@ -1129,53 +814,10 @@
04026DCA27CE3EF6002B3DBF /* SwiftMultipleAnimations.swift in Sources */,
042C88882643DB7100E7DBB2 /* SimpleAnimation.swift in Sources */,
04026DC427CE3ED6002B3DBF /* SwiftSimpleAnimation.swift in Sources */,
0453FCB92B012DA9001185C8 /* SimpleOutOfBand.swift in Sources */,
E57798A92A730A9B00FF25C3 /* SwiftTestText.swift in Sources */,
04026DCE27CE3F0F002B3DBF /* SwiftStateMachine.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F8772A6D2AD945FC00AB5920 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E5E87A022AE5A85E00E7295F /* SwiftVariableFPS.swift in Sources */,
F8772ACD2AD9471E00AB5920 /* SwiftMeshAnimation.swift in Sources */,
F8772AC22AD9471B00AB5920 /* BlendModes.swift in Sources */,
F8772AD72AD9472F00AB5920 /* SceneDelegate.swift in Sources */,
F8772ABE2AD9471800AB5920 /* RiveProgressBar.swift in Sources */,
F8772AC62AD9471B00AB5920 /* MultipleAnimations.swift in Sources */,
F8772A872AD946D500AB5920 /* AppDelegate.swift in Sources */,
F8772ACB2AD9471E00AB5920 /* SwiftLayout.swift in Sources */,
F8772AD62AD9472800AB5920 /* utility.swift in Sources */,
F8772AC82AD9471B00AB5920 /* Layout.swift in Sources */,
F8772ABD2AD9471800AB5920 /* RiveSwitch.swift in Sources */,
F8772AC52AD9471B00AB5920 /* SimpleHttpAnimation.swift in Sources */,
F8772AC02AD9471800AB5920 /* RiveSlider.swift in Sources */,
F8772ACE2AD9471E00AB5920 /* SwiftCannonGame.swift in Sources */,
F8772AC12AD9471B00AB5920 /* StateMachine.swift in Sources */,
F8772AC32AD9471B00AB5920 /* SimpleSlider.swift in Sources */,
F8772AC72AD9471B00AB5920 /* StressTest.swift in Sources */,
F8772ACF2AD9471E00AB5920 /* SwiftStateMachine.swift in Sources */,
F8772ACA2AD9471E00AB5920 /* SwiftWidgets.swift in Sources */,
F8772AD22AD9471E00AB5920 /* SwiftEvents.swift in Sources */,
F8772A892AD9470000AB5920 /* ExamplesMaster.swift in Sources */,
F8772AD32AD9471E00AB5920 /* SwiftSimpleAnimation.swift in Sources */,
F8772AC92AD9471E00AB5920 /* SwiftTestText.swift in Sources */,
F8772ACC2AD9471E00AB5920 /* SwiftMultipleAnimations.swift in Sources */,
F8772ABC2AD9471800AB5920 /* RiveButton.swift in Sources */,
F8772AC42AD9471B00AB5920 /* SimpleAnimation.swift in Sources */,
F8772AD12AD9471E00AB5920 /* SwiftTestParityAnimSM.swift in Sources */,
F8772AD02AD9471E00AB5920 /* SwiftTouchEvents.swift in Sources */,
F8772ABF2AD9471800AB5920 /* ClockViewModel.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F8772ADB2AD94A0500AB5920 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F8772B262AD94AF900AB5920 /* ContentView.swift in Sources */,
F8772B252AD94AF900AB5920 /* Example__macOS_App.swift in Sources */,
F8DA7B452AF523A800FF3CBF /* DismissableView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1400,138 +1042,6 @@
};
name = Release;
};
F8772A822AD945FE00AB5920 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Preview/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = app.rive.Preview;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
F8772A832AD945FE00AB5920 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Preview/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = app.rive.Preview;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
F8772AEC2AD94A0800AB5920 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_ENTITLEMENTS = "Preview (macOS)/Preview__macOS_.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Preview (macOS)/Preview Content\"";
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Rive. All rights reserved.";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.1;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "app.rive.Preview--macOS-";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
F8772AED2AD94A0800AB5920 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_ENTITLEMENTS = "Preview (macOS)/Preview__macOS_.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Preview (macOS)/Preview Content\"";
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Rive. All rights reserved.";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.1;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "app.rive.Preview--macOS-";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -1562,24 +1072,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F8772A862AD945FE00AB5920 /* Build configuration list for PBXNativeTarget "Preview" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F8772A822AD945FE00AB5920 /* Debug */,
F8772A832AD945FE00AB5920 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F8772AEB2AD94A0800AB5920 /* Build configuration list for PBXNativeTarget "Preview (macOS)" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F8772AEC2AD94A0800AB5920 /* Debug */,
F8772AED2AD94A0800AB5920 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
@@ -1592,19 +1084,6 @@
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
F8772AD92AD9483800AB5920 /* RiveRuntime */ = {
isa = XCSwiftPackageProductDependency;
package = F8772AD82AD9483800AB5920 /* XCRemoteSwiftPackageReference "rive-ios" */;
productName = RiveRuntime;
};
F8772AEE2AD94A3900AB5920 /* RiveRuntime */ = {
isa = XCSwiftPackageProductDependency;
package = F8772AD82AD9483800AB5920 /* XCRemoteSwiftPackageReference "rive-ios" */;
productName = RiveRuntime;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = C9C73E8C24FC471E00EF9516 /* Project object */;
}

View File

@@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/rive-app/rive-ios/",
"state" : {
"revision" : "9030b8c2c2bd52c22114850c3666a4eef2a2acd8",
"version" : "5.3.2"
"revision" : "5e4e9b42d732e7fc3254848939338b4c192b19c6",
"version" : "5.6.0"
}
}
],

View File

@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8772A702AD945FC00AB5920"
BuildableName = "Preview.app"
BlueprintName = "Preview"
ReferencedContainer = "container:RiveExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8772A702AD945FC00AB5920"
BuildableName = "Preview.app"
BlueprintName = "Preview"
ReferencedContainer = "container:RiveExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8772A702AD945FC00AB5920"
BuildableName = "Preview.app"
BlueprintName = "Preview"
ReferencedContainer = "container:RiveExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8772ADE2AD94A0500AB5920"
BuildableName = "Preview (macOS).app"
BlueprintName = "Preview (macOS)"
ReferencedContainer = "container:RiveExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8772ADE2AD94A0500AB5920"
BuildableName = "Preview (macOS).app"
BlueprintName = "Preview (macOS)"
ReferencedContainer = "container:RiveExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8772ADE2AD94A0500AB5920"
BuildableName = "Preview (macOS).app"
BlueprintName = "Preview (macOS)"
ReferencedContainer = "container:RiveExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,14 @@
//
// DismissableView.swift
// RiveExample
//
// Created by Peter G Hayes on 03/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
import SwiftUI
public protocol DismissableView: View {
init()
var dismiss: () -> Void { get set }
}

View File

@@ -0,0 +1,226 @@
//
// File.swift
// RiveExample
//
// Created by Maxwell Talbot on 06/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
import UIKit
import RiveRuntime
import SwiftUI
class AssetLoader{
init() {
factory = RenderContextManager.shared()!.getDefaultFactory();
fillFontCache();
fillImageCache();
}
var imageCache: [RiveRenderImage] = [];
var fontCache: [RiveFont] = [];
var onDemandFont: RiveFontAsset?;
var onDemandImage: RiveImageAsset?;
var cachedFont: RiveFontAsset?;
var cachedImage: RiveImageAsset?;
var factory: RiveFactory?;
// pretty naive way to clean up any outstanding requests.
var tasks: [URLSessionDataTask] = [];
func fillFontCache(){
let options = [
"https://cdn.rive.app/runtime/flutter/IndieFlower-Regular.ttf",
"https://cdn.rive.app/runtime/flutter/comic-neue.ttf",
"https://cdn.rive.app/runtime/flutter/inter.ttf",
"https://cdn.rive.app/runtime/flutter/inter-tight.ttf",
"https://cdn.rive.app/runtime/flutter/josefin-sans.ttf",
"https://cdn.rive.app/runtime/flutter/send-flowers.ttf",
]
var first = true;
for option in options {
let url = URL(string: option)!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
if let data = data {
self.fontCache.append(self.factory!.decodeFont(data));
}
if (first){
first=false;
if let fontAsset = self.cachedFont, let font=self.fontCache.randomElement() {
fontAsset.font(font);
}
}
}
task.resume()
tasks.append(task)
}
}
func fillImageCache(){
var i = 0;
var first = true;
repeat {
let url = URL(string: "https://picsum.photos/2048/1365")!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
if let data = data {
self.imageCache.append(self.factory!.decodeImage(data));
}
if (first){
first=false;
if let imageAsset = self.cachedImage, let image=self.imageCache.randomElement() {
imageAsset.renderImage(image);
}
}
}
task.resume()
tasks.append(task)
i += 1;
} while (i < 10)
}
func cachedFontAsset(asset: RiveFontAsset) {
if let font = fontCache.randomElement() {
asset.font(font);
}
}
func cachedImageAsset(asset: RiveImageAsset) {
if let image = imageCache.randomElement() {
asset.renderImage(image);
}
}
func randomFontAsset(asset: RiveFontAsset, factory: RiveFactory){
let options = [
"https://cdn.rive.app/runtime/flutter/IndieFlower-Regular.ttf",
"https://cdn.rive.app/runtime/flutter/comic-neue.ttf",
"https://cdn.rive.app/runtime/flutter/inter.ttf",
"https://cdn.rive.app/runtime/flutter/inter-tight.ttf",
"https://cdn.rive.app/runtime/flutter/josefin-sans.ttf",
"https://cdn.rive.app/runtime/flutter/send-flowers.ttf",
]
let url = URL(string: options.randomElement()!)!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
if let data = data {
asset.font(factory.decodeFont(data));
} else if let error = error {
if (error.localizedDescription != "cancelled"){
print("HTTP Request Failed \(error)")
}
}
}
task.resume()
tasks.append(task)
}
func randomImageAsset(asset: RiveImageAsset, factory: RiveFactory){
let url = URL(string: "https://picsum.photos/1000/1500")!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
if let data = data {
asset.renderImage(factory.decodeImage(data));
} else if let error = error {
// there doesnt seem to be much else to go on here
if (error.localizedDescription != "cancelled"){
print("HTTP Request Failed \(error)")
}
}
}
task.resume()
tasks.append(task)
}
func loader (asset: RiveFileAsset, data: Data, factory: RiveFactory) -> Bool{
if (data.count > 0) {return false;}
if (asset.cdnUuid().count > 0) {return false;}
switch (asset.name()) {
case "flower.jpeg",
"three.png":
onDemandImage = (asset as! RiveImageAsset);
randomImageAsset(asset: onDemandImage!, factory: factory);
return true;
case "tree.jpg":
cachedImage = (asset as! RiveImageAsset);
cachedImageAsset(asset: cachedImage!);
return true;
case "Kenia",
"Inter":
onDemandFont = (asset as! RiveFontAsset);
randomFontAsset(asset: (asset as! RiveFontAsset), factory: factory);
return true;
case "Kodchasan":
cachedFont = (asset as! RiveFontAsset);
cachedFontAsset(asset: cachedFont!);
return true;
default: break
}
return false;
}
func shuffle(){
if let asset=onDemandImage, let factory=factory{
randomImageAsset(asset: (asset), factory: factory);
}
if let asset=onDemandFont, let factory=factory{
randomFontAsset(asset: (asset), factory: factory);
}
if let asset=cachedFont, let font=fontCache.randomElement(){
asset.font(font)
}
if let asset=cachedImage, let image=imageCache.randomElement(){
asset.renderImage(image)
}
}
func cleanup(){
for task in tasks {
task.cancel();
}
}
}
class OutOfBandAssetsController: UIViewController, UIGestureRecognizerDelegate {
// TODO: talk to people to see if we can make this nice...
var loader: AssetLoader = AssetLoader();
var viewModel: RiveViewModel?;
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
loader.cleanup()
}
required init?(coder: NSCoder) {
self.viewModel = RiveViewModel(fileName: "asset_load_check", loadCdn: true, customLoader: loader.loader);
super.init(coder: coder);
}
override func viewWillAppear(_ animated: Bool) {
let riveView = viewModel!.createRiveView()
view.addSubview(riveView)
riveView.frame = view.frame
let gesture = UITapGestureRecognizer(target: self, action: #selector (self.tap (_:)))
self.view.addGestureRecognizer(gesture)
riveView.addGestureRecognizer(gesture)
}
@objc func tap(_ sender:UITapGestureRecognizer) {
loader.shuffle()
}
}

View File

@@ -0,0 +1,62 @@
//
// File.swift
// RiveExample
//
// Created by Maxwell Talbot on 06/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
import UIKit
import RiveRuntime
import SwiftUI
func loadAndSetRenderImage(named resourceName: String, asset: RiveImageAsset, factory: RiveFactory) -> Bool {
guard let url = Bundle.main.url(forResource: resourceName, withExtension: "jpeg"),
let data = try? Data(contentsOf: url)
else {
fatalError("Failed to load or locate '\(resourceName)' in bundle.")
}
asset.renderImage(factory.decodeImage(data))
return true
}
func loadAndSetRenderFont(named resourceName: String, asset: RiveFontAsset, factory: RiveFactory) -> Bool {
guard let url = Bundle.main.url(forResource: resourceName, withExtension: "ttf"),
let data = try? Data(contentsOf: url)
else {
fatalError("Failed to load or locate '\(resourceName)' in bundle.")
}
asset.font(factory.decodeFont(data))
return true
}
class SimpleOutOfBandController: UIViewController, UIGestureRecognizerDelegate {
// TODO: talk to people to see if we can make this nice...
var loader: AssetLoader = AssetLoader();
var viewModel: RiveViewModel?;
required init?(coder: NSCoder) {
self.viewModel = RiveViewModel(fileName: "simple_assets", loadCdn: false, customLoader: { (asset: RiveFileAsset, data: Data, factory: RiveFactory) -> Bool in
if let imageAsset = asset as? RiveImageAsset {
return loadAndSetRenderImage(named: "picture-47982", asset: imageAsset, factory: factory)
} else if let fontAsset = asset as? RiveFontAsset {
return loadAndSetRenderFont(named: "Inter-45562", asset: fontAsset, factory: factory)
}
return false;
}
)
super.init(coder: coder);
}
override func viewWillAppear(_ animated: Bool) {
let riveView = viewModel!.createRiveView()
view.addSubview(riveView)
riveView.frame = view.frame
}
}

View File

@@ -10,6 +10,7 @@
import SwiftUI
import RiveRuntime
struct SwiftSimpleAnimation: DismissableView {
var dismiss: () -> Void = {}

View File

@@ -0,0 +1,48 @@
//
// SwiftSimpleAssets.swift
// Example (iOS)
//
// Created by Maxwell Talbot on 20/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
import SwiftUI
import RiveRuntime
struct SwiftSimpleAssets: DismissableView {
var dismiss: () -> Void = {}
var body: some View {
RiveViewModel(fileName: "simple_assets", autoPlay: false, loadCdn: false, customLoader: { (asset: RiveFileAsset, data: Data, factory: RiveFactory) -> Bool in
// TODO: this looks kinda compolex, can this be simpler?
if (asset is RiveImageAsset){
guard let url = (.main as Bundle).url(forResource: "picture-47982", withExtension: "jpeg") else {
fatalError("Failed to locate 'picture-47982' in bundle.")
}
guard let data = try? Data(contentsOf: url) else {
fatalError("Failed to load \(url) from bundle.")
}
(asset as! RiveImageAsset).renderImage(
factory.decodeImage(data)
)
return true;
}else if (asset is RiveFontAsset) {
guard let url = (.main as Bundle).url(forResource: "Inter-45562", withExtension: "ttf") else {
fatalError("Failed to locate 'Inter-45562' in bundle.")
}
guard let data = try? Data(contentsOf: url) else {
fatalError("Failed to load \(url) from bundle.")
}
(asset as! RiveFontAsset).font(
factory.decodeFont(data)
)
return true;
}
return false;
}).view()
}
}

View File

@@ -21,7 +21,9 @@ class ExamplesMasterTableViewController: UITableViewController {
"State Machine",
"Blend Mode",
"Slider Widget",
"Stress Test"
"Stress Test",
"Simple assets",
"Cached assets",
]
@@ -39,7 +41,8 @@ class ExamplesMasterTableViewController: UITableViewController {
("Mesh Animation", typeErased(dismissableView: SwiftMeshAnimation())),
("Playing with Text", typeErased(dismissableView: TextInputView())),
("Rive Events", typeErased(dismissableView: SwiftEvents())),
("Variable FPS", typeErased(dismissableView: SwiftVariableFPS()))
("Variable FPS", typeErased(dismissableView: SwiftVariableFPS())),
("Simple Assets", typeErased(dismissableView: SwiftSimpleAssets()))
]
@@ -150,8 +153,3 @@ extension ExamplesMasterTableViewController {
return AnyView(view)
}
}
public protocol DismissableView: View {
init()
var dismiss: () -> Void { get set }
}

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="0Wt-ue-AAA">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="0Wt-ue-AAA">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -12,7 +12,7 @@
<!--Rive Examples-->
<scene sceneID="XV1-T1-lAJ">
<objects>
<tableViewController title="Rive Examples" id="oFD-NX-sZZ" customClass="ExamplesMasterTableViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<tableViewController title="Rive Examples" id="oFD-NX-sZZ" customClass="ExamplesMasterTableViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" id="WCh-4c-dF3">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -56,7 +56,7 @@
<!--Simple Slider View Controller-->
<scene sceneID="Pvx-pO-5XB">
<objects>
<viewController storyboardIdentifier="Slider Widget" id="nXP-c2-Cpg" customClass="SimpleSliderViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="Slider Widget" id="nXP-c2-Cpg" customClass="SimpleSliderViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="2zm-EC-beS">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -87,8 +87,8 @@
<!--Layout-->
<scene sceneID="f8y-qg-uzH">
<objects>
<viewController storyboardIdentifier="Layout" id="6EP-ej-U9V" customClass="LayoutViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="ogd-2a-ycI" customClass="LayoutView" customModule="RiveExample" customModuleProvider="target">
<viewController storyboardIdentifier="Layout" id="6EP-ej-U9V" customClass="LayoutViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="ogd-2a-ycI" customClass="LayoutView" customModule="Example__iOS_" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -281,7 +281,7 @@
<!--Blend Modes-->
<scene sceneID="JXR-CF-wxg">
<objects>
<viewController storyboardIdentifier="Blend Mode" id="6Y6-o9-aZy" customClass="BlendModeViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="Blend Mode" id="6Y6-o9-aZy" customClass="BlendModeViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="nG9-ag-3SU">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -297,8 +297,8 @@
<!--Loop Mode-->
<scene sceneID="iqU-00-Krb">
<objects>
<viewController storyboardIdentifier="Loop Mode" id="fGr-bk-Efd" customClass="LoopModeController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="PUC-Yj-uP6" customClass="LoopMode" customModule="RiveExample" customModuleProvider="target">
<viewController storyboardIdentifier="Loop Mode" id="fGr-bk-Efd" customClass="LoopModeController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="PUC-Yj-uP6" customClass="LoopMode" customModule="Example__iOS_" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -525,8 +525,8 @@
<!--State Machine-->
<scene sceneID="sMa-mk-G4H">
<objects>
<viewController storyboardIdentifier="State Machine" id="tat-Jb-Aap" customClass="StateMachineViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="EmG-VF-nMb" customClass="StateMachineView" customModule="RiveExample" customModuleProvider="target">
<viewController storyboardIdentifier="State Machine" id="tat-Jb-Aap" customClass="StateMachineViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="EmG-VF-nMb" customClass="StateMachineView" customModule="Example__iOS_" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -608,8 +608,8 @@
<!--iOS Player-->
<scene sceneID="8FV-8I-h1w">
<objects>
<viewController storyboardIdentifier="iOS Player" id="bLr-Sd-R4P" customClass="IOSPlayerViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="atc-Qh-uPc" customClass="IOSPlayerView" customModule="RiveExample" customModuleProvider="target">
<viewController storyboardIdentifier="iOS Player" id="bLr-Sd-R4P" customClass="IOSPlayerViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="atc-Qh-uPc" customClass="IOSPlayerView" customModule="Example__iOS_" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -691,8 +691,8 @@
<!--Multiple Animations-->
<scene sceneID="RWJ-v9-IHm">
<objects>
<viewController storyboardIdentifier="MultipleAnimations" id="qQy-Yc-tGr" customClass="MultipleAnimationsController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Vnx-gq-hge" customClass="MultipleAnimations" customModule="RiveExample" customModuleProvider="target">
<viewController storyboardIdentifier="MultipleAnimations" id="qQy-Yc-tGr" customClass="MultipleAnimationsController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Vnx-gq-hge" customClass="MultipleAnimations" customModule="Example__iOS_" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
@@ -852,7 +852,7 @@
<!--Simple Animation Example-->
<scene sceneID="b8F-wH-PQu">
<objects>
<viewController storyboardIdentifier="Simple Animation" title="Simple Animation Example" id="l4C-BT-Wpi" customClass="SimpleAnimationViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="Simple Animation" title="Simple Animation Example" id="l4C-BT-Wpi" customClass="SimpleAnimationViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="dF4-O8-Npa">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -868,7 +868,7 @@
<!--Simple Animation Example-->
<scene sceneID="tSg-C0-hLK">
<objects>
<viewController storyboardIdentifier="Simple Http Animation" title="Simple Animation Example" id="HT9-8q-8Wg" customClass="SimpleHttpAnimationViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="Simple Http Animation" title="Simple Animation Example" id="HT9-8q-8Wg" customClass="SimpleHttpAnimationViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="uQJ-eq-uHM">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -884,7 +884,7 @@
<!--Stress Test Example-->
<scene sceneID="BJl-SY-XuL">
<objects>
<viewController storyboardIdentifier="Stress Test" title="Stress Test Example" id="z8m-Vh-cMa" customClass="StressTestViewController" customModule="RiveExample" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="Stress Test" title="Stress Test Example" id="z8m-Vh-cMa" customClass="StressTestViewController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="DfU-QA-wiO">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -897,6 +897,38 @@
</objects>
<point key="canvasLocation" x="2377" y="-358"/>
</scene>
<!--Cached assets-->
<scene sceneID="7fT-Qc-hZc">
<objects>
<viewController storyboardIdentifier="Cached assets" title="Cached assets" id="UdV-cw-Cjf" customClass="OutOfBandAssetsController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="dBR-Pg-mqy">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="r98-qH-17d"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" title="Out of band assets" id="FXG-7Q-GwZ"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="lfy-7H-VVG" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="5997" y="353"/>
</scene>
<!--Simple Assets-->
<scene sceneID="KqE-fe-7te">
<objects>
<viewController storyboardIdentifier="Simple assets" title="Simple Assets" id="FcT-yV-UCr" customClass="SimpleOutOfBandController" customModule="Example__iOS_" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Pws-Ro-Yr0">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="wa2-jX-NxB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" title="Out of band assets" id="G2T-ot-OmF"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ITF-JM-jGj" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="5303" y="353"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">

View File

@@ -23,9 +23,9 @@ func getBytes(resourceName: String, resourceExt: String=".riv") -> [UInt8] {
}
@available(*, deprecated, message: "Use convenience init in RiveFile+Extensions instead")
func getRiveFile(resourceName: String, resourceExt: String=".riv") throws -> RiveFile{
func getRiveFile(resourceName: String, resourceExt: String=".riv", loadCdn: Bool=true) throws -> RiveFile{
let byteArray = getBytes(resourceName: resourceName, resourceExt: resourceExt)
return try RiveFile(byteArray: byteArray)
return try RiveFile(byteArray: byteArray, loadCdn:loadCdn)
}
struct SwiftVMPlayer: View {

View File

@@ -3,10 +3,23 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
041265262B0CB41E009400EC /* OutOfBandAssetTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 041265252B0CB41E009400EC /* OutOfBandAssetTest.mm */; };
041265282B0CC387009400EC /* hosted_assets.riv in Resources */ = {isa = PBXBuildFile; fileRef = 041265272B0CC387009400EC /* hosted_assets.riv */; };
0412652A2B0CCB8E009400EC /* embedded_assets.riv in Resources */ = {isa = PBXBuildFile; fileRef = 041265292B0CCB8E009400EC /* embedded_assets.riv */; };
043025F22AF90D4800320F2E /* RiveFileAssetLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 043025F12AF90D4800320F2E /* RiveFileAssetLoader.h */; settings = {ATTRIBUTES = (Public, ); }; };
043025F42AF90EAC00320F2E /* RiveFileAssetLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 043025F32AF90EAC00320F2E /* RiveFileAssetLoader.mm */; };
043025F62AF9355B00320F2E /* CDNFileAssetLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 043025F52AF9355B00320F2E /* CDNFileAssetLoader.h */; settings = {ATTRIBUTES = (Public, ); }; };
043025F82AFA46EF00320F2E /* CDNFileAssetLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 043025F72AFA46EF00320F2E /* CDNFileAssetLoader.mm */; };
043025FA2AFA860E00320F2E /* FileAssetLoaderAdapter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 043025F92AFA860E00320F2E /* FileAssetLoaderAdapter.hpp */; };
043025FC2AFA862E00320F2E /* FileAssetLoaderAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 043025FB2AFA862E00320F2E /* FileAssetLoaderAdapter.mm */; };
043025FE2AFA8FCF00320F2E /* RiveFileAsset.h in Headers */ = {isa = PBXBuildFile; fileRef = 043025FD2AFA8FCF00320F2E /* RiveFileAsset.h */; settings = {ATTRIBUTES = (Public, ); }; };
043026002AFA915B00320F2E /* RiveFileAsset.mm in Sources */ = {isa = PBXBuildFile; fileRef = 043025FF2AFA915B00320F2E /* RiveFileAsset.mm */; };
043026022AFB9FCD00320F2E /* RiveFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 043026012AFB9FCD00320F2E /* RiveFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
043026042AFBA04100320F2E /* RiveFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = 043026032AFBA04100320F2E /* RiveFactory.mm */; };
046FB7F1264EAA60000129B1 /* RiveLinearAnimationInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 046FB7E1264EAA5E000129B1 /* RiveLinearAnimationInstance.h */; settings = {ATTRIBUTES = (Public, ); }; };
046FB7F2264EAA60000129B1 /* RiveArtboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = 046FB7E2264EAA5E000129B1 /* RiveArtboard.mm */; };
046FB7F4264EAA60000129B1 /* RiveLinearAnimationInstance.mm in Sources */ = {isa = PBXBuildFile; fileRef = 046FB7E4264EAA5F000129B1 /* RiveLinearAnimationInstance.mm */; };
@@ -50,7 +63,7 @@
83DE4C932AA8DD9F00B88B72 /* RenderContextManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE4C922AA8DD9F00B88B72 /* RenderContextManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
83DE4CA02AAA072B00B88B72 /* PlatformCGImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83DE4C9F2AAA072B00B88B72 /* PlatformCGImage.mm */; };
83DE4CA22AAA077200B88B72 /* PlatformCGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE4CA12AAA077200B88B72 /* PlatformCGImage.h */; };
83DE4CA72AAAE72100B88B72 /* RenderContext.hh in Headers */ = {isa = PBXBuildFile; fileRef = 83DE4CA62AAAE72000B88B72 /* RenderContext.hh */; };
83DE4CA72AAAE72100B88B72 /* RenderContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE4CA62AAAE72000B88B72 /* RenderContext.h */; };
C34609FC27FF9114002DBCB7 /* RiveFile+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34609FB27FF9114002DBCB7 /* RiveFile+Extensions.swift */; };
C3468E5827EB9887008652FD /* RiveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3468E5727EB9887008652FD /* RiveView.swift */; };
C3468E5A27ECC7C6008652FD /* RiveViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3468E5927ECC7C6008652FD /* RiveViewModel.swift */; };
@@ -85,6 +98,19 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
041265252B0CB41E009400EC /* OutOfBandAssetTest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = OutOfBandAssetTest.mm; sourceTree = "<group>"; };
041265272B0CC387009400EC /* hosted_assets.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = hosted_assets.riv; sourceTree = "<group>"; };
041265292B0CCB8E009400EC /* embedded_assets.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = embedded_assets.riv; sourceTree = "<group>"; };
043025F12AF90D4800320F2E /* RiveFileAssetLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RiveFileAssetLoader.h; sourceTree = "<group>"; };
043025F32AF90EAC00320F2E /* RiveFileAssetLoader.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveFileAssetLoader.mm; sourceTree = "<group>"; };
043025F52AF9355B00320F2E /* CDNFileAssetLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDNFileAssetLoader.h; sourceTree = "<group>"; };
043025F72AFA46EF00320F2E /* CDNFileAssetLoader.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CDNFileAssetLoader.mm; sourceTree = "<group>"; };
043025F92AFA860E00320F2E /* FileAssetLoaderAdapter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FileAssetLoaderAdapter.hpp; sourceTree = "<group>"; };
043025FB2AFA862E00320F2E /* FileAssetLoaderAdapter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FileAssetLoaderAdapter.mm; sourceTree = "<group>"; };
043025FD2AFA8FCF00320F2E /* RiveFileAsset.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RiveFileAsset.h; sourceTree = "<group>"; };
043025FF2AFA915B00320F2E /* RiveFileAsset.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveFileAsset.mm; sourceTree = "<group>"; };
043026012AFB9FCD00320F2E /* RiveFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RiveFactory.h; sourceTree = "<group>"; };
043026032AFBA04100320F2E /* RiveFactory.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveFactory.mm; sourceTree = "<group>"; };
046FB7E1264EAA5E000129B1 /* RiveLinearAnimationInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RiveLinearAnimationInstance.h; sourceTree = "<group>"; };
046FB7E2264EAA5E000129B1 /* RiveArtboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveArtboard.mm; sourceTree = "<group>"; };
046FB7E4264EAA5F000129B1 /* RiveLinearAnimationInstance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveLinearAnimationInstance.mm; sourceTree = "<group>"; };
@@ -129,7 +155,7 @@
83DE4C922AA8DD9F00B88B72 /* RenderContextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderContextManager.h; sourceTree = "<group>"; };
83DE4C9F2AAA072B00B88B72 /* PlatformCGImage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCGImage.mm; sourceTree = "<group>"; };
83DE4CA12AAA077200B88B72 /* PlatformCGImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCGImage.h; sourceTree = "<group>"; };
83DE4CA62AAAE72000B88B72 /* RenderContext.hh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RenderContext.hh; sourceTree = "<group>"; };
83DE4CA62AAAE72000B88B72 /* RenderContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderContext.h; sourceTree = "<group>"; };
C34609FB27FF9114002DBCB7 /* RiveFile+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RiveFile+Extensions.swift"; sourceTree = "<group>"; };
C3468E5727EB9887008652FD /* RiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RiveView.swift; sourceTree = "<group>"; };
C3468E5927ECC7C6008652FD /* RiveViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RiveViewModel.swift; sourceTree = "<group>"; };
@@ -190,9 +216,14 @@
04BE542F264D1F4100427B39 /* LayerState.h */,
04BE5435264D2A7500427B39 /* RivePrivateHeaders.h */,
E57798A12A72C81F00FF25C3 /* RiveTextValueRun.h */,
83DE4CA62AAAE72000B88B72 /* RenderContext.hh */,
83DE4CA62AAAE72000B88B72 /* RenderContext.h */,
83DE4C922AA8DD9F00B88B72 /* RenderContextManager.h */,
E5964A952A965A9300140479 /* RiveEvent.h */,
043025F12AF90D4800320F2E /* RiveFileAssetLoader.h */,
043025F52AF9355B00320F2E /* CDNFileAssetLoader.h */,
043025F92AFA860E00320F2E /* FileAssetLoaderAdapter.hpp */,
043025FD2AFA8FCF00320F2E /* RiveFileAsset.h */,
043026012AFB9FCD00320F2E /* RiveFactory.h */,
);
path = include;
sourceTree = "<group>";
@@ -200,6 +231,8 @@
04BE53F726493FE600427B39 /* Assets */ = {
isa = PBXGroup;
children = (
041265272B0CC387009400EC /* hosted_assets.riv */,
041265292B0CCB8E009400EC /* embedded_assets.riv */,
C38BB5F3287629C20039E385 /* defaultstatemachine.riv */,
04BE5419264A823000427B39 /* animationconfigurations.riv */,
04BE53FC2649403600427B39 /* flux_capacitor.riv */,
@@ -249,6 +282,11 @@
04BE5431264D243D00427B39 /* LayerState.mm */,
83DE4C902AA8DD7B00B88B72 /* RenderContextManager.mm */,
E5964A972A9697B600140479 /* RiveEvent.mm */,
043025F32AF90EAC00320F2E /* RiveFileAssetLoader.mm */,
043025F72AFA46EF00320F2E /* CDNFileAssetLoader.mm */,
043025FB2AFA862E00320F2E /* FileAssetLoaderAdapter.mm */,
043025FF2AFA915B00320F2E /* RiveFileAsset.mm */,
043026032AFBA04100320F2E /* RiveFactory.mm */,
);
path = Renderer;
sourceTree = "<group>";
@@ -302,6 +340,7 @@
04BE5426264C02AA00427B39 /* StateMachineInstanceTest.mm */,
04BE542C264C1A3300427B39 /* RiveDelegatesTest.swift */,
C38BB5F528762B720039E385 /* RiveStateMachineTest.swift */,
041265252B0CB41E009400EC /* OutOfBandAssetTest.mm */,
);
path = Tests;
sourceTree = "<group>";
@@ -326,15 +365,20 @@
83DE4CA22AAA077200B88B72 /* PlatformCGImage.h in Headers */,
83DE4C932AA8DD9F00B88B72 /* RenderContextManager.h in Headers */,
046FB800264EAA61000129B1 /* RiveStateMachineInstance.h in Headers */,
043025FA2AFA860E00320F2E /* FileAssetLoaderAdapter.hpp in Headers */,
046FB7FB264EAA61000129B1 /* RiveSMIInput.h in Headers */,
E57798A72A72EEAD00FF25C3 /* RiveTextValueRun.h in Headers */,
046FB7F1264EAA60000129B1 /* RiveLinearAnimationInstance.h in Headers */,
043025F62AF9355B00320F2E /* CDNFileAssetLoader.h in Headers */,
04BE5430264D1F4100427B39 /* LayerState.h in Headers */,
043025F22AF90D4800320F2E /* RiveFileAssetLoader.h in Headers */,
043025FE2AFA8FCF00320F2E /* RiveFileAsset.h in Headers */,
E5964A962A965A9300140479 /* RiveEvent.h in Headers */,
043026022AFB9FCD00320F2E /* RiveFactory.h in Headers */,
C9C741F424FC510200EF9516 /* Rive.h in Headers */,
04BE5436264D2A7500427B39 /* RivePrivateHeaders.h in Headers */,
C9C73EE224FC478900EF9516 /* RiveRuntime.h in Headers */,
83DE4CA72AAAE72100B88B72 /* RenderContext.hh in Headers */,
83DE4CA72AAAE72100B88B72 /* RenderContext.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -435,7 +479,9 @@
C38BB5F4287629C20039E385 /* defaultstatemachine.riv in Resources */,
04BE54082649403600427B39 /* flux_capacitor.riv in Resources */,
04BE54052649403600427B39 /* noartboard.riv in Resources */,
0412652A2B0CCB8E009400EC /* embedded_assets.riv in Resources */,
04BE540B2649403600427B39 /* multiple_animations.riv in Resources */,
041265282B0CC387009400EC /* hosted_assets.riv in Resources */,
E57798AB2A7310B700FF25C3 /* testtext.riv in Resources */,
04ED72F3299C115100E8DE53 /* empty_animation_state.riv in Resources */,
E599DCFA2AAFA06100D1E49A /* rating_animation.riv in Resources */,
@@ -461,11 +507,16 @@
C34609FC27FF9114002DBCB7 /* RiveFile+Extensions.swift in Sources */,
C3468E5827EB9887008652FD /* RiveView.swift in Sources */,
E5964A982A9697B600140479 /* RiveEvent.mm in Sources */,
043025F82AFA46EF00320F2E /* CDNFileAssetLoader.mm in Sources */,
043026042AFBA04100320F2E /* RiveFactory.mm in Sources */,
04BE5434264D267900427B39 /* LayerState.mm in Sources */,
C9601F2B250C25930032AA07 /* RiveRenderer.mm in Sources */,
043025F42AF90EAC00320F2E /* RiveFileAssetLoader.mm in Sources */,
043025FC2AFA862E00320F2E /* FileAssetLoaderAdapter.mm in Sources */,
83DE4C912AA8DD7B00B88B72 /* RenderContextManager.mm in Sources */,
C3E2B580282F242400A8651B /* RiveStateMachineInstance+Extensions.swift in Sources */,
046FB7F5264EAA60000129B1 /* RiveSMIInput.mm in Sources */,
043026002AFA915B00320F2E /* RiveFileAsset.mm in Sources */,
C3468E5A27ECC7C6008652FD /* RiveViewModel.swift in Sources */,
C3745FD3282BFAB90087F4AF /* FPSCounterView.swift in Sources */,
C9C741F524FC510200EF9516 /* Rive.mm in Sources */,
@@ -484,6 +535,7 @@
files = (
04BE5420264ACFC200427B39 /* RiveStateMachineLoadTest.mm in Sources */,
04BE541E264AC7A600427B39 /* RiveArtboardLoadTest.mm in Sources */,
041265262B0CB41E009400EC /* OutOfBandAssetTest.mm in Sources */,
04BE542D264C1A3300427B39 /* RiveDelegatesTest.swift in Sources */,
04BE5422264AD97C00427B39 /* RiveStateMachineConfigurationTest.mm in Sources */,
04ED72F1299C114000E8DE53 /* RiveViewModelTest.swift in Sources */,
@@ -705,6 +757,7 @@
);
"OTHER_LDFLAGS[sdk=macosx*]" = (
"-lskia_macos",
"-lrive_macos",
"-lrive_harfbuzz_macos",
"-lrive_sheenbidi_macos",
"-lrive_skia_renderer_macos",

View File

@@ -0,0 +1,108 @@
//
// CDNFileAssetLoader.m
// RiveRuntime
//
// Created by Maxwell Talbot on 07/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#import <RiveFileAsset.h>
#import <RiveFactory.h>
#import <CDNFileAssetLoader.h>
@implementation CDNFileAssetLoader
{}
- (bool)loadContentsWithAsset:(RiveFileAsset*)asset
andData:(NSData*)data
andFactory:(RiveFactory*)factory
{
// TODO: Error handling
// TODO: Track tasks, so we can cancel them if we garbage collect the asset loader
if ([[asset cdnUuid] length] > 0)
{
NSURL* URL = [NSURL
URLWithString:[NSString
stringWithFormat:@"%@/%@", [asset cdnBaseUrl], [asset cdnUuid]]];
NSURLSessionTask* task = [[NSURLSession sharedSession]
downloadTaskWithURL:URL
completionHandler:^(NSURL* location, NSURLResponse* response, NSError* error) {
if (!error)
{
// Load the data into the reader
NSData* data = [NSData dataWithContentsOfURL:location];
if ([asset isKindOfClass:[RiveFontAsset class]])
{
[(RiveFontAsset*)asset font:[factory decodeFont:data]];
}
else if ([asset isKindOfClass:[RiveImageAsset class]])
{
[(RiveImageAsset*)asset renderImage:[factory decodeImage:data]];
}
}
}];
// Kick off the http download
// QUESTION: Do we need to tie this into the RiveFile so we can wait for these loads to be
// completed?
[task resume];
return true;
}
return false;
}
@end
@implementation FallbackFileAssetLoader
{
NSMutableArray* loaders;
}
- (instancetype)init
{
self = [super init];
loaders = [NSMutableArray array];
return self;
}
- (void)addLoader:(RiveFileAssetLoader*)loader
{
[loaders addObject:loader];
}
- (bool)loadContentsWithAsset:(RiveFileAsset*)asset
andData:(NSData*)data
andFactory:(RiveFactory*)factory
{
for (RiveFileAssetLoader* loader in loaders)
{
if ([loader loadContentsWithAsset:asset andData:data andFactory:factory])
{
return true;
}
}
return false;
}
@end
@implementation CustomFileAssetLoader
- (instancetype)initWithLoader:(LoadAsset)loader
{
self = [super init];
_loadAsset = loader;
return self;
}
- (bool)loadContentsWithAsset:(RiveFileAsset*)asset
andData:(NSData*)data
andFactory:(RiveFactory*)factory
{
return _loadAsset(asset, data, factory);
}
@end

View File

@@ -0,0 +1,42 @@
//
// FileAssetLoaderAdapter.m
// RiveRuntime
//
// Created by Maxwell Talbot on 07/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#import <FileAssetLoaderAdapter.hpp>
#import <RiveFileAssetLoader.h>
#import <RiveFileAsset.h>
#import <RiveFactory.h>
NS_ASSUME_NONNULL_BEGIN
rive::FileAssetLoaderAdapter::FileAssetLoaderAdapter(RiveFileAssetLoader* myLoader)
{
loader = myLoader;
}
bool rive::FileAssetLoaderAdapter::loadContents(rive::FileAsset& asset,
rive::Span<const uint8_t> bytes,
rive::Factory* factory)
{
NSData* data = [NSData dataWithBytes:bytes.data() length:bytes.size()];
RiveFactory* myFactory = [[RiveFactory alloc] initWithFactory:factory];
if (asset.is<rive::FontAsset>())
{
RiveFontAsset* fontAsset =
[[RiveFontAsset alloc] initWithFileAsset:asset.as<rive::FontAsset>()];
return [loader loadContentsWithAsset:fontAsset andData:data andFactory:myFactory];
}
else if (asset.is<rive::ImageAsset>())
{
RiveImageAsset* imageAsset =
[[RiveImageAsset alloc] initWithFileAsset:asset.as<rive::ImageAsset>()];
return [loader loadContentsWithAsset:imageAsset andData:data andFactory:myFactory];
}
return false;
}
NS_ASSUME_NONNULL_END

View File

@@ -48,7 +48,7 @@ do
}
end
filter {'system:ios', 'options:variant=simulator'}
filter {'system:ios', 'options:variant=emulator'}
do
targetdir 'iphonesimulator_%{cfg.buildcfg}'
objdir 'obj/iphonesimulator_%{cfg.buildcfg}'
@@ -69,7 +69,7 @@ newoption {
description = 'Choose a particular variant to build',
allowed = {
{'system', 'Builds the static library for the provided system'},
{'simulator', 'Builds for an emulator/simulator for the provided system'}
{'emulator', 'Builds for an emulator/simulator for the provided system'}
},
default = 'system'
}

View File

@@ -3,7 +3,7 @@
*/
#import <RenderContextManager.h>
#import <RenderContext.hh>
#import <RenderContext.h>
#import <PlatformCGImage.h>
@@ -26,6 +26,10 @@
@end
// skia throws out a bunch of documentation warnings for us
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#include "include/core/SkCanvas.h"
#include "include/core/SkSurface.h"
#include "include/core/SkSurfaceProps.h"
@@ -34,9 +38,14 @@
#include "include/gpu/mtl/GrMtlBackendContext.h"
#include "skia_renderer.hpp"
#include "skia_factory.hpp"
#pragma clang diagnostic pop
#include "cg_factory.hpp"
#include "cg_renderer.hpp"
#include "Rive.h"
#include "RivePrivateHeaders.h"
@interface SkiaContext : RenderContext
- (rive::Factory*)factory;
- (rive::Renderer*)beginFrame:(MTKView*)view;
@@ -414,6 +423,8 @@ constexpr static int kBufferRingSize = 3;
__weak CGRendererContext* _cgContextWeakPtr;
}
bool _riveRendererSupportWarningDisplayed = false;
// The context manager is a singleton.
+ (RenderContextManager*)shared
{
@@ -439,8 +450,13 @@ constexpr static int kBufferRingSize = 3;
return [self getSkiaContext];
case RendererType::riveRenderer:
#if TARGET_OS_SIMULATOR
NSLog(@"warning: Rive Renderer is not supported by the simulator. Falling back on Skia "
@"within the simulator.");
if (_riveRendererSupportWarningDisplayed == false)
{
NSLog(@"warning: Rive Renderer is not supported by the simulator. Falling back on "
@"Skia "
@"within the simulator.");
_riveRendererSupportWarningDisplayed = true;
}
return [self getSkiaContext];
#else
return [self getRiveRendererContext];
@@ -500,4 +516,24 @@ constexpr static int kBufferRingSize = 3;
return strongPtr;
}
- (RiveFactory*)getDefaultFactory
{
return [[RiveFactory alloc] initWithFactory:[[self getDefaultContext] factory]];
}
- (RiveFactory*)getRiveRendererFactory
{
return [[RiveFactory alloc] initWithFactory:[[self getRiveRendererContext] factory]];
}
- (RiveFactory*)getSkiaFactory
{
return [[RiveFactory alloc] initWithFactory:[[self getSkiaContext] factory]];
}
- (RiveFactory*)getCGFactory
{
return [[RiveFactory alloc] initWithFactory:[[self getCGRendererContext] factory]];
}
@end

View File

@@ -0,0 +1,95 @@
//
// RiveFactory.m
// RiveRuntime
//
// Created by Maxwell Talbot on 08/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#import <Rive.h>
#import <RivePrivateHeaders.h>
#import <RiveFactory.h>
@implementation RiveFont
{
rive::rcp<rive::Font> instance; // note: we do NOT own this, so don't delete it
}
- (instancetype)initWithFont:(rive::rcp<rive::Font>)font
{
if (self = [super init])
{
instance = font;
return self;
}
else
{
return nil;
}
}
- (rive::rcp<rive::Font>)instance
{
return instance;
}
@end
@implementation RiveRenderImage
{
rive::rcp<rive::RenderImage> instance; // note: we do NOT own this, so don't delete it
}
- (instancetype)initWithImage:(rive::rcp<rive::RenderImage>)image
{
if (self = [super init])
{
instance = image;
return self;
}
else
{
return nil;
}
}
- (rive::rcp<rive::RenderImage>)instance
{
return instance;
}
@end
/*
* RiveFactory
*/
@implementation RiveFactory
{
rive::Factory* instance; // note: we do NOT own this, so don't delete it
}
// Creates a new RiveFactory from a cpp RiveFactory
- (instancetype)initWithFactory:(rive::Factory*)factory
{
if (self = [super init])
{
instance = factory;
return self;
}
else
{
return nil;
}
}
- (RiveRenderImage*)decodeImage:(nonnull NSData*)data
{
UInt8* bytes = (UInt8*)[data bytes];
return [[RiveRenderImage alloc]
initWithImage:instance->decodeImage(rive::Span<const uint8_t>(bytes, [data length]))];
}
- (RiveFont*)decodeFont:(nonnull NSData*)data
{
UInt8* bytes = (UInt8*)[data bytes];
return [[RiveFont alloc]
initWithFont:instance->decodeFont(rive::Span<const uint8_t>(bytes, [data length]))];
}
@end

View File

@@ -8,8 +8,12 @@
#import <Rive.h>
#import <RivePrivateHeaders.h>
#import <RenderContext.hh>
#import <RenderContext.h>
#import <RenderContextManager.h>
#import <RiveFileAssetLoader.h>
#import <CDNFileAssetLoader.h>
#import <FileAssetLoaderAdapter.hpp>
/*
* RiveFile
@@ -17,6 +21,7 @@
@implementation RiveFile
{
std::unique_ptr<rive::File> riveFile;
rive::FileAssetLoader* fileAssetLoader;
}
+ (uint)majorVersion
@@ -28,7 +33,7 @@
return UInt8(rive::File::minorVersion);
}
- (nullable instancetype)initWithByteArray:(NSArray*)array error:(NSError**)error
- (nullable instancetype)initWithByteArray:(NSArray*)array loadCdn:(bool)cdn error:(NSError**)error
{
if (self = [super init])
{
@@ -40,7 +45,7 @@
[array enumerateObjectsUsingBlock:^(NSNumber* number, NSUInteger index, BOOL* stop) {
bytes[index] = number.unsignedIntValue;
}];
BOOL ok = [self import:bytes byteLength:array.count error:error];
BOOL ok = [self import:bytes byteLength:array.count loadCdn:cdn error:error];
if (!ok)
{
return nil;
@@ -57,13 +62,73 @@
return nil;
}
- (nullable instancetype)initWithByteArray:(NSArray*)array
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error
{
if (self = [super init])
{
UInt8* bytes;
@try
{
bytes = (UInt8*)calloc(array.count, sizeof(UInt64));
[array enumerateObjectsUsingBlock:^(NSNumber* number, NSUInteger index, BOOL* stop) {
bytes[index] = number.unsignedIntValue;
}];
BOOL ok = [self import:bytes
byteLength:array.count
loadCdn:cdn
customAssetLoader:customAssetLoader
error:error];
if (!ok)
{
return nil;
}
self.isLoaded = true;
}
@finally
{
free(bytes);
}
return self;
}
return nil;
}
// QUESTION: deprecate? init with NSData feels like its all we need?
- (nullable instancetype)initWithBytes:(UInt8*)bytes
byteLength:(UInt64)length
loadCdn:(bool)cdn
error:(NSError**)error
{
if (self = [super init])
{
BOOL ok = [self import:bytes byteLength:length error:error];
BOOL ok = [self import:bytes byteLength:length loadCdn:cdn error:error];
if (!ok)
{
return nil;
}
self.isLoaded = true;
return self;
}
return nil;
}
- (nullable instancetype)initWithBytes:(UInt8*)bytes
byteLength:(UInt64)length
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error
{
if (self = [super init])
{
BOOL ok = [self import:bytes
byteLength:length
loadCdn:cdn
customAssetLoader:customAssetLoader
error:error];
if (!ok)
{
return nil;
@@ -74,32 +139,95 @@
return nil;
}
- (nullable instancetype)initWithData:(NSData*)data loadCdn:(bool)cdn error:(NSError**)error
{
UInt8* bytes = (UInt8*)[data bytes];
return [self initWithBytes:bytes byteLength:data.length loadCdn:cdn error:error];
}
- (nullable instancetype)initWithData:(NSData*)data
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error
{
UInt8* bytes = (UInt8*)[data bytes];
return [self initWithBytes:bytes
byteLength:data.length
loadCdn:cdn
customAssetLoader:customAssetLoader
error:error];
}
/*
* Creates a RiveFile from a binary resource
*/
- (nullable instancetype)initWithResource:(NSString*)resourceName
withExtension:(NSString*)extension
loadCdn:(bool)cdn
error:(NSError**)error
{
// QUESTION: good ideas on how we can combine a few of these into following the same path
// better?
// there's a lot of copy pasta here.
NSString* filepath = [[NSBundle mainBundle] pathForResource:resourceName ofType:extension];
NSURL* fileUrl = [NSURL fileURLWithPath:filepath];
NSData* fileData = [NSData dataWithContentsOfURL:fileUrl];
UInt8* bytePtr = (UInt8*)[fileData bytes];
return [self initWithBytes:bytePtr byteLength:fileData.length error:error];
return [self initWithData:fileData loadCdn:cdn error:error];
}
/*
* Creates a RiveFile from a binary resource, and assumes the resource extension is '.riv'
*/
- (nullable instancetype)initWithResource:(NSString*)resourceName error:(NSError**)error
- (nullable instancetype)initWithResource:(NSString*)resourceName
loadCdn:(bool)cdn
error:(NSError**)error
{
return [self initWithResource:resourceName withExtension:@"riv" error:error];
return [self initWithResource:resourceName withExtension:@"riv" loadCdn:cdn error:error];
}
- (nullable instancetype)initWithResource:(nonnull NSString*)resourceName
loadCdn:(bool)cdn
customAssetLoader:(nonnull LoadAsset)customAssetLoader
error:(NSError* __autoreleasing _Nullable* _Nullable)error
{
return [self initWithResource:resourceName
withExtension:@"riv"
loadCdn:cdn
customAssetLoader:customAssetLoader
error:error];
}
- (nullable instancetype)initWithResource:(nonnull NSString*)resourceName
withExtension:(nonnull NSString*)extension
loadCdn:(bool)cdn
customAssetLoader:(nonnull LoadAsset)customAssetLoader
error:(NSError* __autoreleasing _Nullable* _Nullable)error
{
NSString* filepath = [[NSBundle mainBundle] pathForResource:resourceName ofType:extension];
NSURL* fileUrl = [NSURL fileURLWithPath:filepath];
NSData* fileData = [NSData dataWithContentsOfURL:fileUrl];
return [self initWithData:fileData loadCdn:cdn customAssetLoader:customAssetLoader error:error];
}
/*
* Creates a RiveFile from an HTTP url
*/
- (nullable instancetype)initWithHttpUrl:(NSString*)url withDelegate:(id<RiveFileDelegate>)delegate
- (nullable instancetype)initWithHttpUrl:(NSString*)url
loadCdn:(bool)loadCdn
withDelegate:(id<RiveFileDelegate>)delegate
{
return [self initWithHttpUrl:url
loadCdn:loadCdn
customAssetLoader:^bool(RiveFileAsset* asset, NSData* data, RiveFactory* factory) {
return false;
}
withDelegate:delegate];
}
- (nullable instancetype)initWithHttpUrl:(nonnull NSString*)url
loadCdn:(bool)cdn
customAssetLoader:(nonnull LoadAsset)customAssetLoader
withDelegate:(nonnull id<RiveFileDelegate>)delegate
{
self.isLoaded = false;
if (self = [super init])
@@ -107,11 +235,9 @@
self.delegate = delegate;
// Set up the http download task
NSURL* URL = [NSURL URLWithString:url];
// TODO: we are still adding 8MB of memory when we load our first http url.
// note: Could use shared session.
NSURLSession* session = [NSURLSession
sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSessionTask* task = [session
NSURLSessionTask* task = [[NSURLSession sharedSession]
downloadTaskWithURL:URL
completionHandler:^(NSURL* location, NSURLResponse* response, NSError* error) {
if (!error)
@@ -121,7 +247,11 @@
UInt8* bytes = (UInt8*)[data bytes];
// TODO: Do something with this error the proper way with delegates.
NSError* error = nil;
[self import:bytes byteLength:[data length] error:&error];
[self import:bytes
byteLength:[data length]
loadCdn:true
customAssetLoader:customAssetLoader
error:&error];
self.isLoaded = true;
dispatch_async(dispatch_get_main_queue(), ^{
if ([[NSThread currentThread] isMainThread])
@@ -138,22 +268,48 @@
// Kick off the http download
[task resume];
[session finishTasksAndInvalidate];
// Return the as yet uninitialized RiveFile
return self;
}
return nil;
}
- (BOOL)import:(UInt8*)bytes byteLength:(UInt64)length error:(NSError**)error
- (BOOL)import:(UInt8*)bytes byteLength:(UInt64)length loadCdn:(bool)loadCdn error:(NSError**)error
{
return [self import:bytes
byteLength:length
loadCdn:loadCdn
customAssetLoader:^bool(RiveFileAsset* asset, NSData* data, RiveFactory* factory) {
return false;
}
error:error];
}
- (BOOL)import:(UInt8*)bytes
byteLength:(UInt64)length
loadCdn:(bool)loadCdn
customAssetLoader:(LoadAsset)custom
error:(NSError**)error
{
rive::ImportResult result;
RenderContext* renderContext = [[RenderContextManager shared] getDefaultContext];
assert(renderContext);
rive::Factory* factory = [renderContext factory];
auto file = rive::File::import(rive::Span(bytes, length), factory, &result);
FallbackFileAssetLoader* fallbackLoader = [[FallbackFileAssetLoader alloc] init];
CustomFileAssetLoader* customAssetLoader =
[[CustomFileAssetLoader alloc] initWithLoader:custom];
[fallbackLoader addLoader:customAssetLoader];
if (loadCdn)
{
CDNFileAssetLoader* cdnLoader = [[CDNFileAssetLoader alloc] init];
[fallbackLoader addLoader:cdnLoader];
}
fileAssetLoader = new rive::FileAssetLoaderAdapter(fallbackLoader);
auto file = rive::File::import(rive::Span(bytes, length), factory, &result, fileAssetLoader);
if (result == rive::ImportResult::success)
{
riveFile = std::move(file);
@@ -269,6 +425,7 @@
- (void)dealloc
{
riveFile.reset(nullptr);
delete fileAssetLoader;
}
@end

View File

@@ -0,0 +1,91 @@
//
// RiveFileAsset.m
// RiveRuntime
//
// Created by Maxwell Talbot on 07/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#import <Rive.h>
#import <RivePrivateHeaders.h>
#import <RiveFileAsset.h>
@implementation RiveFileAsset
{
const rive::FileAsset* instance;
}
- (const rive::FileAsset*)getInstance
{
return instance;
}
- (instancetype)initWithFileAsset:(const rive::FileAsset*)fileAsset
{
if (self = [super init])
{
instance = (rive::FileAsset* _Nonnull)fileAsset;
return self;
}
else
{
return nil;
}
}
- (nonnull NSString*)cdnBaseUrl
{
std::string str = instance->cdnBaseUrl();
return [NSString stringWithCString:str.c_str() encoding:[NSString defaultCStringEncoding]];
}
- (nonnull NSString*)cdnUuid
{
std::string str = instance->cdnUuidStr();
return [NSString stringWithCString:str.c_str() encoding:[NSString defaultCStringEncoding]];
}
- (nonnull NSString*)fileExtension
{
std::string str = instance->fileExtension();
return [NSString stringWithCString:str.c_str() encoding:[NSString defaultCStringEncoding]];
}
- (nonnull NSString*)name
{
std::string str = instance->name();
return [NSString stringWithCString:str.c_str() encoding:[NSString defaultCStringEncoding]];
}
- (nonnull NSString*)uniqueFilename
{
std::string str = instance->uniqueFilename();
return [NSString stringWithCString:str.c_str() encoding:[NSString defaultCStringEncoding]];
}
@end
@implementation RiveImageAsset
- (instancetype)initWithFileAsset:(const rive::ImageAsset*)fileAsset
{
return [super initWithFileAsset:fileAsset];
}
- (void)renderImage:(RiveRenderImage*)image
{
((rive::ImageAsset*)[self getInstance])->renderImage([image instance]);
}
@end
@implementation RiveFontAsset
- (instancetype)initWithFileAsset:(const rive::FontAsset*)fileAsset
{
return [super initWithFileAsset:fileAsset];
}
- (void)font:(RiveFont*)font
{
((rive::FontAsset*)[self getInstance])->font([font instance]);
}
@end

View File

@@ -0,0 +1,24 @@
//
// CDNFileAssetLoader.m
// RiveRuntime
//
// Created by Maxwell Talbot on 06/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#import <Rive.h>
#import <RivePrivateHeaders.h>
#import <RiveFileAssetLoader.h>
using namespace rive;
@implementation RiveFileAssetLoader
- (BOOL)loadContentsWithAsset:(RiveFileAsset*)asset
andData:(NSData*)data
andFactory:(RiveFactory*)factory
{
return false;
}
@end

View File

@@ -355,7 +355,6 @@ static int smInstanceCount = 0;
- (void)touchBeganAtLocation:(CGPoint)touchLocation
{
instance->pointerDown(rive::Vec2D(touchLocation.x, touchLocation.y));
NSLog(@"SMI: pointerDown at x:%f, y:%f", touchLocation.x, touchLocation.y);
}
- (void)touchMovedAtLocation:(CGPoint)touchLocation

View File

@@ -0,0 +1,32 @@
//
// CDNFileAssetLoader.h
// RiveRuntime
//
// Created by Maxwell Talbot on 06/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#ifndef CDNFileAssetLoader_h
#define CDNFileAssetLoader_h
#import <RiveRuntime/RiveFileAssetLoader.h>
@class RiveFileAssetLoader;
@interface CDNFileAssetLoader : RiveFileAssetLoader
@end
@interface FallbackFileAssetLoader : RiveFileAssetLoader
- (void)addLoader:(RiveFileAssetLoader*)loader;
@end
typedef bool (^LoadAsset)(RiveFileAsset* asset, NSData* data, RiveFactory* factory);
@interface CustomFileAssetLoader : RiveFileAssetLoader
@property(nonatomic, copy) LoadAsset loadAsset;
- (instancetype)initWithLoader:(LoadAsset)loader;
@end
#endif /* CDNFileAssetLoader_h */

View File

@@ -0,0 +1,35 @@
//
// FileAssetLoaderAdapter.hpp
// RiveRuntime
//
// Created by Maxwell Talbot on 07/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#ifndef FileAssetLoaderAdapter_h
#define FileAssetLoaderAdapter_h
#import <Rive.h>
#import <RivePrivateHeaders.h>
@class RiveFileAssetLoader;
namespace rive
{
class FileAssetLoaderAdapter : public FileAssetLoader
{
private:
RiveFileAssetLoader* loader;
public:
FileAssetLoaderAdapter(RiveFileAssetLoader*);
bool loadContents(rive::FileAsset& asset,
rive::Span<const uint8_t> bytes,
rive::Factory* factory) override;
};
} // namespace rive
#endif /* FileAssetLoaderAdapter_h */

View File

@@ -4,6 +4,9 @@
#pragma once
#ifndef render_context_h
#define render_context_h
#import <MetalKit/MetalKit.h>
#import <Metal/Metal.h>
@@ -11,7 +14,9 @@ namespace rive
{
class Factory;
class Renderer;
};
}; // namespace rive
@class MTKView;
/// RenderContext knows how to set up a backend-specific render context (e.g., Skia, CG, Rive, ...),
/// and provides a rive::Factory and rive::Renderer for it.
@@ -24,3 +29,5 @@ class Renderer;
- (rive::Renderer*)beginFrame:(MTKView*)view;
- (void)endFrame;
@end
#endif

View File

@@ -4,11 +4,15 @@
#pragma once
#ifndef render_context_manager_h
#define render_context_manager_h
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, RendererType) { skiaRenderer, riveRenderer, cgRenderer };
@class RenderContext;
@class RiveFactory;
/// The RenderContextManager is used to allow us to share contexts (e.g., Skia, CG, Rive, ...),
/// while there are active view(s). It has weak refs to its render contexts, which means that when
@@ -20,4 +24,11 @@ typedef NS_ENUM(NSInteger, RendererType) { skiaRenderer, riveRenderer, cgRendere
- (RenderContext*)getSkiaContext;
- (RenderContext*)getRiveRendererContext;
- (RenderContext*)getCGRendererContext;
// exposing these directly as RenderContext is not exposed
- (RiveFactory*)getDefaultFactory;
- (RiveFactory*)getSkiaFactory;
- (RiveFactory*)getCGFactory;
- (RiveFactory*)getRiveRendererFactory;
@end
#endif

View File

@@ -21,6 +21,11 @@
#import <RiveRuntime/RiveEvent.h>
#import <RiveRuntime/LayerState.h>
#import <RiveRuntime/RenderContextManager.h>
// TODO: fix our headers so these can become exposed here
#import <RiveRuntime/RiveFactory.h>
#import <RiveRuntime/RiveFileAsset.h>
#import <RiveRuntime/RiveFileAssetLoader.h>
#import <RiveRuntime/CDNFileAssetLoader.h>
NS_ASSUME_NONNULL_BEGIN
@@ -88,6 +93,8 @@ typedef NS_ENUM(NSInteger, RiveErrorCode) {
@end
typedef bool (^LoadAsset)(RiveFileAsset* asset, NSData* data, RiveFactory* factory);
NS_ASSUME_NONNULL_END
#endif /* rive_h */

View File

@@ -0,0 +1,32 @@
//
// RiveFactory.h
// RiveRuntime
//
// Created by Maxwell Talbot on 08/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#ifndef RiveFactory_h
#define RiveFactory_h
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface RiveFont : NSObject
@end
@interface RiveRenderImage : NSObject
@end
/*
* RiveFactory
*/
@interface RiveFactory : NSObject
- (RiveFont*)decodeFont:(NSData*)data;
- (RiveRenderImage*)decodeImage:(NSData*)data;
@end
NS_ASSUME_NONNULL_END
#endif /* RiveFactory_h */

View File

@@ -15,6 +15,9 @@ NS_ASSUME_NONNULL_BEGIN
@class RiveArtboard;
@protocol RiveFileDelegate;
@class RiveFileAsset;
@class RiveFactory;
typedef bool (^LoadAsset)(RiveFileAsset* asset, NSData* data, RiveFactory* factory);
/*
* RiveFile
@@ -30,15 +33,54 @@ NS_ASSUME_NONNULL_BEGIN
/// Delegate for calling when a file has finished loading
@property(weak) id delegate;
- (nullable instancetype)initWithByteArray:(NSArray*)bytes error:(NSError**)error;
/// Used to manage url sessions Rive, this is to enable testing.
- (nullable instancetype)initWithByteArray:(NSArray*)bytes loadCdn:(bool)cdn error:(NSError**)error;
- (nullable instancetype)initWithByteArray:(NSArray*)bytes
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error;
- (nullable instancetype)initWithBytes:(UInt8*)bytes
byteLength:(UInt64)length
loadCdn:(bool)cdn
error:(NSError**)error;
- (nullable instancetype)initWithBytes:(UInt8*)bytes
byteLength:(UInt64)length
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error;
- (nullable instancetype)initWithData:(NSData*)bytes loadCdn:(bool)cdn error:(NSError**)error;
- (nullable instancetype)initWithData:(NSData*)bytes
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error;
- (nullable instancetype)initWithResource:(NSString*)resourceName
withExtension:(NSString*)extension
loadCdn:(bool)cdn
error:(NSError**)error;
- (nullable instancetype)initWithResource:(NSString*)resourceName error:(NSError**)error;
- (nullable instancetype)initWithHttpUrl:(NSString*)url withDelegate:(id<RiveFileDelegate>)delegate;
- (nullable instancetype)initWithResource:(NSString*)resourceName
withExtension:(NSString*)extension
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error;
- (nullable instancetype)initWithResource:(NSString*)resourceName
loadCdn:(bool)cdn
error:(NSError**)error;
- (nullable instancetype)initWithResource:(NSString*)resourceName
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
error:(NSError**)error;
- (nullable instancetype)initWithHttpUrl:(NSString*)url
loadCdn:(bool)cdn
withDelegate:(id<RiveFileDelegate>)delegate;
- (nullable instancetype)initWithHttpUrl:(NSString*)url
loadCdn:(bool)cdn
customAssetLoader:(LoadAsset)customAssetLoader
withDelegate:(id<RiveFileDelegate>)delegate;
/// Returns a reference to the default artboard
- (RiveArtboard* __nullable)artboard:(NSError**)error;

View File

@@ -0,0 +1,47 @@
//
// RiveFileAsset.h
// RiveRuntime
//
// Created by Maxwell Talbot on 07/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#ifndef RiveFileAsset_h
#define RiveFileAsset_h
#import <Foundation/Foundation.h>
@class RiveRenderImage;
@class RiveFont;
NS_ASSUME_NONNULL_BEGIN
/*
* RiveFileAsset
*/
@interface RiveFileAsset : NSObject
// TODO: add an asset type?
- (NSString*)name;
- (NSString*)uniqueFilename;
- (NSString*)fileExtension;
- (NSString*)cdnBaseUrl;
- (NSString*)cdnUuid;
@end
/*
* RiveImageAsset
*/
@interface RiveImageAsset : RiveFileAsset
- (void)renderImage:(RiveRenderImage*)image;
@end
/*
* SMIBool
*/
@interface RiveFontAsset : RiveFileAsset
- (void)font:(RiveFont*)font;
@end
NS_ASSUME_NONNULL_END
#endif /* RiveFileAsset_h */

View File

@@ -0,0 +1,23 @@
//
// RiveFileAssetLoader.h
// RiveRuntime
//
// Created by Maxwell Talbot on 06/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#ifndef RiveFileAssetLoader_h
#define RiveFileAssetLoader_h
#import <Foundation/Foundation.h>
@class RiveFactory;
@class RiveFileAsset;
@interface RiveFileAssetLoader : NSObject
- (BOOL)loadContentsWithAsset:(RiveFileAsset*)asset
andData:(NSData*)data
andFactory:(RiveFactory*)factory;
@end
#endif /* RiveFileAssetLoader_h */

View File

@@ -28,6 +28,11 @@
#import "rive/animation/animation_state.hpp"
#import "rive/text/text_value_run.hpp"
#import "rive/event.hpp"
#import "rive/assets/image_asset.hpp"
#import "rive/assets/font_asset.hpp"
#import "rive/assets/file_asset.hpp"
#import "rive/file_asset_loader.hpp"
#include "rive/open_url_event.hpp"
#include "rive/custom_property_boolean.hpp"
#include "rive/custom_property_string.hpp"
@@ -116,3 +121,34 @@
@end
#endif /* RivePrivateHeaders_h */
/*
* RiveImageAsset
*/
@interface RiveImageAsset ()
- (instancetype)initWithFileAsset:(const rive::ImageAsset*)fileAsset;
@end
/*
* SMIBool
*/
@interface RiveFontAsset ()
- (instancetype)initWithFileAsset:(const rive::FontAsset*)fileAsset;
@end
/*
* RiveFileAsset
*/
@interface RiveFactory ()
- (instancetype)initWithFactory:(rive::Factory*)factory;
@end
@interface RiveFont ()
- (instancetype)initWithFont:(rive::rcp<rive::Font>)font;
- (rive::rcp<rive::Font>)instance;
@end
@interface RiveRenderImage ()
- (instancetype)initWithImage:(rive::rcp<rive::RenderImage>)image;
- (rive::rcp<rive::RenderImage>)instance;
@end

View File

@@ -14,7 +14,7 @@
NS_ASSUME_NONNULL_BEGIN
/*
* SMITrigger
* SMIInput
*/
@interface RiveSMIInput : NSObject
- (NSString*)name;

View File

@@ -10,7 +10,7 @@
#endif
#import "RivePrivateHeaders.h"
#import <RenderContext.hh>
#import <RenderContext.h>
#import <RenderContextManager.h>
@implementation RiveRendererView

View File

@@ -7,23 +7,25 @@
//
import Foundation
import Combine
open class RiveModel: ObservableObject {
internal private(set) var riveFile: RiveFile
public private(set) var artboard: RiveArtboard!
// NOTE: the order here determines the order in which memory garbage collected
public internal(set) var stateMachine: RiveStateMachineInstance?
public internal(set) var animation: RiveLinearAnimationInstance?
public private(set) var artboard: RiveArtboard!
internal private(set) var riveFile: RiveFile
public init(riveFile: RiveFile) {
self.riveFile = riveFile
}
public init(fileName: String, extension: String = ".riv", in bundle: Bundle = .main) throws {
riveFile = try RiveFile(name: fileName, extension: `extension`, in: bundle)
public init(fileName: String, extension: String = ".riv", in bundle: Bundle = .main, loadCdn: Bool = true, customLoader: LoadAsset? = nil) throws {
riveFile = try RiveFile(name: fileName, extension: `extension`, in: bundle, loadCdn: loadCdn, customLoader: customLoader)
}
public init(webURL: String, delegate: RiveFileDelegate) {
riveFile = RiveFile(httpUrl: webURL, with: delegate)!
public init(webURL: String, delegate: RiveFileDelegate, loadCdn: Bool) {
riveFile = RiveFile(httpUrl: webURL, loadCdn:loadCdn, with: delegate)!
}
// MARK: - Setters

View File

@@ -83,13 +83,15 @@ open class RiveViewModel: NSObject, ObservableObject, RiveFileDelegate, RiveStat
fit: RiveFit = .contain,
alignment: RiveAlignment = .center,
autoPlay: Bool = true,
artboardName: String? = nil
artboardName: String? = nil,
loadCdn: Bool = true,
customLoader: LoadAsset? = nil
) {
self.fit = fit
self.alignment = alignment
self.autoPlay = autoPlay
super.init()
riveModel = try! RiveModel(fileName: fileName, extension: `extension`, in: bundle)
riveModel = try! RiveModel(fileName: fileName, extension: `extension`, in: bundle, loadCdn: loadCdn, customLoader:customLoader)
sharedInit(artboardName: artboardName, stateMachineName: stateMachineName, animationName: nil)
}
@@ -102,13 +104,15 @@ open class RiveViewModel: NSObject, ObservableObject, RiveFileDelegate, RiveStat
alignment: RiveAlignment = .center,
autoPlay: Bool = true,
artboardName: String? = nil,
preferredFramesPerSecond: Int? = nil
preferredFramesPerSecond: Int? = nil,
loadCdn: Bool = true,
customLoader: LoadAsset? = nil
) {
self.fit = fit
self.alignment = alignment
self.autoPlay = autoPlay
super.init()
riveModel = try! RiveModel(fileName: fileName, extension: `extension`, in: bundle)
riveModel = try! RiveModel(fileName: fileName, extension: `extension`, in: bundle, loadCdn: loadCdn, customLoader:customLoader)
sharedInit(artboardName: artboardName, stateMachineName: nil, animationName: animationName)
}
@@ -118,13 +122,14 @@ open class RiveViewModel: NSObject, ObservableObject, RiveFileDelegate, RiveStat
fit: RiveFit = .contain,
alignment: RiveAlignment = .center,
autoPlay: Bool = true,
loadCdn: Bool = true,
artboardName: String? = nil
) {
self.fit = fit
self.alignment = alignment
self.autoPlay = autoPlay
super.init()
riveModel = RiveModel(webURL: webURL, delegate: self)
riveModel = RiveModel(webURL: webURL, delegate: self, loadCdn: loadCdn)
defaultModel = RiveModelBuffer(artboardName: artboardName, stateMachineName: stateMachineName, animationName: nil)
}
@@ -134,13 +139,14 @@ open class RiveViewModel: NSObject, ObservableObject, RiveFileDelegate, RiveStat
fit: RiveFit = .contain,
alignment: RiveAlignment = .center,
autoPlay: Bool = true,
loadCdn: Bool = true,
artboardName: String? = nil
) {
self.fit = fit
self.alignment = alignment
self.autoPlay = autoPlay
super.init()
riveModel = RiveModel(webURL: webURL, delegate: self)
riveModel = RiveModel(webURL: webURL, delegate: self, loadCdn: loadCdn)
defaultModel = RiveModelBuffer(artboardName: artboardName, stateMachineName: nil, animationName: animationName)
}

View File

@@ -9,9 +9,13 @@
import Foundation
public extension RiveFile {
convenience init(name fileName: String, extension ext: String = ".riv", in bundle: Bundle = .main) throws {
convenience init(name fileName: String, extension ext: String = ".riv", in bundle: Bundle = .main, loadCdn: Bool=true, customLoader: LoadAsset? = nil) throws {
let byteArray = RiveFile.getBytes(fileName: fileName, extension: ext, in: bundle)
try self.init(byteArray: byteArray)
if (customLoader == nil){
try self.init(byteArray: byteArray, loadCdn: loadCdn)
}else {
try self.init(byteArray: byteArray, loadCdn: loadCdn, customAssetLoader: customLoader!)
}
}
static func getBytes(fileName: String, extension ext: String = ".riv", in bundle: Bundle = .main) -> [UInt8] {

View File

@@ -9,7 +9,7 @@
import Foundation
extension RiveStateMachineInstance {
open var inputs: [StateMachineInput] {
public var inputs: [StateMachineInput] {
var inputs: [StateMachineInput] = []
for i in 0 ..< inputCount() {

Binary file not shown.

Binary file not shown.

116
Tests/OutOfBandAssetTest.mm Normal file
View File

@@ -0,0 +1,116 @@
//
// OutOfBandAssetTest.mm
// RiveRuntimeTests
//
// Created by Maxwell Talbot on 21/11/2023.
// Copyright © 2023 Rive. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "Rive.h"
#import "util.h"
@interface OutOfBandAssetTest : XCTestCase
@end
@implementation OutOfBandAssetTest
- (void)testHostedAssetsProvideCallbacks
{
NSError* error = nil;
NSData* data = [Util loadTestData:@"hosted_assets"];
__block RiveImageAsset* image;
__block RiveFontAsset* font;
__block NSData* imageData;
__block NSData* fontData;
RiveFile* file = [[RiveFile alloc]
initWithData:data
loadCdn:false
customAssetLoader:^bool(RiveFileAsset* asset, NSData* data, RiveFactory* factory) {
if ([asset isKindOfClass:[RiveImageAsset class]])
{
image = (RiveImageAsset*)asset;
imageData = data;
}
if ([asset isKindOfClass:[RiveFontAsset class]])
{
font = (RiveFontAsset*)asset;
fontData = data;
}
return false;
}
error:&error];
XCTAssertNotNil(file);
XCTAssertNil(error);
XCTAssertNotNil(image);
XCTAssertEqual(imageData.length, 0);
XCTAssertEqualObjects([image name], @"image.png");
XCTAssertEqualObjects([image uniqueFilename], @"image-49934.png");
XCTAssertEqualObjects([image fileExtension], @"png");
XCTAssertEqualObjects([image cdnBaseUrl], @"https://public.uat.rive.app/cdn/uuid");
XCTAssertEqualObjects([image cdnUuid], @"eadb7ed8-6d71-4b6c-bbc2-f0f5e9c5dd92");
XCTAssertNotNil(font);
XCTAssertEqual(fontData.length, 0);
XCTAssertEqualObjects([font name], @"Inter");
XCTAssertEqualObjects([font uniqueFilename], @"Inter-45562.ttf");
XCTAssertEqualObjects([font fileExtension], @"ttf");
XCTAssertEqualObjects([font cdnBaseUrl], @"https://public.uat.rive.app/cdn/uuid");
XCTAssertEqualObjects([font cdnUuid], @"60ad5ede-993c-4e03-9a80-e56888b2cff3");
}
- (void)testEmbeddedAssetsProvideData
{
NSError* error = nil;
NSData* data = [Util loadTestData:@"embedded_assets"];
__block RiveImageAsset* image;
__block RiveFontAsset* font;
__block NSData* imageData;
__block NSData* fontData;
RiveFile* file = [[RiveFile alloc]
initWithData:data
loadCdn:false
customAssetLoader:^bool(RiveFileAsset* asset, NSData* data, RiveFactory* factory) {
if ([asset isKindOfClass:[RiveImageAsset class]])
{
image = (RiveImageAsset*)asset;
imageData = data;
}
if ([asset isKindOfClass:[RiveFontAsset class]])
{
font = (RiveFontAsset*)asset;
fontData = data;
}
return false;
}
error:&error];
XCTAssertNotNil(file);
XCTAssertNil(error);
XCTAssertNotNil(image);
// data provided in line.
XCTAssertEqual(imageData.length, 308);
XCTAssertEqualObjects([image name], @"1x1.png");
XCTAssertEqualObjects([image uniqueFilename], @"1x1-49935.png");
XCTAssertEqualObjects([image fileExtension], @"png");
XCTAssertEqualObjects([image cdnBaseUrl], @"https://public.rive.app/cdn/uuid");
XCTAssertEqualObjects([image cdnUuid], @"");
XCTAssertNotNil(font);
XCTAssertEqual(fontData.length, 3348);
// data provided in line.
XCTAssertEqualObjects([font name], @"Inter");
XCTAssertEqualObjects([font uniqueFilename], @"Inter-45562.ttf");
XCTAssertEqualObjects([font fileExtension], @"ttf");
XCTAssertEqualObjects([font cdnBaseUrl], @"https://public.rive.app/cdn/uuid");
XCTAssertEqualObjects([font cdnUuid], @"");
}
@end

View File

@@ -12,7 +12,7 @@ import RiveRuntime
extension RiveFile {
convenience init(testfileName: String, extension ext: String = ".riv") throws {
let byteArray = RiveFile.getBytes(fileName: testfileName, extension: ext)
try self.init(byteArray: byteArray)
try self.init(byteArray: byteArray, loadCdn: false)
}
static func getBytes(fileName: String, extension ext: String = ".riv") -> [UInt8] {

View File

@@ -111,6 +111,7 @@ UInt8 stateMachineFileBytes[] = {
// Valid Rive file, should not be null
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
XCTAssert(file != NULL);
}
@@ -122,6 +123,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
XCTAssert(artboard != NULL);
@@ -135,6 +137,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
NSInteger count = [file artboardCount];
XCTAssert(count == 1);
@@ -147,6 +150,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboardFromIndex:0 error:nil];
XCTAssert(artboard != NULL);
@@ -160,6 +164,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboardFromName:@"New Artboard" error:nil];
XCTAssert(artboard != NULL);
@@ -173,6 +178,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
NSInteger count = [artboard animationCount];
@@ -186,6 +192,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -204,6 +211,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
@@ -219,6 +227,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
NSError* error = nil;
@@ -236,6 +245,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -254,6 +264,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -286,6 +297,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -308,6 +320,7 @@ UInt8 stateMachineFileBytes[] = {
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];

View File

@@ -27,7 +27,6 @@ class RiveViewModelTest: XCTestCase {
let file = try RiveFile(testfileName: "testtext")
let model = RiveModel(riveFile: file)
let viewModel = RiveViewModel(model, autoPlay: false)
let view = viewModel.createRiveView()
XCTAssertEqual(viewModel.getTextRunValue("MyRun"), "Hello there")
try viewModel.setTextRunValue("MyRun", textValue: "Hello test")

View File

@@ -9,8 +9,20 @@
#ifndef util_h
#define util_h
NS_ASSUME_NONNULL_BEGIN
@interface Util : NSObject
+ (RiveFile* __nullable)loadTestFile:(NSString*)filename error:(NSError**)error;
+ (RiveFile*)loadTestFile:(NSString*)name error:(NSError**)error;
+ (NSData*)loadTestData:(NSString*)name;
@end
@interface TestSessionDownloadTask : NSURLSessionDownloadTask
@end
@interface TestSession : NSURLSession
- (NSMutableArray*)getUrls;
@end
NS_ASSUME_NONNULL_END
#endif /* util_h */

View File

@@ -9,18 +9,63 @@
#import "Rive.h"
#import "util.h"
NS_ASSUME_NONNULL_BEGIN
@implementation Util
+ (RiveFile*)loadTestFile:(NSString*)name error:(NSError**)error
+ (NSData*)loadTestData:(NSString*)name
{
NSBundle* bundle = [NSBundle bundleForClass:[self class]];
NSString* path = [bundle pathForResource:name ofType:@"riv"];
NSData* nsData = [NSData dataWithContentsOfFile:path];
Byte* bytes = (Byte*)malloc(nsData.length);
memcpy(bytes, [nsData bytes], nsData.length);
RiveFile* file = [[RiveFile alloc] initWithBytes:bytes byteLength:nsData.length error:error];
return nsData;
}
+ (RiveFile*)loadTestFile:(NSString*)name error:(NSError**)error
{
NSData* nsData = [self loadTestData:name];
RiveFile* file = [[RiveFile alloc] initWithData:nsData loadCdn:false error:error];
return file;
}
@end
typedef void (^CompletionHandler)(NSURL* location, NSURLResponse* response, NSError* error);
@implementation TestSessionDownloadTask
{}
- (void)resume
{};
@end
@implementation TestSession
{
NSMutableArray* urls;
}
- (instancetype)init
{
TestSession* session = [super init];
session->urls = [[NSMutableArray alloc] init];
return session;
}
- (NSURLSessionDownloadTask*)downloadTaskWithURL:(NSURL*)url
completionHandler:(CompletionHandler)completionHandler
{
[urls addObject:url];
return [[TestSessionDownloadTask alloc] init];
}
- (void)finishTasksAndInvalidate
{}
- (nonnull NSMutableArray*)getUrls
{
return urls;
}
@end
NS_ASSUME_NONNULL_END

View File

@@ -50,7 +50,6 @@ build_runtime() {
cp -r $RIVE_RUNTIME_DIR/skia/renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/renderer
cp -r $RIVE_RUNTIME_DIR/include $DEV_SCRIPT_DIR/../dependencies/includes/rive
# Build rive_cg_renderer.
pushd $RIVE_RUNTIME_DIR/cg_renderer/build
premake5 --scripts=$RIVE_RUNTIME_DIR/build --os=ios gmake2
@@ -60,7 +59,6 @@ build_runtime() {
cp -r $RIVE_RUNTIME_DIR/cg_renderer/build/ios/bin/$1/librive_cg_renderer.a $DEV_SCRIPT_DIR/../dependencies/$1/librive_cg_renderer.a
cp -r $RIVE_RUNTIME_DIR/cg_renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/cg_renderer
# Build rive_pls_renderer.
pushd $RIVE_PLS_DIR/out
premake5 --scripts=$RIVE_RUNTIME_DIR/build --file=premake5_pls_renderer.lua --universal-release --no-rive-decoders --os=ios gmake2
@@ -85,7 +83,6 @@ build_runtime_sim() {
cp -r $RIVE_RUNTIME_DIR/skia/renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/renderer
cp -r $RIVE_RUNTIME_DIR/include $DEV_SCRIPT_DIR/../dependencies/includes/rive
# Build rive_cg_renderer.
pushd $RIVE_RUNTIME_DIR/cg_renderer/build
premake5 --scripts=$RIVE_RUNTIME_DIR/build --os=ios --variant=emulator gmake2
@@ -95,10 +92,9 @@ build_runtime_sim() {
cp -r $RIVE_RUNTIME_DIR/cg_renderer/build/ios_sim/bin/$1/librive_cg_renderer.a $DEV_SCRIPT_DIR/../dependencies/$1/librive_cg_renderer_sim.a
cp -r $RIVE_RUNTIME_DIR/cg_renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/cg_renderer
# Build rive_pls_renderer.
pushd $RIVE_PLS_DIR/out
premake5 --scripts=$RIVE_RUNTIME_DIR/build --file=premake5_pls_renderer.lua --universal-release --no-rive-decoders --os=ios --variant=simulator gmake2
premake5 --scripts=$RIVE_RUNTIME_DIR/build --file=premake5_pls_renderer.lua --universal-release --no-rive-decoders --os=ios --variant=emulator gmake2
make config=$1 clean
make config=$1 -j12 rive_pls_renderer
popd
@@ -120,7 +116,6 @@ build_runtime_macosx() {
cp -r $RIVE_RUNTIME_DIR/skia/renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/renderer
cp -r $RIVE_RUNTIME_DIR/include $DEV_SCRIPT_DIR/../dependencies/includes/rive
# Build rive_cg_renderer.
pushd $RIVE_RUNTIME_DIR/cg_renderer/build
premake5 --scripts=$RIVE_RUNTIME_DIR/build --os=macosx --variant=runtime gmake2
@@ -130,7 +125,6 @@ build_runtime_macosx() {
cp -r $RIVE_RUNTIME_DIR/cg_renderer/build/macosx/bin/$1/librive_cg_renderer.a $DEV_SCRIPT_DIR/../dependencies/$1/librive_cg_renderer_macos.a
cp -r $RIVE_RUNTIME_DIR/cg_renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/cg_renderer
# Build rive_pls_renderer.
pushd $RIVE_PLS_DIR/out
premake5 --scripts=$RIVE_RUNTIME_DIR/build --file=premake5_pls_renderer.lua --universal-release --no-rive-decoders --os=macosx gmake2
@@ -220,6 +214,12 @@ ios_sim)
make_dependency_directories
finalize_skia
build_runtime_sim $2
# TODO:
# to build for the example you need debug, but to profile you need release.
# each time you build, both version are removed. to imnprove this only remove
# the version being built, or add a "both" option.
# build_runtime_sim debug
# build_runtime_sim release
;;
*)
usage