ElongationPreview is an elegant UI push-pop style view controller

Related tags

UI swift ios library
Overview

ELONGATION PREVIEW

Elongation Preview is an elegant UI push-pop style view controller for iOS.


We specialize in the designing and coding of custom UI for Mobile Apps and Websites.

Stay tuned for the latest updates:


Twitter PodPlatform PodVersion Documentation Donate Carthage Codebeat


Requirements

  • iOS 9.0+
  • Xcode 8
  • Swift 3 (<= 1.0.5)
  • Swift 4 (>= 1.1)

Installation

You can install ElongationPreview in several ways:

  • Add source files to your project.

pod 'ElongationPreview'

github "Ramotion/elongation-preview"

How to use

First of all, import module to your source file.

import ElongationPreview

ElongationViewController

Then subclass ElongationViewController and configure it as you wish.

class RootViewController: ElongationViewController { }

Now you must register reusable cell in tableView. If you prefer to use Storyboards, you can drag UITableViewCell from bottom-right menu, lay it out and change it's class to ElongationCell. Of course, there are some specific requirements on how you can configure cell's subviews.

ElongationCell

  • Easier way: copy DemoElongationCell from demo project and change it as you wish. Add your own views to top, bottom and scalable containers.

  • If you want to create cell from scratch, this is how your cell hierarchy should look like:

    hierarchy

    Required properties:

    bottomView — the view which comes from behind the cell when you tap on the cell.

    scalableView — the view which will be scaled when you tap on the cell.

    topView — static top view, add here all the views which won't be scaled and must stay on their position.

    Also you must connect this constraints: topViewHeightConstraint, topViewTopConstraint, bottomViewHeightConstraint, bottomViewTopConstraint.


📌 If you need to override

func scrollViewDidScroll(_ scrollView: UIScrollView)

or

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath)

you must call super because some important configuration was made in these methods in superclass (ElongationViewController).


ElongationDetailViewController

class DetailViewController: ElongationDetailViewController { }

If you want to display some details for objects from the root view, it's better to subclass ElongationDetailViewController and configure it for displaying your data.

This class holds headerView property which actually represents ElongationCell in expanded state and it'll be used as a header for tableView by default.

📌 Override openDetailView(for: IndexPath) method, create your ElongationDetailViewController instance and call expand(viewController: ElongationDetailViewController, animated: Bool) method with this instance.

This is the place where you need to configure your ElongationDetailViewController subclass.


Appearance & Behaviour

You can customize both appearance & behaviour of ElongationPreview control by tuning some params of ElongationConfig and overriding shared instance.

// Create new config.
var config = ElongationConfig()

// Change desired properties.
config.scaleViewScaleFactor = 0.9
config.topViewHeight = 190
config.bottomViewHeight = 170
config.bottomViewOffset = 20
config.parallaxFactor = 100
config.separatorHeight = 0.5
config.separatorColor = .white

// Save created config as `shared` instance.
ElongationConfig.shared = config

🗒 All parameters with their descriptions listed in ElongationConfig file.

📄 License

Elongation Preview is released under the MIT license. See LICENSE for details.

This library is a part of a selection of our best UI open-source projects.

If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com

📱 Get the Showroom App for iOS to give it a try

Try this UI component and more like this in our iOS app. Contact us if interested.

Comments
  • Crash:Can't get `ElongationViewController` from UINavigationController nor from context's viewController itself.

    Crash:Can't get `ElongationViewController` from UINavigationController nor from context's viewController itself.

    Buonasera, ho inserito la libreria Elongation Prewiew nel mio progetto, ma mi da questo errore: Can't get ElongationViewController from UINavigationController nor from context's viewController itself. Cosa devo fare? Grazie da Stefania

    opened by Stefania66 7
  • Does it work with Navigation Controller?

    Does it work with Navigation Controller?

    I tried adding Navigation Controller to Demo project and the detail view transition doesn't seem to be happening.

    And thanks for this wonderful work :)

    opened by AnnieNinaJoyceV 7
  • Does not work with Side menu and tab bar controllers??

    Does not work with Side menu and tab bar controllers??

    need help .. error occurs at Elongation Transition in root function and sometimes it does work if i open side menu first showing(Presenting view controllers on detached view controllers is discouraged ) but if i open and close side menu again it crashes.

    opened by RFyre00 1
  • Added Capability to support TabBarController and NavigationController

    Added Capability to support TabBarController and NavigationController

    This will add capability to this excellent component to support automatically without user intervention when the UITableView is embedded into main Navigation flows (UINavigationController and TabBarController).

    The InitialViewController class is Just a Demo to demonstrate how can be launched from this to different approach. There are StoryBoard references to navigate to either types of navigation layouts.

    I've keep your animation logic in the animation transition coordinator, just remove some unnecessary code for this approach.

    Hope this help make this component more powerful. thanks.

    opened by bolekhub 1
  • Button action not being fired from the bottom view.

    Button action not being fired from the bottom view.

    I tried adding a button to the bottom view and noticed that if I normal tap, the button action is not being triggered. I tried adding this code to the SwipeableTableViewController but it still does not seem to encapsulate the button touch.

    public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { if (touch.view is UIButton) { return false } return true }

    opened by jsdu 1
  • Replaced the GridViewCell with my own custom cell but can't connect to my cell to start populating data in my labels

    Replaced the GridViewCell with my own custom cell but can't connect to my cell to start populating data in my labels

    Replaced the GridViewCell with my own custom cell but can't connect to my cell to start populating data in my labels. Get error value type 'UITableViewCell' has no member 'loreLabel'

    import UIKit import ElongationPreview

    class DetailViewController: ElongationDetailViewController {

    var datasource: [ChampionLore] = ChampionLore.loreData
    
    override func viewDidLoad() {
        super.viewDidLoad()
        tableView.backgroundColor = .black
        tableView.separatorStyle  = .none
        tableView.register(UINib(nibName: "AllTableViewCell", bundle: nil), forCellReuseIdentifier: "AllTableViewCell")
    }
    
    override func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
        return 1
    }
       
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "AllTableViewCell")!
        
        let loreInfo = datasource[indexPath.row]
        cell.loreLabel.text = loreInfo.lore
        
        return cell
    }
    

    }

    opened by JuanyboyFresh 0
  • Tableviewcell error

    Tableviewcell error

    this class is not key value coding-compliant for the key bottomView. unable to get the code running. I used the demo cell in my project but cannot get it to run

    opened by kunwar231 0
  • Using this without StoryBoard

    Using this without StoryBoard

    Is it possible to use this library on a current project that does not utilize the storyboard and everything is coded including tableviews and collection view and its corresponding custom cells.

    opened by minon250 1
  • Tableview error

    Tableview error

    elongation-preview implement using pod file, and when i push -> error like this

    Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] instantiated view controller with identifier "ViewController" from storyboard "Home", but didn't get a UITableView.'

    opened by Mahipal-codzgarage 1
  • transition error??

    transition error??

    while holding and touching a cell to show the middle info section the constraints or animations get ruined .. is there any way i can fix this help me out..

    opened by RFyre00 0
