• Stars
    star
    516
  • Rank 85,726 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PullToReach is a simple drag-and-drop solution for adding pull-to-reach functionality to your app

PullToReach πŸ‘†

CI Status Version License Platform

PullToReach is a simple drag-and-drop solution for implementing the pull-to-reach functionality seen in the music app Soor by Tanmay. This allows your users with big phones to reach the content on the top of the display easily.

Screen recording

πŸƒβ€β™‚οΈ Getting started

Getting started is as easy as conforming your ViewController to the PullToReach protocol and activating the functionality by calling the activatePullToReach function.

class TeamMembersViewController: UITableViewController, PullToReach {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.navigationItem.rightBarButtonItems = [
            addBarButtonItem,
            refreshBarButtonItem
        ]

        self.activatePullToReach(on: navigationItem)
    }
    
    ...

If your ViewController is contained in an UINavigationController you can activate pull-to-reach on all UIBarButtonItems. Selecting an item using pull-to-reach will call the same action as the normal UIBarButtonItem action so there is nothing more for you to be done.

πŸ–Œ Custom styling

Changing highlight color

If you want to change the highlight color, you can specify it when activating pull-to-reach.

self.activatePullToReach(on: navigationItem, highlightColor: .red)

Completely custom behavior

By overriding the applyStyle function you can define completely custom style. All the changes between states will be animated by default.

class ScalingButton: UIButton {

    override func applyStyle(isHighlighted: Bool, highlightColor: UIColor) {
        let scale: CGFloat = isHighlighted ? 1.5 : 1.0
        transform = CGAffineTransform(translationX: scale, y: scale)
    }

}

πŸš΄β€β™‚οΈ Usage outside of NavigationBar

Pull-To-Reach can not only be activated for the navigation items, but also for every UIControl independently from its position or functionality. This can be very helpful when you have non-standard views with your own controls. To define your style, you can override applyStyle as seen above.

πŸ›  Installation

CocoaPods

To integrate PullToReach into your Xcode project using CocoaPods, add this to your Podfile:

pod 'PullToReach'

To run the example project, clone the repo, and run pod install from the Example directory first.

Manually

If you prefer not to use any of the dependency managers, you can integrate PullToReach into your project manually, by downloading the source code and placing the files on your project directory.

πŸ‘€ Author

This framework is created with ❀️ by QuickBird Studios.

❀️ Contributing

Open an issue if you need help, if you found a bug, or if you want to discuss a feature request.

Open a PR if you want to make changes to PullToReach.

πŸ“ƒ License

PullToReach is released under an MIT license. See License.md for more information

More Repositories

1

XCoordinator

🎌 Powerful navigation library for iOS based on the coordinator pattern
Swift
2,253
star
2

FlippingNotch

FlippingNotch πŸ€™ - Dribble inspired animation https://dribbble.com/shots/4089014-Pull-To-Refresh-iPhone-X
Swift
835
star
3

SwiftUI-Architectures

Three different architectures (Model-View, Redux, MVVM) for using SwiftUI implemented at the example of a chat app
Swift
682
star
4

opencv-android

Easy way to integrate OpenCv into your Android project via Gradle
Kotlin
673
star
5

SurveyKit

Android library to create beautiful surveys (aligned with ResearchKit on iOS)
Kotlin
386
star
6

SwiftUI-Coordinators-Example

Sample app that showcases the use of the Coordinator Pattern in SwiftUI
Swift
223
star
7

CombineRxSwiftPerformance

A test suite comparing the performance of Combine and RxSwift
Swift
187
star
8

survey_kit

Flutter library to create beautiful surveys (aligned with ResearchKit on iOS)
Dart
124
star
9

XUI

XUI makes modular, testable architectures for SwiftUI apps a breeze!
Swift
116
star
10

XCoordinator-Example

XCoordinator-Example serves as an MVVM-C example app for XCoordinator
Swift
64
star
11

kotlin-snapshot-testing

Extensible Kotlin Multiplatform library to easily create Snapshot tests for Android and other Kotlin applications
Kotlin
61
star
12

XServiceLocator

Light-weight Service Locator / Dependency Injection library for Swift: providing objects with the dependencies they need throughout your whole iOS app.
Swift
54
star
13

yuvToMat

High-performance library for converting YUV_420_888 Android Camera images to OpenCV RGB Mats
Kotlin
53
star
14

NonEmptyCollections

A type-safe implementation for collections that cannot be empty. Life is too short for emptiness-checks!
Kotlin
53
star
15

DataKit

A Swift library to easily read and write binary formatted data using a modern, declarative interface.
Swift
42
star
16

flutter_platform_search

A platform-adaptive search for Flutter
Dart
36
star
17

flutter_pull_to_reach_demo

A new way to access controls in your flutter app that are normally hard to reach with your thumb
Dart
26
star
18

QBRepository

QBRepository is a simple implementation of the repository pattern for data access in Swift
Swift
16
star
19

DependencyInjectionPlayground

Playground showing different techniques for dependency injection in Swift
Swift
15
star
20

platform-independent-mvvm-android

An Android-MVVM example of how we create platform-independent ViewModels that can be reused on iOS/Desktop/Server
Kotlin
13
star
21

crc-swift

Swift
11
star
22

XCoordinator-Talks

Presentations & Workshops about the Coordinator pattern & XCoordinator
Swift
6
star
23

crc-kotlin

Kotlin
5
star
24

DoggyKotlinKoans

A list of entertaining koans/exercises to learn the basic features of Kotlin (including solutions).
Kotlin
3
star
25

mobile_hacknight_flutter

Dart
3
star
26

actions

JavaScript
2
star
27

HackNight-SwiftUI

Swift
1
star