-
Notifications
You must be signed in to change notification settings - Fork 68
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
Conversation
@@ -58,7 +58,7 @@ class LayoutViewController: UIViewController { | |||
default: | |||
fit = Fit.Contain | |||
} | |||
layoutView.riveView.setFit(fit:fit) | |||
layoutView.riveView.fit = fit |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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()) } ) |
There was a problem hiding this comment.
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
No description provided.