iOS - Resize multiple views with touch-drag separators

前端 未结 5 2026
暗喜
暗喜 2021-01-01 04:20

How can I resize views with a separator? What I\'m trying to do is something like Instagram layout app. I want to be able to resize views by dragging the line that separates

5条回答
  •  耶瑟儿~
    2021-01-01 04:41

    I've updated @JULIIncognito's Swift class to Swift 4, added a drag indicator and fixed some typos.

    SeparatorView

    Just import in into your project and use it like so:

    SeparatorView.addSeparatorBetweenViews(separatorType: .horizontal, primaryView: view1, secondaryView: view2, parentView: self.view)
    

    This is how it looks like (MapView on top, TableView on bottom):

提交回复
热议问题