Releases(1.1.1)
Owner
Ramotion
UI Engineering, UI/UX Design and Front-End Development Agency
Ramotion
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
Elegant Apply Style by Swift Method Chain.🌙

ApplyStyleKit ApplyStyleKit is a library that applies styles to UIKit using Swifty Method Chain. Normally, when applying styles to UIView etc.,it is n

shindyu 203 Nov 22, 2022
A UINavigationController subclass that support pop interactive UINavigationbar with hidden or show.

KDInteractiveNavigationController Features ✨ UINavigationController interactive with UINavigationBar hidden or show Hide all UINavigationController ba

Kingiol 154 Dec 3, 2022
🚀 Elegant Pager View fully written in pure SwiftUI.

PagerTabStripView Made with ❤️ by Xmartlabs team. XLPagerTabStrip for SwiftUI! Introduction PagerTabStripView is the first pager view built in pure Sw

xmartlabs 482 Jan 9, 2023
Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it.

SwiftUI TagView Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it. Usage: Just copy the

Ahmadreza 16 Dec 28, 2022
A child view controller framework that makes setting up your parent controllers as easy as pie.

Description Family is a child view controller framework that makes setting up your parent controllers as easy as pie. With a simple yet powerful publi

Christoffer Winterkvist 246 Dec 28, 2022
A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed flag

HidesNavigationBarWhenPushed A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed

Danil Gontovnik 55 Oct 19, 2022
A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI.

A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI. Many of these helpers are useful even in a pure UIKit project.

SwiftUI+ 6 Oct 28, 2022
Page view controller with bounce effect

BouncyPageViewController Page view controller with bounce effect inspired by motion design by Stan Yakushevish. Quickstart Create a queue of UIViewCon

Bohdan Orlov 843 Oct 17, 2022
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

jobandtalent 527 Dec 15, 2022
📖 A simple, highly informative page view controller

TL;DR UIPageViewController done properly. ⭐️ Features Simplified data source management & enhanced delegation. Dynamically insert & remove pages. Infi

UI At Six 1.8k Dec 24, 2022
Meet Page View Controller for iOS by Cleveroad

While a standard page view allows you to navigate between pages by using simple gestures, our component goes further

Cleveroad 397 Aug 20, 2022
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting

Features • Guides • Installation • Usage • Miscellaneous • Contributing ?? README is available in other languages: ???? . ???? . ???? . ???? . ???? To

Juanpe Catalán 11.7k Jan 6, 2023
UIAdapter - An elegant solution to the iOS screen adaptation problem

UIAdapter - An elegant solution to the iOS screen adaptation problem ???? 天朝子民 Features Numerical type fast conversion Storyboard equal scale adaptati

LEE 39 Dec 25, 2022
FSPagerView is an elegant Screen Slide Library implemented primarily with UICollectionView.

FSPagerView is an elegant Screen Slide Library implemented primarily with UICollectionView. It is extremely helpful for making Banner、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders.

Wenchao Ding 6.7k Jan 2, 2023
A simple and elegant UIKit for iOS.

HamsterUIKit A simple and elegant UIKit(Chart) for iOS, written in Swift. ?? Curve and bar Charts. ?? Protocols are designed based on UIKit(UITableVie

Howard Wang 30 Oct 2, 2022
💾 A collection of classic-style UI components for iOS

A collection of classic-style UI components for UIKit, influenced by Windows 95 Introduction This is a little exploration into applying '90s-era desig

Blake Tsuzaki 2.2k Dec 22, 2022
Kit for building custom gauges + easy reproducible Apple's style ring gauges.

GaugeKit ##Kit for building custom gauges + easy reproducible Apple's style ring gauges. -> Example Usage Open GaugeKit.xcworkspace and change the sch

Petr Korolev 1k Dec 23, 2022