Skip to content

Conversation

@wooooooong
Copy link

  • delete minimap datasource (because the data is not dynamic, just need to set the data when init the minimap view)

  • just need to init minimap view and pass the scroll view, image, downsize ratio for the size of minimap view compared to scroll view and selectively, the minimap image if the image for the minimap is different from the image of the scroll view.

scrollView.contentInsetAdjustmentBehavior = .never
scrollImageView = UIImageView(frame: CGRect(x: 0, y: 0,
width: scrollView.frame.width,
height: scrollView.frame.height))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrollImageView = UIImageView(frame: CGRect(origin: .zero, size: scrollView.frame.size))

This style looks better for minimizing code.

}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is THMinimapViewcan still be used from storyboard with setUp(scrollView:downSizeRatio:image:minimapImage) ?
Call default setUp()function, or you should handle required property from another function.(not from init)
For example,

let minimapView = THMinimapView()
minimapView.setup(scrollView: scrollView, downSizeRatio: downSizeRatio, image: image, minimapImage: minimapImage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants