Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hacked in play/pause to SwiftUI #28

Merged
merged 2 commits into from
May 11, 2021
Merged

Hacked in play/pause to SwiftUI #28

merged 2 commits into from
May 11, 2021

Conversation

mjohnsullivan
Copy link
Contributor

No description provided.

@mjohnsullivan mjohnsullivan requested a review from mjtalbot May 10, 2021 23:38
@@ -58,7 +58,7 @@ class LayoutViewController: UIViewController {
default:
fit = Fit.Contain
}
layoutView.riveView.setFit(fit:fit)
layoutView.riveView.fit = fit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it

@@ -81,6 +81,7 @@ typedef NS_ENUM(NSInteger, Alignment) {
- (const RiveSMIBool *)getBool:(NSString*)name;
- (const RiveSMITrigger *)getTrigger:(NSString*)name;
- (const RiveSMINumber *)getNumber:(NSString*)name;
- (NSString* )name;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:o does the instance even have a name?

@@ -32,7 +32,7 @@ - (instancetype)initWithStateMachine:(const rive::StateMachine *)stateMachine;
* RiveStateMachine interface
*/
@interface RiveStateMachine ()
- (instancetype)initWithStateMachine:(const rive::StateMachine *)riveStateMachine;
- (instancetype)initWithStateMachine:(const rive::StateMachine *)stateMachine;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh :P yeah there's a question of names like this :P should we prefix everything with rive, or leave that as implied...

instance = new rive::StateMachineInstance(stateMachine);
return self;
} else {
return nil;
}
}

-(void) applyTo:(RiveArtboard*) artboard {
- (void) applyTo:(RiveArtboard*)artboard {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what formatter do you use? my xcode doesnt do shit for formatting, is there something we can use here?

@@ -541,6 +543,11 @@ - (RiveSMINumber *)getNumber:(NSString *) name {
}
}

- (NSString *)name {
std::string str = stateMachine->name();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh!

private func _pause(_ animation: RiveLinearAnimationInstance) {
let removed = playingAnimations.remove(animation)
if removed != nil {
eventQueue.add( { self.pauseDelegate?.pause(animation.name()) } )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohhhh... maybe i should do it this way in android too.... i currently just call the callback

@mjtalbot mjtalbot merged commit 1d6a5a1 into master May 11, 2021
@mjtalbot mjtalbot deleted the fixes_5_10 branch May 12, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants