From f6eb200363622923235c07e4227c690b8a0684a3 Mon Sep 17 00:00:00 2001 From: AppFeel Date: Tue, 23 Jun 2015 19:24:54 +0200 Subject: [PATCH] Add fade method --- src/ios/OverAppBrowser.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ios/OverAppBrowser.m b/src/ios/OverAppBrowser.m index 79b66b4..29d8b17 100755 --- a/src/ios/OverAppBrowser.m +++ b/src/ios/OverAppBrowser.m @@ -85,6 +85,21 @@ - (void) open:(CDVInvokedUrlCommand *)command } +- (void)fade:(CDVInvokedUrlCommand *)command { + NSArray* arguments = [command arguments]; + NSUInteger argc = [arguments count]; + + if (argc < 2) { + return; + } + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationDuration:[[arguments objectAtIndex:0] floatValue]]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [self.overWebView setAlpha:[[arguments objectAtIndex:1] floatValue]]; + [UIView commitAnimations]; +} + - (BOOL)isValidCallbackId:(NSString *)callbackId { NSError *err = nil;