diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 7d3d40b..438deb6 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-09-10 20:41:42.050199","version":"2.2.2"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-11-15 23:44:20.482386","version":"2.2.2"} \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index e9626a4..310124c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -87,7 +87,7 @@ packages: path: ".." relative: true source: path - version: "2.33.15" + version: "2.34.5" path: dependency: transitive description: diff --git a/ios/Classes/Api/MOP_webViewBounces.h b/ios/Classes/Api/MOP_webViewBounces.h new file mode 100644 index 0000000..0d15f9b --- /dev/null +++ b/ios/Classes/Api/MOP_webViewBounces.h @@ -0,0 +1,19 @@ +// +// MOP_webViewBounces.h +// mop +// +// Created by beetle_92 on 2021/11/16. +// + +#import +#import "MOPBaseApi.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MOP_webViewBounces : MOPBaseApi + +@property (nonatomic, assign) BOOL bounces; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ios/Classes/Api/MOP_webViewBounces.m b/ios/Classes/Api/MOP_webViewBounces.m new file mode 100644 index 0000000..b3a084f --- /dev/null +++ b/ios/Classes/Api/MOP_webViewBounces.m @@ -0,0 +1,32 @@ +// +// MOP_webViewBounces.m +// mop +// +// Created by beetle_92 on 2021/11/16. +// + +#import "MOP_webViewBounces.h" +#import "MOPTools.h" + +@implementation MOP_webViewBounces + +- (void)setupApiWithSuccess:(void (^)(NSDictionary * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel { + UIViewController *currentVC = [MOPTools topViewController]; + WKWebView *webView = [self searchWKWebView:currentVC.view]; + webView.scrollView.bounces = self.bounces; +} + +- (WKWebView *)searchWKWebView:(UIView *)view { + for (UIView *subview in view.subviews) { + if ([subview isKindOfClass:[WKWebView class]]) { + return (WKWebView *)subview; + } + WKWebView *webView = [self searchWKWebView:subview]; + if (webView) { + return webView; + } + } + return nil; +} + +@end diff --git a/ios/mop.podspec b/ios/mop.podspec index 8964a66..36ded5b 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk. s.dependency 'Flutter' s.ios.deployment_target = '9.0' - s.dependency 'FinApplet' , '2.34.5' - s.dependency 'FinAppletExt' , '2.34.5' + s.dependency 'FinApplet' , '2.35.0-alpha20211116v012' + s.dependency 'FinAppletExt' , '2.35.0-alpha20211116v12' end diff --git a/lib/mop.dart b/lib/mop.dart index 855078e..8c08066 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -54,9 +54,7 @@ class Mop { if (handler != null) { return await handler(call.arguments); } - } else if (call.method.startsWith("extensionApi:")) { - - } + } else if (call.method.startsWith("extensionApi:")) {} } /// @@ -242,4 +240,10 @@ class Mop { print(data); return data; } + + /// WKWebView的弹性设置 + void webViewBounces(bool bounces) async { + await _channel.invokeMapMethod("webViewBounces", {'bounces': bounces}); + return; + } }