{"id":7976,"date":"2015-11-14T08:46:10","date_gmt":"2015-11-14T08:46:10","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/14\/creating-a-pop-animation-similar-to-the-presentation-of-uialertview-open-source-projects-facebook-pop\/"},"modified":"2015-11-14T08:46:10","modified_gmt":"2015-11-14T08:46:10","slug":"creating-a-pop-animation-similar-to-the-presentation-of-uialertview-open-source-projects-facebook-pop","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/14\/creating-a-pop-animation-similar-to-the-presentation-of-uialertview-open-source-projects-facebook-pop\/","title":{"rendered":"Creating a Pop animation similar to the presentation of UIAlertView-open source projects facebook\/pop"},"content":{"rendered":"<p>I would like to present a view in the same manner as that of UIAlertView &#8211; a pop\/spring. Unfortunately subclassing UIAlertView is not an option for the view I need to present. I have written some code, but I can&#8217;t seem to get it as realistic as I would like. I would appreciate any suggestions for greater realism or a link if anything similar has been done (I could not find anything on Google). Thank you.<\/p>\n<pre><code>  - (id)initWithFrame:(CGRect)frame {\n    if ((self = [super initWithFrame:frame])) {\n\n        self.backgroundColor = [UIColor whiteColor];\n\n        v = [[UIView alloc] initWithFrame:CGRectMake(140, 140, 60, 60)];\n        v.backgroundColor = [UIColor blueColor];\n\n        [self addSubview:v];\n        [self animate];\n\n    }\n    return self;\n}\n\n- (void)animate {\n\n    [UIView beginAnimations:nil context:NULL];\n    [UIView setAnimationCurve:UIViewAnimationCurveLinear];\n    [UIView setAnimationDuration:0.2];\n    [UIView setAnimationDelegate:self];\n    [UIView setAnimationDidStopSelector:@selector(popStep1Complete)];\n    v.frame = CGRectMake(90, 90, 140, 140);\n    [UIView commitAnimations];\n}\n\n- (void)popStep1Complete {\n\n    [UIView beginAnimations:nil context:NULL];\n    [UIView setAnimationCurve:UIViewAnimationCurveLinear];\n    [UIView setAnimationDuration:0.15];\n    [UIView setAnimationDelegate:self];\n    [UIView setAnimationDidStopSelector:@selector(popStep2Complete)];\n    v.frame = CGRectMake(110, 110, 100, 100);\n    [UIView commitAnimations];\n}\n\n- (void)popStep2Complete {\n\n    [UIView beginAnimations:nil context:NULL];\n    [UIView setAnimationCurve:UIViewAnimationCurveLinear];\n    [UIView setAnimationDuration:0.15];\n    v.frame = CGRectMake(100, 100, 120, 120);\n    [UIView commitAnimations];\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I would like to present a view in the same manner as that of UIAlertView &#8211; a pop\/spring. Unfortunately subclassing UIAlertView is not an option for the view I need to present. I have written some code, but I can&#8217;t seem to get it as realistic as I would like. I would appreciate any suggestions [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7976","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7976"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7976\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}