diff --git a/.gitignore b/.gitignore
index 54467d56..e291d612 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
@@ -93,4 +96,4 @@ fastlane/test_output
iOSInjectionProject/
# used for us to put our tar.gz lib cache
-cache/
\ No newline at end of file
+cache/
diff --git a/.rive_head b/.rive_head
index c640d70d..1be5c7bb 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-ed4474d1ab3aa1e68d47cfcb2c178f39c376257e
+fabb7f97fe7b69368c9a7369febfecbc90be49cd
diff --git a/.rive_renderer b/.rive_renderer
index aaeb2c98..92ff8adf 100644
--- a/.rive_renderer
+++ b/.rive_renderer
@@ -1 +1 @@
-05e26a46fb68d9de2595c7d21ce8db48a78892e1
+7b7595392d849217e43a829b71dfad58ecf29b06
diff --git a/Example-iOS/Assets/Inter-45562.ttf b/Example-iOS/Assets/Inter-45562.ttf
new file mode 100644
index 00000000..a02ee83d
Binary files /dev/null and b/Example-iOS/Assets/Inter-45562.ttf differ
diff --git a/Example-iOS/Assets/picture-47982.jpeg b/Example-iOS/Assets/picture-47982.jpeg
new file mode 100644
index 00000000..ec19c5bf
Binary files /dev/null and b/Example-iOS/Assets/picture-47982.jpeg differ
diff --git a/Example-iOS/Assets/simple_assets.riv b/Example-iOS/Assets/simple_assets.riv
new file mode 100644
index 00000000..230bbd8e
Binary files /dev/null and b/Example-iOS/Assets/simple_assets.riv differ
diff --git a/Example-iOS/Preview (macOS)/Preview Content/Preview Assets.xcassets/Contents.json b/Example-iOS/Preview (macOS)/Preview Content/Preview Assets.xcassets/Contents.json
deleted file mode 100644
index 73c00596..00000000
--- a/Example-iOS/Preview (macOS)/Preview Content/Preview Assets.xcassets/Contents.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
diff --git a/Example-iOS/Preview (macOS)/Preview__macOS_.entitlements b/Example-iOS/Preview (macOS)/Preview__macOS_.entitlements
deleted file mode 100644
index 18aff0ce..00000000
--- a/Example-iOS/Preview (macOS)/Preview__macOS_.entitlements
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- com.apple.security.app-sandbox
-
- com.apple.security.files.user-selected.read-only
-
-
-
diff --git a/Example-iOS/Preview/Info.plist b/Example-iOS/Preview/Info.plist
deleted file mode 100644
index dd3c9afd..00000000
--- a/Example-iOS/Preview/Info.plist
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
- UIApplicationSceneManifest
-
- UIApplicationSupportsMultipleScenes
-
- UISceneConfigurations
-
- UIWindowSceneSessionRoleApplication
-
-
- UISceneConfigurationName
- Default Configuration
- UISceneDelegateClassName
- $(PRODUCT_MODULE_NAME).SceneDelegate
- UISceneStoryboardFile
- Main
-
-
-
-
-
-
diff --git a/Example-iOS/RiveExample.xcodeproj/project.pbxproj b/Example-iOS/RiveExample.xcodeproj/project.pbxproj
index aec98a5b..e9cec02a 100644
--- a/Example-iOS/RiveExample.xcodeproj/project.pbxproj
+++ b/Example-iOS/RiveExample.xcodeproj/project.pbxproj
@@ -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 = ""; };
04026DC927CE3EF6002B3DBF /* SwiftMultipleAnimations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMultipleAnimations.swift; sourceTree = ""; };
04026DCD27CE3F0F002B3DBF /* SwiftStateMachine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftStateMachine.swift; sourceTree = ""; };
+ 041265212B0BC5A5009400EC /* SwiftSimpleAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftSimpleAssets.swift; sourceTree = ""; };
042C88822643D6B900E7DBB2 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; };
042C88872643DB7100E7DBB2 /* SimpleAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleAnimation.swift; sourceTree = ""; };
042C888B2643EEE300E7DBB2 /* Layout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Layout.swift; sourceTree = ""; };
@@ -358,8 +234,14 @@
042C88D82644447500E7DBB2 /* skills.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = skills.riv; sourceTree = ""; };
042C88D92644447500E7DBB2 /* clipping.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = clipping.riv; sourceTree = ""; };
042C88DA2644447500E7DBB2 /* vader.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = vader.riv; sourceTree = ""; };
+ 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 = ""; };
+ 043025EE2AF905B100320F2E /* CachedAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CachedAssets.swift; sourceTree = ""; };
+ 043026052B012C5000320F2E /* simple_assets.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = simple_assets.riv; sourceTree = ""; };
0448838C29F82DD000D7523E /* SimpleHttpAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleHttpAnimation.swift; sourceTree = ""; };
0450445E26B3F71E007B25CA /* constrained.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = constrained.riv; sourceTree = ""; };
+ 0453FCB02B012D17001185C8 /* picture-47982.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "picture-47982.jpeg"; sourceTree = ""; };
+ 0453FCB82B012DA9001185C8 /* SimpleOutOfBand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleOutOfBand.swift; sourceTree = ""; };
+ 0453FCBC2B014E2F001185C8 /* Inter-45562.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Inter-45562.ttf"; sourceTree = ""; };
046AFA6E2673AF04004ED497 /* blendmodes.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = blendmodes.riv; sourceTree = ""; };
046AFA722673B00B004ED497 /* BlendModes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlendModes.swift; sourceTree = ""; };
048002882729AA4400F7132B /* clean_icon_set.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = clean_icon_set.riv; sourceTree = ""; };
@@ -422,11 +304,7 @@
E5A7874B27E1158E0056F24B /* prop_example.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = prop_example.riv; sourceTree = ""; };
E5CD7D7027DC331900BFE5E2 /* SwiftMeshAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMeshAnimation.swift; sourceTree = ""; };
E5E87A002AE5A83700E7295F /* SwiftVariableFPS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftVariableFPS.swift; sourceTree = ""; };
- 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 = ""; };
- 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 = ""; };
- F8772AEA2AD94A0800AB5920 /* Preview__macOS_.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Preview__macOS_.entitlements; sourceTree = ""; };
+ F8DA7B442AF523A800FF3CBF /* DismissableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DismissableView.swift; sourceTree = ""; };
/* 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 = "";
@@ -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 = "";
@@ -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 = "";
@@ -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 = "";
};
- F8772A722AD945FC00AB5920 /* Preview */ = {
- isa = PBXGroup;
- children = (
- F8772A812AD945FE00AB5920 /* Info.plist */,
- );
- path = Preview;
- sourceTree = "";
- };
- F8772AE02AD94A0500AB5920 /* Preview (macOS) */ = {
- isa = PBXGroup;
- children = (
- F8772AEA2AD94A0800AB5920 /* Preview__macOS_.entitlements */,
- F8772AE72AD94A0800AB5920 /* Preview Content */,
- );
- path = "Preview (macOS)";
- sourceTree = "";
- };
- F8772AE72AD94A0800AB5920 /* Preview Content */ = {
- isa = PBXGroup;
- children = (
- F8772AE82AD94A0800AB5920 /* Preview Assets.xcassets */,
- );
- path = "Preview Content";
- sourceTree = "";
- };
/* 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 */;
}
diff --git a/Example-iOS/RiveExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example-iOS/RiveExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index c3424e0a..d16df00c 100644
--- a/Example-iOS/RiveExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/Example-iOS/RiveExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -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"
}
}
],
diff --git a/Example-iOS/RiveExample.xcodeproj/xcshareddata/xcschemes/Preview (iOS).xcscheme b/Example-iOS/RiveExample.xcodeproj/xcshareddata/xcschemes/Preview (iOS).xcscheme
deleted file mode 100644
index 14ef30ec..00000000
--- a/Example-iOS/RiveExample.xcodeproj/xcshareddata/xcschemes/Preview (iOS).xcscheme
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Example-iOS/RiveExample.xcodeproj/xcshareddata/xcschemes/Preview (macOS).xcscheme b/Example-iOS/RiveExample.xcodeproj/xcshareddata/xcschemes/Preview (macOS).xcscheme
deleted file mode 100644
index cb4eef15..00000000
--- a/Example-iOS/RiveExample.xcodeproj/xcshareddata/xcschemes/Preview (macOS).xcscheme
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Example-iOS/Source/DismissableView.swift b/Example-iOS/Source/DismissableView.swift
new file mode 100644
index 00000000..3d38385b
--- /dev/null
+++ b/Example-iOS/Source/DismissableView.swift
@@ -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 }
+}
diff --git a/Example-iOS/Source/Examples/Storyboard/CachedAssets.swift b/Example-iOS/Source/Examples/Storyboard/CachedAssets.swift
new file mode 100644
index 00000000..6654b71a
--- /dev/null
+++ b/Example-iOS/Source/Examples/Storyboard/CachedAssets.swift
@@ -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()
+ }
+}
diff --git a/Example-iOS/Source/Examples/Storyboard/SimpleOutOfBand.swift b/Example-iOS/Source/Examples/Storyboard/SimpleOutOfBand.swift
new file mode 100644
index 00000000..97e23396
--- /dev/null
+++ b/Example-iOS/Source/Examples/Storyboard/SimpleOutOfBand.swift
@@ -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
+ }
+}
diff --git a/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAnimation.swift b/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAnimation.swift
index 43a798f1..15dc8564 100644
--- a/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAnimation.swift
+++ b/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAnimation.swift
@@ -10,6 +10,7 @@
import SwiftUI
import RiveRuntime
+
struct SwiftSimpleAnimation: DismissableView {
var dismiss: () -> Void = {}
diff --git a/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAssets.swift b/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAssets.swift
new file mode 100644
index 00000000..ce9c7f90
--- /dev/null
+++ b/Example-iOS/Source/Examples/SwiftUI/SwiftSimpleAssets.swift
@@ -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()
+ }
+}
diff --git a/Example-iOS/Source/ExamplesMaster.swift b/Example-iOS/Source/ExamplesMaster.swift
index 8c7fe208..ea48b560 100644
--- a/Example-iOS/Source/ExamplesMaster.swift
+++ b/Example-iOS/Source/ExamplesMaster.swift
@@ -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 }
-}
diff --git a/Example-iOS/Source/Main.storyboard b/Example-iOS/Source/Main.storyboard
index bb5758ae..da55356f 100644
--- a/Example-iOS/Source/Main.storyboard
+++ b/Example-iOS/Source/Main.storyboard
@@ -1,9 +1,9 @@
-
+
-
+
@@ -12,7 +12,7 @@
-
+
@@ -56,7 +56,7 @@
-
+
@@ -87,8 +87,8 @@
-
-
+
+
@@ -281,7 +281,7 @@
-
+
@@ -297,8 +297,8 @@
-
-
+
+
@@ -525,8 +525,8 @@
-
-
+
+
@@ -608,8 +608,8 @@
-
-
+
+
@@ -691,8 +691,8 @@
-
-
+
+
@@ -852,7 +852,7 @@
-
+
@@ -868,7 +868,7 @@
-
+
@@ -884,7 +884,7 @@
-
+
@@ -897,6 +897,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Example-iOS/Source/lib/utility.swift b/Example-iOS/Source/lib/utility.swift
index 9e0faead..3b38c0d3 100644
--- a/Example-iOS/Source/lib/utility.swift
+++ b/Example-iOS/Source/lib/utility.swift
@@ -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 {
diff --git a/RiveRuntime.xcodeproj/project.pbxproj b/RiveRuntime.xcodeproj/project.pbxproj
index fbe30ad3..8e81ab2f 100644
--- a/RiveRuntime.xcodeproj/project.pbxproj
+++ b/RiveRuntime.xcodeproj/project.pbxproj
@@ -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 = ""; };
+ 041265272B0CC387009400EC /* hosted_assets.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = hosted_assets.riv; sourceTree = ""; };
+ 041265292B0CCB8E009400EC /* embedded_assets.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = embedded_assets.riv; sourceTree = ""; };
+ 043025F12AF90D4800320F2E /* RiveFileAssetLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RiveFileAssetLoader.h; sourceTree = ""; };
+ 043025F32AF90EAC00320F2E /* RiveFileAssetLoader.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveFileAssetLoader.mm; sourceTree = ""; };
+ 043025F52AF9355B00320F2E /* CDNFileAssetLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDNFileAssetLoader.h; sourceTree = ""; };
+ 043025F72AFA46EF00320F2E /* CDNFileAssetLoader.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CDNFileAssetLoader.mm; sourceTree = ""; };
+ 043025F92AFA860E00320F2E /* FileAssetLoaderAdapter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FileAssetLoaderAdapter.hpp; sourceTree = ""; };
+ 043025FB2AFA862E00320F2E /* FileAssetLoaderAdapter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FileAssetLoaderAdapter.mm; sourceTree = ""; };
+ 043025FD2AFA8FCF00320F2E /* RiveFileAsset.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RiveFileAsset.h; sourceTree = ""; };
+ 043025FF2AFA915B00320F2E /* RiveFileAsset.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveFileAsset.mm; sourceTree = ""; };
+ 043026012AFB9FCD00320F2E /* RiveFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RiveFactory.h; sourceTree = ""; };
+ 043026032AFBA04100320F2E /* RiveFactory.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveFactory.mm; sourceTree = ""; };
046FB7E1264EAA5E000129B1 /* RiveLinearAnimationInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RiveLinearAnimationInstance.h; sourceTree = ""; };
046FB7E2264EAA5E000129B1 /* RiveArtboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveArtboard.mm; sourceTree = ""; };
046FB7E4264EAA5F000129B1 /* RiveLinearAnimationInstance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RiveLinearAnimationInstance.mm; sourceTree = ""; };
@@ -129,7 +155,7 @@
83DE4C922AA8DD9F00B88B72 /* RenderContextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderContextManager.h; sourceTree = ""; };
83DE4C9F2AAA072B00B88B72 /* PlatformCGImage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCGImage.mm; sourceTree = ""; };
83DE4CA12AAA077200B88B72 /* PlatformCGImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCGImage.h; sourceTree = ""; };
- 83DE4CA62AAAE72000B88B72 /* RenderContext.hh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RenderContext.hh; sourceTree = ""; };
+ 83DE4CA62AAAE72000B88B72 /* RenderContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderContext.h; sourceTree = ""; };
C34609FB27FF9114002DBCB7 /* RiveFile+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RiveFile+Extensions.swift"; sourceTree = ""; };
C3468E5727EB9887008652FD /* RiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RiveView.swift; sourceTree = ""; };
C3468E5927ECC7C6008652FD /* RiveViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RiveViewModel.swift; sourceTree = ""; };
@@ -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 = "";
@@ -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 = "";
@@ -302,6 +340,7 @@
04BE5426264C02AA00427B39 /* StateMachineInstanceTest.mm */,
04BE542C264C1A3300427B39 /* RiveDelegatesTest.swift */,
C38BB5F528762B720039E385 /* RiveStateMachineTest.swift */,
+ 041265252B0CB41E009400EC /* OutOfBandAssetTest.mm */,
);
path = Tests;
sourceTree = "";
@@ -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",
diff --git a/Source/Renderer/CDNFileAssetLoader.mm b/Source/Renderer/CDNFileAssetLoader.mm
new file mode 100644
index 00000000..0f1ddd09
--- /dev/null
+++ b/Source/Renderer/CDNFileAssetLoader.mm
@@ -0,0 +1,108 @@
+//
+// CDNFileAssetLoader.m
+// RiveRuntime
+//
+// Created by Maxwell Talbot on 07/11/2023.
+// Copyright © 2023 Rive. All rights reserved.
+//
+
+#import
+#import
+#import
+
+@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
diff --git a/Source/Renderer/FileAssetLoaderAdapter.mm b/Source/Renderer/FileAssetLoaderAdapter.mm
new file mode 100644
index 00000000..17455939
--- /dev/null
+++ b/Source/Renderer/FileAssetLoaderAdapter.mm
@@ -0,0 +1,42 @@
+//
+// FileAssetLoaderAdapter.m
+// RiveRuntime
+//
+// Created by Maxwell Talbot on 07/11/2023.
+// Copyright © 2023 Rive. All rights reserved.
+//
+
+#import
+#import
+#import
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+rive::FileAssetLoaderAdapter::FileAssetLoaderAdapter(RiveFileAssetLoader* myLoader)
+{
+ loader = myLoader;
+}
+
+bool rive::FileAssetLoaderAdapter::loadContents(rive::FileAsset& asset,
+ rive::Span bytes,
+ rive::Factory* factory)
+{
+ NSData* data = [NSData dataWithBytes:bytes.data() length:bytes.size()];
+ RiveFactory* myFactory = [[RiveFactory alloc] initWithFactory:factory];
+ if (asset.is())
+ {
+ RiveFontAsset* fontAsset =
+ [[RiveFontAsset alloc] initWithFileAsset:asset.as()];
+ return [loader loadContentsWithAsset:fontAsset andData:data andFactory:myFactory];
+ }
+ else if (asset.is())
+ {
+ RiveImageAsset* imageAsset =
+ [[RiveImageAsset alloc] initWithFileAsset:asset.as()];
+ return [loader loadContentsWithAsset:imageAsset andData:data andFactory:myFactory];
+ }
+ return false;
+}
+
+NS_ASSUME_NONNULL_END
diff --git a/Source/Renderer/NullPLS/out/premake5_pls_renderer.lua b/Source/Renderer/NullPLS/out/premake5_pls_renderer.lua
index 0963d457..f5467df0 100644
--- a/Source/Renderer/NullPLS/out/premake5_pls_renderer.lua
+++ b/Source/Renderer/NullPLS/out/premake5_pls_renderer.lua
@@ -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'
}
diff --git a/Source/Renderer/RenderContextManager.mm b/Source/Renderer/RenderContextManager.mm
index 667df3fe..0634e2ec 100644
--- a/Source/Renderer/RenderContextManager.mm
+++ b/Source/Renderer/RenderContextManager.mm
@@ -3,7 +3,7 @@
*/
#import
-#import
+#import
#import
@@ -26,6 +26,10 @@ - (void)endFrame
@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 @@ - (void)endFrame
#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 @@ @implementation RenderContextManager
__weak CGRendererContext* _cgContextWeakPtr;
}
+bool _riveRendererSupportWarningDisplayed = false;
+
// The context manager is a singleton.
+ (RenderContextManager*)shared
{
@@ -439,8 +450,13 @@ - (RenderContext*)getDefaultContext
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 @@ - (RenderContext*)getCGRendererContext
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
diff --git a/Source/Renderer/RiveFactory.mm b/Source/Renderer/RiveFactory.mm
new file mode 100644
index 00000000..29f525c8
--- /dev/null
+++ b/Source/Renderer/RiveFactory.mm
@@ -0,0 +1,95 @@
+//
+// RiveFactory.m
+// RiveRuntime
+//
+// Created by Maxwell Talbot on 08/11/2023.
+// Copyright © 2023 Rive. All rights reserved.
+//
+
+#import
+#import
+#import
+
+@implementation RiveFont
+{
+ rive::rcp instance; // note: we do NOT own this, so don't delete it
+}
+- (instancetype)initWithFont:(rive::rcp)font
+{
+ if (self = [super init])
+ {
+ instance = font;
+ return self;
+ }
+ else
+ {
+ return nil;
+ }
+}
+- (rive::rcp)instance
+{
+ return instance;
+}
+
+@end
+
+@implementation RiveRenderImage
+{
+ rive::rcp instance; // note: we do NOT own this, so don't delete it
+}
+- (instancetype)initWithImage:(rive::rcp)image
+{
+ if (self = [super init])
+ {
+ instance = image;
+ return self;
+ }
+ else
+ {
+ return nil;
+ }
+}
+- (rive::rcp)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(bytes, [data length]))];
+}
+
+- (RiveFont*)decodeFont:(nonnull NSData*)data
+{
+ UInt8* bytes = (UInt8*)[data bytes];
+ return [[RiveFont alloc]
+ initWithFont:instance->decodeFont(rive::Span(bytes, [data length]))];
+}
+
+@end
diff --git a/Source/Renderer/RiveFile.mm b/Source/Renderer/RiveFile.mm
index c51a9723..66597f06 100644
--- a/Source/Renderer/RiveFile.mm
+++ b/Source/Renderer/RiveFile.mm
@@ -8,8 +8,12 @@
#import
#import
-#import
+#import
#import
+#import
+#import
+
+#import
/*
* RiveFile
@@ -17,6 +21,7 @@
@implementation RiveFile
{
std::unique_ptr riveFile;
+ rive::FileAssetLoader* fileAssetLoader;
}
+ (uint)majorVersion
@@ -28,7 +33,39 @@ + (uint)minorVersion
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])
+ {
+ 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 error:error];
+ if (!ok)
+ {
+ return nil;
+ }
+ self.isLoaded = true;
+ }
+ @finally
+ {
+ free(bytes);
+ }
+
+ return self;
+ }
+ return nil;
+}
+
+- (nullable instancetype)initWithByteArray:(NSArray*)array
+ loadCdn:(bool)cdn
+ customAssetLoader:(LoadAsset)customAssetLoader
+ error:(NSError**)error
{
if (self = [super init])
{
@@ -40,7 +77,11 @@ - (nullable instancetype)initWithByteArray:(NSArray*)array error:(NSError**)erro
[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
+ customAssetLoader:customAssetLoader
+ error:error];
if (!ok)
{
return nil;
@@ -57,13 +98,15 @@ - (nullable instancetype)initWithByteArray:(NSArray*)array error:(NSError**)erro
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;
@@ -73,33 +116,118 @@ - (nullable instancetype)initWithBytes:(UInt8*)bytes
}
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;
+ }
+ self.isLoaded = true;
+ return self;
+ }
+ 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)delegate
+- (nullable instancetype)initWithHttpUrl:(NSString*)url
+ loadCdn:(bool)loadCdn
+ withDelegate:(id)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)delegate
{
self.isLoaded = false;
if (self = [super init])
@@ -107,11 +235,9 @@ - (nullable instancetype)initWithHttpUrl:(NSString*)url withDelegate:(id
+#import
+#import
+
+@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
diff --git a/Source/Renderer/RiveFileAssetLoader.mm b/Source/Renderer/RiveFileAssetLoader.mm
new file mode 100644
index 00000000..4945f164
--- /dev/null
+++ b/Source/Renderer/RiveFileAssetLoader.mm
@@ -0,0 +1,24 @@
+//
+// CDNFileAssetLoader.m
+// RiveRuntime
+//
+// Created by Maxwell Talbot on 06/11/2023.
+// Copyright © 2023 Rive. All rights reserved.
+//
+
+#import
+#import
+#import
+
+using namespace rive;
+
+@implementation RiveFileAssetLoader
+
+- (BOOL)loadContentsWithAsset:(RiveFileAsset*)asset
+ andData:(NSData*)data
+ andFactory:(RiveFactory*)factory
+{
+ return false;
+}
+
+@end
diff --git a/Source/Renderer/RiveStateMachineInstance.mm b/Source/Renderer/RiveStateMachineInstance.mm
index 9fe5fff5..2b53edb9 100644
--- a/Source/Renderer/RiveStateMachineInstance.mm
+++ b/Source/Renderer/RiveStateMachineInstance.mm
@@ -355,7 +355,6 @@ - (NSInteger)layerCount
- (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
diff --git a/Source/Renderer/include/CDNFileAssetLoader.h b/Source/Renderer/include/CDNFileAssetLoader.h
new file mode 100644
index 00000000..09b2800a
--- /dev/null
+++ b/Source/Renderer/include/CDNFileAssetLoader.h
@@ -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
+
+@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 */
diff --git a/Source/Renderer/include/FileAssetLoaderAdapter.hpp b/Source/Renderer/include/FileAssetLoaderAdapter.hpp
new file mode 100644
index 00000000..14426dab
--- /dev/null
+++ b/Source/Renderer/include/FileAssetLoaderAdapter.hpp
@@ -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
+#import
+
+@class RiveFileAssetLoader;
+
+namespace rive
+{
+
+class FileAssetLoaderAdapter : public FileAssetLoader
+{
+private:
+ RiveFileAssetLoader* loader;
+
+public:
+ FileAssetLoaderAdapter(RiveFileAssetLoader*);
+
+ bool loadContents(rive::FileAsset& asset,
+ rive::Span bytes,
+ rive::Factory* factory) override;
+};
+
+} // namespace rive
+
+#endif /* FileAssetLoaderAdapter_h */
diff --git a/Source/Renderer/include/RenderContext.hh b/Source/Renderer/include/RenderContext.h
similarity index 86%
rename from Source/Renderer/include/RenderContext.hh
rename to Source/Renderer/include/RenderContext.h
index 29c5cefe..7fb6b145 100644
--- a/Source/Renderer/include/RenderContext.hh
+++ b/Source/Renderer/include/RenderContext.h
@@ -4,6 +4,9 @@
#pragma once
+#ifndef render_context_h
+#define render_context_h
+
#import
#import
@@ -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
diff --git a/Source/Renderer/include/RenderContextManager.h b/Source/Renderer/include/RenderContextManager.h
index efed02ff..d5694528 100644
--- a/Source/Renderer/include/RenderContextManager.h
+++ b/Source/Renderer/include/RenderContextManager.h
@@ -4,11 +4,15 @@
#pragma once
+#ifndef render_context_manager_h
+#define render_context_manager_h
+
#import
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
diff --git a/Source/Renderer/include/Rive.h b/Source/Renderer/include/Rive.h
index 82b11b45..26603af2 100644
--- a/Source/Renderer/include/Rive.h
+++ b/Source/Renderer/include/Rive.h
@@ -21,6 +21,11 @@
#import
#import
#import
+// TODO: fix our headers so these can become exposed here
+#import
+#import
+#import
+#import
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 */
diff --git a/Source/Renderer/include/RiveFactory.h b/Source/Renderer/include/RiveFactory.h
new file mode 100644
index 00000000..4e3b418d
--- /dev/null
+++ b/Source/Renderer/include/RiveFactory.h
@@ -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
+
+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 */
diff --git a/Source/Renderer/include/RiveFile.h b/Source/Renderer/include/RiveFile.h
index 7e5c4749..0a800afe 100644
--- a/Source/Renderer/include/RiveFile.h
+++ b/Source/Renderer/include/RiveFile.h
@@ -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)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)delegate;
+- (nullable instancetype)initWithHttpUrl:(NSString*)url
+ loadCdn:(bool)cdn
+ customAssetLoader:(LoadAsset)customAssetLoader
+ withDelegate:(id)delegate;
/// Returns a reference to the default artboard
- (RiveArtboard* __nullable)artboard:(NSError**)error;
diff --git a/Source/Renderer/include/RiveFileAsset.h b/Source/Renderer/include/RiveFileAsset.h
new file mode 100644
index 00000000..756d8160
--- /dev/null
+++ b/Source/Renderer/include/RiveFileAsset.h
@@ -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
+
+@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 */
diff --git a/Source/Renderer/include/RiveFileAssetLoader.h b/Source/Renderer/include/RiveFileAssetLoader.h
new file mode 100644
index 00000000..e6f1bca1
--- /dev/null
+++ b/Source/Renderer/include/RiveFileAssetLoader.h
@@ -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
+
+@class RiveFactory;
+@class RiveFileAsset;
+
+@interface RiveFileAssetLoader : NSObject
+- (BOOL)loadContentsWithAsset:(RiveFileAsset*)asset
+ andData:(NSData*)data
+ andFactory:(RiveFactory*)factory;
+@end
+
+#endif /* RiveFileAssetLoader_h */
diff --git a/Source/Renderer/include/RivePrivateHeaders.h b/Source/Renderer/include/RivePrivateHeaders.h
index ad6a1f1f..a64c6bcc 100644
--- a/Source/Renderer/include/RivePrivateHeaders.h
+++ b/Source/Renderer/include/RivePrivateHeaders.h
@@ -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)font;
+- (rive::rcp)instance;
+@end
+
+@interface RiveRenderImage ()
+- (instancetype)initWithImage:(rive::rcp)image;
+- (rive::rcp)instance;
+@end
diff --git a/Source/Renderer/include/RiveSMIInput.h b/Source/Renderer/include/RiveSMIInput.h
index 064d717b..ff82206c 100644
--- a/Source/Renderer/include/RiveSMIInput.h
+++ b/Source/Renderer/include/RiveSMIInput.h
@@ -14,7 +14,7 @@
NS_ASSUME_NONNULL_BEGIN
/*
- * SMITrigger
+ * SMIInput
*/
@interface RiveSMIInput : NSObject
- (NSString*)name;
diff --git a/Source/Renderer/rive_renderer_view.mm b/Source/Renderer/rive_renderer_view.mm
index dbc375da..b3ae3705 100644
--- a/Source/Renderer/rive_renderer_view.mm
+++ b/Source/Renderer/rive_renderer_view.mm
@@ -10,7 +10,7 @@
#endif
#import "RivePrivateHeaders.h"
-#import
+#import
#import
@implementation RiveRendererView
diff --git a/Source/RiveModel.swift b/Source/RiveModel.swift
index ff1bd197..56f9f529 100644
--- a/Source/RiveModel.swift
+++ b/Source/RiveModel.swift
@@ -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
diff --git a/Source/RiveViewModel.swift b/Source/RiveViewModel.swift
index b8244199..e16f3be0 100644
--- a/Source/RiveViewModel.swift
+++ b/Source/RiveViewModel.swift
@@ -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)
}
diff --git a/Source/Utils/RiveFile+Extensions.swift b/Source/Utils/RiveFile+Extensions.swift
index 4becd3ad..78cf6b63 100644
--- a/Source/Utils/RiveFile+Extensions.swift
+++ b/Source/Utils/RiveFile+Extensions.swift
@@ -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] {
diff --git a/Source/Utils/RiveStateMachineInstance+Extensions.swift b/Source/Utils/RiveStateMachineInstance+Extensions.swift
index c8703789..024d3b54 100644
--- a/Source/Utils/RiveStateMachineInstance+Extensions.swift
+++ b/Source/Utils/RiveStateMachineInstance+Extensions.swift
@@ -9,7 +9,7 @@
import Foundation
extension RiveStateMachineInstance {
- open var inputs: [StateMachineInput] {
+ public var inputs: [StateMachineInput] {
var inputs: [StateMachineInput] = []
for i in 0 ..< inputCount() {
diff --git a/Tests/Assets/embedded_assets.riv b/Tests/Assets/embedded_assets.riv
new file mode 100644
index 00000000..e71056e0
Binary files /dev/null and b/Tests/Assets/embedded_assets.riv differ
diff --git a/Tests/Assets/hosted_assets.riv b/Tests/Assets/hosted_assets.riv
new file mode 100644
index 00000000..96d56bfb
Binary files /dev/null and b/Tests/Assets/hosted_assets.riv differ
diff --git a/Tests/OutOfBandAssetTest.mm b/Tests/OutOfBandAssetTest.mm
new file mode 100644
index 00000000..0079f39b
--- /dev/null
+++ b/Tests/OutOfBandAssetTest.mm
@@ -0,0 +1,116 @@
+//
+// OutOfBandAssetTest.mm
+// RiveRuntimeTests
+//
+// Created by Maxwell Talbot on 21/11/2023.
+// Copyright © 2023 Rive. All rights reserved.
+//
+
+#import
+#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
diff --git a/Tests/RiveDelegatesTest.swift b/Tests/RiveDelegatesTest.swift
index fa0e778c..1bfc43ab 100644
--- a/Tests/RiveDelegatesTest.swift
+++ b/Tests/RiveDelegatesTest.swift
@@ -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] {
diff --git a/Tests/RiveRuntimeTests.mm b/Tests/RiveRuntimeTests.mm
index 4e7768f0..940c6651 100644
--- a/Tests/RiveRuntimeTests.mm
+++ b/Tests/RiveRuntimeTests.mm
@@ -111,6 +111,7 @@ - (void)testRiveFileCreation
// 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 @@ - (void)testRetrieveDefaultArtboardFromRiveFile
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
+ loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
XCTAssert(artboard != NULL);
@@ -135,6 +137,7 @@ - (void)testRetrieveArtboardCountFromRiveFile
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
+ loadCdn:false
error:nil];
NSInteger count = [file artboardCount];
XCTAssert(count == 1);
@@ -147,6 +150,7 @@ - (void)testRetrieveArtboardByIndex
{
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 @@ - (void)testRetrieveArtboardByName
{
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 @@ - (void)testRetrieveAnimationCountFromArtboard
{
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 @@ - (void)testRetrieveFirstAnimation
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
+ loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -204,6 +211,7 @@ - (void)testRetrieveAnimationByIndex
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
+ loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
@@ -219,6 +227,7 @@ - (void)testRetrieveAnimationByName
{
RiveFile* file = [[RiveFile alloc] initWithBytes:pingPongRiveFileBytes
byteLength:156
+ loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
NSError* error = nil;
@@ -236,6 +245,7 @@ - (void)testRetrieveFirstStateMachine
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
+ loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -254,6 +264,7 @@ - (void)testRetrieveStateMachineByIndex
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
+ loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -286,6 +297,7 @@ - (void)testRetrieveStateMachineByName
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
+ loadCdn:false
error:nil];
XCTAssert(file != NULL);
RiveArtboard* artboard = [file artboard:nil];
@@ -308,6 +320,7 @@ - (void)testCreateStateMachineInstance
{
RiveFile* file = [[RiveFile alloc] initWithBytes:stateMachineFileBytes
byteLength:916
+ loadCdn:false
error:nil];
RiveArtboard* artboard = [file artboard:nil];
diff --git a/Tests/RiveViewModelTest.swift b/Tests/RiveViewModelTest.swift
index 328ee272..36b1c569 100644
--- a/Tests/RiveViewModelTest.swift
+++ b/Tests/RiveViewModelTest.swift
@@ -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")
diff --git a/Tests/util.h b/Tests/util.h
index 12a62f32..ab62e0fc 100644
--- a/Tests/util.h
+++ b/Tests/util.h
@@ -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 */
diff --git a/Tests/util.mm b/Tests/util.mm
index 225d5765..c857fd66 100644
--- a/Tests/util.mm
+++ b/Tests/util.mm
@@ -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
diff --git a/scripts/build.rive.sh b/scripts/build.rive.sh
index 617ef181..a9c4b38a 100755
--- a/scripts/build.rive.sh
+++ b/scripts/build.rive.sh
@@ -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
diff --git a/submodules/rive-cpp b/submodules/rive-cpp
index 3d0537a0..911b1631 160000
--- a/submodules/rive-cpp
+++ b/submodules/rive-cpp
@@ -1 +1 @@
-Subproject commit 3d0537a01a32c3b295c8532cf77b3a379a7fb7c1
+Subproject commit 911b1631b81fa4fdc1cc1618ed8776e016eded60