Code Monkey home page Code Monkey logo

elongation-preview's Introduction

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.

elongation-preview's People

Contributors

0ber avatar aleksei1000000 avatar alexmik89 avatar av0c0der avatar igork-ramotion avatar ikolpachkov avatar juriv avatar ramotiondev avatar ronnielsen avatar v-ken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elongation-preview's Issues

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..

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
}

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.

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

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.

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.'

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
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.