A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Related tags

UI Arale
Overview

License Platform Version

Arale

A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built for iOS 10 and later.

Demo

Example 1

Arale, by ZulwiyozaPutra

  • Compatible with UITableView, UICollectionView, or any UIScrollView subclasses.
  • Data source and delegate independency: can be added to an existing view controller without interfering with your existing delegate or dataSource.
  • No need to subclass a custom view controller or to use a custom UICollectionViewLayout.

If you are using this library in your project, I would be more than glad to know about it!

Usage

To add a stretchy header to your table or collection view, you just have to do this:

import Arale

init with optional backgroundImage

let araleHeaderView = AraleHeaderView(minHeight: 256.0, backgroundImage: myBackgroundImage)
self.tableView.addSubview(araleHeaderView)

In case you want to add a UIActivityIndicatorView, to handle action if the AraleHeaderView did resize to maxHeight you can implement a AraleHeaderViewDelegate conformed UIViewController

araleHeaderView.delegate = self

You can implement headerViewDidReachMaxHeight method to get event when the araleHeaderView did reach the maximum height

func headerViewDidReachMaxHeight(_ headerView: AraleHeaderView) {
    NSLog("%@", "Start Refreshing")
    headerView.activityIndicatorView.stopAnimating()
}

AraleHeaderViewDelegate comes with three optional delegate method

func headerViewWillResizeFrame(_ headerView: AraleHeaderView)
func headerViewDidResizeFrame(_ headerView: AraleHeaderView)
func headerViewDidReachMaxHeight(_ headerView: AraleHeaderView)

Configuration

You can add an optional UIViewActivityIndicatorView in your stretchy header view:

let myActivityIndicatorview = UIActivityIndicatorView(style: .white)
araleHeadeView.activityIndicatorView = myActivityIndicatorView

the activityIndicatorView will not be rendered if remain nil in case you don't need an activityIndicator.

Installation

Arale is available through CocoaPods. To install it, simply add the following line to your Podfile, you can check the Example Podfile to see how it looks like:

pod "Arale"

Author

Zulwiyoza Putra

Contributions

Contributions are more than welcome! If you find a solution for a bug or have an improvement, don't hesitate to open a pull request!

License

Arale is available under the MIT license. See the LICENSE file for more info.

If your app uses Arale, I'd be glad if you reach me via Twitter or via email.

You might also like...
A SwiftUI Library for creating resizable partitions for View Content.
A SwiftUI Library for creating resizable partitions for View Content.

Partition Kit Recently Featured In Top 10 Trending Android and iOS Libraries in October and in 5 iOS libraries to enhance your app! What is PartitionK

A framework that provides CurtainController. CurtainController is a container view controller that implements a content-curtain interface. You can find a similar implementation in applications like Apple Maps, Find My, Stocks, etc. Someone calls it
A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View

ScrollViewIfNeeded A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View Installation Requirements iOS 13+ Swift Package Manag

A framework which helps you attach observers to `UIView`s to get updates on its frame changes

FrameObserver is a framework that lets you attach observers to any UIView subclass and get notified when its size changes. It doesn't use any Method S

Elissa displays a notification on top of a UITabBarItem or any UIView anchor view to reveal additional information.
Elissa displays a notification on top of a UITabBarItem or any UIView anchor view to reveal additional information.

Elissa Attach a local notification to any UIView to reveal additional user guidance. Usage Example Per default, Elissa will try to align to the center

An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Placeholder views based on content, loading, error or empty states
Placeholder views based on content, loading, error or empty states

StatefulViewController A protocol to enable UIViewControllers or UIViews to present placeholder views based on content, loading, error or empty states

🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction 🔍 Awesome search view, written in Swift 5.0, appears search view like Pinteres

iOS custom controller used in Jobandtalent app to present new view controllers as cards
iOS custom controller used in Jobandtalent app to present new view controllers as cards

CardStackController iOS custom controller used in the Jobandtalent app to present new view controllers as cards. This controller behaves very similar

Comments
  • Add supplementary overlay view

    Add supplementary overlay view

    Hello! I think it would be really neat if we could feed our own view into Arale, to be shown in front of the image view.

    At the moment this is difficult to achieve because the image view is added to the view hierarchy only after the header view is added to the scroll view so if we were to add our customizations in a factory method, the image view would be displayed in front of whatever subviews we added.

    I attached PR #2 for this if you want to merge it into the repo. Thanks!

    opened by alinradut 1
Releases(v0.1.0)
Owner
Putra Z.
Polymath Software Engineer
Putra Z.
Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView.

StepProgressView Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView. Usage let progr

Yonat Sharon 340 Dec 16, 2022
Handy UIControl subclasses. (Think Three20/NimbusKit of UIControls.)

STAControls STAControls is a collection of classes that aim to make dealing with Cocoa's UIControl subclasses more convenient, and to reduce the compl

Aaron 12 Oct 30, 2019
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Jogendra 772 Dec 28, 2022
A container view that responds to scrolling of UIScrollView

FlexibleHeader A container view that responds to scrolling of UIScrollView. normal threshold FlexibleHeaderExecutantType Getting Started Progressive I

DongHee Kang 69 May 2, 2022
ScrollView that supports a parallax header image and static overlay.

ScrollViewReactiveHeader A replacement ScrollView that provides a header with subtle scroll animations. example-video.mov Using ScrollViewReactiveHead

null 49 Dec 29, 2022
MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.

MZFormSheetPresentationController MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding sup

Michał Zaborowski 979 Nov 17, 2022
Scrollable UINavigationBar that follows the scrolling of a UIScrollView

A custom UINavigationController that enables the scrolling of the navigation bar alongside the scrolling of an observed content view Versioning notes

Andrea Mazzini 6.1k Dec 24, 2022
SwiftUI view enabling navigation between pages of content, imitating the behaviour of UIPageViewController for iOS and watchOS

PageView SwiftUI view enabling page-based navigation, imitating the behaviour of UIPageViewController in iOS. Why SwiftUI doesn't have any kind of pag

Kacper Rączy 365 Dec 29, 2022
A nice iOS View Capture Swift Library which can capture all content.

SwViewCapture A nice iOS View Capture Library which can capture all content. SwViewCapture could convert all content of UIWebView to a UIImage. 一个用起来还

Xing Chen 597 Nov 22, 2022
A controller that uses a UIStackView and view controller composition to display content in a list

StackViewController Overview StackViewController is a Swift framework that simplifies the process of building forms and other static content using UIS

Seed 867 Dec 27, 2022