Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.3 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.3 KB

Minimap

Minimap is light way to represent your canvas to mini map.

Swift 5.1

For base I used PKToolPicker API and Minimap works and looks like PKToolPicker.

Features

  • Floating minimap
  • Customization
  • Dark theme support
  • PKToolPicker API
  • Orienation support

Example

Requirements

Minimap is written in Swift 5.1 and is available on iOS 13.

Usage

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.

How it's works?

Minimap subscribe to canvas properties like contentSize, contentOffset and etc. and present new MinimapHostWindow for presenting minimap without adding like subview to your views.