PLVContentAreaView
Objective-C
@interface PLVContentAreaView : UIView
/// 频道信息
@property (nonatomic, strong) PLVWebViewLiveChannelInfo * __nullable liveChannelInfo;
/// 加载的WebView
@property (nonatomic, strong, readonly) PLVWKWebView *mainWebView;
/// 设置视图控制器和WebView配置
/// @param webViewController 当前页面的视图控制器
/// @param config 配置项
- (void)setupWebViewController:(UIViewController *)webViewController config:(PLVWebViewConfig *)config;
/// 添加至外部父视图
- (void)addToSuperview:(UIView *)view;
/// 销毁方法
- (void)destroy;
#pragma mark 小窗操作
/// 主动切换到悬浮窗
/// @note 当allowFloatingWindow为YES、supportFloatingWindow也为YES时才会切换
- (BOOL)changeToFloatingWindow;
/// 点击商品来唤出小窗
/// @param link 商品链接
/// @param data 商品数据
/// @param size 小窗尺寸
/// @param newPage 是否打开新页面
- (void)changeToWindowForProductLink:(NSString *)link data:(NSDictionary *)data size:(CGSize)size newPage:(BOOL)newPage;
/// 小窗恢复到正常全屏页面状态
- (void)revertWindowToNormal;
/// 主动关闭悬浮窗
/// @note 主动调用不触发相关回调
- (void)closeWindow;
/// 获取当前网络状态
- (void)getCurrentNetworkStatus;
@end
Swift
class PLVContentAreaView
Undocumented
-
频道信息
Declaration
Objective-C
@property (nonatomic, strong) PLVWebViewLiveChannelInfo *_Nullable liveChannelInfo;
Swift
var liveChannelInfo: PLVWebViewLiveChannelInfo? { get set }
-
加载的WebView
Declaration
Objective-C
@property (nonatomic, strong, readonly) PLVWKWebView *_Nonnull mainWebView;
Swift
var mainWebView: PLVWKWebView { get }
-
设置视图控制器和WebView配置
Declaration
Objective-C
- (void)setupWebViewController:(id)webViewController config:(nonnull PLVWebViewConfig *)config;
Swift
func setupWebViewController(_ webViewController: Any!, config: PLVWebViewConfig)
Parameters
webViewController
当前页面的视图控制器
config
配置项
-
添加至外部父视图
Declaration
Objective-C
- (void)addToSuperview:(id)view;
Swift
func add(toSuperview view: Any!)
-
销毁方法
Declaration
Objective-C
- (void)destroy;
Swift
func destroy()
-
主动切换到悬浮窗
Note
当allowFloatingWindow为YES、supportFloatingWindow也为YES时才会切换Declaration
Objective-C
- (BOOL)changeToFloatingWindow;
Swift
func changeToFloatingWindow() -> Bool
-
点击商品来唤出小窗
Declaration
Objective-C
- (void)changeToWindowForProductLink:(nonnull NSString *)link data:(nonnull NSDictionary *)data size:(CGSize)size newPage:(BOOL)newPage;
Swift
func changeToWindow(forProductLink link: String, data: [AnyHashable : Any], size: CGSize, newPage: Bool)
Parameters
link
商品链接
data
商品数据
size
小窗尺寸
newPage
是否打开新页面
-
小窗恢复到正常全屏页面状态
Declaration
Objective-C
- (void)revertWindowToNormal;
Swift
func revertWindowToNormal()
-
主动关闭悬浮窗
Note
主动调用不触发相关回调Declaration
Objective-C
- (void)closeWindow;
Swift
func closeWindow()
-
获取当前网络状态
Declaration
Objective-C
- (void)getCurrentNetworkStatus;
Swift
func getCurrentNetworkStatus()