Latest 0.1.1
Homepage https://github.com/TileImageTeamiOS/UIScrollView_minimap
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors , ,

THScrollView-minimap

Version
License: MIT
Build Status
Platform
Swift 4.0

Feature

  • [x] 🗺 Map will shows based on your ScrollView.
  • [x] 🖍 Focused Box in MiniMap will follow user’s sight and resizable.

Demo

minimap_demo

Installation

CocoaPods

To integrate THScrollView-minimap into your Xcode project using CocoaPods, specify it in your Podfile:

pod "THScrollView-minimap"

Requirements

THScrollView-minimap is written in Swift 4, and compatible with iOS 9.0+

How to use

// StoryBoard에 MinimapView 위치 설정
// Set the position of MinimapView on the Storyboard
@IBOutlet weak var minimapView: MinimapView!

// minimap이 참고할 scrollView 와 imageView 설정(minimap에 originImageSize를 쓰게될 경우)
// Set the scrollView and the imageView which are referred by the minimap - 1. the case of using originImageSize
minimapDataSource = MyMinimapDataSource(scrollView: scrollView, thumbnailImage: imageView.image!, originImageSize: nil)
// minimap에 thumbnailImage를 쓸 경우
// 2. the case of using thumbnailImage
minimapDataSource = MyMinimapDataSource(scrollView: scrollView, thumbnailImage: UIImage(contentsOfFile: thumbnailImageURL.path)!, originImageSize: CGSize(width: 5214, height: 7300))

// mimimap의  borderWidth 설정
// Set the width of the minimap's border
minimapDataSource.borderWidth = 2.0

// minimap의 color 설정
// Set the color of the minimap's border
minimapDataSource.borderColor = UIColor.yellow

// minimap이 참고한 image 사이즈의 비율 정하기 (ex, image의 1/4 크기)
// Set the ratio of image Size which is referred by the minimap
minimapDataSource.downSizeRatio = 4.0

// minimapView에 설정
// Set the minimap
minimapView.set(dataSource: minimapDataSource)

// 그 후에 UIScrollViewDelegate의 scrollViewDidScroll에 다음과 같은 코드를 추가해 줍니다.
// Then, add the following codes on the ScrollViewDidScroll of the UIScrollViewDelegate
extension ViewController: UIScrollViewDelegate {
    public func scrollViewDidScroll(_ scrollView: UIScrollView) {
        minimapDataSource.resizeMinimapView(minimapView: minimapView)
    }
}

MinimapView and Data Source

MinimapView draws the Minimap by referring ScrollView and the ImageView. You can set the attributes for drawing the view by using MinimapDatasource

License

THScrollView-minimap is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "UIScrollView_minimap",
    "version": "0.1.1",
    "summary": "create minimap by UIScrollView",
    "description": "UIScrollView_minimap is a awesome module that shows the part of image in the scroll view as a form of minimap",
    "homepage": "https://github.com/TileImageTeamiOS/UIScrollView_minimap",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Hong Seong Ho": "[email protected]",
        "Changnam Hong": "[email protected]",
        "Han JeeWoong": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/TileImageTeamiOS/UIScrollView_minimap.git",
        "tag": "0.1.1"
    },
    "source_files": "ScrollViewMinimap/Minimap/*.swift",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This