455 Commits

Author SHA1 Message Date
csmartdalton
3bc87050d2 Updating version files 2023-09-19 22:05:47 +00:00
csmartdalton
a795c2fe60 Add a CG render context to the iOS runtime
Diffs=
42f393436 Add a CG render context to the iOS runtime (#5998)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-09-15 23:41:26 +00:00
csmartdalton
aeb5f94e49 Bump the iOS minimum version to 13 on native builds
Our actual framework targets 14, so this won't have any effect on clients.

This also allows us to quit targeting armv7.

And cut out arm64e as well. Let's keep our release lean.

Diffs=
05e1afaf3 Bump the iOS minimum version to 13 on native builds (#5989)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-09-15 07:53:24 +00:00
zplata
072aca5b82 Updating version files 2023-09-13 19:53:51 +00:00
zplata
064fd46b1c feature: Add Rive Event bindings to iOS runtime
Adds event bindings for iOS/macOS

**Caveat:** tl;dr We may have to explicitly make app owners open URLs for `OpenUrlEvent`, rather than doing it implicitly

Recently, there was a [request for a specific change](https://github.com/rive-app/rive-ios/pull/267) to mark `RiveRuntime` package as using application-extension-safe in terms of API usge. This allows RiveRuntime to be used in places other than apps in the Apple ecosystem, which they needed, so that Apple doesn't flag their apps negatively in App Store submissions. Because we mark this setting in build settings for our package, this means we can't use a specific API to access `UIApplication`, which is needed to open URLs from our side (i.e. `UIApplication.shared.open(url)`), thus not allowing us to _directly_ open URLs on `OpenUrlEvent`. Couldn't find a way around this unfortunately, so the onus on opening the URL will be on the consumer when they listen for this event.

Diffs=
b47ff1523 feature: Add Rive Event bindings to iOS runtime (#5899)

Co-authored-by: Zachary Plata <plata.zach@gmail.com>
2023-09-13 18:07:11 +00:00
HayesGordon
330c29b563 Updating version files 2023-09-13 17:00:02 +00:00
csmartdalton
ee7b6c45d5 Updating version files 2023-09-12 01:06:31 +00:00
csmartdalton
ed4d6c9f5f Fix the iOS release
* Build fat libraries
* Configure the bots to install python PLY
* Fix a cp command in the macosx build
* Only publish release builds of PLS

Diffs=
e53ea111b Fix the iOS release (#5967)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-09-11 19:05:53 +00:00
csmartdalton
1dbf44304b Fix ios builds when PLS is not present
Diffs=
ea5593879 Fix ios builds when PLS is not present (#5959)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-09-08 19:24:39 +00:00
csmartdalton
b1f11bf828 Integrate the Rive renderer into iOS
Diffs=
afc961233 Integrate the Rive renderer into iOS (#5952)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Co-authored-by: Luigi Rosso <luigi.rosso@gmail.com>
2023-09-08 18:30:17 +00:00
HayesGordon
d1edfc1926 Updating version files 2023-08-14 12:06:08 +00:00
HayesGordon
7906a93e91 Updating version files 2023-08-10 11:51:17 +00:00
zplata
31027d559f Updating version files 2023-08-07 19:03:10 +00:00
zplata
af41f0a96c Updating version files 2023-08-05 16:43:44 +00:00
zplata
90ec2888c0 Updating version files 2023-08-03 01:21:38 +00:00
zplata
8568b32902 Updating version files 2023-07-31 22:42:20 +00:00
zplata
c674b856e6 Updating version files 2023-07-31 18:30:42 +00:00
zplata
7fd8df317e Add text binding ios
Redoing the PR from: https://github.com/rive-app/rive/pull/5683

Wasn't recognizing latest commits for some reason, Github was having some PR status issues yesterday so might've been from that

Diffs=
fe466871e Add text binding ios (#5687)

Co-authored-by: Zachary Plata <plata.zach@gmail.com>
2023-07-31 14:07:41 +00:00
luigi-rosso
8c52c9ebe1 Updating version files 2023-07-26 18:13:26 +00:00
zplata
bbf55a33ea Updating version files 2023-07-21 14:00:44 +00:00
mjtalbot
ea061e0190 fixup touch location for ios when the riveview is a subview
i've manually tested this changing our simple animation view controller to this:

(had to also install snapkit for this example to work btw)

i should probably check the commit history to see if there's some rationale behind adding origin into the mix, or if that was just "the first guess" as we need origin in our own sizing...

```
//
//  SimpleAnimation.swift
//  RiveExample
//
//  Created by Maxwell Talbot on 06/05/2021.
//  Copyright © 2021 Rive. All rights reserved.
//

import UIKit
import RiveRuntime
import SwiftUI
import SnapKit

class SimpleAnimationViewController: UIViewController {
    var viewModel = RiveViewModel(fileName: "play_button_event_example")
    var viewModel2 = RiveViewModel(fileName: "play_button_event_example")

    override func viewWillAppear(_ animated: Bool) {
        let riveContainerView = UIView()
        let riveView = viewModel.createRiveView()

        if (false){
//            bad

            let topSpacer = UILayoutGuide()
            let midSpacer = UILayoutGuide()
            let bottomSpacer = UILayoutGuide()

            [riveView].forEach(view.addSubview)
            [topSpacer, midSpacer, bottomSpacer].forEach(view.addLayoutGuide)

            topSpacer.snp.makeConstraints { make in
                make.top.left.right.equalToSuperview()
                make.height.equalTo(bottomSpacer)
            }

            midSpacer.snp.makeConstraints { make in
                make.top.equalTo(topSpacer.snp.bottom)
                make.left.right.equalToSuperview()
                make.height.equalTo(bottomSpacer)
            }

            riveView.snp.makeConstraints { make in
                make.top.equalTo(midSpacer.snp.bottom)
                make.width.equalToSuperview()
                make.height.equalTo(riveView.snp.width)
            }

            bottomSpacer.snp.makeConstraints { make in
                make.bottom.left.right.equalToSuperview()
                make.top.equalTo(riveView.snp.bottom)
                make.height.greaterThanOrEqualTo(1)
            }

        }else {

    //            good

                let topSpacer = UILayoutGuide()
                let midSpacer = UILayoutGuide()
                let bottomSpacer = UILayoutGuide()

                riveContainerView.addSubview(riveView)

                [riveContainerView].forEach(view.addSubview)
                [topSpacer, midSpacer, bottomSpacer].forEach(view.addLayoutGuide)

                topSpacer.snp.makeConstraints { make in
                    make.top.left.right.equalToSuperview()
                    make.height.equalTo(bottomSpacer)
                }

                midSpacer.snp.makeConstraints { make in
                    make.top.equalTo(topSpacer.snp.bottom)

                    make.left.right.equalToSuperview()
                    make.height.equalTo(bottomSpacer)
                }

            riveContainerView.snp.makeConstraints { make in
                    make.top.equalTo(midSpacer.snp.bottom)
                    make.width.equalToSuperview()
                    make.height.equalTo(riveView.snp.width)
                }

                riveView.snp.makeConstraints { make in
                    make.edges.equalToSuperview()
                }

                bottomSpacer.snp.makeConstraints { make in
                    make.bottom.left.right.equalToSuperview()
                    make.top.equalTo(riveView.snp.bottom)
                    make.height.greaterThanOrEqualTo(1)
                }
        }

    }
}

```

Diffs=
f3176e045 fixup touch location for ios when the riveview is a subview (#5592)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-17 13:33:10 +00:00
zplata
afb60b7078 Updating version files 2023-06-26 19:58:53 +00:00
zplata
04f70fba73 Updating version files 2023-05-31 15:14:17 +00:00
zplata
1b78705768 Add support for injecting Bundle when creating RiveFile
[Downstream community contribution](https://github.com/rive-app/rive-ios/pull/250) to support pulling Rive files from bundles other than `.main`

Diffs=
46a0745e6 Add support for injecting Bundle when creating RiveFile (#5335)

Co-authored-by: Robert Dresler <robertdreslerjr@gmail.com>
Co-authored-by: Zachary Plata <plata.zach@gmail.com>
2023-05-31 14:15:25 +00:00
zplata
c2d642b81e Updating version files 2023-05-25 18:46:54 +00:00
zplata
23f8d39a9e patch: only set riveView to nil on a viewmodel if the view Swift wants to dismantle is the same as the riveView property on viewmodel
Potential fix for a reported issue on Discord - where `.riveVIew` on a RiveVIewModel is unexpectedly being set to nil on:
- Navigation changes (i.e., using a `NavigationView`)
- View being re-drawn due to state changes in the component

Our current `RiveViewRepresentable` implements `makeUIView` and `dismantleUIView` - the former creating a new `RiveView()` and setting it on `.riveView` in the view model, and the latter setting `.riveView` to `nil` blindly. In the case of NavigationView, if you re-enter a route, what happens in Swift behind the scenes is it makes a new view, then trashes the old view - `makeUIView` then `dismantleUIView`. This means that the new view is set onto `.riveVew` property but then quickly set to `nil` due to `dismantleUIView`.

This change guarantees that when `dismantleUIView` is called, we only set `.riveView = nil` **iff** the view Swift wants to dismantle is the same view as the `.riveView` on the view model.

Diffs=
05f43724b patch: only set riveView to nil on a viewmodel if the view Swift wants to dismantle is the same as the riveView property on viewmodel (#5295)
2023-05-25 17:44:06 +00:00
mjtalbot
59775f832b Updating version files 2023-05-24 13:06:09 +00:00
mjtalbot
2642a65303 Updating version files 2023-05-24 12:19:30 +00:00
mjtalbot
b6d48a1f7b Macos take2
draft because i need to get a todo list together.

Adds macos as a target for our ios runtime! Also adds a macos target for our example (which is a different app completely, very minimalistic right now).

<img width="331" alt="CleanShot 2023-05-17 at 20 32 45@2x" src="https://github.com/rive-app/rive/assets/1216025/7a6cadce-9763-41a3-b1a0-6d067dfc3eca">

macos, macos rosetta, macos (designed for ipad), and ios  all co existing in peace, from the same runtime project

![CleanShot 2023-05-17 at 18 32 04@2x](https://github.com/rive-app/rive/assets/1216025/eead319d-a16b-4098-a7db-d5f033b1ef8f)

todo:
- [x] update build scripts to build supporting macos (gotta do this)
- [x] run formatter
- [x] test out builds in forked version of ios? (gotta do this)
- [ ] one more stab at catalyst? (i think we can try that later...)
- [ ] do we need a more comprehensive example setup for macos (I think we can do this later & try to pull zach's examples in)
- [ ] I think we should restructure the ios project, but i think we can do that after this as well (i just think the folder structure/project structure can do with some work, now that we add macos (and should make room for tvos as well)
- [x] probably got tests to fix
- [ ] there's probably a bunch of looking at errors in the debugger and figuring those out, but i would hope that we can deploy with some warnings here too.

catalyst problem:

we get this error:
and the problem is basically that we can target a specific library for macos, but we need one for macos and one for macos catalyst. they share the same architecture, so i dont think we can lipo them into one file...

we could change the compiled binaries before creating the frameworks I guess though? .. maybe something to try..

`/Users/maxwelltalbot/development/rive/rive/packages/runtime_ios/dependencies/debug/librive_skia_renderer_macos.a(cg_factory.o), building for Mac Catalyst, but linking in object file built for macOS, file '/Users/maxwelltalbot/development/rive/rive/packages/runtime_ios/dependencies/debug/librive_skia_renderer_macos.a' for architecture arm64` basically

Diffs=
a9f8a1c5d Macos take2 (#5258)
2023-05-24 11:15:51 +00:00
HayesGordon
11f4690b5e Updating version files 2023-05-12 16:09:19 +00:00
mjtalbot
4d4b4a9d31 Updating version files 2023-04-26 14:14:17 +00:00
mjtalbot
c4238e9b36 Ios memory shared context
Set of ios changes:
- Fixes a couple of memory leaks
- Implements ref counting for our graphics context, so we can ditch it if noone's using it
- few leftover notes about things i've not quite "solved" we still keep a hold of too much url data, but i think i want to get this change in. its been too long

Diffs=
1ddbb679a Ios memory shared context (#5169)
2023-04-26 13:27:28 +00:00
zplata
cbfe3f9196 Updating version files 2023-04-14 14:19:18 +00:00
zplata
24556e417d Updating version files 2023-04-13 15:10:14 +00:00
zplata
bc8ac1ed17 Updating version files 2023-04-06 17:20:01 +00:00
zplata
521255905e fix riveModel force-unwrap crash
Community contribution: https://github.com/rive-app/rive-ios/pull/246

Tested their crash example on the example app in this runtime and their changes seem to fix the crash repro they provided in the above PR

Diffs=
2701dee55 fix riveModel force-unwrap crash (#5089)
2023-04-04 14:07:19 +00:00
luigi-rosso
5185488bf6 Rename reset to rewind.
In profiling Joel we saw that RawPath::reset was causing a lot of re-allocation. We realized the intention of reset in most of Rive code is to actually call rewind, so we renamed it and made other adjustments (like calling RawPath::rewind).

Diffs=
f4046e60b Rename reset to rewind. (#5004)
2023-03-16 21:12:29 +00:00
mjtalbot
ae09eef8ab Updating version files 2023-03-03 19:41:41 +00:00
mjtalbot
3fa665d203 Updating version files 2023-03-01 15:06:17 +00:00
mjtalbot
07f48dee06 apply missing animation fix to macos and android
couple more fun patches to cope when animation state objects do not have an animation.

Diffs=
272ca3f02 apply missing animation fix to macos and android (#4847)
2023-02-22 12:50:42 +00:00
mjtalbot
e6005f6779 Updating version files 2023-02-20 15:47:25 +00:00
mjtalbot
a2cb5ea201 address an issue where a state without an aniimation can break advanc…
…ing state machines in ios

Diffs=
cef9bd8cd address an issue where a state without an aniimation can break advanc… (#4832)
2023-02-15 18:41:20 +00:00
csmartdalton
627ecee71c Update ObjC formatting to look more similar to the C++
Also update the auto formatter to run on *.m and *.mm files, and effectively ban breaking on return types entirely, as I think this is ugly.

Diffs=
c7d125c7d Update ObjC formatting to look more similar to the C++
2023-02-15 17:24:57 +00:00
csmartdalton
e88b16bd03 Make the ios FPSCounterView more stable
* Calculate the accumulated frame rate over the entire update interval.

* Update FPS when we actually draw, instead of when we advance the animation.

Diffs=
1ec31ffba Make the ios FPSCounterView more stable
2023-01-31 20:21:36 +00:00
duncandoit
47196b50be Updating version files 2023-01-04 20:31:34 +00:00
duncandoit
8b30fc71e0 Deregister view in RiveViewModel
RiveViewModel's .deregisterView() method now has open access

Diffs=
1b9b07f0a RiveViewModel's .deregisterView() method now has open access
2023-01-04 19:40:39 +00:00
duncandoit
75442f849b Updating version files 2022-12-15 17:43:47 +00:00
duncandoit
a0d2cfbb0c iOS/Mac get artboard names from RiveViewModel
Added a convenience method in RiveViewModel for checking the current file's artboard names

Diffs=
9b4f3aea3 Added a convenience method in RiveViewModel for checking the current file's artboard names
2022-12-15 00:16:39 +00:00
duncandoit
4b03b7a0ae iOS project reorg
Reorganized the project to put it inline with the cleaner organization of the mac runtime

Diffs=
3468941d0 Reorganized the project to put it inline with the cleaner organization of the mac runtime
2022-12-15 00:07:37 +00:00
duncandoit
dcc14c5455 Updating version files 2022-11-22 22:45:01 +00:00