LeadKit/TIUIElements
Boyko Mihail 2da25414da fix: change gif 2021-06-05 12:32:06 +03:00
..
Assets fix: change gif 2021-06-05 12:32:06 +03:00
Sources docs: Add gif and change readme file 2021-06-05 12:08:10 +03:00
README.md fix: align of image in doc 2021-06-05 12:10:06 +03:00
TIUIElements.podspec feat: Add HeaderTransitionDelegate - Helper for transition of TableView header and navigationBar title view 2021-06-03 18:41:27 +03:00

README.md

TIUIElements

Bunch of useful protocols and views:

  • RefreshControl - a basic UIRefreshControl with fixed refresh action.

HeaderTransitionDelegate

Use for transition table header to navigationBar view while scrolling

Your class must implement HeaderViewHandlerProtocol protocol

HeaderViewHandlerProtocol

public protocol HeaderViewHandlerProtocol {
    var largeHeaderView: UIView? { get }
    var headerView: UIView? { get }
    var navigationBar: UINavigationBar? { get }
    var window: UIWindow? { get }
    var tableView: UITableView { get }
}

Usage if your ViewController don't needs extend UITableViewDelegate

let headerTransitionDelegate = HeaderTransitionDelegate(headerViewHandler: self)
tableView.delegate = headerTransitionDelegate

Usage if your ViewController needs extend UITableViewDelegate

let headerTransitionDelegate = HeaderTransitionDelegate(headerViewHandler: self)
tableView.delegate = self
.
.
func scrollViewDidScroll(_ scrollView: UIScrollView) {
    headerTransitionDelegate?.scrollViewDidScrollHandler(scrollView)
    
    /// Your local work
}

Customization

You can use different kinds of animations to change views

HeaderTransitionDelegate(headerViewHandler: HeaderViewHandlerProtocol,
                         headerAnimationType: HeaderAnimationType = .paralaxWithTransition)
  1. headerAnimationType - определяет тип анимации перехода отображений:
    • onlyParalax - applies only parallax effect to the header of table
    • paralaxWithTransition - applies parallax effect to the header of table with transition effect down up of the navigationBar titleView
    • transition - applies only transition effect down up of the navigationBar titleView
    • scale - applies only scale effect down up of the navigationBar titleView
    • paralaxWithScale - applies parallax effect to the header of table with scale effect down up of the navigationBar titleView
    • none (default value) - dont applies any effects

Examples

none

onlyParalax

paralaxWithTransition

transition

scale

paralaxWithScale

Installation via SPM

You can install this framework as a target of LeadKit.