123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //
- // YMGoddessCertifiedProtocolView.h
- // MSYOUPAI
- //
- // Created by YoMi on 2024/3/2.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import "YMBaseView.h"
- NS_ASSUME_NONNULL_BEGIN
- @interface YMGoddessCertifiedProtocolView : YMBaseView
- @property (nonatomic, strong) UIColor *web_progressTintColor;
- @property (nonatomic, strong) UIColor *web_progressTrackTintColor;
- /**
- * 加载一个 webview
- *
- * @param request 请求的 NSURL URLRequest
- */
- - (void)web_loadRequest:(NSURLRequest *)request;
- /**
- * 加载一个 webview
- *
- * @param URL 请求的 URL
- */
- - (void)web_loadURL:(NSURL *)URL;
- /**
- * 加载一个 webview
- *
- * @param URLString 请求的 URLString
- */
- - (void)web_loadURLString:(NSString *)URLString;
- /**
- * 加载本地网页
- *
- * @param htmlName 请求的本地 HTML 文件名
- */
- - (void)web_loadHTMLFileName:(NSString *)htmlName;
- /**
- * 加载本地 htmlString
- *
- * @param htmlString 请求的本地 htmlString
- */
- - (void)web_loadHTMLString:(NSString *)htmlString;
- /**
- * 加载 js 字符串,例如:高度自适应获取代码:
- // webView 高度自适应
- [self web_stringByEvaluateJavaScript:@"document.body.offsetHeight" completionHandler:^(id _Nullable result, NSError * _Nullable error) {
- // 获取页面高度,并重置 webview 的 frame
- self.web_currentHeight = [result doubleValue];
- CGRect frame = webView.frame;
- frame.size.height = self.web_currentHeight;
- webView.frame = frame;
- }];
- *
- * @param javaScriptString js 字符串
- */
- - (void)web_stringByEvaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^ _Nullable)(_Nullable id, NSError * _Nullable error))completionHandler;
- @end
- NS_ASSUME_NONNULL_END
|