ObjectiveSpring icon indicating copy to clipboard operation
ObjectiveSpring copied to clipboard

Animate a Button's arrival in viewdidload

Open connman21 opened this issue 10 years ago • 8 comments

@jamtang - What about animating a button showing up on the Storyboard at all? So, not an action but just its arrival ("slideUp" for example) being triggered in that code?

How would this be initiated in viewdidload?

Thanks!

connman21 avatar Jul 19 '15 01:07 connman21

if it's in storyboard, you'll need to use an IBOutlet to connect to your button, then

@interface ViewController ()

@property (nonatomic, strong) IBOutlet SpringButton *springButton;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    springButton.animation = @"slideUp";
    [springButton animate];

}

jamztang avatar Jul 19 '15 06:07 jamztang

@jamztang - That completely works when I do it in your ObjectiveSpring demo project.

However, when I do it in mine I am getting an error that the "ObjectiveSpring-Swift.h" file not found. Any idea why that would happen? I've added the Spring folder (copied and added groups). I noticed that I don't actually see any file with that name in your project, but it doesn't give that error?

Sorry to keep bugging you, but I am SO CLOSE! Thanks for your help...

connman21 avatar Jul 19 '15 14:07 connman21

You will have to import with correct name. Try change ObjectiveSpring-Swift.h to YourProjectName-Swift.h

https://medium.com/ios-apprentice/using-swift-in-objective-c-projects-f7e7a09f8be

https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

James

— Sent from Mailbox

On Sun, Jul 19, 2015 at 10:12 PM, connman21 [email protected] wrote:

@jamztang - That completely works when I do it in your ObjectiveSpring demo project. However, when I do it in mine I am getting an error that the "ObjectiveSpring-Swift.h" file not found. Any idea why that would happen? I've added the Spring folder (copied and added groups). I noticed that I don't actually see any file with that name in your project, but it doesn't give that error?

Sorry to keep bugging you, but I am SO CLOSE! Thanks for your help...

Reply to this email directly or view it on GitHub: https://github.com/jamztang/ObjectiveSpring/issues/5#issuecomment-122664040

jamztang avatar Jul 19 '15 14:07 jamztang

Figured out that Bridging issue... thanks.

Still working on the animation -- I'll let you know.

connman21 avatar Jul 19 '15 18:07 connman21

Sure, can’t wait to see what you’ll create!

— Sent from Mailbox

On Mon, Jul 20, 2015 at 2:36 AM, connman21 [email protected] wrote:

Figured out that Bridging issue... thanks.

Still working on the animation -- I'll let you know.

Reply to this email directly or view it on GitHub: https://github.com/jamztang/ObjectiveSpring/issues/5#issuecomment-122694174

jamztang avatar Jul 19 '15 18:07 jamztang

Weird @jamztang -- it doesn't seem to work if a page is arrived at via performSegueWithIdentifier even if I have explicitly set the Spring animation into the View Controller.

Can you think of anything that I might be missing?

Thank you SO MUCH for your help... can't wait to show you my app when its done.

connman21 avatar Jul 19 '15 21:07 connman21

@connman21 So the latest Spring fixed the issue : ) https://github.com/MengTo/Spring/issues/31

jamztang avatar Aug 04 '15 13:08 jamztang

Thanks, @jamztang -- appreciate your efforts and response.

I am using this animation library in my new iOS app that releases soon... I'll let you know when you can see it and give you guys a shout-out.

connman21 avatar Aug 04 '15 16:08 connman21