Minimap is light way to represent your canvas to mini map.
For base I used PKToolPicker API and Minimap works and looks like PKToolPicker.
- Floating minimap
- Customization
- Dark theme support
- PKToolPicker API
- Orienation support
Minimap is written in Swift 5.1 and is available on iOS 13.
For get instance Minimap using Minimap.shared(for: UIWindow)
Example:
if let minimap = Minimap.shared(for: self.view.window) {
PKToolPicker.shared(for: window)?.addObserver(minimap) // For handling PKToolPicker frame
minimap.observeCanvasView(canvasView) // For handling content changing
minimap.setVisible(!minimap.isVisible, forFirstResponder: canvasView) // Set visible for minimap
canvasView.becomeFirstResponder()
minimap.tintColor = .green // Set visible zone color
}
Minimap will automaticly hidden if responder will resign.
Minimap subscribe to canvas properties like contentSize
, contentOffset
and etc. and present new MinimapHostWindow
for presenting minimap without adding like subview to your views.