- Confirm whiteboard ratio
- Inserting multimedia content
- Custom App Plugin
- Interface customization
- Using YYKit
How to set the whiteboard scale correctly
A variety of file types can be inserted in the Fastboard. The methods of insertion can be found in FastRoom
-
Inserting music or video
func insertMedia(_ src: URL, title: String, completionHandler: ((String)->Void)? = nil)
-
Inserting an image
func insertImg(_ src: URL, imageSize: CGSize)
-
Insert dynamic ppt
func insertPptx(_ pages: [WhitePptPage], title: String, completionHandler: ((String)->Void)? = nil)
-
Insert static files (including pdf, ppt, doc)
func insertStaticDocument(_ pages: [WhitePptPage], title: String, completionHandler: ((String)->Void)? = nil)
The Custom App plugin extends the whiteboard functionality, and users write js code to implement their own whiteboard plugin.
To operate the Custom App plugin you need to use WhiteSDK
and WhiteRoom
objects, both of which can be found in FastRoom
.
The corresponding property names are whiteSDK
and room
.
Custom App plugin details can be found in Whiteboard-README-CustomApp
All of the following are demonstrated in code in the sample project
- Switching preset themes
- Light
FastRoomThemeManager.shared.apply(FastRoomDefaultTheme.defaultLightTheme)
- Dark
FastRoomThemeManager.shared.apply(FastRoomDefaultTheme.defaultDarkTheme)
- Auto
FastRoomThemeManager.shared.apply(FastRoomDefaultTheme.defaultAutoTheme)
- Light
- Switching custom themes
let white = FastRoomWhiteboardAssets(whiteboardBackgroundColor: .green, containerColor: .yellow) let control = FastRoomControlBarAssets(backgroundColor: .blue, borderColor: .gray, effectStyle: .init(style: .regular)) let panel = FastRoomPanelItemAssets(normalIconColor: .black, selectedIconColor: .systemRed, highlightBgColor: .cyan, subOpsIndicatorColor: .yellow, pageTextLabelColor: .orange) let theme = FastRoomThemeAsset(whiteboardAssets: white, controlBarAssets: control, panelItemAssets: panel) FastRoomThemeManager.shared.apply(theme)
- Modify brush color collection
FastRoomDefaultOperationItem.defaultColors = [.red, .yellow, .blue]
- iPhone
CompactFastRoomOverlay.defaultCompactAppliance = [ .AppliancePencil, .ApplianceSelector, .ApplianceEraser]
- iPad
var items: [FastRoomOperationItem] = [] let shape = SubOpsItem(subOps: RegularFastRoomOverlay.shapeItems) items.append(shape) items.append(FastRoomDefaultOperationItem.selectableApplianceItem(.AppliancePencil, shape: nil)) items.append(FastRoomDefaultOperationItem.clean()) let panel = FastRoomPanel(items: items) RegularFastRoomOverlay.customOptionPanel = { return panel }
- Adjust global appearance
// Toolbar direction left FastRoomView.appearance().operationBarDirection == .left // Toolbar direction right FastRoomView.appearance().operationBarDirection == .right // Toolbar width FastRoomControlBar.appearance().itemWidth = 64 // Toolbar Icons replace FastRoomThemeManager.shared.updateIcons(using: **Some Bundle**)
- Overlay show hide
// Hide all fastRoom.setAllPanel(hide: **isHide**) // Specific Hide fastRoom.setPanelItemHide(item: **key**, hide: **isHide**)
- Use your own overlay (not recommended)
let config = FastRoomConfiguration(appIdentifier: *, roomUUID: *, mToken: *, region: *, userUID: *) // Implement a FastOverlay of your own let customOverlay = CustomOverlay() // Add to FastConfiguration config.customOverlay = customOverlay // Generate Fastboard
- Remake overlay Constraints
// invalid all overlay layout public func invalidAllLayout()
- Choose whether followSystemPencilBehavior
Fastboard.followSystemPencilBehavior
This SDK has a dependency on YYModel by default, if you need to change the dependency to YYKit, you can use the following command:
pod 'Fastboard/core-YYKit'