Compare commits
80 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb471b2295 | |||
| 0ae093ea75 | |||
| 7bec499be2 | |||
| 74f93c36d5 | |||
| 4deca2d95b | |||
| e15d420969 | |||
| e08f300ebe | |||
| 643469a4b4 | |||
| 2f8f77fb5c | |||
| 2f8eb0632e | |||
| f494d7f185 | |||
| 4f8b51b5bc | |||
| 79537b624f | |||
| 3271e28008 | |||
| 01fdcfd333 | |||
| c0c3d33058 | |||
| 9bae1297b2 | |||
| 13d845634a | |||
| 226b67b654 | |||
| d3f4abfee8 | |||
| 3edf6223f7 | |||
| be9990001f | |||
| 4f143e39c5 | |||
| 1790d05c1d | |||
| cfd8a8349c | |||
| fa277edea0 | |||
| a9f62a47b8 | |||
| 37440b4029 | |||
| 55c93633af | |||
| abc2774b46 | |||
| 67d6842583 | |||
| a7d73c406d | |||
| d6245ea06f | |||
| f531d87663 | |||
| 023d83b9f0 | |||
| 21258e6142 | |||
| f2c52e31d5 | |||
| 5c1681a437 | |||
| 8378f3771b | |||
| 41ee44cd0a | |||
| 884ee6c285 | |||
| b7562a7c54 | |||
| 8eaf56bfcd | |||
| 31e33122de | |||
| 209e2f812c | |||
| 9bdc0a1d78 | |||
| fb7706b652 | |||
| 5db329d60e | |||
| ce73ee36e5 | |||
| f44540635a | |||
| c2c20c9d72 | |||
| c8bf0dc625 | |||
| 607120fae1 | |||
| 53a8a9c4e4 | |||
| e739a1fc0b | |||
| 288707c0d3 | |||
| 190c55fdda | |||
| 523a5da83a | |||
| 5e12d7090e | |||
| 069af47430 | |||
| 768eae1be3 | |||
| f86249a2c3 | |||
| 7d1c1fc6ae | |||
| 810c7d7971 | |||
| e12514b881 | |||
| 5208f224ae | |||
| 703fa05a05 | |||
| 8e42530b3e | |||
| e3a11c0d10 | |||
| 6e8940a322 | |||
| 0cd4c61481 | |||
| e22850859b | |||
| 295d9ad00e | |||
| ed2d75ff87 | |||
| a737fac395 | |||
| fe9e6dfcbb | |||
| 1afeb51d13 | |||
| 8160537c55 | |||
| b829379158 | |||
| f27423d80a |
@@ -0,0 +1 @@
|
||||
4.2
|
||||
@@ -1,6 +1,11 @@
|
||||
osx_image: xcode7.3
|
||||
osx_image: xcode9.2
|
||||
language: objective-c
|
||||
|
||||
xcode_project: PreviewTransitionDemo/PreviewTransitionDemo.xcodeproj
|
||||
xcode_scheme: PreviewTransitionDemo
|
||||
xcode_sdk: iphonesimulator
|
||||
xcode_scheme: PreviewTransition
|
||||
xcode_sdk: iphonesimulator11.2
|
||||
|
||||
# whitelist
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// swift-tools-version:5.1
|
||||
//
|
||||
// Package.swift
|
||||
//
|
||||
// Copyright (c) Ramotion Inc. (https://www.ramotion.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
import PackageDescription
|
||||
|
||||
|
||||
let package = Package(
|
||||
name: "PreviewTransition",
|
||||
platforms: [
|
||||
.iOS(.v9)
|
||||
],
|
||||
products: [
|
||||
.library(name: "PreviewTransition",
|
||||
targets: ["PreviewTransition"]),
|
||||
],
|
||||
targets: [
|
||||
.target(name: "PreviewTransition",
|
||||
path: "PreviewTransition")
|
||||
],
|
||||
swiftLanguageVersions: [.v5]
|
||||
)
|
||||
@@ -1,12 +1,11 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'PreviewTransition'
|
||||
s.version = '0.1.1'
|
||||
s.version = '4.1.0'
|
||||
s.summary = 'Transition animation'
|
||||
s.license = 'MIT'
|
||||
s.homepage = 'https://github.com/Ramotion/preview-transision'
|
||||
s.homepage = 'https://github.com/Ramotion/preview-transition'
|
||||
s.author = { 'Juri Vasylenko' => 'juri.v@ramotion.com' }
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.source = { :git => 'https://github.com/Ramotion/preview-transision.git', :tag => s.version.to_s }
|
||||
s.ios.deployment_target = '9.0'
|
||||
s.source = { :git => 'https://github.com/Ramotion/preview-transition.git', :tag => s.version.to_s }
|
||||
s.source_files = 'PreviewTransition/**/*.swift'
|
||||
s.requires_arc = true
|
||||
end
|
||||
|
||||
@@ -23,107 +23,98 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
public class PTDetailViewController: UIViewController {
|
||||
|
||||
public var bgImage: UIImage?
|
||||
public var titleText: String?
|
||||
|
||||
private var backgroundImageView: UIImageView?
|
||||
/// Base UIViewController for preview transition
|
||||
open class PTDetailViewController: UIViewController {
|
||||
|
||||
var bgImage: UIImage?
|
||||
var titleText: String?
|
||||
|
||||
fileprivate var backgroundImageView: UIImageView?
|
||||
}
|
||||
|
||||
// MARK: life cicle
|
||||
|
||||
extension PTDetailViewController {
|
||||
|
||||
public override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
backgroundImageView = createBackgroundImage(bgImage)
|
||||
view.backgroundColor = .blackColor()
|
||||
|
||||
if let titleText = self.titleText {
|
||||
title = titleText
|
||||
extension PTDetailViewController {
|
||||
|
||||
open override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
backgroundImageView = createBackgroundImage(bgImage)
|
||||
view.backgroundColor = .black
|
||||
|
||||
if let titleText = self.titleText {
|
||||
title = titleText
|
||||
}
|
||||
|
||||
// hack
|
||||
if let navigationController = self.navigationController {
|
||||
for case let label as UILabel in navigationController.view.subviews {
|
||||
label.isHidden = true
|
||||
}
|
||||
}
|
||||
|
||||
_ = createNavBar(UIColor(red: 0, green: 0, blue: 0, alpha: 0.5))
|
||||
}
|
||||
|
||||
// hack
|
||||
if let navigationController = self.navigationController {
|
||||
for case let label as UILabel in navigationController.view.subviews {
|
||||
label.hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
createNavBar(UIColor(red: 0, green: 0, blue: 0, alpha: 0.5))
|
||||
}
|
||||
|
||||
public override func viewWillAppear(animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: public
|
||||
|
||||
extension PTDetailViewController {
|
||||
|
||||
public func popViewController() {
|
||||
|
||||
if let navigationController = self.navigationController {
|
||||
for case let label as UILabel in navigationController.view.subviews {
|
||||
label.hidden = false
|
||||
}
|
||||
|
||||
/**
|
||||
Pops the top view controller from the navigation stack and updates the display with custom animation.
|
||||
*/
|
||||
public func popViewController() {
|
||||
|
||||
if let navigationController = self.navigationController {
|
||||
for case let label as UILabel in navigationController.view.subviews {
|
||||
label.isHidden = false
|
||||
}
|
||||
}
|
||||
_ = navigationController?.popViewController(animated: false)
|
||||
}
|
||||
navigationController?.popViewControllerAnimated(false)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: create
|
||||
|
||||
extension PTDetailViewController {
|
||||
|
||||
private func createBackgroundImage(image: UIImage?) -> UIImageView {
|
||||
// add constraint closures
|
||||
let addConstraint: (imageView: UIImageView, toView: UIView, attribute: NSLayoutAttribute) -> () = {
|
||||
(imageView, toView, attribute) in
|
||||
let constraint = NSLayoutConstraint(item: imageView,
|
||||
attribute: attribute,
|
||||
relatedBy: .Equal,
|
||||
toItem: toView,
|
||||
attribute: attribute,
|
||||
multiplier: 1,
|
||||
constant: 0)
|
||||
toView.addConstraint(constraint)
|
||||
}
|
||||
|
||||
// crate imageView
|
||||
let imageView = UIImageView(frame: CGRect.zero)
|
||||
imageView.image = image
|
||||
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
imageView.contentMode = .Center
|
||||
view.insertSubview(imageView, atIndex: 0)
|
||||
|
||||
// added constraints
|
||||
for attribute in [NSLayoutAttribute.Leading, NSLayoutAttribute.Trailing, NSLayoutAttribute.Top, NSLayoutAttribute.Bottom] {
|
||||
addConstraint(imageView: imageView, toView: view, attribute: attribute)
|
||||
}
|
||||
|
||||
return imageView
|
||||
}
|
||||
|
||||
private func createNavBar(color: UIColor) -> UIView {
|
||||
let navBar = UIView(frame: CGRect.zero)
|
||||
navBar.backgroundColor = color
|
||||
navBar.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(navBar)
|
||||
|
||||
for attributes: NSLayoutAttribute in [.Left, .Right, .Top] {
|
||||
(view, navBar) >>>- { $0.attribute = attributes }
|
||||
}
|
||||
navBar >>>- {
|
||||
$0.attribute = .Height
|
||||
$0.constant = 64
|
||||
}
|
||||
|
||||
return navBar
|
||||
}
|
||||
|
||||
}
|
||||
fileprivate func createBackgroundImage(_ image: UIImage?) -> UIImageView {
|
||||
|
||||
let imageView = UIImageView(frame: CGRect.zero)
|
||||
imageView.image = image
|
||||
imageView.frame = view.bounds
|
||||
imageView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
|
||||
imageView.contentMode = UIView.ContentMode.scaleAspectFill
|
||||
view.insertSubview(imageView, at: 0)
|
||||
|
||||
return imageView
|
||||
}
|
||||
|
||||
fileprivate func createNavBar(_ color: UIColor) -> UIView {
|
||||
let navBar = UIView(frame: CGRect.zero)
|
||||
navBar.backgroundColor = color
|
||||
navBar.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(navBar)
|
||||
|
||||
for attributes: NSLayoutConstraint.Attribute in [.left, .right, .top] {
|
||||
(view, navBar) >>>- {
|
||||
$0.attribute = attributes
|
||||
return
|
||||
}
|
||||
}
|
||||
navBar >>>- {
|
||||
$0.attribute = .height
|
||||
var constant: CGFloat = 64
|
||||
if #available(iOS 11.0, *) {
|
||||
if let topPadding = UIApplication.shared.keyWindow?.safeAreaInsets.top {
|
||||
constant += topPadding
|
||||
}
|
||||
}
|
||||
$0.constant = constant
|
||||
return
|
||||
}
|
||||
|
||||
return navBar
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,333 +23,410 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
public class ParallaxCell: UITableViewCell {
|
||||
|
||||
public var separatorView: UIView?
|
||||
|
||||
var topSeparator: UIView? // only for animation
|
||||
|
||||
enum Direction {
|
||||
case Up
|
||||
case Down
|
||||
}
|
||||
|
||||
var bgImageY: NSLayoutConstraint?
|
||||
|
||||
var parallaxTitleY: NSLayoutConstraint?
|
||||
|
||||
@IBInspectable public var difference: CGFloat = 100 // image parallax
|
||||
|
||||
var bgImage: UIImageView?
|
||||
var parallaxTitle: UILabel?
|
||||
|
||||
@IBInspectable public var foregroundColor = UIColor.blackColor()
|
||||
@IBInspectable public var foregroundAlpha: CGFloat = 0.5
|
||||
|
||||
var foregroundView: UIView?
|
||||
var isMovedHidden: Bool = false
|
||||
|
||||
private var closedBgImageYConstant: CGFloat = 0
|
||||
private var closedYPosition: CGFloat = 0
|
||||
|
||||
private var damping: CGFloat = 0.78
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
commonInit()
|
||||
}
|
||||
fileprivate struct C {
|
||||
|
||||
struct Constraints {
|
||||
static let bottom = "Bottom"
|
||||
static let height = "Height"
|
||||
}
|
||||
}
|
||||
|
||||
/// UITableViewCell with parallax background
|
||||
open class ParallaxCell: UITableViewCell {
|
||||
|
||||
/// Custom separator view
|
||||
open var separatorView: UIView?
|
||||
|
||||
var topSeparator: UIView? // only for animation
|
||||
|
||||
enum Direction {
|
||||
case up
|
||||
case down
|
||||
}
|
||||
|
||||
private var bgImageY: NSLayoutConstraint?
|
||||
private var bgImageHeight: NSLayoutConstraint?
|
||||
|
||||
private var parallaxTitleY: NSLayoutConstraint?
|
||||
|
||||
/// parallax offset
|
||||
@IBInspectable open var difference: CGFloat = 100 // image parallax
|
||||
|
||||
var bgImage: UIImageView?
|
||||
var parallaxTitle: UILabel?
|
||||
|
||||
/// The foreground view’s background color.
|
||||
@IBInspectable open var foregroundColor: UIColor = UIColor.black {
|
||||
didSet {
|
||||
foregroundView?.backgroundColor = foregroundColor
|
||||
}
|
||||
}
|
||||
|
||||
/// The foreground view’s alpha.
|
||||
@IBInspectable open var foregroundAlpha: CGFloat = 0.5 {
|
||||
didSet {
|
||||
foregroundView?.alpha = foregroundAlpha
|
||||
}
|
||||
}
|
||||
|
||||
var foregroundView: UIView?
|
||||
var isMovedHidden: Bool = false
|
||||
|
||||
fileprivate var closedBgImageYConstant: CGFloat = 0
|
||||
fileprivate var closedYPosition: CGFloat = 0
|
||||
fileprivate var closedHeight: CGFloat = 0
|
||||
|
||||
fileprivate var damping: CGFloat = 0.78
|
||||
|
||||
/**
|
||||
Initializes a view from data in a given unarchiver.
|
||||
|
||||
- parameter aDecoder: An unarchiver object.
|
||||
|
||||
- returns: An initialized UITableViewCell object.
|
||||
*/
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
/**
|
||||
Initializes a table cell with a style and a reuse identifier and returns it to the caller.
|
||||
|
||||
- parameter style: A constant indicating a cell style. See UITableViewCellStyle for descriptions of these constants.
|
||||
- parameter reuseIdentifier: A string used to identify the cell object if it is to be reused for drawing multiple rows of a table view. Pass nil if the cell object is not to be reused. You should use the same reuse identifier for all cells of the same form.
|
||||
|
||||
- returns: an initialized UITableViewCell object or nil if the object could not be created.
|
||||
*/
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
commonInit()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: life cicle
|
||||
|
||||
extension ParallaxCell {
|
||||
|
||||
func commonInit() {
|
||||
|
||||
layer.masksToBounds = false
|
||||
selectionStyle = .None
|
||||
|
||||
// create background image view
|
||||
let backgroundImageView = createBckgroundImage()
|
||||
|
||||
// add constraints
|
||||
if let bgSuperView = backgroundImageView.superview {
|
||||
for attribute: NSLayoutAttribute in [.Leading, .Trailing] {
|
||||
(bgSuperView, backgroundImageView) >>>- { $0.attribute = attribute }
|
||||
}
|
||||
bgImageY = (bgSuperView, backgroundImageView) >>>- { $0.attribute = .CenterY }
|
||||
backgroundImageView >>>- {
|
||||
$0.attribute = .Height
|
||||
$0.constant = bounds.height + difference
|
||||
}
|
||||
|
||||
func commonInit() {
|
||||
|
||||
layer.masksToBounds = false
|
||||
selectionStyle = .none
|
||||
|
||||
// create background image view
|
||||
let backgroundImageView = createBckgroundImage()
|
||||
|
||||
// add constraints
|
||||
if let bgSuperView = backgroundImageView.superview {
|
||||
for attribute: NSLayoutConstraint.Attribute in [.leading, .trailing] {
|
||||
(bgSuperView, backgroundImageView) >>>- {
|
||||
$0.attribute = attribute
|
||||
return
|
||||
}
|
||||
}
|
||||
bgImageY = (bgSuperView, backgroundImageView) >>>- {
|
||||
$0.attribute = .centerY
|
||||
return
|
||||
}
|
||||
bgImageHeight = backgroundImageView >>>- {
|
||||
$0.attribute = .height
|
||||
$0.constant = bounds.height + difference
|
||||
return
|
||||
}
|
||||
}
|
||||
bgImage = backgroundImageView
|
||||
|
||||
foregroundView = createForegroundView(foregroundColor)
|
||||
contentView.backgroundColor = UIColor.black
|
||||
|
||||
// create title label
|
||||
let titleLabel = createTitleLable()
|
||||
for attribute: NSLayoutConstraint.Attribute in [.left, .right] {
|
||||
(contentView, titleLabel) >>>- {
|
||||
$0.attribute = attribute
|
||||
return
|
||||
}
|
||||
}
|
||||
parallaxTitleY = (contentView, titleLabel) >>>- {
|
||||
$0.attribute = .centerY
|
||||
return
|
||||
}
|
||||
titleLabel >>>- {
|
||||
$0.attribute = .height
|
||||
$0.constant = bounds.height + difference
|
||||
return
|
||||
}
|
||||
parallaxTitle = titleLabel
|
||||
|
||||
separatorView = createSeparator(.black, height: 2.0, verticalAttribure: .bottom, verticalConstant: 0.0)
|
||||
}
|
||||
bgImage = backgroundImageView
|
||||
|
||||
foregroundView = createForegroundView(foregroundColor)
|
||||
contentView.backgroundColor = UIColor.blackColor()
|
||||
|
||||
// create title label
|
||||
let titleLabel = createTitleLable()
|
||||
for attribute: NSLayoutAttribute in [.Left, .Right] {
|
||||
(contentView, titleLabel) >>>- { $0.attribute = attribute }
|
||||
}
|
||||
parallaxTitleY = (contentView, titleLabel) >>>- { $0.attribute = .CenterY }
|
||||
titleLabel >>>- {
|
||||
$0.attribute = .Height
|
||||
$0.constant = bounds.height + difference
|
||||
}
|
||||
parallaxTitle = titleLabel
|
||||
|
||||
separatorView = createSeparator(.blackColor(), height: 2.0, verticalAttribure: .Bottom, verticalConstant: 0.0)
|
||||
}
|
||||
|
||||
public override func prepareForReuse() {
|
||||
if topSeparator?.superview != nil {
|
||||
topSeparator?.removeFromSuperview()
|
||||
topSeparator = nil
|
||||
|
||||
open override func prepareForReuse() {
|
||||
if topSeparator?.superview != nil {
|
||||
topSeparator?.removeFromSuperview()
|
||||
topSeparator = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: public
|
||||
// MARK: Methods
|
||||
|
||||
public extension ParallaxCell {
|
||||
|
||||
public func setImage(image: UIImage, title: String) {
|
||||
bgImage?.image = image
|
||||
parallaxTitle?.text = title
|
||||
}
|
||||
/**
|
||||
Sets the contents of the background image and title label
|
||||
|
||||
- parameter image: The image object which set to the backgroundImageView
|
||||
- parameter title: The text to be displayed in the Cell
|
||||
*/
|
||||
func setImage(_ image: UIImage, title: String) {
|
||||
bgImage?.image = image
|
||||
parallaxTitle?.text = title
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: internal
|
||||
|
||||
extension ParallaxCell {
|
||||
|
||||
func parallaxOffset(tableView: UITableView) {
|
||||
|
||||
guard let bgImageY = self.bgImageY where isMovedHidden == false else {
|
||||
return
|
||||
}
|
||||
|
||||
var deltaY = (frame.origin.y + frame.height/2) - tableView.contentOffset.y
|
||||
deltaY = min(tableView.bounds.height, max(deltaY, 0)) // range
|
||||
|
||||
var move : CGFloat = (deltaY / tableView.bounds.height) * difference
|
||||
move = move / 2.0 - move
|
||||
|
||||
bgImageY.constant = move
|
||||
}
|
||||
|
||||
func openCell(tableView: UITableView, duration: Double) {
|
||||
guard let superview = self.superview,
|
||||
let bgImageY = self.bgImageY else {
|
||||
return
|
||||
}
|
||||
|
||||
closedBgImageYConstant = bgImageY.constant
|
||||
closedYPosition = center.y
|
||||
|
||||
let offsetY = tableView.contentOffset.y
|
||||
let cellY = frame.origin.y - offsetY + frame.size.height / 2.0 + offsetY - tableView.frame.size.height / 2.0
|
||||
let cellFrame = CGRect(x: 0, y: cellY, width: tableView.frame.size.width, height: tableView.frame.size.height)
|
||||
frame = cellFrame
|
||||
superview.sendSubviewToBack(self)
|
||||
|
||||
// animation
|
||||
moveToCenter(duration , offset: offsetY)
|
||||
parallaxTitle?.hidden = true
|
||||
foregroundHidden(true, duration: duration)
|
||||
}
|
||||
|
||||
func closeCell(duration: Double, tableView: UITableView, completion: () -> Void) {
|
||||
bgImageY?.constant = closedBgImageYConstant
|
||||
UIView.animateWithDuration(duration, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 0, options: .CurveEaseInOut, animations: { () -> Void in
|
||||
self.layoutIfNeeded()
|
||||
self.center = CGPoint(x: self.center.x, y: self.closedYPosition)
|
||||
}, completion: {finished in
|
||||
|
||||
self.parallaxTitle?.hidden = false
|
||||
completion()
|
||||
})
|
||||
|
||||
foregroundHidden(false, duration: duration / 2.0)
|
||||
}
|
||||
func parallaxOffset(_ tableView: UITableView) {
|
||||
|
||||
func animationMoveCell(direction: Direction, duration: Double, tableView: UITableView, selectedIndexPaht: NSIndexPath, close: Bool) {
|
||||
|
||||
let selfYPosition = close == false ? frame.origin.y : closedYPosition
|
||||
let selectedCellFrame = tableView.rectForRowAtIndexPath(selectedIndexPaht)
|
||||
var dy: CGFloat = 0
|
||||
if selfYPosition < selectedCellFrame.origin.y {
|
||||
dy = selectedCellFrame.origin.y - tableView.contentOffset.y
|
||||
} else {
|
||||
dy = tableView.frame.size.height - (selectedCellFrame.origin.y - tableView.contentOffset.y + selectedCellFrame.size.height)
|
||||
guard let bgImageY = self.bgImageY, isMovedHidden == false else {
|
||||
return
|
||||
}
|
||||
|
||||
var deltaY = (frame.origin.y + frame.height / 2) - tableView.contentOffset.y
|
||||
deltaY = min(tableView.bounds.height, max(deltaY, 0)) // range
|
||||
|
||||
var move: CGFloat = (deltaY / tableView.bounds.height) * difference
|
||||
move = move / 2.0 - move
|
||||
|
||||
bgImageY.constant = move
|
||||
}
|
||||
dy = direction == .Down ? dy * -1 : dy
|
||||
if close == false {
|
||||
closedYPosition = center.y
|
||||
} else {
|
||||
center.y = closedYPosition - dy
|
||||
|
||||
func openCell(_ tableView: UITableView, duration: Double) {
|
||||
guard let superview = self.superview,
|
||||
let bgImageY = self.bgImageY,
|
||||
let bgImageHeight = self.bgImageHeight else {
|
||||
return
|
||||
}
|
||||
|
||||
closedBgImageYConstant = bgImageY.constant
|
||||
closedYPosition = center.y
|
||||
closedHeight = bgImageHeight.constant
|
||||
|
||||
let offsetY = tableView.contentOffset.y
|
||||
let cellY = frame.origin.y - offsetY + frame.size.height / 2.0 + offsetY - tableView.frame.size.height / 2.0
|
||||
let cellFrame = CGRect(x: 0, y: cellY, width: tableView.frame.size.width, height: tableView.frame.size.height)
|
||||
frame = cellFrame
|
||||
superview.sendSubviewToBack(self)
|
||||
|
||||
// animation
|
||||
bgImageHeight.constant = cellFrame.height
|
||||
moveToCenter(duration, offset: offsetY)
|
||||
parallaxTitle?.isHidden = true
|
||||
foregroundHidden(true, duration: duration)
|
||||
}
|
||||
|
||||
func closeCell(_ duration: Double, tableView _: UITableView, completion: @escaping () -> Void) {
|
||||
bgImageY?.constant = closedBgImageYConstant
|
||||
bgImageHeight?.constant = closedHeight
|
||||
UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 0, options: UIView.AnimationOptions(), animations: { [weak self] () in
|
||||
guard let `self` = self else { return }
|
||||
self.bgImage?.superview?.layoutIfNeeded()
|
||||
self.center = CGPoint(x: self.center.x, y: self.closedYPosition)
|
||||
}, completion: { [weak self] _ in
|
||||
|
||||
self?.parallaxTitle?.isHidden = false
|
||||
completion()
|
||||
})
|
||||
|
||||
foregroundHidden(false, duration: duration / 2.0)
|
||||
}
|
||||
|
||||
func animationMoveCell(_ direction: Direction, duration: Double, tableView: UITableView, selectedIndexPaht: IndexPath, close: Bool) {
|
||||
|
||||
let selfYPosition = close == false ? frame.origin.y : closedYPosition
|
||||
let selectedCellFrame = tableView.rectForRow(at: selectedIndexPaht)
|
||||
var dy: CGFloat = 0
|
||||
if selfYPosition < selectedCellFrame.origin.y {
|
||||
dy = selectedCellFrame.origin.y - tableView.contentOffset.y
|
||||
} else {
|
||||
dy = tableView.frame.size.height - (selectedCellFrame.origin.y - tableView.contentOffset.y + selectedCellFrame.size.height)
|
||||
}
|
||||
dy = direction == .down ? dy * -1 : dy
|
||||
if close == false {
|
||||
closedYPosition = center.y
|
||||
} else {
|
||||
center.y = closedYPosition - dy
|
||||
}
|
||||
|
||||
superview?.bringSubviewToFront(self)
|
||||
UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 0, options: UIView.AnimationOptions(), animations: { () -> Void in
|
||||
self.center.y = self.center.y + dy
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
func showTopSeparator() {
|
||||
topSeparator = createSeparator(.black, height: 2, verticalAttribure: .top, verticalConstant: -2)
|
||||
}
|
||||
|
||||
superview?.bringSubviewToFront(self)
|
||||
UIView.animateWithDuration(duration, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 0, options: .CurveEaseInOut, animations: { () -> Void in
|
||||
self.center.y = self.center.y + dy
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
func showTopSeparator() {
|
||||
topSeparator = createSeparator(.blackColor(), height: 2, verticalAttribure: .Top, verticalConstant: -2)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: animation
|
||||
|
||||
extension ParallaxCell {
|
||||
|
||||
private func moveToCenter(duration: Double, offset: CGFloat) {
|
||||
bgImageY?.constant = 0
|
||||
UIView.animateWithDuration(duration, delay: 0, usingSpringWithDamping: 0.78, initialSpringVelocity: 0, options: .CurveEaseInOut, animations: { () -> Void in
|
||||
self.frame = CGRect(x: 0, y: offset, width: self.frame.size.width, height: self.frame.size.height)
|
||||
self.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
private func foregroundHidden(hidden: Bool, duration: Double) {
|
||||
guard let foregroundView = self.foregroundView else {
|
||||
return
|
||||
|
||||
fileprivate func moveToCenter(_ duration: Double, offset: CGFloat) {
|
||||
bgImageY?.constant = 0
|
||||
UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: 0.78, initialSpringVelocity: 0, options: UIView.AnimationOptions(), animations: { () -> Void in
|
||||
self.frame.origin.y = offset
|
||||
self.bgImage?.superview?.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
if hidden == true {
|
||||
let currentConstrant = contentView.constraints.filter{return $0.identifier == "Bottom" ? true : false}
|
||||
contentView.removeConstraints(currentConstrant)
|
||||
|
||||
foregroundView >>>- {
|
||||
$0.attribute = .Height
|
||||
$0.constant = 64
|
||||
$0.identifier = "Height"
|
||||
}
|
||||
} else {
|
||||
let currentConstrant = foregroundView.constraints.filter{return $0.identifier == "Height" ? true : false}
|
||||
foregroundView.removeConstraints(currentConstrant)
|
||||
|
||||
(contentView, foregroundView) >>>- {
|
||||
$0.attribute = .Bottom
|
||||
$0.identifier = "Bottom"
|
||||
}
|
||||
|
||||
fileprivate func foregroundHidden(_ hidden: Bool, duration: Double) {
|
||||
guard let foregroundView = self.foregroundView else {
|
||||
return
|
||||
}
|
||||
|
||||
if hidden == true {
|
||||
let currentConstrant = contentView.constraints.filter { return $0.identifier == C.Constraints.bottom ? true : false }
|
||||
contentView.removeConstraints(currentConstrant)
|
||||
|
||||
foregroundView >>>- {
|
||||
$0.attribute = .height
|
||||
var constant: CGFloat = 64
|
||||
if #available(iOS 11.0, *) {
|
||||
if let topPadding = UIApplication.shared.keyWindow?.safeAreaInsets.top {
|
||||
constant += topPadding
|
||||
}
|
||||
}
|
||||
$0.constant = constant
|
||||
$0.identifier = C.Constraints.height
|
||||
return
|
||||
}
|
||||
} else {
|
||||
let currentConstrant = foregroundView.constraints.filter { return $0.identifier == C.Constraints.height ? true : false }
|
||||
foregroundView.removeConstraints(currentConstrant)
|
||||
|
||||
(contentView, foregroundView) >>>- {
|
||||
$0.attribute = .bottom
|
||||
$0.identifier = C.Constraints.bottom
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
UIView.animate(withDuration: duration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: damping * 2.0,
|
||||
initialSpringVelocity: 0,
|
||||
options: UIView.AnimationOptions(),
|
||||
animations: { () -> Void in
|
||||
foregroundView.superview?.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
UIView.animateWithDuration(duration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: damping * 2.0,
|
||||
initialSpringVelocity: 0,
|
||||
options: .CurveEaseInOut,
|
||||
animations: { () -> Void in
|
||||
self.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: create
|
||||
// MARK: create
|
||||
|
||||
extension ParallaxCell {
|
||||
|
||||
private func createBckgroundImage() -> UIImageView {
|
||||
|
||||
let container = createImageContainer()
|
||||
let imageView = UIImageView()
|
||||
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
imageView.contentMode = .Center
|
||||
container.addSubview(imageView)
|
||||
return imageView
|
||||
}
|
||||
|
||||
private func createImageContainer() -> UIView {
|
||||
let view = UIView(frame: CGRect.zero)
|
||||
view.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.layer.masksToBounds = true
|
||||
contentView.addSubview(view)
|
||||
|
||||
// added constraints
|
||||
for attribute: NSLayoutAttribute in [.Left, .Right, .Top, .Bottom] {
|
||||
(contentView, view) >>>- { $0.attribute = attribute }
|
||||
}
|
||||
|
||||
return view
|
||||
}
|
||||
|
||||
|
||||
private func createTitleLable() -> UILabel {
|
||||
|
||||
let label = UILabel()
|
||||
label.backgroundColor = .clearColor()
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
label.textAlignment = .Center
|
||||
if case let font as UIFont = UINavigationBar.appearance().titleTextAttributes?[NSFontAttributeName] {
|
||||
label.font = font
|
||||
fileprivate func createBckgroundImage() -> UIImageView {
|
||||
|
||||
let container = UIView(frame: contentView.bounds)
|
||||
container.translatesAutoresizingMaskIntoConstraints = false
|
||||
container.backgroundColor = .clear
|
||||
container.clipsToBounds = true
|
||||
contentView.addSubview(container)
|
||||
for attribute: NSLayoutConstraint.Attribute in [.left, .right, .top, .bottom] {
|
||||
(contentView, container) >>>- {
|
||||
$0.attribute = attribute
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let imageView = UIImageView(frame: container.bounds)
|
||||
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
imageView.contentMode = .scaleAspectFill
|
||||
container.addSubview(imageView)
|
||||
return imageView
|
||||
}
|
||||
|
||||
if case let textColor as UIColor = UINavigationBar.appearance().titleTextAttributes?[NSForegroundColorAttributeName] {
|
||||
label.textColor = textColor
|
||||
|
||||
fileprivate func createTitleLable() -> UILabel {
|
||||
|
||||
let label = UILabel()
|
||||
label.backgroundColor = .clear
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
label.textAlignment = .center
|
||||
if case let font as UIFont = UINavigationBar.appearance().titleTextAttributes?[NSAttributedString.Key.font] {
|
||||
label.font = font
|
||||
}
|
||||
|
||||
if case let textColor as UIColor = UINavigationBar.appearance().titleTextAttributes?[NSAttributedString.Key.foregroundColor] {
|
||||
label.textColor = textColor
|
||||
}
|
||||
contentView.addSubview(label)
|
||||
return label
|
||||
}
|
||||
contentView.addSubview(label)
|
||||
return label
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: cofigure
|
||||
|
||||
extension ParallaxCell {
|
||||
|
||||
private func createForegroundView(color: UIColor) -> UIView {
|
||||
guard let bgImage = self.bgImage else {
|
||||
fatalError("set bgImage")
|
||||
|
||||
fileprivate func createForegroundView(_ color: UIColor) -> UIView {
|
||||
guard let bgImage = self.bgImage else {
|
||||
fatalError("set bgImage")
|
||||
}
|
||||
|
||||
let foregroundView = UIView()
|
||||
foregroundView.alpha = foregroundAlpha
|
||||
foregroundView.backgroundColor = color
|
||||
foregroundView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
contentView.insertSubview(foregroundView, aboveSubview: bgImage)
|
||||
|
||||
// add constraints
|
||||
for attribute: NSLayoutConstraint.Attribute in [.left, .right, .top] {
|
||||
(contentView, foregroundView) >>>- {
|
||||
$0.attribute = attribute
|
||||
return
|
||||
}
|
||||
}
|
||||
(contentView, foregroundView) >>>- {
|
||||
$0.attribute = .bottom
|
||||
$0.identifier = C.Constraints.bottom
|
||||
return
|
||||
}
|
||||
|
||||
return foregroundView
|
||||
}
|
||||
|
||||
let foregroundView = UIView()
|
||||
foregroundView.alpha = foregroundAlpha
|
||||
foregroundView.backgroundColor = color
|
||||
foregroundView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
contentView.insertSubview(foregroundView, aboveSubview: bgImage)
|
||||
|
||||
// add constraints
|
||||
for attribute: NSLayoutAttribute in [.Left, .Right, .Top] {
|
||||
(contentView, foregroundView) >>>- { $0.attribute = attribute }
|
||||
|
||||
// return bottom constraint
|
||||
fileprivate func createSeparator(_ color: UIColor, height: CGFloat, verticalAttribure: NSLayoutConstraint.Attribute, verticalConstant: CGFloat) -> UIView {
|
||||
let separator = UIView(frame: CGRect.zero)
|
||||
separator.backgroundColor = color
|
||||
separator.translatesAutoresizingMaskIntoConstraints = false
|
||||
contentView.addSubview(separator)
|
||||
|
||||
for attribute: NSLayoutConstraint.Attribute in [.leading, .trailing] {
|
||||
(contentView, separator) >>>- {
|
||||
$0.attribute = attribute
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
(contentView, separator) >>>- {
|
||||
$0.attribute = verticalAttribure
|
||||
$0.constant = verticalConstant
|
||||
return
|
||||
}
|
||||
// height constraint
|
||||
separator >>>- {
|
||||
$0.attribute = .height
|
||||
$0.constant = height
|
||||
return
|
||||
}
|
||||
return separator
|
||||
}
|
||||
(contentView, foregroundView) >>>- {
|
||||
$0.attribute = .Bottom
|
||||
$0.identifier = "Bottom"
|
||||
}
|
||||
|
||||
return foregroundView
|
||||
}
|
||||
|
||||
// return bottom constraint
|
||||
private func createSeparator(color: UIColor, height: CGFloat, verticalAttribure: NSLayoutAttribute, verticalConstant: CGFloat) -> UIView {
|
||||
let separator = UIView(frame: CGRect.zero)
|
||||
separator.backgroundColor = color
|
||||
separator.translatesAutoresizingMaskIntoConstraints = false
|
||||
contentView.addSubview(separator)
|
||||
|
||||
for attribute: NSLayoutAttribute in [.Leading, .Trailing] {
|
||||
(contentView, separator) >>>- { $0.attribute = attribute }
|
||||
}
|
||||
|
||||
(contentView, separator) >>>- {
|
||||
$0.attribute = verticalAttribure
|
||||
$0.constant = verticalConstant
|
||||
}
|
||||
// height constraint
|
||||
separator >>>- {
|
||||
$0.attribute = .Height
|
||||
$0.constant = height
|
||||
}
|
||||
return separator
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
func delay(delay:Double, closure:()->()) {
|
||||
dispatch_after(
|
||||
dispatch_time(
|
||||
DISPATCH_TIME_NOW,
|
||||
Int64(delay * Double(NSEC_PER_SEC))
|
||||
),
|
||||
dispatch_get_main_queue(), closure)
|
||||
func delay(_ delay: Double, closure: @escaping () -> Void) {
|
||||
DispatchQueue.main.asyncAfter(
|
||||
deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ConstraintsHalper.swift
|
||||
// ConstraintsHelper.swift
|
||||
// AnimatedPageView
|
||||
//
|
||||
// Created by Alex K. on 13/04/16.
|
||||
@@ -9,62 +9,69 @@
|
||||
import UIKit
|
||||
|
||||
struct ConstraintInfo {
|
||||
var attribute: NSLayoutAttribute = .Left
|
||||
var secondAttribute: NSLayoutAttribute = .NotAnAttribute
|
||||
var constant: CGFloat = 0
|
||||
var identifier: String?
|
||||
var relation: NSLayoutRelation = .Equal
|
||||
var attribute: NSLayoutConstraint.Attribute = .left
|
||||
var secondAttribute: NSLayoutConstraint.Attribute = .notAnAttribute
|
||||
var constant: CGFloat = 0
|
||||
var identifier: String?
|
||||
var relation: NSLayoutConstraint.Relation = .equal
|
||||
}
|
||||
|
||||
infix operator >>>- { associativity left precedence 150 }
|
||||
|
||||
func >>>- <T: UIView> (left: (T, T), @noescape block: (inout ConstraintInfo) -> ()) -> NSLayoutConstraint {
|
||||
var info = ConstraintInfo()
|
||||
block(&info)
|
||||
info.secondAttribute = info.secondAttribute == .NotAnAttribute ? info.attribute : info.secondAttribute
|
||||
|
||||
let constraint = NSLayoutConstraint(item: left.1,
|
||||
attribute: info.attribute,
|
||||
relatedBy: info.relation,
|
||||
toItem: left.0,
|
||||
attribute: info.secondAttribute,
|
||||
multiplier: 1,
|
||||
constant: info.constant)
|
||||
constraint.identifier = info.identifier
|
||||
left.0.addConstraint(constraint)
|
||||
return constraint
|
||||
precedencegroup constOp {
|
||||
associativity: left
|
||||
higherThan: AssignmentPrecedence
|
||||
}
|
||||
|
||||
func >>>- <T: UIView> (left: T, @noescape block: (inout ConstraintInfo) -> ()) -> NSLayoutConstraint {
|
||||
var info = ConstraintInfo()
|
||||
block(&info)
|
||||
|
||||
let constraint = NSLayoutConstraint(item: left,
|
||||
attribute: info.attribute,
|
||||
relatedBy: info.relation,
|
||||
toItem: nil,
|
||||
attribute: info.attribute,
|
||||
multiplier: 1,
|
||||
constant: info.constant)
|
||||
constraint.identifier = info.identifier
|
||||
left.addConstraint(constraint)
|
||||
return constraint
|
||||
infix operator >>>-: constOp
|
||||
|
||||
@discardableResult
|
||||
func >>>- <T: UIView>(left: (T, T), block: (inout ConstraintInfo) -> Void) -> NSLayoutConstraint {
|
||||
var info = ConstraintInfo()
|
||||
block(&info)
|
||||
info.secondAttribute = info.secondAttribute == .notAnAttribute ? info.attribute : info.secondAttribute
|
||||
|
||||
let constraint = NSLayoutConstraint(item: left.1,
|
||||
attribute: info.attribute,
|
||||
relatedBy: info.relation,
|
||||
toItem: left.0,
|
||||
attribute: info.secondAttribute,
|
||||
multiplier: 1,
|
||||
constant: info.constant)
|
||||
constraint.identifier = info.identifier
|
||||
left.0.addConstraint(constraint)
|
||||
return constraint
|
||||
}
|
||||
|
||||
func >>>- <T: UIView> (left: (T, T, T), @noescape block: (inout ConstraintInfo) -> ()) -> NSLayoutConstraint {
|
||||
var info = ConstraintInfo()
|
||||
block(&info)
|
||||
info.secondAttribute = info.secondAttribute == .NotAnAttribute ? info.attribute : info.secondAttribute
|
||||
|
||||
let constraint = NSLayoutConstraint(item: left.1,
|
||||
attribute: info.attribute,
|
||||
relatedBy: info.relation,
|
||||
toItem: left.2,
|
||||
attribute: info.secondAttribute,
|
||||
multiplier: 1,
|
||||
constant: info.constant)
|
||||
constraint.identifier = info.identifier
|
||||
left.0.addConstraint(constraint)
|
||||
return constraint
|
||||
@discardableResult
|
||||
func >>>- <T: UIView>(left: T, block: (inout ConstraintInfo) -> Void) -> NSLayoutConstraint {
|
||||
var info = ConstraintInfo()
|
||||
block(&info)
|
||||
|
||||
let constraint = NSLayoutConstraint(item: left,
|
||||
attribute: info.attribute,
|
||||
relatedBy: info.relation,
|
||||
toItem: nil,
|
||||
attribute: info.attribute,
|
||||
multiplier: 1,
|
||||
constant: info.constant)
|
||||
constraint.identifier = info.identifier
|
||||
left.addConstraint(constraint)
|
||||
return constraint
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func >>>- <T: UIView>(left: (T, T, T), block: (inout ConstraintInfo) -> Void) -> NSLayoutConstraint {
|
||||
var info = ConstraintInfo()
|
||||
block(&info)
|
||||
info.secondAttribute = info.secondAttribute == .notAnAttribute ? info.attribute : info.secondAttribute
|
||||
|
||||
let constraint = NSLayoutConstraint(item: left.1,
|
||||
attribute: info.attribute,
|
||||
relatedBy: info.relation,
|
||||
toItem: left.2,
|
||||
attribute: info.secondAttribute,
|
||||
multiplier: 1,
|
||||
constant: info.constant)
|
||||
constraint.identifier = info.identifier
|
||||
left.0.addConstraint(constraint)
|
||||
return constraint
|
||||
}
|
||||
|
||||
@@ -24,57 +24,63 @@
|
||||
import UIKit
|
||||
|
||||
internal enum MovingDirection {
|
||||
case Up
|
||||
case Down
|
||||
case up
|
||||
case down
|
||||
}
|
||||
|
||||
internal protocol Moving {
|
||||
|
||||
var defaultYPosition: CGFloat {get set}
|
||||
|
||||
mutating func move(duration: Double, direction: MovingDirection, completion: ((Bool) -> Void)?)
|
||||
internal protocol Moving: class {
|
||||
|
||||
var defaultYPosition: CGFloat { get set }
|
||||
|
||||
func move(_ duration: Double, direction: MovingDirection, completion: ((Bool) -> Void)?)
|
||||
}
|
||||
|
||||
extension Moving where Self: UIView {
|
||||
|
||||
mutating func move(duration: Double, direction: MovingDirection, completion: ((Bool) -> Void)?) {
|
||||
UIView.animateWithDuration(duration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: 0.78,
|
||||
initialSpringVelocity: 0,
|
||||
options: .CurveEaseInOut,
|
||||
animations: { () -> Void in
|
||||
var toYPosition = self.defaultYPosition
|
||||
if direction == .Up {
|
||||
self.defaultYPosition = self.frame.origin.y
|
||||
toYPosition = 20
|
||||
}
|
||||
self.frame = CGRect(x: 0, y: toYPosition, width: self.frame.size.width, height: self.frame.size.height)
|
||||
}, completion: completion)
|
||||
}
|
||||
|
||||
func move(_ duration: Double, direction: MovingDirection, completion: ((Bool) -> Void)?) {
|
||||
UIView.animate(withDuration: duration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: 0.78,
|
||||
initialSpringVelocity: 0,
|
||||
options: UIView.AnimationOptions(),
|
||||
animations: { [weak self] () -> Void in
|
||||
guard let `self` = self else { return }
|
||||
var toYPosition = self.defaultYPosition
|
||||
if direction == .up {
|
||||
self.defaultYPosition = self.frame.origin.y
|
||||
var position: CGFloat = 20
|
||||
if #available(iOS 11.0, *) {
|
||||
if let topPadding = UIApplication.shared.keyWindow?.safeAreaInsets.top {
|
||||
position = topPadding
|
||||
}
|
||||
}
|
||||
toYPosition = position
|
||||
}
|
||||
self.frame = CGRect(x: 0, y: toYPosition, width: self.frame.size.width, height: self.frame.size.height)
|
||||
}, completion: completion)
|
||||
}
|
||||
}
|
||||
|
||||
internal class MovingLabel: UILabel, Moving {
|
||||
var defaultYPosition: CGFloat = 0
|
||||
var defaultYPosition: CGFloat = 0
|
||||
}
|
||||
|
||||
internal class MovingView: UIView {
|
||||
var defaultYPosition: CGFloat = 0
|
||||
|
||||
internal func move(duration: Double, direction: MovingDirection, distance: CGFloat, completion: ((Bool) -> Void)? = nil) {
|
||||
var yPosition = defaultYPosition - 2
|
||||
if direction == .Down {
|
||||
defaultYPosition = frame.origin.y
|
||||
yPosition = distance
|
||||
}
|
||||
UIView.animateWithDuration(duration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: 0.78,
|
||||
initialSpringVelocity: 0,
|
||||
options: .CurveEaseInOut,
|
||||
animations: { () -> Void in
|
||||
self.frame.origin.y = yPosition
|
||||
}, completion: completion)
|
||||
}
|
||||
var defaultYPosition: CGFloat = 0
|
||||
|
||||
internal func move(_ duration: Double, direction: MovingDirection, distance: CGFloat, completion: ((Bool) -> Void)? = nil) {
|
||||
var yPosition = defaultYPosition - 2
|
||||
if direction == .down {
|
||||
defaultYPosition = frame.origin.y
|
||||
yPosition = distance
|
||||
}
|
||||
UIView.animate(withDuration: duration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: 0.78,
|
||||
initialSpringVelocity: 0,
|
||||
options: UIView.AnimationOptions(),
|
||||
animations: { () -> Void in
|
||||
self.frame.origin.y = yPosition
|
||||
}, completion: completion)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,197 +22,216 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
import UIKit
|
||||
fileprivate func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool {
|
||||
switch (lhs, rhs) {
|
||||
case let (l?, r?):
|
||||
return l < r
|
||||
case (nil, _?):
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
public class PTTableViewController: UITableViewController {
|
||||
|
||||
internal var currentCell: ParallaxCell?
|
||||
|
||||
private var duration: Double = 0.65
|
||||
private var currentTextLabel: MovingLabel?
|
||||
/// Base UITableViewController for preview transition
|
||||
open class PTTableViewController: UITableViewController {
|
||||
|
||||
internal var currentCell: ParallaxCell?
|
||||
|
||||
fileprivate var duration: Double = 0.8
|
||||
fileprivate var currentTextLabel: MovingLabel?
|
||||
}
|
||||
|
||||
// MARK: public
|
||||
|
||||
public extension PTTableViewController {
|
||||
|
||||
public func pushViewController(viewController: PTDetailViewController) {
|
||||
|
||||
guard let currentCell = currentCell,
|
||||
let navigationController = self.navigationController else {
|
||||
fatalError("current cell is empty or add navigationController")
|
||||
|
||||
/**
|
||||
Pushes a view controller onto the receiver’s stack and updates the display whith custom animation.
|
||||
|
||||
- parameter viewController: The view controller to push onto the stack.
|
||||
*/
|
||||
func pushViewController(_ viewController: PTDetailViewController) {
|
||||
|
||||
guard let currentCell = currentCell,
|
||||
let navigationController = self.navigationController else {
|
||||
fatalError("current cell is empty or add navigationController")
|
||||
}
|
||||
|
||||
if let currentIndex = tableView.indexPath(for: currentCell) {
|
||||
let nextIndex = IndexPath(row: (currentIndex as NSIndexPath).row + 1, section: (currentIndex as NSIndexPath).section)
|
||||
if case let nextCell as ParallaxCell = tableView.cellForRow(at: nextIndex) {
|
||||
nextCell.showTopSeparator()
|
||||
nextCell.superview?.bringSubviewToFront(nextCell)
|
||||
}
|
||||
}
|
||||
|
||||
currentTextLabel = createTitleLable(currentCell)
|
||||
currentTextLabel?.move(duration, direction: .up, completion: nil)
|
||||
|
||||
currentCell.openCell(tableView, duration: duration)
|
||||
moveCells(tableView, currentCell: currentCell, duration: duration)
|
||||
if let bgImage = currentCell.bgImage?.image {
|
||||
viewController.bgImage = bgImage
|
||||
}
|
||||
if let text = currentCell.parallaxTitle?.text {
|
||||
viewController.titleText = text
|
||||
}
|
||||
delay(duration) {
|
||||
navigationController.pushViewController(viewController, animated: false)
|
||||
}
|
||||
}
|
||||
|
||||
if let currentIndex = tableView.indexPathForCell(currentCell) {
|
||||
let nextIndex = NSIndexPath(forRow: currentIndex.row + 1, inSection: currentIndex.section)
|
||||
if case let nextCell as ParallaxCell = tableView.cellForRowAtIndexPath(nextIndex) {
|
||||
nextCell.showTopSeparator()
|
||||
nextCell.superview?.bringSubviewToFront(nextCell)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
self.currentTextLabel = createTitleLable(currentCell)
|
||||
currentTextLabel?.move(duration, direction: .Up, completion: nil)
|
||||
|
||||
currentCell.openCell(tableView, duration: duration)
|
||||
moveCells(tableView, currentCell: currentCell, duration: duration)
|
||||
if let bgImage = currentCell.bgImage?.image {
|
||||
viewController.bgImage = bgImage
|
||||
}
|
||||
if let text = currentCell.parallaxTitle?.text {
|
||||
viewController.titleText = text
|
||||
}
|
||||
delay(duration) {
|
||||
navigationController.pushViewController(viewController, animated: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: life cicle
|
||||
|
||||
extension PTTableViewController {
|
||||
|
||||
public override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
tableView.contentInset = UIEdgeInsetsMake(-64, 0, 0, 0);
|
||||
tableView.separatorStyle = .None
|
||||
}
|
||||
|
||||
public override func viewWillAppear(animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
moveCellsBackIfNeed(duration) {
|
||||
self.tableView.reloadData()
|
||||
|
||||
open override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
tableView.separatorStyle = .none
|
||||
|
||||
if #available(iOS 11.0, *) {
|
||||
tableView.contentInsetAdjustmentBehavior = .never
|
||||
} else {
|
||||
tableView.contentInset = UIEdgeInsets.init(top: -64, left: 0, bottom: 0, right: 0)
|
||||
}
|
||||
}
|
||||
|
||||
open override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
moveCellsBackIfNeed(duration) {
|
||||
self.tableView.reloadData()
|
||||
}
|
||||
closeCurrentCellIfNeed(duration)
|
||||
moveDownCurrentLabelIfNeed()
|
||||
}
|
||||
closeCurrentCellIfNeed(duration)
|
||||
moveDownCurrentLabelIfNeed()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: create
|
||||
|
||||
extension PTTableViewController {
|
||||
|
||||
private func createTitleLable(cell: ParallaxCell) -> MovingLabel {
|
||||
|
||||
let yPosition = cell.frame.origin.y + cell.frame.size.height / 2.0 - 22 - tableView.contentOffset.y
|
||||
let label = MovingLabel(frame: CGRect(x: 0, y: yPosition, width: UIScreen.mainScreen().bounds.size.width, height: 44))
|
||||
label.textAlignment = .Center
|
||||
label.backgroundColor = .clearColor()
|
||||
if let font = cell.parallaxTitle?.font,
|
||||
let text = cell.parallaxTitle?.text,
|
||||
let textColor = cell.parallaxTitle?.textColor {
|
||||
label.font = font
|
||||
label.text = text
|
||||
label.textColor = textColor
|
||||
|
||||
fileprivate func createTitleLable(_ cell: ParallaxCell) -> MovingLabel {
|
||||
|
||||
let yPosition = cell.frame.origin.y + cell.frame.size.height / 2.0 - 22 - tableView.contentOffset.y
|
||||
let label = MovingLabel(frame: CGRect(x: 0, y: yPosition, width: UIScreen.main.bounds.size.width, height: 44))
|
||||
label.textAlignment = .center
|
||||
label.backgroundColor = .clear
|
||||
if let font = cell.parallaxTitle?.font,
|
||||
let text = cell.parallaxTitle?.text,
|
||||
let textColor = cell.parallaxTitle?.textColor {
|
||||
label.font = font
|
||||
label.text = text
|
||||
label.textColor = textColor
|
||||
}
|
||||
|
||||
navigationController?.view.addSubview(label)
|
||||
return label
|
||||
}
|
||||
|
||||
navigationController?.view.addSubview(label)
|
||||
return label
|
||||
}
|
||||
|
||||
private func createSeparator(color: UIColor?, height: CGFloat, cell: UITableViewCell) -> MovingView {
|
||||
|
||||
let yPosition = cell.frame.origin.y + cell.frame.size.height - tableView.contentOffset.y
|
||||
let separator = MovingView(frame: CGRect(x:0.0, y: yPosition, width: tableView.bounds.size.width, height: height))
|
||||
if let color = color {
|
||||
separator.backgroundColor = color
|
||||
|
||||
fileprivate func createSeparator(_ color: UIColor?, height: CGFloat, cell: UITableViewCell) -> MovingView {
|
||||
|
||||
let yPosition = cell.frame.origin.y + cell.frame.size.height - tableView.contentOffset.y
|
||||
let separator = MovingView(frame: CGRect(x: 0.0, y: yPosition, width: tableView.bounds.size.width, height: height))
|
||||
if let color = color {
|
||||
separator.backgroundColor = color
|
||||
}
|
||||
separator.translatesAutoresizingMaskIntoConstraints = false
|
||||
navigationController?.view.addSubview(separator)
|
||||
return separator
|
||||
}
|
||||
separator.translatesAutoresizingMaskIntoConstraints = false
|
||||
navigationController?.view.addSubview(separator)
|
||||
return separator
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: tableView dataSource
|
||||
|
||||
extension PTTableViewController {
|
||||
|
||||
final public override func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? {
|
||||
|
||||
guard let currentCell = tableView.cellForRowAtIndexPath(indexPath) as? ParallaxCell else {
|
||||
return indexPath
|
||||
|
||||
public final override func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
|
||||
|
||||
guard let currentCell = tableView.cellForRow(at: indexPath) as? ParallaxCell else {
|
||||
return indexPath
|
||||
}
|
||||
|
||||
self.currentCell = currentCell
|
||||
return indexPath
|
||||
}
|
||||
|
||||
self.currentCell = currentCell
|
||||
return indexPath
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: helpers
|
||||
|
||||
extension PTTableViewController {
|
||||
|
||||
private func parallaxOffsetDidChange(offset: CGFloat) {
|
||||
|
||||
for case let cell as ParallaxCell in tableView.visibleCells where cell != currentCell {
|
||||
cell.parallaxOffset(tableView)
|
||||
|
||||
fileprivate func parallaxOffsetDidChange(_: CGFloat) {
|
||||
|
||||
_ = tableView.visibleCells
|
||||
.filter { $0 != currentCell }
|
||||
.forEach { if case let cell as ParallaxCell = $0 { cell.parallaxOffset(tableView) } }
|
||||
}
|
||||
}
|
||||
|
||||
private func moveCellsBackIfNeed(duration: Double, completion: () -> Void) {
|
||||
|
||||
guard let currentCell = self.currentCell,
|
||||
let currentIndex = tableView.indexPathForCell(currentCell) else {
|
||||
return
|
||||
|
||||
fileprivate func moveCellsBackIfNeed(_ duration: Double, completion: @escaping () -> Void) {
|
||||
|
||||
guard let currentCell = self.currentCell,
|
||||
let currentIndex = tableView.indexPath(for: currentCell) else {
|
||||
return
|
||||
}
|
||||
|
||||
for case let cell as ParallaxCell in tableView.visibleCells where cell != currentCell {
|
||||
|
||||
if cell.isMovedHidden == false { continue }
|
||||
|
||||
if let index = tableView.indexPath(for: cell) {
|
||||
let direction = (index as NSIndexPath).row < (currentIndex as NSIndexPath).row ? ParallaxCell.Direction.up : ParallaxCell.Direction.down
|
||||
cell.animationMoveCell(direction, duration: duration, tableView: tableView, selectedIndexPaht: currentIndex, close: true)
|
||||
cell.isMovedHidden = false
|
||||
}
|
||||
}
|
||||
delay(duration, closure: completion)
|
||||
}
|
||||
|
||||
for case let cell as ParallaxCell in tableView.visibleCells where cell != currentCell {
|
||||
|
||||
if cell.isMovedHidden == false {continue}
|
||||
|
||||
if let index = tableView.indexPathForCell(cell) {
|
||||
let direction = index.row < currentIndex.row ? ParallaxCell.Direction .Up : ParallaxCell.Direction.Down
|
||||
cell.animationMoveCell(direction, duration: duration, tableView: tableView, selectedIndexPaht: currentIndex, close: true)
|
||||
cell.isMovedHidden = false
|
||||
}
|
||||
|
||||
fileprivate func closeCurrentCellIfNeed(_ duration: Double) {
|
||||
|
||||
guard let currentCell = self.currentCell else {
|
||||
return
|
||||
}
|
||||
|
||||
currentCell.closeCell(duration, tableView: tableView) { () -> Void in
|
||||
self.currentCell = nil
|
||||
}
|
||||
}
|
||||
delay(duration, closure: completion)
|
||||
}
|
||||
|
||||
private func closeCurrentCellIfNeed(duration: Double) {
|
||||
|
||||
guard let currentCell = self.currentCell else {
|
||||
return
|
||||
|
||||
fileprivate func moveDownCurrentLabelIfNeed() {
|
||||
|
||||
guard let currentTextLabel = self.currentTextLabel else {
|
||||
return
|
||||
}
|
||||
currentTextLabel.move(duration, direction: .down) { _ in
|
||||
currentTextLabel.removeFromSuperview()
|
||||
self.currentTextLabel = nil
|
||||
}
|
||||
}
|
||||
|
||||
currentCell.closeCell(duration, tableView: tableView) { () -> Void in
|
||||
self.currentCell = nil
|
||||
|
||||
// animtaions
|
||||
fileprivate func moveCells(_ tableView: UITableView, currentCell: ParallaxCell, duration: Double) {
|
||||
guard let currentIndex = tableView.indexPath(for: currentCell) else {
|
||||
return
|
||||
}
|
||||
|
||||
for case let cell as ParallaxCell in tableView.visibleCells where cell != currentCell {
|
||||
cell.isMovedHidden = true
|
||||
let row = (tableView.indexPath(for: cell) as NSIndexPath?)?.row
|
||||
let direction = row < (currentIndex as NSIndexPath).row ? ParallaxCell.Direction.down : ParallaxCell.Direction.up
|
||||
cell.animationMoveCell(direction, duration: duration, tableView: tableView, selectedIndexPaht: currentIndex, close: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func moveDownCurrentLabelIfNeed() {
|
||||
|
||||
guard var currentTextLabel = self.currentTextLabel else {
|
||||
return
|
||||
}
|
||||
currentTextLabel.move(duration, direction: .Down) { (finished) in
|
||||
currentTextLabel.removeFromSuperview()
|
||||
self.currentTextLabel = nil
|
||||
}
|
||||
}
|
||||
|
||||
// animtaions
|
||||
private func moveCells(tableView: UITableView, currentCell: ParallaxCell, duration: Double) {
|
||||
guard let currentIndex = tableView.indexPathForCell(currentCell) else {
|
||||
return
|
||||
}
|
||||
|
||||
for case let cell as ParallaxCell in tableView.visibleCells where cell != currentCell {
|
||||
cell.isMovedHidden = true
|
||||
let row = tableView.indexPathForCell(cell)?.row
|
||||
let direction = row < currentIndex.row ? ParallaxCell.Direction .Down : ParallaxCell.Direction.Up
|
||||
cell.animationMoveCell(direction, duration: duration, tableView: tableView, selectedIndexPaht: currentIndex, close: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: ScroolViewDelegate
|
||||
|
||||
extension PTTableViewController {
|
||||
|
||||
override public func scrollViewDidScroll(scrollView: UIScrollView) {
|
||||
parallaxOffsetDidChange(scrollView.contentOffset.y)
|
||||
}
|
||||
}
|
||||
|
||||
open override func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
parallaxOffsetDidChange(scrollView.contentOffset.y)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
//
|
||||
// LayerAnimationHalper.swift
|
||||
// PreviewTransitionDemo
|
||||
//
|
||||
// Created by Alex K. on 03/05/16.
|
||||
// Copyright © 2016 Alex K. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
extension UIView {
|
||||
|
||||
private func createAnimationFromKey(key: String, duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) -> CABasicAnimation {
|
||||
let animation = CABasicAnimation(keyPath: key)
|
||||
animation.duration = duration
|
||||
animation.toValue = to
|
||||
animation.fromValue = from
|
||||
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
|
||||
animation.beginTime = CACurrentMediaTime() + delay
|
||||
if remove == false {
|
||||
animation.removedOnCompletion = remove
|
||||
animation.fillMode = kCAFillModeForwards
|
||||
}
|
||||
return animation
|
||||
}
|
||||
|
||||
|
||||
func rotateDuration(duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) {
|
||||
let animation = createAnimationFromKey("transform.rotation.z",
|
||||
duration: duration,
|
||||
from: from,
|
||||
to: to,
|
||||
delay: delay,
|
||||
remove: remove)
|
||||
layer.addAnimation(animation, forKey: nil)
|
||||
}
|
||||
|
||||
|
||||
func scaleDuration(duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) {
|
||||
let animation = createAnimationFromKey("transform.scale",
|
||||
duration: duration,
|
||||
from: from,
|
||||
to: to,
|
||||
delay: delay,
|
||||
remove: remove)
|
||||
|
||||
layer.addAnimation(animation, forKey: nil)
|
||||
}
|
||||
|
||||
|
||||
func opacityDuration(duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) {
|
||||
let animation = createAnimationFromKey("opacity",
|
||||
duration: duration,
|
||||
from: from,
|
||||
to: to,
|
||||
delay: delay,
|
||||
remove: remove)
|
||||
|
||||
layer.addAnimation(animation, forKey: nil)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// LayerAnimationHelper.swift
|
||||
// PreviewTransitionDemo
|
||||
//
|
||||
// Created by Alex K. on 03/05/16.
|
||||
// Copyright © 2016 Alex K. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
extension UIView {
|
||||
|
||||
private func createAnimationFromKey(key: String, duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) -> CABasicAnimation {
|
||||
let animation = CABasicAnimation(keyPath: key)
|
||||
animation.duration = duration
|
||||
animation.toValue = to
|
||||
animation.fromValue = from
|
||||
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut)
|
||||
animation.beginTime = CACurrentMediaTime() + delay
|
||||
if remove == false {
|
||||
animation.isRemovedOnCompletion = remove
|
||||
animation.fillMode = CAMediaTimingFillMode.forwards
|
||||
}
|
||||
return animation
|
||||
}
|
||||
|
||||
func rotateDuration(duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) {
|
||||
let animation = createAnimationFromKey(key: "transform.rotation.z",
|
||||
duration: duration,
|
||||
from: from,
|
||||
to: to,
|
||||
delay: delay,
|
||||
remove: remove)
|
||||
layer.add(animation, forKey: nil)
|
||||
}
|
||||
|
||||
func scaleDuration(duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) {
|
||||
let animation = createAnimationFromKey(key: "transform.scale",
|
||||
duration: duration,
|
||||
from: from,
|
||||
to: to,
|
||||
delay: delay,
|
||||
remove: remove)
|
||||
|
||||
layer.add(animation, forKey: nil)
|
||||
}
|
||||
|
||||
func opacityDuration(duration: Double, from: CGFloat, to: CGFloat, delay: Double = 0, remove: Bool = true) {
|
||||
let animation = createAnimationFromKey(key: "opacity",
|
||||
duration: duration,
|
||||
from: from,
|
||||
to: to,
|
||||
delay: delay,
|
||||
remove: remove)
|
||||
|
||||
layer.add(animation, forKey: nil)
|
||||
}
|
||||
}
|
||||
@@ -4,23 +4,24 @@ import Foundation
|
||||
import UIKit
|
||||
|
||||
extension UIImage {
|
||||
enum Asset: String {
|
||||
case _1 = "1"
|
||||
case _2 = "2"
|
||||
case _3 = "3"
|
||||
case _4 = "4"
|
||||
case _5 = "5"
|
||||
case Back = "back"
|
||||
case HertIcon = "HertIcon"
|
||||
case PlusIcon = "PlusIcon"
|
||||
case ShareIcon = "ShareIcon"
|
||||
enum Asset: String {
|
||||
case _1 = "1"
|
||||
case _2 = "2"
|
||||
case _3 = "3"
|
||||
case _4 = "4"
|
||||
case _5 = "5"
|
||||
case Back = "back"
|
||||
case HertIcon
|
||||
case PlusIcon
|
||||
case ShareIcon
|
||||
case TransparentPixel
|
||||
|
||||
var image: UIImage {
|
||||
return UIImage(asset: self)
|
||||
var image: UIImage {
|
||||
return UIImage(asset: self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
convenience init!(asset: Asset) {
|
||||
self.init(named: asset.rawValue)
|
||||
}
|
||||
convenience init!(asset: Asset) {
|
||||
self.init(named: asset.rawValue)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,36 +11,32 @@ import UIKit
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
var window: UIWindow?
|
||||
|
||||
func application(application _: UIApplication, didFinishLaunchingWithOptions _: [NSObject: AnyObject]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
func applicationWillResignActive(application _: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationWillResignActive(application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
func applicationDidEnterBackground(application _: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(application: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
func applicationWillEnterForeground(application _: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(application _: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(application _: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,31 +10,28 @@ import UIKit
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
@IBOutlet weak var lableText: UILabel!
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
let animation = CABasicAnimation(keyPath: "fontSize")
|
||||
animation.toValue = 10
|
||||
animation.duration = 3
|
||||
|
||||
let textLayer = CATextLayer()
|
||||
textLayer.font = UIFont.systemFontOfSize(50)
|
||||
textLayer.fontSize = 50
|
||||
textLayer.string = "text"
|
||||
textLayer.foregroundColor = UIColor.redColor().CGColor
|
||||
textLayer.backgroundColor = UIColor.blackColor().CGColor
|
||||
textLayer.frame = CGRect(x: 100, y: 100, width: 100, height: 100)
|
||||
view.layer.addSublayer(textLayer)
|
||||
|
||||
lableText.layer.addAnimation(animation, forKey: nil)
|
||||
}
|
||||
@IBOutlet var lableText: UILabel!
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
let animation = CABasicAnimation(keyPath: "fontSize")
|
||||
animation.toValue = 10
|
||||
animation.duration = 3
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
let textLayer = CATextLayer()
|
||||
textLayer.font = UIFont.systemFontOfSize(50)
|
||||
textLayer.fontSize = 50
|
||||
textLayer.string = "text"
|
||||
textLayer.foregroundColor = UIColor.redColor().CGColor
|
||||
textLayer.backgroundColor = UIColor.blackColor().CGColor
|
||||
textLayer.frame = CGRect(x: 100, y: 100, width: 100, height: 100)
|
||||
view.layer.addSublayer(textLayer)
|
||||
|
||||
lableText.layer.addAnimation(animation, forKey: nil)
|
||||
}
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,12 +13,14 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// PreivewTransition.h
|
||||
// PreivewTransition
|
||||
//
|
||||
// Created by Alex K. on 02/06/16.
|
||||
// Copyright © 2016 Alex K. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for PreivewTransition.
|
||||
FOUNDATION_EXPORT double PreivewTransitionVersionNumber;
|
||||
|
||||
//! Project version string for PreivewTransition.
|
||||
FOUNDATION_EXPORT const unsigned char PreivewTransitionVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <PreivewTransition/PublicHeader.h>
|
||||
|
||||
|
||||
@@ -8,46 +8,56 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8416D9EA1CB28E2600BB599D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8416D9E91CB28E2600BB599D /* Extensions.swift */; };
|
||||
8416D9EB1CB28E2600BB599D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8416D9E91CB28E2600BB599D /* Extensions.swift */; };
|
||||
84204DFD1CB2869E001FC263 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204DFC1CB2869E001FC263 /* AppDelegate.swift */; };
|
||||
84204E021CB2869E001FC263 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84204E001CB2869E001FC263 /* Main.storyboard */; };
|
||||
84204E041CB2869E001FC263 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84204E031CB2869E001FC263 /* Assets.xcassets */; };
|
||||
84204E071CB2869E001FC263 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84204E051CB2869E001FC263 /* LaunchScreen.storyboard */; };
|
||||
84204E121CB2869E001FC263 /* PreviewTransitionDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E111CB2869E001FC263 /* PreviewTransitionDemoTests.swift */; };
|
||||
84204E1F1CB289B3001FC263 /* PTDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E1E1CB289B3001FC263 /* PTDetailViewController.swift */; };
|
||||
84204E281CB289DC001FC263 /* ParallaxCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E221CB289DC001FC263 /* ParallaxCell.swift */; };
|
||||
84204E291CB289DC001FC263 /* TimeExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E241CB289DC001FC263 /* TimeExtensions.swift */; };
|
||||
84204E2A1CB289DC001FC263 /* MovingViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E261CB289DC001FC263 /* MovingViews.swift */; };
|
||||
84204E2B1CB289DC001FC263 /* PTTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E271CB289DC001FC263 /* PTTableViewController.swift */; };
|
||||
84204E2F1CB28B5B001FC263 /* DemoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E2D1CB28B5B001FC263 /* DemoDetailViewController.swift */; };
|
||||
84204E301CB28B5B001FC263 /* DemoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E2D1CB28B5B001FC263 /* DemoDetailViewController.swift */; };
|
||||
84204E311CB28B5B001FC263 /* DemoTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E2E1CB28B5B001FC263 /* DemoTableViewController.swift */; };
|
||||
84204E321CB28B5B001FC263 /* DemoTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E2E1CB28B5B001FC263 /* DemoTableViewController.swift */; };
|
||||
842D7E9B1CB395C800DE59DE /* ParallaxCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E221CB289DC001FC263 /* ParallaxCell.swift */; };
|
||||
842D7E9C1CB395D900DE59DE /* PTTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E271CB289DC001FC263 /* PTTableViewController.swift */; };
|
||||
842D7E9D1CB395FC00DE59DE /* TimeExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E241CB289DC001FC263 /* TimeExtensions.swift */; };
|
||||
842D7E9E1CB3960200DE59DE /* MovingViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E261CB289DC001FC263 /* MovingViews.swift */; };
|
||||
842D7E9F1CB3960A00DE59DE /* PTDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E1E1CB289B3001FC263 /* PTDetailViewController.swift */; };
|
||||
848526521CD39CFB0052BEAD /* Images.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848526511CD39CFB0052BEAD /* Images.swift */; };
|
||||
848526531CD39CFB0052BEAD /* Images.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848526511CD39CFB0052BEAD /* Images.swift */; };
|
||||
848BD7E51CCF54620046DC13 /* ConstraintsHalper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848BD7E41CCF54620046DC13 /* ConstraintsHalper.swift */; };
|
||||
848BD7E61CCF54620046DC13 /* ConstraintsHalper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848BD7E41CCF54620046DC13 /* ConstraintsHalper.swift */; };
|
||||
84A36E0E1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A36E0D1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift */; };
|
||||
84A36E0F1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A36E0D1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift */; };
|
||||
8499D8BA1D006020004B5B37 /* PreivewTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8499D8B91D006020004B5B37 /* PreivewTransition.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8499D8BE1D006020004B5B37 /* PreviewTransition.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8B71D006020004B5B37 /* PreviewTransition.framework */; };
|
||||
8499D8BF1D006020004B5B37 /* PreviewTransition.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8B71D006020004B5B37 /* PreviewTransition.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
8499D8C41D006062004B5B37 /* ConstraintsHalper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848BD7E41CCF54620046DC13 /* ConstraintsHalper.swift */; };
|
||||
8499D8C51D006066004B5B37 /* ParallaxCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E221CB289DC001FC263 /* ParallaxCell.swift */; };
|
||||
8499D8C61D00607B004B5B37 /* TimeExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E241CB289DC001FC263 /* TimeExtensions.swift */; };
|
||||
8499D8C71D006082004B5B37 /* MovingViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E261CB289DC001FC263 /* MovingViews.swift */; };
|
||||
8499D8C81D006085004B5B37 /* PTTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E271CB289DC001FC263 /* PTTableViewController.swift */; };
|
||||
8499D8C91D00608B004B5B37 /* PTDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84204E1E1CB289B3001FC263 /* PTDetailViewController.swift */; };
|
||||
84A36E0E1CD88EEA00AEC2F2 /* LayerAnimationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A36E0D1CD88EEA00AEC2F2 /* LayerAnimationHelper.swift */; };
|
||||
84A36E141CD8C70F00AEC2F2 /* ScreenShot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A36E131CD8C70F00AEC2F2 /* ScreenShot.swift */; };
|
||||
84A36E151CD8C70F00AEC2F2 /* ScreenShot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A36E131CD8C70F00AEC2F2 /* ScreenShot.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
84204E0E1CB2869E001FC263 /* PBXContainerItemProxy */ = {
|
||||
8499D8BC1D006020004B5B37 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 84204DF11CB2869E001FC263 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 84204DF81CB2869E001FC263;
|
||||
remoteInfo = PreviewTransitionDemo;
|
||||
remoteGlobalIDString = 8499D8B61D006020004B5B37;
|
||||
remoteInfo = PreivewTransition;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
8499D8C31D006020004B5B37 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
8499D8BF1D006020004B5B37 /* PreviewTransition.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
8416D9E91CB28E2600BB599D /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
|
||||
84204DF91CB2869E001FC263 /* PreviewTransitionDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PreviewTransitionDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -56,9 +66,6 @@
|
||||
84204E031CB2869E001FC263 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
84204E061CB2869E001FC263 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
84204E081CB2869E001FC263 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
84204E0D1CB2869E001FC263 /* PreviewTransitionDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PreviewTransitionDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
84204E111CB2869E001FC263 /* PreviewTransitionDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewTransitionDemoTests.swift; sourceTree = "<group>"; };
|
||||
84204E131CB2869E001FC263 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
84204E1E1CB289B3001FC263 /* PTDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PTDetailViewController.swift; sourceTree = "<group>"; };
|
||||
84204E221CB289DC001FC263 /* ParallaxCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParallaxCell.swift; sourceTree = "<group>"; };
|
||||
84204E241CB289DC001FC263 /* TimeExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimeExtensions.swift; sourceTree = "<group>"; };
|
||||
@@ -68,7 +75,10 @@
|
||||
84204E2E1CB28B5B001FC263 /* DemoTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoTableViewController.swift; sourceTree = "<group>"; };
|
||||
848526511CD39CFB0052BEAD /* Images.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Images.swift; sourceTree = "<group>"; };
|
||||
848BD7E41CCF54620046DC13 /* ConstraintsHalper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintsHalper.swift; sourceTree = "<group>"; };
|
||||
84A36E0D1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayerAnimationHalper.swift; sourceTree = "<group>"; };
|
||||
8499D8B71D006020004B5B37 /* PreviewTransition.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PreviewTransition.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8499D8B91D006020004B5B37 /* PreivewTransition.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PreivewTransition.h; sourceTree = "<group>"; };
|
||||
8499D8BB1D006020004B5B37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
84A36E0D1CD88EEA00AEC2F2 /* LayerAnimationHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayerAnimationHelper.swift; sourceTree = "<group>"; };
|
||||
84A36E131CD8C70F00AEC2F2 /* ScreenShot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScreenShot.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@@ -77,10 +87,11 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8499D8BE1D006020004B5B37 /* PreviewTransition.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
84204E0A1CB2869E001FC263 /* Frameworks */ = {
|
||||
8499D8B31D006020004B5B37 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -101,11 +112,11 @@
|
||||
84204DF01CB2869E001FC263 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84A36E111CD8C31C00AEC2F2 /* Halpers */,
|
||||
84A36E111CD8C31C00AEC2F2 /* Helpers */,
|
||||
848526501CD39CDD0052BEAD /* Constants */,
|
||||
84204E1C1CB286DD001FC263 /* PreviewTransition */,
|
||||
84204DFB1CB2869E001FC263 /* PreviewTransitionDemo */,
|
||||
84204E101CB2869E001FC263 /* PreviewTransitionDemoTests */,
|
||||
8499D8B81D006020004B5B37 /* PreivewTransition */,
|
||||
84204DFA1CB2869E001FC263 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@@ -114,7 +125,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84204DF91CB2869E001FC263 /* PreviewTransitionDemo.app */,
|
||||
84204E0D1CB2869E001FC263 /* PreviewTransitionDemoTests.xctest */,
|
||||
8499D8B71D006020004B5B37 /* PreviewTransition.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -133,15 +144,6 @@
|
||||
path = PreviewTransitionDemo;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84204E101CB2869E001FC263 /* PreviewTransitionDemoTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84204E111CB2869E001FC263 /* PreviewTransitionDemoTests.swift */,
|
||||
84204E131CB2869E001FC263 /* Info.plist */,
|
||||
);
|
||||
path = PreviewTransitionDemoTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84204E1C1CB286DD001FC263 /* PreviewTransition */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -222,21 +224,30 @@
|
||||
path = Halpers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84A36E0C1CD88EB200AEC2F2 /* AnimationHalpers */ = {
|
||||
8499D8B81D006020004B5B37 /* PreivewTransition */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84A36E0D1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift */,
|
||||
8499D8B91D006020004B5B37 /* PreivewTransition.h */,
|
||||
8499D8BB1D006020004B5B37 /* Info.plist */,
|
||||
);
|
||||
path = AnimationHalpers;
|
||||
path = PreivewTransition;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84A36E111CD8C31C00AEC2F2 /* Halpers */ = {
|
||||
84A36E0C1CD88EB200AEC2F2 /* AnimationHelpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84A36E0D1CD88EEA00AEC2F2 /* LayerAnimationHelper.swift */,
|
||||
);
|
||||
path = AnimationHelpers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84A36E111CD8C31C00AEC2F2 /* Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84A36E121CD8C32600AEC2F2 /* ScreenShot */,
|
||||
84A36E0C1CD88EB200AEC2F2 /* AnimationHalpers */,
|
||||
84A36E0C1CD88EB200AEC2F2 /* AnimationHelpers */,
|
||||
);
|
||||
name = Halpers;
|
||||
name = Helpers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84A36E121CD8C32600AEC2F2 /* ScreenShot */ = {
|
||||
@@ -250,6 +261,17 @@
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
8499D8B41D006020004B5B37 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8499D8BA1D006020004B5B37 /* PreivewTransition.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
84204DF81CB2869E001FC263 /* PreviewTransitionDemo */ = {
|
||||
isa = PBXNativeTarget;
|
||||
@@ -258,34 +280,35 @@
|
||||
84204DF51CB2869E001FC263 /* Sources */,
|
||||
84204DF61CB2869E001FC263 /* Frameworks */,
|
||||
84204DF71CB2869E001FC263 /* Resources */,
|
||||
8485264F1CD39C880052BEAD /* image enum gen */,
|
||||
8499D8C31D006020004B5B37 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
8499D8BD1D006020004B5B37 /* PBXTargetDependency */,
|
||||
);
|
||||
name = PreviewTransitionDemo;
|
||||
productName = PreviewTransitionDemo;
|
||||
productReference = 84204DF91CB2869E001FC263 /* PreviewTransitionDemo.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
84204E0C1CB2869E001FC263 /* PreviewTransitionDemoTests */ = {
|
||||
8499D8B61D006020004B5B37 /* PreviewTransition */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 84204E191CB2869E001FC263 /* Build configuration list for PBXNativeTarget "PreviewTransitionDemoTests" */;
|
||||
buildConfigurationList = 8499D8C21D006020004B5B37 /* Build configuration list for PBXNativeTarget "PreviewTransition" */;
|
||||
buildPhases = (
|
||||
84204E091CB2869E001FC263 /* Sources */,
|
||||
84204E0A1CB2869E001FC263 /* Frameworks */,
|
||||
84204E0B1CB2869E001FC263 /* Resources */,
|
||||
8499D8B21D006020004B5B37 /* Sources */,
|
||||
8499D8B31D006020004B5B37 /* Frameworks */,
|
||||
8499D8B41D006020004B5B37 /* Headers */,
|
||||
8499D8B51D006020004B5B37 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
84204E0F1CB2869E001FC263 /* PBXTargetDependency */,
|
||||
);
|
||||
name = PreviewTransitionDemoTests;
|
||||
productName = PreviewTransitionDemoTests;
|
||||
productReference = 84204E0D1CB2869E001FC263 /* PreviewTransitionDemoTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
name = PreviewTransition;
|
||||
productName = PreivewTransition;
|
||||
productReference = 8499D8B71D006020004B5B37 /* PreviewTransition.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
@@ -294,21 +317,24 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0730;
|
||||
LastUpgradeCheck = 1020;
|
||||
ORGANIZATIONNAME = "Alex K.";
|
||||
TargetAttributes = {
|
||||
84204DF81CB2869E001FC263 = {
|
||||
CreatedOnToolsVersion = 7.3;
|
||||
DevelopmentTeam = 34MUF9YXTA;
|
||||
LastSwiftMigration = 1020;
|
||||
};
|
||||
84204E0C1CB2869E001FC263 = {
|
||||
CreatedOnToolsVersion = 7.3;
|
||||
TestTargetID = 84204DF81CB2869E001FC263;
|
||||
8499D8B61D006020004B5B37 = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
DevelopmentTeam = LEAZS7L33U;
|
||||
LastSwiftMigration = 1020;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 84204DF41CB2869E001FC263 /* Build configuration list for PBXProject "PreviewTransitionDemo" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
@@ -320,7 +346,7 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
84204DF81CB2869E001FC263 /* PreviewTransitionDemo */,
|
||||
84204E0C1CB2869E001FC263 /* PreviewTransitionDemoTests */,
|
||||
8499D8B61D006020004B5B37 /* PreviewTransition */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -336,7 +362,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
84204E0B1CB2869E001FC263 /* Resources */ = {
|
||||
8499D8B51D006020004B5B37 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -345,23 +371,6 @@
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
8485264F1CD39C880052BEAD /* image enum gen */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "image enum gen";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "if which swiftgen >/dev/null; then\nswiftgen images \"$PROJECT_DIR/PreviewTransitionDemo/Assets.xcassets\" --output \"$PROJECT_DIR/Constants/Images.swift\"\nelse\necho \"warning: SwiftGen not installed, download it from https://github.com/AliSoftware/SwiftGen\"\nfi";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
84204DF51CB2869E001FC263 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
@@ -378,38 +387,31 @@
|
||||
848BD7E51CCF54620046DC13 /* ConstraintsHalper.swift in Sources */,
|
||||
84204E2B1CB289DC001FC263 /* PTTableViewController.swift in Sources */,
|
||||
84204DFD1CB2869E001FC263 /* AppDelegate.swift in Sources */,
|
||||
84A36E0E1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift in Sources */,
|
||||
84A36E0E1CD88EEA00AEC2F2 /* LayerAnimationHelper.swift in Sources */,
|
||||
84204E2F1CB28B5B001FC263 /* DemoDetailViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
84204E091CB2869E001FC263 /* Sources */ = {
|
||||
8499D8B21D006020004B5B37 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
842D7E9B1CB395C800DE59DE /* ParallaxCell.swift in Sources */,
|
||||
84204E301CB28B5B001FC263 /* DemoDetailViewController.swift in Sources */,
|
||||
842D7E9E1CB3960200DE59DE /* MovingViews.swift in Sources */,
|
||||
848526531CD39CFB0052BEAD /* Images.swift in Sources */,
|
||||
84204E121CB2869E001FC263 /* PreviewTransitionDemoTests.swift in Sources */,
|
||||
842D7E9F1CB3960A00DE59DE /* PTDetailViewController.swift in Sources */,
|
||||
84A36E151CD8C70F00AEC2F2 /* ScreenShot.swift in Sources */,
|
||||
84204E321CB28B5B001FC263 /* DemoTableViewController.swift in Sources */,
|
||||
848BD7E61CCF54620046DC13 /* ConstraintsHalper.swift in Sources */,
|
||||
8416D9EB1CB28E2600BB599D /* Extensions.swift in Sources */,
|
||||
842D7E9C1CB395D900DE59DE /* PTTableViewController.swift in Sources */,
|
||||
84A36E0F1CD88EEA00AEC2F2 /* LayerAnimationHalper.swift in Sources */,
|
||||
842D7E9D1CB395FC00DE59DE /* TimeExtensions.swift in Sources */,
|
||||
8499D8C61D00607B004B5B37 /* TimeExtensions.swift in Sources */,
|
||||
8499D8C91D00608B004B5B37 /* PTDetailViewController.swift in Sources */,
|
||||
8499D8C51D006066004B5B37 /* ParallaxCell.swift in Sources */,
|
||||
8499D8C71D006082004B5B37 /* MovingViews.swift in Sources */,
|
||||
8499D8C41D006062004B5B37 /* ConstraintsHalper.swift in Sources */,
|
||||
8499D8C81D006085004B5B37 /* PTTableViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
84204E0F1CB2869E001FC263 /* PBXTargetDependency */ = {
|
||||
8499D8BD1D006020004B5B37 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 84204DF81CB2869E001FC263 /* PreviewTransitionDemo */;
|
||||
targetProxy = 84204E0E1CB2869E001FC263 /* PBXContainerItemProxy */;
|
||||
target = 8499D8B61D006020004B5B37 /* PreviewTransition */;
|
||||
targetProxy = 8499D8BC1D006020004B5B37 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
@@ -437,18 +439,29 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -470,7 +483,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
@@ -482,18 +495,29 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -509,9 +533,10 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
@@ -519,48 +544,84 @@
|
||||
84204E171CB2869E001FC263 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
DEVELOPMENT_TEAM = 34MUF9YXTA;
|
||||
INFOPLIST_FILE = PreviewTransitionDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PreviewTransitionDemo;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
84204E181CB2869E001FC263 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
DEVELOPMENT_TEAM = 34MUF9YXTA;
|
||||
INFOPLIST_FILE = PreviewTransitionDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PreviewTransitionDemo;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
84204E1A1CB2869E001FC263 /* Debug */ = {
|
||||
8499D8C01D006020004B5B37 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = PreviewTransitionDemoTests/Info.plist;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = PreivewTransition/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PreviewTransitionDemoTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PreivewTransition;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PreviewTransitionDemo.app/PreviewTransitionDemo";
|
||||
SKIP_INSTALL = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
84204E1B1CB2869E001FC263 /* Release */ = {
|
||||
8499D8C11D006020004B5B37 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = PreviewTransitionDemoTests/Info.plist;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = PreivewTransition/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PreviewTransitionDemoTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.PreivewTransition;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PreviewTransitionDemo.app/PreviewTransitionDemo";
|
||||
SKIP_INSTALL = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -585,11 +646,11 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
84204E191CB2869E001FC263 /* Build configuration list for PBXNativeTarget "PreviewTransitionDemoTests" */ = {
|
||||
8499D8C21D006020004B5B37 /* Build configuration list for PBXNativeTarget "PreviewTransition" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
84204E1A1CB2869E001FC263 /* Debug */,
|
||||
84204E1B1CB2869E001FC263 /* Release */,
|
||||
8499D8C01D006020004B5B37 /* Debug */,
|
||||
8499D8C11D006020004B5B37 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0730"
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -14,23 +14,9 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "84204DF81CB2869E001FC263"
|
||||
BuildableName = "PreviewTransitionDemo.app"
|
||||
BlueprintName = "PreviewTransitionDemo"
|
||||
ReferencedContainer = "container:PreviewTransitionDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "NO"
|
||||
buildForRunning = "NO"
|
||||
buildForProfiling = "NO"
|
||||
buildForArchiving = "NO"
|
||||
buildForAnalyzing = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "84204E0C1CB2869E001FC263"
|
||||
BuildableName = "PreviewTransitionDemoTests.xctest"
|
||||
BlueprintName = "PreviewTransitionDemoTests"
|
||||
BlueprintIdentifier = "8499D8B61D006020004B5B37"
|
||||
BuildableName = "PreviewTransition.framework"
|
||||
BlueprintName = "PreviewTransition"
|
||||
ReferencedContainer = "container:PreviewTransitionDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
@@ -43,15 +29,6 @@
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "84204DF81CB2869E001FC263"
|
||||
BuildableName = "PreviewTransitionDemo.app"
|
||||
BlueprintName = "PreviewTransitionDemo"
|
||||
ReferencedContainer = "container:PreviewTransitionDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
@@ -65,16 +42,15 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "84204DF81CB2869E001FC263"
|
||||
BuildableName = "PreviewTransitionDemo.app"
|
||||
BlueprintName = "PreviewTransitionDemo"
|
||||
BlueprintIdentifier = "8499D8B61D006020004B5B37"
|
||||
BuildableName = "PreviewTransition.framework"
|
||||
BlueprintName = "PreviewTransition"
|
||||
ReferencedContainer = "container:PreviewTransitionDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
@@ -84,16 +60,15 @@
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "84204DF81CB2869E001FC263"
|
||||
BuildableName = "PreviewTransitionDemo.app"
|
||||
BlueprintName = "PreviewTransitionDemo"
|
||||
BlueprintIdentifier = "8499D8B61D006020004B5B37"
|
||||
BuildableName = "PreviewTransition.framework"
|
||||
BlueprintName = "PreviewTransition"
|
||||
ReferencedContainer = "container:PreviewTransitionDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
@@ -11,58 +11,26 @@ import UIKit
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
configureStatusBar()
|
||||
configureNavigationBar()
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(application: UIApplication) {
|
||||
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(application: UIApplication) {
|
||||
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(application: UIApplication) {
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
}
|
||||
|
||||
func applicationWillTerminate(application: UIApplication) {
|
||||
}
|
||||
func applicationDidFinishLaunching(_: UIApplication) {
|
||||
configureNavigationBar()
|
||||
}
|
||||
}
|
||||
|
||||
extension AppDelegate {
|
||||
|
||||
private func configureNavigationBar() {
|
||||
|
||||
//transparent background
|
||||
UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: .Default)
|
||||
UINavigationBar.appearance().shadowImage = UIImage()
|
||||
UINavigationBar.appearance().translucent = true
|
||||
UINavigationBar.appearance().tintColor = .whiteColor()
|
||||
|
||||
if let font = UIFont(name: "Avenir-medium" , size: 18) {
|
||||
UINavigationBar.appearance().titleTextAttributes = [
|
||||
NSForegroundColorAttributeName : UIColor.whiteColor(),
|
||||
NSFontAttributeName : font
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
private func configureStatusBar() {
|
||||
guard let statusBar = UIApplication.sharedApplication().valueForKey("statusBarWindow")?.valueForKey("statusBar") as? UIView else {
|
||||
return
|
||||
}
|
||||
|
||||
statusBar.backgroundColor = .clearColor()
|
||||
UIApplication.sharedApplication().statusBarStyle = .LightContent
|
||||
}
|
||||
fileprivate func configureNavigationBar() {
|
||||
//transparent background
|
||||
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
|
||||
UINavigationBar.appearance().shadowImage = UIImage()
|
||||
UINavigationBar.appearance().isTranslucent = true
|
||||
|
||||
if let font = UIFont(name: "Avenir-medium", size: 18) {
|
||||
UINavigationBar.appearance().titleTextAttributes = [
|
||||
NSAttributedString.Key.foregroundColor: UIColor.white,
|
||||
NSAttributedString.Key.font: font,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,38 +1,119 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-40.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-60.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-58.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-87.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-80.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-120.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-120.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-180.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-20.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-40.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-29.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-58.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-40.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-80.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-76.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-152.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-167.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Ramotion.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"pre-rendered" : true
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 475 B |
|
After Width: | Height: | Size: 620 B |
|
After Width: | Height: | Size: 792 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -1,8 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
@@ -14,14 +19,35 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2018 Ramotion. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fcf-sN-ku0">
|
||||
<rect key="frame" x="16" y="630" width="343" height="17"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Preview Transition" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bCd-3b-lHA">
|
||||
<rect key="frame" x="111.5" y="323" width="152" height="21"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="fcf-sN-ku0" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leadingMargin" id="811-hI-Egq"/>
|
||||
<constraint firstItem="bCd-3b-lHA" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="T4x-O3-JqD"/>
|
||||
<constraint firstItem="bCd-3b-lHA" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="VFr-tp-sPw"/>
|
||||
<constraint firstItem="fcf-sN-ku0" firstAttribute="trailing" secondItem="Ze5-6b-2t3" secondAttribute="trailingMargin" id="dS9-pv-ebe"/>
|
||||
<constraint firstItem="xb3-aO-Qok" firstAttribute="top" secondItem="fcf-sN-ku0" secondAttribute="bottom" constant="20" id="kbD-dX-t3N"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
<point key="canvasLocation" x="52" y="374.66266866566718"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
||||
@@ -1,29 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="rNz-sP-Qod">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="rNz-sP-Qod">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<customFonts key="customFonts">
|
||||
<array key="Avenir.ttc">
|
||||
<string>Avenir-Medium</string>
|
||||
</array>
|
||||
</customFonts>
|
||||
<scenes>
|
||||
<!--Demo Table View Controller-->
|
||||
<scene sceneID="TS0-JK-FG8">
|
||||
<objects>
|
||||
<tableViewController storyboardIdentifier="DemoTableViewController" id="R4r-KK-4wR" customClass="DemoTableViewController" customModule="PreviewTransitionDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="240" sectionHeaderHeight="28" sectionFooterHeight="28" id="bOE-4i-fSR">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="240" sectionHeaderHeight="28" sectionFooterHeight="28" id="bOE-4i-fSR">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ParallaxCell" id="AII-q7-Txi" customClass="ParallaxCell" customModule="PreviewTransitionDemo" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="92" width="600" height="240"/>
|
||||
<rect key="frame" x="0.0" y="28" width="375" height="240"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="AII-q7-Txi" id="dOL-VB-4JN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="239"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="239.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="separatorColor">
|
||||
<color key="value" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="value" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</tableViewCell>
|
||||
@@ -47,68 +57,80 @@
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bep-Nt-aTe" userLabel="BottomView">
|
||||
<rect key="frame" x="0.0" y="525" width="600" height="75"/>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e87-Lw-D6d" userLabel="ControlsViewContainer">
|
||||
<rect key="frame" x="0.0" y="592" width="375" height="75"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PlusIcon" translatesAutoresizingMaskIntoConstraints="NO" id="cNu-DQ-KVS">
|
||||
<rect key="frame" x="26" y="24" width="28" height="28"/>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bep-Nt-aTe" userLabel="ControlsView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="75"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PlusIcon" translatesAutoresizingMaskIntoConstraints="NO" id="cNu-DQ-KVS">
|
||||
<rect key="frame" x="26" y="23.5" width="28" height="28"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="28" id="Oez-4a-Ajf"/>
|
||||
<constraint firstAttribute="height" constant="28" id="dVU-d2-hQD"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="UPLOAD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="of2-Mb-6dK">
|
||||
<rect key="frame" x="72" y="26.5" width="65.5" height="22"/>
|
||||
<fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="16"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="HertIcon" translatesAutoresizingMaskIntoConstraints="NO" id="qf5-7H-m8I">
|
||||
<rect key="frame" x="329" y="27.5" width="20" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="20" id="7vC-Kj-Xhh"/>
|
||||
<constraint firstAttribute="height" constant="20" id="y9j-Rr-ADZ"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ShareIcon" translatesAutoresizingMaskIntoConstraints="NO" id="fYq-Bm-C3g">
|
||||
<rect key="frame" x="278" y="27.5" width="20" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="20" id="AdG-0M-DE8"/>
|
||||
<constraint firstAttribute="height" constant="20" id="npa-OF-Phw"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.2418571412563324" green="0.17698898911476135" blue="0.1230514720082283" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="28" id="Oez-4a-Ajf"/>
|
||||
<constraint firstAttribute="height" constant="28" id="dVU-d2-hQD"/>
|
||||
<constraint firstItem="qf5-7H-m8I" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="7Sl-Yf-TPT"/>
|
||||
<constraint firstItem="qf5-7H-m8I" firstAttribute="leading" secondItem="fYq-Bm-C3g" secondAttribute="trailing" constant="31" id="CbF-3f-1Rz"/>
|
||||
<constraint firstItem="fYq-Bm-C3g" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="Q7R-nz-kDO"/>
|
||||
<constraint firstItem="cNu-DQ-KVS" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="VSr-aL-49x"/>
|
||||
<constraint firstAttribute="trailing" secondItem="qf5-7H-m8I" secondAttribute="trailing" constant="26" id="dyM-CD-2Xy"/>
|
||||
<constraint firstItem="of2-Mb-6dK" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="ndt-gV-UNC"/>
|
||||
<constraint firstItem="cNu-DQ-KVS" firstAttribute="leading" secondItem="bep-Nt-aTe" secondAttribute="leading" constant="26" id="sM2-by-tp2"/>
|
||||
<constraint firstItem="of2-Mb-6dK" firstAttribute="leading" secondItem="cNu-DQ-KVS" secondAttribute="trailing" constant="18" id="u48-EN-PaD"/>
|
||||
<constraint firstAttribute="height" constant="75" id="y5q-xC-6PW"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="UPLOAD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="of2-Mb-6dK">
|
||||
<rect key="frame" x="72" y="27" width="66" height="22"/>
|
||||
<fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="16"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="HertIcon" translatesAutoresizingMaskIntoConstraints="NO" id="qf5-7H-m8I">
|
||||
<rect key="frame" x="545" y="23" width="29" height="29"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="29" id="7vC-Kj-Xhh"/>
|
||||
<constraint firstAttribute="height" constant="29" id="y9j-Rr-ADZ"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.65000000000000002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ShareIcon" translatesAutoresizingMaskIntoConstraints="NO" id="fYq-Bm-C3g">
|
||||
<rect key="frame" x="485" y="23" width="29" height="29"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="29" id="AdG-0M-DE8"/>
|
||||
<constraint firstAttribute="height" constant="29" id="npa-OF-Phw"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.2418571412563324" green="0.17698898911476135" blue="0.1230514720082283" alpha="0.0" colorSpace="calibratedRGB"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="qf5-7H-m8I" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="7Sl-Yf-TPT"/>
|
||||
<constraint firstItem="qf5-7H-m8I" firstAttribute="leading" secondItem="fYq-Bm-C3g" secondAttribute="trailing" constant="31" id="CbF-3f-1Rz"/>
|
||||
<constraint firstItem="fYq-Bm-C3g" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="Q7R-nz-kDO"/>
|
||||
<constraint firstItem="cNu-DQ-KVS" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="VSr-aL-49x"/>
|
||||
<constraint firstAttribute="trailing" secondItem="qf5-7H-m8I" secondAttribute="trailing" constant="26" id="dyM-CD-2Xy"/>
|
||||
<constraint firstItem="of2-Mb-6dK" firstAttribute="centerY" secondItem="bep-Nt-aTe" secondAttribute="centerY" id="ndt-gV-UNC"/>
|
||||
<constraint firstItem="cNu-DQ-KVS" firstAttribute="leading" secondItem="bep-Nt-aTe" secondAttribute="leading" constant="26" id="sM2-by-tp2"/>
|
||||
<constraint firstItem="of2-Mb-6dK" firstAttribute="leading" secondItem="cNu-DQ-KVS" secondAttribute="trailing" constant="18" id="u48-EN-PaD"/>
|
||||
<constraint firstAttribute="height" constant="75" id="y5q-xC-6PW"/>
|
||||
<constraint firstItem="bep-Nt-aTe" firstAttribute="top" secondItem="e87-Lw-D6d" secondAttribute="top" id="AQh-Mt-Zu0"/>
|
||||
<constraint firstAttribute="trailing" secondItem="bep-Nt-aTe" secondAttribute="trailing" id="R5F-Ml-C1h"/>
|
||||
<constraint firstItem="bep-Nt-aTe" firstAttribute="leading" secondItem="e87-Lw-D6d" secondAttribute="leading" id="e33-px-zT6"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="bep-Nt-aTe" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="HoE-lK-c1w"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="bep-Nt-aTe" secondAttribute="bottom" id="Ye7-fc-GvE"/>
|
||||
<constraint firstAttribute="trailing" secondItem="bep-Nt-aTe" secondAttribute="trailing" id="fVz-GY-Jz2"/>
|
||||
<constraint firstItem="e87-Lw-D6d" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="WtK-eJ-Evt"/>
|
||||
<constraint firstAttribute="trailing" secondItem="e87-Lw-D6d" secondAttribute="trailing" id="Xfw-qN-wKE"/>
|
||||
<constraint firstAttribute="bottom" secondItem="e87-Lw-D6d" secondAttribute="bottom" id="Z1u-Zc-6Gx"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="bep-Nt-aTe" secondAttribute="bottom" id="qoN-F2-pl4"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="controlBottomConstrant" destination="Ye7-fc-GvE" id="Z4z-3v-JPd"/>
|
||||
<outlet property="controlHeightConstraint" destination="y5q-xC-6PW" id="bj2-EN-9sN"/>
|
||||
<outlet property="controlBottomConstrant" destination="qoN-F2-pl4" id="7vP-GT-O7y"/>
|
||||
<outlet property="controlTextLabel" destination="of2-Mb-6dK" id="8VW-Qx-njJ"/>
|
||||
<outlet property="controlTextLableLending" destination="u48-EN-PaD" id="THf-Gf-6Oe"/>
|
||||
<outlet property="controlView" destination="bep-Nt-aTe" id="lB6-d4-1rx"/>
|
||||
<outlet property="controlsViewContainer" destination="e87-Lw-D6d" id="vqd-db-r0q"/>
|
||||
<outlet property="hertIconView" destination="qf5-7H-m8I" id="LUd-B6-aY7"/>
|
||||
<outlet property="plusImageView" destination="cNu-DQ-KVS" id="xQY-UZ-Bve"/>
|
||||
<outlet property="shareImageView" destination="fYq-Bm-C3g" id="mW0-7l-wPb"/>
|
||||
@@ -116,7 +138,7 @@
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1609" y="484"/>
|
||||
<point key="canvasLocation" x="1608.8" y="483.50824587706148"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="cXS-jQ-bIr">
|
||||
@@ -125,8 +147,11 @@
|
||||
<toolbarItems/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="crh-l4-DmE">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textAttributes key="titleTextAttributes">
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</textAttributes>
|
||||
</navigationBar>
|
||||
<nil name="viewControllers"/>
|
||||
<connections>
|
||||
|
||||
@@ -26,65 +26,64 @@ import UIKit
|
||||
// MARK: tableview
|
||||
|
||||
extension UITableView {
|
||||
func getReusableCellWithIdentifier<T: UITableViewCell where T: TableViewCellIdentifiable>(indexPath: NSIndexPath) -> T {
|
||||
guard let cell = self.dequeueReusableCellWithIdentifier(T.cellIdentifier, forIndexPath: indexPath) as? T else {
|
||||
fatalError("Couldn't instantiate view controller with identifier \(T.cellIdentifier) ")
|
||||
func getReusableCellWithIdentifier<T: UITableViewCell>(indexPath: IndexPath) -> T {
|
||||
guard let cell = self.dequeueReusableCell(withIdentifier: T.cellIdentifier, for: indexPath as IndexPath) as? T else {
|
||||
fatalError("Couldn't instantiate view controller with identifier \(T.cellIdentifier) ")
|
||||
}
|
||||
|
||||
return cell
|
||||
}
|
||||
|
||||
return cell
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UITableViewCell
|
||||
|
||||
protocol TableViewCellIdentifiable {
|
||||
static var cellIdentifier: String { get }
|
||||
static var cellIdentifier: String { get }
|
||||
}
|
||||
|
||||
extension TableViewCellIdentifiable where Self: UITableViewCell {
|
||||
static var cellIdentifier: String {
|
||||
return String(self)
|
||||
}
|
||||
static var cellIdentifier: String {
|
||||
return String(describing: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension UITableViewCell : TableViewCellIdentifiable { }
|
||||
|
||||
extension UITableViewCell: TableViewCellIdentifiable {}
|
||||
|
||||
// MARK: storyboard
|
||||
|
||||
extension UIStoryboard {
|
||||
|
||||
enum Storyboard : String {
|
||||
case Main
|
||||
}
|
||||
|
||||
convenience init(storyboard: Storyboard, bundle: NSBundle? = nil) {
|
||||
self.init(name: storyboard.rawValue, bundle: bundle)
|
||||
}
|
||||
|
||||
class func storyboard(storyboard: Storyboard, bundle: NSBundle? = nil) -> UIStoryboard {
|
||||
return UIStoryboard(name: storyboard.rawValue, bundle: bundle)
|
||||
}
|
||||
|
||||
func instantiateViewController<T: UIViewController where T: StoryboardIdentifiable>() -> T {
|
||||
guard let viewController = self.instantiateViewControllerWithIdentifier(T.storyboardIdentifier) as? T else {
|
||||
fatalError("Couldn't instantiate view controller with identifier \(T.storyboardIdentifier) ")
|
||||
|
||||
enum Storyboard: String {
|
||||
case Main
|
||||
}
|
||||
|
||||
convenience init(storyboard: Storyboard, bundle: Bundle? = nil) {
|
||||
self.init(name: storyboard.rawValue, bundle: bundle)
|
||||
}
|
||||
|
||||
class func storyboard(storyboard: Storyboard, bundle: Bundle? = nil) -> UIStoryboard {
|
||||
return UIStoryboard(name: storyboard.rawValue, bundle: bundle)
|
||||
}
|
||||
|
||||
func instantiateViewController<T: UIViewController>() -> T {
|
||||
guard let viewController = self.instantiateViewController(withIdentifier: T.storyboardIdentifier) as? T else {
|
||||
fatalError("Couldn't instantiate view controller with identifier \(T.storyboardIdentifier) ")
|
||||
}
|
||||
|
||||
return viewController
|
||||
}
|
||||
|
||||
return viewController
|
||||
}
|
||||
}
|
||||
|
||||
extension UIViewController : StoryboardIdentifiable { }
|
||||
extension UIViewController: StoryboardIdentifiable {}
|
||||
|
||||
// MARK: identifiable
|
||||
|
||||
protocol StoryboardIdentifiable {
|
||||
static var storyboardIdentifier: String { get }
|
||||
static var storyboardIdentifier: String { get }
|
||||
}
|
||||
|
||||
extension StoryboardIdentifiable where Self: UIViewController {
|
||||
static var storyboardIdentifier: String {
|
||||
return String(self)
|
||||
}
|
||||
static var storyboardIdentifier: String {
|
||||
return String(describing: self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UIStatusBarStyle</key>
|
||||
<string>UIStatusBarStyleLightContent</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
|
||||
@@ -21,155 +21,150 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
import UIKit
|
||||
|
||||
public class DemoDetailViewController: PTDetailViewController {
|
||||
|
||||
@IBOutlet weak var controlHeightConstraint: NSLayoutConstraint!
|
||||
@IBOutlet weak var controlBottomConstrant: NSLayoutConstraint!
|
||||
|
||||
// bottom control icons
|
||||
@IBOutlet weak var controlView: UIView!
|
||||
@IBOutlet weak var plusImageView: UIImageView!
|
||||
@IBOutlet weak var controlTextLabel: UILabel!
|
||||
@IBOutlet weak var controlTextLableLending: NSLayoutConstraint!
|
||||
@IBOutlet weak var shareImageView: UIImageView!
|
||||
@IBOutlet weak var hertIconView: UIImageView!
|
||||
|
||||
var backButton: UIButton?
|
||||
|
||||
@IBOutlet var controlBottomConstrant: NSLayoutConstraint!
|
||||
|
||||
// bottom control icons
|
||||
@IBOutlet var controlsViewContainer: UIView!
|
||||
@IBOutlet var controlView: UIView!
|
||||
@IBOutlet var plusImageView: UIImageView!
|
||||
@IBOutlet var controlTextLabel: UILabel!
|
||||
@IBOutlet var controlTextLableLending: NSLayoutConstraint!
|
||||
@IBOutlet var shareImageView: UIImageView!
|
||||
@IBOutlet var hertIconView: UIImageView!
|
||||
|
||||
var backButton: UIButton?
|
||||
|
||||
var bottomSafeArea: CGFloat {
|
||||
var result: CGFloat = 0
|
||||
if #available(iOS 11.0, *) {
|
||||
result = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: life cicle
|
||||
|
||||
extension DemoDetailViewController {
|
||||
|
||||
public override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
backButton = createBackButton()
|
||||
createNavigationBarBackItem(backButton)
|
||||
|
||||
// animations
|
||||
showBackButtonDuration(0.3)
|
||||
showControlViewDuration(0.3)
|
||||
|
||||
createBlurView()
|
||||
}
|
||||
|
||||
public override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
backButton = createBackButton()
|
||||
_ = createNavigationBarBackItem(button: backButton)
|
||||
|
||||
// animations
|
||||
showBackButtonDuration(duration: 0.3)
|
||||
showControlViewDuration(duration: 0.3)
|
||||
|
||||
_ = createBlurView()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: helpers
|
||||
|
||||
extension DemoDetailViewController {
|
||||
|
||||
private func createBackButton() -> UIButton {
|
||||
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 22, height: 44))
|
||||
button.setImage(UIImage.Asset.Back.image, forState: .Normal)
|
||||
button.addTarget(self, action: #selector(DemoDetailViewController.backButtonHandler) , forControlEvents: .TouchUpInside)
|
||||
return button
|
||||
}
|
||||
|
||||
private func createNavigationBarBackItem(button: UIButton?) -> UIBarButtonItem? {
|
||||
guard let button = button else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let buttonItem = UIBarButtonItem(customView: button)
|
||||
navigationItem.leftBarButtonItem = buttonItem
|
||||
return buttonItem
|
||||
}
|
||||
|
||||
private func createBlurView() -> UIView {
|
||||
let imageFrame = CGRect(x: 0, y: view.frame.size.height - controlHeightConstraint.constant, width: view.frame.width, height: controlHeightConstraint.constant)
|
||||
let image = view.makeScreenShotFromFrame(imageFrame)
|
||||
let screnShotImageView = UIImageView(image: image)
|
||||
screnShotImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
screnShotImageView.blurViewValue(5)
|
||||
controlView.insertSubview(screnShotImageView, atIndex: 0)
|
||||
// added constraints
|
||||
[NSLayoutAttribute.Left, .Right, .Bottom, .Top].forEach { attribute in
|
||||
(self.controlView, screnShotImageView) >>>- {
|
||||
$0.attribute = attribute
|
||||
}
|
||||
}
|
||||
|
||||
createMaskView(screnShotImageView)
|
||||
|
||||
return screnShotImageView
|
||||
}
|
||||
|
||||
private func createMaskView(onView: UIView) {
|
||||
let blueView = UIView(frame: CGRect.zero)
|
||||
blueView.backgroundColor = .blackColor()
|
||||
blueView.translatesAutoresizingMaskIntoConstraints = false
|
||||
blueView.alpha = 0.4
|
||||
onView.addSubview(blueView)
|
||||
|
||||
// add constraints
|
||||
[NSLayoutAttribute.Left, .Right, .Bottom, .Top].forEach { attribute in
|
||||
(onView, blueView) >>>- {
|
||||
$0.attribute = attribute
|
||||
}
|
||||
fileprivate func createBackButton() -> UIButton {
|
||||
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 22, height: 44))
|
||||
button.setImage(UIImage.Asset.Back.image, for: .normal)
|
||||
button.addTarget(self, action: #selector(DemoDetailViewController.backButtonHandler), for: .touchUpInside)
|
||||
return button
|
||||
}
|
||||
|
||||
fileprivate func createNavigationBarBackItem(button: UIButton?) -> UIBarButtonItem? {
|
||||
guard let button = button else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let buttonItem = UIBarButtonItem(customView: button)
|
||||
navigationItem.leftBarButtonItem = buttonItem
|
||||
return buttonItem
|
||||
}
|
||||
|
||||
fileprivate func createBlurView() -> UIView {
|
||||
let height = controlView.bounds.height + bottomSafeArea
|
||||
let imageFrame = CGRect(x: 0, y: view.frame.size.height - height, width: view.frame.width, height: height)
|
||||
let image = view.makeScreenShotFromFrame(frame: imageFrame)
|
||||
let screnShotImageView = UIImageView(image: image)
|
||||
screnShotImageView.blurViewValue(value: 5)
|
||||
screnShotImageView.frame = controlsViewContainer.bounds
|
||||
screnShotImageView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
||||
controlsViewContainer.insertSubview(screnShotImageView, at: 0)
|
||||
addOverlay(toView: screnShotImageView)
|
||||
return screnShotImageView
|
||||
}
|
||||
|
||||
fileprivate func addOverlay(toView view: UIView) {
|
||||
let overlayView = UIView(frame: view.bounds)
|
||||
overlayView.backgroundColor = .black
|
||||
overlayView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
||||
overlayView.alpha = 0.4
|
||||
view.addSubview(overlayView)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: animations
|
||||
|
||||
extension DemoDetailViewController {
|
||||
|
||||
private func showBackButtonDuration(duration: Double) {
|
||||
backButton?.rotateDuration(duration, from: CGFloat(-M_PI_4), to: 0)
|
||||
backButton?.scaleDuration(duration, from: 0.5, to: 1)
|
||||
backButton?.opacityDuration(duration, from: 0, to: 1)
|
||||
}
|
||||
|
||||
private func showControlViewDuration(duration: Double) {
|
||||
moveUpControllerDuration(duration)
|
||||
showControlButtonsDuration(duration)
|
||||
showControlLabelDuration(duration)
|
||||
}
|
||||
|
||||
private func moveUpControllerDuration(duration: Double) {
|
||||
controlBottomConstrant.constant = -controlHeightConstraint.constant
|
||||
view.layoutIfNeeded()
|
||||
|
||||
controlBottomConstrant.constant = 0
|
||||
UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseOut, animations: {
|
||||
self.view.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
private func showControlButtonsDuration(duration: Double) {
|
||||
[plusImageView, shareImageView, hertIconView].forEach {
|
||||
$0.rotateDuration(duration, from: CGFloat(-M_PI_4), to: 0, delay: duration)
|
||||
$0.scaleDuration(duration, from: 0.5, to: 1, delay: duration)
|
||||
$0.alpha = 0
|
||||
$0.opacityDuration(duration, from: 0, to: 1, delay: duration, remove: false)
|
||||
fileprivate func showBackButtonDuration(duration: Double) {
|
||||
backButton?.rotateDuration(duration: duration, from: -CGFloat.pi / 4, to: 0)
|
||||
backButton?.scaleDuration(duration: duration, from: 0.5, to: 1)
|
||||
backButton?.opacityDuration(duration: duration, from: 0, to: 1)
|
||||
}
|
||||
}
|
||||
|
||||
private func showControlLabelDuration(duration: Double) {
|
||||
controlTextLabel.alpha = 0
|
||||
controlTextLabel.opacityDuration(duration, from: 0, to: 1, delay: duration, remove: false)
|
||||
|
||||
// move rigth
|
||||
let offSet: CGFloat = 20
|
||||
controlTextLableLending.constant -= offSet
|
||||
view.layoutIfNeeded()
|
||||
|
||||
controlTextLableLending.constant += offSet
|
||||
UIView.animateWithDuration(duration * 2, delay: 0, options: .CurveEaseOut, animations: {
|
||||
self.view.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
fileprivate func showControlViewDuration(duration: Double) {
|
||||
moveUpControllerDuration(duration: duration)
|
||||
showControlButtonsDuration(duration: duration)
|
||||
showControlLabelDuration(duration: duration)
|
||||
}
|
||||
|
||||
fileprivate func moveUpControllerDuration(duration: Double) {
|
||||
|
||||
controlBottomConstrant.constant = -controlsViewContainer.bounds.height
|
||||
view.layoutIfNeeded()
|
||||
|
||||
controlBottomConstrant.constant = 0
|
||||
UIView.animate(withDuration: duration, delay: 0, options: .curveEaseOut, animations: {
|
||||
self.view.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
fileprivate func showControlButtonsDuration(duration: Double) {
|
||||
[plusImageView, shareImageView, hertIconView].forEach {
|
||||
$0?.rotateDuration(duration: duration, from: CGFloat.pi / 4, to: 0, delay: duration)
|
||||
$0?.scaleDuration(duration: duration, from: 0.5, to: 1, delay: duration)
|
||||
$0?.alpha = 0
|
||||
$0?.opacityDuration(duration: duration, from: 0, to: 1, delay: duration, remove: false)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func showControlLabelDuration(duration: Double) {
|
||||
controlTextLabel.alpha = 0
|
||||
controlTextLabel.opacityDuration(duration: duration, from: 0, to: 1, delay: duration, remove: false)
|
||||
|
||||
// move rigth
|
||||
let offSet: CGFloat = 20
|
||||
controlTextLableLending.constant -= offSet
|
||||
view.layoutIfNeeded()
|
||||
|
||||
controlTextLableLending.constant += offSet
|
||||
UIView.animate(withDuration: duration * 2, delay: 0, options: .curveEaseOut, animations: {
|
||||
self.view.layoutIfNeeded()
|
||||
}, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: actions
|
||||
|
||||
extension DemoDetailViewController {
|
||||
|
||||
func backButtonHandler() {
|
||||
popViewController()
|
||||
}
|
||||
}
|
||||
|
||||
@objc func backButtonHandler() {
|
||||
popViewController()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,41 +24,38 @@
|
||||
import UIKit
|
||||
|
||||
public class DemoTableViewController: PTTableViewController {
|
||||
|
||||
private let items = [("1", "River cruise"), ("2", "North Island"), ("3", "Mountain trail"), ("4", "Southern Coast"), ("5", "Fishing place")] // image names
|
||||
|
||||
fileprivate let items = [("1", "River cruise"), ("2", "North Island"), ("3", "Mountain trail"), ("4", "Southern Coast"), ("5", "Fishing place")] // image names
|
||||
}
|
||||
|
||||
// MARK: UITableViewDelegate
|
||||
|
||||
extension DemoTableViewController {
|
||||
|
||||
public override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return 100
|
||||
}
|
||||
|
||||
public override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
|
||||
|
||||
guard let cell = cell as? ParallaxCell else {
|
||||
return
|
||||
|
||||
public override func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
|
||||
return 100
|
||||
}
|
||||
|
||||
let index = indexPath.row % items.count
|
||||
let imageName = items[index].0
|
||||
let title = items[index].1
|
||||
|
||||
if let image = UIImage(named: imageName) {
|
||||
cell.setImage(image, title: title)
|
||||
|
||||
public override func tableView(_: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
|
||||
guard let cell = cell as? ParallaxCell else { return }
|
||||
|
||||
let index = indexPath.row % items.count
|
||||
let imageName = items[index].0
|
||||
let title = items[index].1
|
||||
|
||||
if let image = UIImage(named: imageName) {
|
||||
cell.setImage(image, title: title)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
|
||||
let cell: ParallaxCell = tableView.getReusableCellWithIdentifier(indexPath)
|
||||
return cell
|
||||
}
|
||||
|
||||
public override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
|
||||
let storyboard = UIStoryboard.storyboard(.Main)
|
||||
let detaleViewController: DemoDetailViewController = storyboard.instantiateViewController()
|
||||
pushViewController(detaleViewController)
|
||||
}
|
||||
}
|
||||
|
||||
public override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell: ParallaxCell = tableView.getReusableCellWithIdentifier(indexPath: indexPath)
|
||||
return cell
|
||||
}
|
||||
|
||||
public override func tableView(_: UITableView, didSelectRowAt _: IndexPath) {
|
||||
let storyboard = UIStoryboard.storyboard(storyboard: .Main)
|
||||
let detaleViewController: DemoDetailViewController = storyboard.instantiateViewController()
|
||||
pushViewController(detaleViewController)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
//
|
||||
// PreviewTransitionDemoTests.swift
|
||||
// PreviewTransitionDemoTests
|
||||
//
|
||||
// Created by Alex K. on 04/04/16.
|
||||
// Copyright © 2016 Alex K. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import PreviewTransitionDemo
|
||||
|
||||
class PreviewTransitionDemoTests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
self.measureBlock {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,43 +9,41 @@
|
||||
import UIKit
|
||||
|
||||
extension UIView {
|
||||
|
||||
func makeScreenShotFromFrame(frame: CGRect) -> UIImage? {
|
||||
UIGraphicsBeginImageContextWithOptions(frame.size, false, 0.0)
|
||||
|
||||
let context = UIGraphicsGetCurrentContext();
|
||||
CGContextTranslateCTM(context, frame.origin.x * -1, frame.origin.y * -1)
|
||||
|
||||
guard let currentContext = UIGraphicsGetCurrentContext() else {
|
||||
return nil
|
||||
|
||||
func makeScreenShotFromFrame(frame: CGRect) -> UIImage? {
|
||||
UIGraphicsBeginImageContextWithOptions(frame.size, false, 0.0)
|
||||
|
||||
let context = UIGraphicsGetCurrentContext()
|
||||
context!.translateBy(x: frame.origin.x * -1, y: frame.origin.y * -1)
|
||||
|
||||
guard let currentContext = UIGraphicsGetCurrentContext() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
layer.render(in: currentContext)
|
||||
let image = UIGraphicsGetImageFromCurrentImageContext()
|
||||
UIGraphicsEndImageContext()
|
||||
|
||||
return image
|
||||
}
|
||||
|
||||
self.layer.renderInContext(currentContext)
|
||||
let image = UIGraphicsGetImageFromCurrentImageContext()
|
||||
UIGraphicsEndImageContext()
|
||||
|
||||
return image
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension UIImageView {
|
||||
|
||||
func blurViewValue(value: CGFloat) {
|
||||
guard let image = self.image,
|
||||
let blurfilter = CIFilter(name: "CIGaussianBlur"),
|
||||
let imageToBlur = CIImage(image: image)
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
blurfilter.setValue(value, forKey: kCIInputRadiusKey)
|
||||
blurfilter.setValue(imageToBlur, forKey: "inputImage")
|
||||
let resultImage = blurfilter.valueForKey("outputImage") as! CIImage
|
||||
var blurredImage = UIImage(CIImage: resultImage)
|
||||
let cropped:CIImage=resultImage.imageByCroppingToRect(CGRectMake(0, 0,imageToBlur.extent.size.width, imageToBlur.extent.size.height))
|
||||
blurredImage = UIImage(CIImage: cropped)
|
||||
self.image = blurredImage
|
||||
}
|
||||
|
||||
}
|
||||
func blurViewValue(value: CGFloat) {
|
||||
guard let image = self.image,
|
||||
let blurfilter = CIFilter(name: "CIGaussianBlur"),
|
||||
let imageToBlur = CIImage(image: image)
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
blurfilter.setValue(value, forKey: kCIInputRadiusKey)
|
||||
blurfilter.setValue(imageToBlur, forKey: "inputImage")
|
||||
let resultImage = blurfilter.value(forKey: "outputImage") as! CIImage
|
||||
var blurredImage = UIImage(ciImage: resultImage)
|
||||
let cropped: CIImage = resultImage.cropped(to: CGRect(x: 0, y: 0, width: imageToBlur.extent.size.width, height: imageToBlur.extent.size.height))
|
||||
blurredImage = UIImage(ciImage: cropped)
|
||||
self.image = blurredImage
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,80 @@
|
||||
# Preview-transition [](http://twitter.com/Ramotion)
|
||||
<a href="https://www.ramotion.com/agency/app-development/?utm_source=gthb&utm_medium=repo&utm_campaign=preview-transition"><img src="https://github.com/Ramotion/folding-cell/blob/master/header.png"></a>
|
||||
|
||||
<a href="https://github.com/Ramotion/fpreview-transition">
|
||||
<img align="left" src="https://github.com/Ramotion/preview-transition/blob/master/preview-transition.gif" width="480" height="360" /></a>
|
||||
|
||||
<p><h1 align="left">PREVIEW TRANSITION</h1></p>
|
||||
|
||||
<h4>Preview Transition is a simple preview gallery UI controller with animated tranisitions</h4>
|
||||
|
||||
|
||||
___
|
||||
|
||||
|
||||
|
||||
<p><h6>We specialize in the designing and coding of custom UI for Mobile Apps and Websites.</h6>
|
||||
<a href="https://www.ramotion.com/agency/app-development/?utm_source=gthb&utm_medium=repo&utm_campaign=preview-transition">
|
||||
<img src="https://github.com/ramotion/gliding-collection/raw/master/contact_our_team@2x.png" width="187" height="34"></a>
|
||||
</p>
|
||||
<p><h6>Stay tuned for the latest updates:</h6>
|
||||
<a href="https://goo.gl/rPFpid" >
|
||||
<img src="https://i.imgur.com/ziSqeSo.png/" width="156" height="28"></a></p>
|
||||
|
||||
</br>
|
||||
|
||||
[](http://twitter.com/Ramotion)
|
||||
[](https://travis-ci.org/Ramotion/preview-transition.svg?branch=master)
|
||||
[](https://github.com/Ramotion/preview-transition)
|
||||
[](https://cocoapods.org/pods/PreviewTransition)
|
||||
[](http://cocoapods.org/pods/PreviewTransition)
|
||||
[](https://codebeat.co/projects/github-com-ramotion-preview-transition)
|
||||
[](https://paypal.me/Ramotion)
|
||||
|
||||
|
||||
## About
|
||||
This project is maintained by Ramotion, Inc.<br>
|
||||
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.<br>
|
||||
|
||||
**Looking for developers for your project?**<br>
|
||||
This project is maintained by Ramotion, Inc. We specialize in the designing and coding of custom UI for Mobile Apps and Websites.
|
||||
|
||||
<a href="https://www.ramotion.com/agency/app-development/?utm_source=gthb&utm_medium=repo&utm_campaign=preview-transition">
|
||||
<img src="https://github.com/ramotion/gliding-collection/raw/master/contact_our_team@2x.png" width="187" height="34"></a> <br>
|
||||
|
||||
## Requirements
|
||||
|
||||
- iOS 8.0+
|
||||
- Xcode 7.3
|
||||
- iOS 9.0+
|
||||
- Xcode 9
|
||||
|
||||
## Licence
|
||||
|
||||
Preview-transition is released under the MIT license.
|
||||
See [LICENSE](./LICENSE) for details.
|
||||
|
||||
Just add the Source folder to your project.
|
||||
## Installation
|
||||
|
||||
or use [CocoaPods](https://cocoapods.org) with Podfile:
|
||||
Just add the Source folder to your project or use [CocoaPods](https://cocoapods.org) like this:
|
||||
``` ruby
|
||||
pod 'PreviewTransition', '~> 0.1.1'
|
||||
pod "PreviewTransition"
|
||||
```
|
||||
|
||||
or [Carthage](https://github.com/Carthage/Carthage) users can simply add to their `Cartfile`:
|
||||
```
|
||||
github "Ramotion/preview-transition"
|
||||
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
1) ``` import PreviewTransition ```
|
||||
|
||||
2) Create UITableViewController inherit, inheriting from ```PTTableViewController```
|
||||
|
||||
3) Add UITableVeiwDelegate methods
|
||||
3) Add UITableViewDelegate methods
|
||||
|
||||
```swift
|
||||
public override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return <RowsCoutn>
|
||||
return <RowsCount>
|
||||
}
|
||||
|
||||
public override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
|
||||
@@ -38,19 +82,21 @@ public override func tableView(tableView: UITableView, cellForRowAtIndexPath ind
|
||||
}
|
||||
```
|
||||
|
||||
4) add ParallaxCell
|
||||
4) add a ParallaxCell
|
||||
|
||||
strorybords:
|
||||
create cell and inheriting from ParallaxCell, don't forget set identifier <CellIdentifier>
|
||||
storyboards:
|
||||
create a cell and inherit from ```ParallaxCell```; don't forget set the identifier ```<CellIdentifier>```
|
||||
|
||||
or programmatically:
|
||||
register cell in viewDidLoad ```tableView.registerClass(ParallaxCell, forCellReuseIdentifier:<CellIdentifier>)```
|
||||
register a cell in viewDidLoad ```tableView.registerClass(ParallaxCell, forCellReuseIdentifier:<CellIdentifier>)```
|
||||
|
||||
5) set cell height for example 240
|
||||
5) set cell height
|
||||
|
||||
6) create image names (image size must be equal screen size or bigger)
|
||||
6) create image names (image sizes must be equal to screen size or bigger)
|
||||
|
||||
```swift
|
||||
let images = [image_name, image_name, image_name, image_name, image_name] // image names
|
||||
```
|
||||
|
||||
7) set image and text for ParallaxCell
|
||||
|
||||
@@ -68,13 +114,13 @@ public override func tableView(tableView: UITableView, willDisplayCell cell: UIT
|
||||
}
|
||||
}
|
||||
```
|
||||
your tableViewController must be look like [DemoTableViewController](https://github.com/Ramotion/preview-transition/blob/master/PreviewTransitionDemo/PreviewTransitionDemo/ViewController/DemoTableViewController.swift)
|
||||
your tableViewController should look like [DemoTableViewController](https://github.com/Ramotion/preview-transition/blob/master/PreviewTransitionDemo/PreviewTransitionDemo/ViewController/DemoTableViewController.swift)
|
||||
|
||||
Method ```public override func tableView(tableView: didSelectRowAtIndexPath indexPath:)``` we will add later. (step 10)
|
||||
|
||||
8) Create UIViewController inherit, inheriting from ```PTDetailViewController```
|
||||
8) Create UIViewController, inheriting from ```PTDetailViewController```
|
||||
|
||||
9) Added action for backButton and call ```popViewController()```
|
||||
9) Add action for backButton and call ```popViewController()```
|
||||
|
||||
```swift
|
||||
func backButtonHandler() {
|
||||
@@ -113,9 +159,22 @@ if let font = UIFont(name: <Font name> , size: 18) {
|
||||
}
|
||||
```
|
||||
|
||||
## About
|
||||
The project maintained by [app development agency](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition) [Ramotion Inc.](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition)
|
||||
See our other [open-source projects](https://github.com/ramotion) or [hire](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition) us to design, develop, and grow your product.
|
||||
## 📄 License
|
||||
|
||||
[](https://twitter.com/intent/tweet?text=https://github.com/ramotion/preview-transition)
|
||||
[](https://twitter.com/ramotion)
|
||||
Preview Transition is released under the MIT license.
|
||||
See [LICENSE](./LICENSE) for details.
|
||||
|
||||
This library is a part of a <a href="https://github.com/Ramotion/swift-ui-animation-components-and-libraries"><b>selection of our best UI open-source projects.</b></a>
|
||||
|
||||
If you use the open-source library in your project, please make sure to credit and backlink to https://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.
|
||||
|
||||
<a href="https://itunes.apple.com/app/apple-store/id1182360240?pt=550053&ct=preview-transition&mt=8" >
|
||||
<img src="https://github.com/ramotion/gliding-collection/raw/master/app_store@2x.png" width="117" height="34"></a>
|
||||
|
||||
<a href="https://www.ramotion.com/agency/app-development/?utm_source=gthb&utm_medium=repo&utm_campaign=preview-transition">
|
||||
<img src="https://github.com/ramotion/gliding-collection/raw/master/contact_our_team@2x.png" width="187" height="34"></a>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C21PreviewTransitionDemo22PTDetailViewController"></a>
|
||||
<a name="//apple_ref/swift/Class/PTDetailViewController" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C21PreviewTransitionDemo22PTDetailViewController">PTDetailViewController</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Base UIViewController for preview transition</p>
|
||||
|
||||
<a href="Classes/PTDetailViewController.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTDetailViewController</span><span class="p">:</span> <span class="kt">UIViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C21PreviewTransitionDemo12ParallaxCell"></a>
|
||||
<a name="//apple_ref/swift/Class/ParallaxCell" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C21PreviewTransitionDemo12ParallaxCell">ParallaxCell</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>UITableViewCell with parallax background</p>
|
||||
|
||||
<a href="Classes/ParallaxCell.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ParallaxCell</span><span class="p">:</span> <span class="kt">UITableViewCell</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C21PreviewTransitionDemo21PTTableViewController"></a>
|
||||
<a name="//apple_ref/swift/Class/PTTableViewController" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C21PreviewTransitionDemo21PTTableViewController">PTTableViewController</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Base UITableViewController for preview transition</p>
|
||||
|
||||
<a href="Classes/PTTableViewController.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTTableViewController</span><span class="p">:</span> <span class="kt">UITableViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,101 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>PTDetailViewController Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/PTDetailViewController" class="dashAnchor"></a>
|
||||
<a title="PTDetailViewController Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
PTDetailViewController Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>PTDetailViewController</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTDetailViewController</span><span class="p">:</span> <span class="kt">UIViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Base UIViewController for preview transition</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo22PTDetailViewController17popViewControllerFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/popViewController()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo22PTDetailViewController17popViewControllerFT_T_">popViewController()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Pops the top view controller from the navigation stack and updates the display with custom animation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">popViewController</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,121 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>PTTableViewController Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/PTTableViewController" class="dashAnchor"></a>
|
||||
<a title="PTTableViewController Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
PTTableViewController Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>PTTableViewController</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTTableViewController</span><span class="p">:</span> <span class="kt">UITableViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Base UITableViewController for preview transition</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo21PTTableViewController18pushViewControllerFCS_22PTDetailViewControllerT_"></a>
|
||||
<a name="//apple_ref/swift/Method/pushViewController(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo21PTTableViewController18pushViewControllerFCS_22PTDetailViewControllerT_">pushViewController(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Pushes a view controller onto the receiver’s stack and updates the display whith custom animation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">pushViewController</span><span class="p">(</span><span class="nv">viewController</span><span class="p">:</span> <span class="kt">PTDetailViewController</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>viewController</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The view controller to push onto the stack.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,298 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ParallaxCell Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ParallaxCell" class="dashAnchor"></a>
|
||||
<a title="ParallaxCell Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ParallaxCell Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ParallaxCell</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ParallaxCell</span><span class="p">:</span> <span class="kt">UITableViewCell</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>UITableViewCell with parallax background</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell13separatorViewGSqCSo6UIView_"></a>
|
||||
<a name="//apple_ref/swift/Property/separatorView" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell13separatorViewGSqCSo6UIView_">separatorView</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Custom separator view</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">separatorView</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell10differenceV12CoreGraphics7CGFloat"></a>
|
||||
<a name="//apple_ref/swift/Property/difference" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell10differenceV12CoreGraphics7CGFloat">difference</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>parallax offset</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">difference</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mi">100</span> <span class="c1">// image parallax</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundColorCSo7UIColor"></a>
|
||||
<a name="//apple_ref/swift/Property/foregroundColor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundColorCSo7UIColor">foregroundColor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The foreground view’s background color.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">foregroundColor</span> <span class="o">=</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">blackColor</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundAlphaV12CoreGraphics7CGFloat"></a>
|
||||
<a name="//apple_ref/swift/Property/foregroundAlpha" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundAlphaV12CoreGraphics7CGFloat">foregroundAlpha</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The foreground view’s alpha.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">foregroundAlpha</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mf">0.5</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo12ParallaxCellcFT5coderCSo7NSCoder_GSqS0__"></a>
|
||||
<a name="//apple_ref/swift/Method/init(coder:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo12ParallaxCellcFT5coderCSo7NSCoder_GSqS0__">init(coder:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a view from data in a given unarchiver.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">required</span> <span class="nf">init</span><span class="p">?(</span><span class="n">coder</span> <span class="nv">aDecoder</span><span class="p">:</span> <span class="kt">NSCoder</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>aDecoder</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An unarchiver object.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized UITableViewCell object.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo12ParallaxCell8setImageFTCSo7UIImage5titleSS_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/setImage(_:title:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo12ParallaxCell8setImageFTCSo7UIImage5titleSS_T_">setImage(_:title:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Sets the contents of the background image and title label</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">setImage</span><span class="p">(</span><span class="nv">image</span><span class="p">:</span> <span class="kt">UIImage</span><span class="p">,</span> <span class="nv">title</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>image</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The image object which set to the backgroundImageView</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>title</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The text to be displayed in the Cell</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
/* Credit to https://gist.github.com/wataru420/2048287 */
|
||||
.highlight {
|
||||
/* Comment */
|
||||
/* Error */
|
||||
/* Keyword */
|
||||
/* Operator */
|
||||
/* Comment.Multiline */
|
||||
/* Comment.Preproc */
|
||||
/* Comment.Single */
|
||||
/* Comment.Special */
|
||||
/* Generic.Deleted */
|
||||
/* Generic.Deleted.Specific */
|
||||
/* Generic.Emph */
|
||||
/* Generic.Error */
|
||||
/* Generic.Heading */
|
||||
/* Generic.Inserted */
|
||||
/* Generic.Inserted.Specific */
|
||||
/* Generic.Output */
|
||||
/* Generic.Prompt */
|
||||
/* Generic.Strong */
|
||||
/* Generic.Subheading */
|
||||
/* Generic.Traceback */
|
||||
/* Keyword.Constant */
|
||||
/* Keyword.Declaration */
|
||||
/* Keyword.Pseudo */
|
||||
/* Keyword.Reserved */
|
||||
/* Keyword.Type */
|
||||
/* Literal.Number */
|
||||
/* Literal.String */
|
||||
/* Name.Attribute */
|
||||
/* Name.Builtin */
|
||||
/* Name.Class */
|
||||
/* Name.Constant */
|
||||
/* Name.Entity */
|
||||
/* Name.Exception */
|
||||
/* Name.Function */
|
||||
/* Name.Namespace */
|
||||
/* Name.Tag */
|
||||
/* Name.Variable */
|
||||
/* Operator.Word */
|
||||
/* Text.Whitespace */
|
||||
/* Literal.Number.Float */
|
||||
/* Literal.Number.Hex */
|
||||
/* Literal.Number.Integer */
|
||||
/* Literal.Number.Oct */
|
||||
/* Literal.String.Backtick */
|
||||
/* Literal.String.Char */
|
||||
/* Literal.String.Doc */
|
||||
/* Literal.String.Double */
|
||||
/* Literal.String.Escape */
|
||||
/* Literal.String.Heredoc */
|
||||
/* Literal.String.Interpol */
|
||||
/* Literal.String.Other */
|
||||
/* Literal.String.Regex */
|
||||
/* Literal.String.Single */
|
||||
/* Literal.String.Symbol */
|
||||
/* Name.Builtin.Pseudo */
|
||||
/* Name.Variable.Class */
|
||||
/* Name.Variable.Global */
|
||||
/* Name.Variable.Instance */
|
||||
/* Literal.Number.Integer.Long */ }
|
||||
.highlight .c {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2; }
|
||||
.highlight .k {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .o {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .cm {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cp {
|
||||
color: #999999;
|
||||
font-weight: bold; }
|
||||
.highlight .c1 {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cs {
|
||||
color: #999999;
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
.highlight .gd {
|
||||
color: #000000;
|
||||
background-color: #ffdddd; }
|
||||
.highlight .gd .x {
|
||||
color: #000000;
|
||||
background-color: #ffaaaa; }
|
||||
.highlight .ge {
|
||||
color: #000000;
|
||||
font-style: italic; }
|
||||
.highlight .gr {
|
||||
color: #aa0000; }
|
||||
.highlight .gh {
|
||||
color: #999999; }
|
||||
.highlight .gi {
|
||||
color: #000000;
|
||||
background-color: #ddffdd; }
|
||||
.highlight .gi .x {
|
||||
color: #000000;
|
||||
background-color: #aaffaa; }
|
||||
.highlight .go {
|
||||
color: #888888; }
|
||||
.highlight .gp {
|
||||
color: #555555; }
|
||||
.highlight .gs {
|
||||
font-weight: bold; }
|
||||
.highlight .gu {
|
||||
color: #aaaaaa; }
|
||||
.highlight .gt {
|
||||
color: #aa0000; }
|
||||
.highlight .kc {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kd {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kp {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kr {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kt {
|
||||
color: #445588; }
|
||||
.highlight .m {
|
||||
color: #009999; }
|
||||
.highlight .s {
|
||||
color: #d14; }
|
||||
.highlight .na {
|
||||
color: #008080; }
|
||||
.highlight .nb {
|
||||
color: #0086B3; }
|
||||
.highlight .nc {
|
||||
color: #445588;
|
||||
font-weight: bold; }
|
||||
.highlight .no {
|
||||
color: #008080; }
|
||||
.highlight .ni {
|
||||
color: #800080; }
|
||||
.highlight .ne {
|
||||
color: #990000;
|
||||
font-weight: bold; }
|
||||
.highlight .nf {
|
||||
color: #990000; }
|
||||
.highlight .nn {
|
||||
color: #555555; }
|
||||
.highlight .nt {
|
||||
color: #000080; }
|
||||
.highlight .nv {
|
||||
color: #008080; }
|
||||
.highlight .ow {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .w {
|
||||
color: #bbbbbb; }
|
||||
.highlight .mf {
|
||||
color: #009999; }
|
||||
.highlight .mh {
|
||||
color: #009999; }
|
||||
.highlight .mi {
|
||||
color: #009999; }
|
||||
.highlight .mo {
|
||||
color: #009999; }
|
||||
.highlight .sb {
|
||||
color: #d14; }
|
||||
.highlight .sc {
|
||||
color: #d14; }
|
||||
.highlight .sd {
|
||||
color: #d14; }
|
||||
.highlight .s2 {
|
||||
color: #d14; }
|
||||
.highlight .se {
|
||||
color: #d14; }
|
||||
.highlight .sh {
|
||||
color: #d14; }
|
||||
.highlight .si {
|
||||
color: #d14; }
|
||||
.highlight .sx {
|
||||
color: #d14; }
|
||||
.highlight .sr {
|
||||
color: #009926; }
|
||||
.highlight .s1 {
|
||||
color: #d14; }
|
||||
.highlight .ss {
|
||||
color: #990073; }
|
||||
.highlight .bp {
|
||||
color: #999999; }
|
||||
.highlight .vc {
|
||||
color: #008080; }
|
||||
.highlight .vg {
|
||||
color: #008080; }
|
||||
.highlight .vi {
|
||||
color: #008080; }
|
||||
.highlight .il {
|
||||
color: #009999; }
|
||||
@@ -0,0 +1,331 @@
|
||||
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
vertical-align: baseline; }
|
||||
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: Helvetica, freesans, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
word-wrap: break-word; }
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
font-weight: 100;
|
||||
color: black; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid #e2e2e2; }
|
||||
|
||||
h4 {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin-top: 21px; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.1em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
color: #777; }
|
||||
|
||||
.section-name {
|
||||
color: gray;
|
||||
display: block;
|
||||
font-family: Helvetica;
|
||||
font-size: 22px;
|
||||
font-weight: 100;
|
||||
margin-bottom: 15px; }
|
||||
|
||||
pre, code {
|
||||
font: 0.95em Menlo, monospace;
|
||||
color: #777;
|
||||
word-wrap: normal; }
|
||||
|
||||
p code, li code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px; }
|
||||
|
||||
a {
|
||||
color: #0088cc;
|
||||
text-decoration: none; }
|
||||
|
||||
ul {
|
||||
padding-left: 15px; }
|
||||
|
||||
li {
|
||||
line-height: 1.8em; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
border-left: 4px solid #ccc; }
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 980px; }
|
||||
|
||||
header {
|
||||
font-size: 0.85em;
|
||||
line-height: 26px;
|
||||
background-color: #414141;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1; }
|
||||
header img {
|
||||
padding-right: 6px;
|
||||
vertical-align: -4px;
|
||||
height: 16px; }
|
||||
header a {
|
||||
color: #fff; }
|
||||
header p {
|
||||
float: left;
|
||||
color: #999; }
|
||||
header .header-right {
|
||||
float: right;
|
||||
margin-left: 16px; }
|
||||
|
||||
#breadcrumbs {
|
||||
background-color: #f2f2f2;
|
||||
height: 27px;
|
||||
padding-top: 17px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
margin-top: 26px; }
|
||||
#breadcrumbs #carat {
|
||||
height: 10px;
|
||||
margin: 0 5px; }
|
||||
|
||||
.sidebar {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e2e2e2;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
width: 230px;
|
||||
word-wrap: normal; }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
background: #fff;
|
||||
padding-left: 0; }
|
||||
|
||||
.nav-group-name {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
font-size: 1.1em;
|
||||
font-weight: 100;
|
||||
padding: 15px 0 15px 20px; }
|
||||
.nav-group-name > a {
|
||||
color: #333; }
|
||||
|
||||
.nav-group-tasks {
|
||||
margin-top: 5px; }
|
||||
|
||||
.nav-group-task {
|
||||
font-size: 0.9em;
|
||||
list-style-type: none; }
|
||||
.nav-group-task a {
|
||||
color: #888; }
|
||||
|
||||
.main-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin-left: 246px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-bottom: 60px;
|
||||
top: 70px;
|
||||
width: 734px; }
|
||||
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
|
||||
margin-bottom: 1em; }
|
||||
.main-content p {
|
||||
line-height: 1.8em; }
|
||||
.main-content section .section:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
.main-content section .task-group-section .task-group:first-of-type {
|
||||
padding-top: 10px; }
|
||||
.main-content section .task-group-section .task-group:first-of-type .section-name {
|
||||
padding-top: 15px; }
|
||||
|
||||
.section {
|
||||
padding: 0 25px; }
|
||||
|
||||
.highlight {
|
||||
background-color: #eee;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
padding: 0 40px 40px 0;
|
||||
margin-bottom: -25px;
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
|
||||
.section-name {
|
||||
margin: 0;
|
||||
margin-left: 18px; }
|
||||
|
||||
.task-group-section {
|
||||
padding-left: 6px;
|
||||
border-top: 1px solid #e2e2e2; }
|
||||
|
||||
.task-group {
|
||||
padding-top: 0px; }
|
||||
|
||||
.task-name-container a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.item {
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
.item code {
|
||||
background-color: transparent;
|
||||
padding: 0; }
|
||||
.item .token {
|
||||
padding-left: 3px;
|
||||
margin-left: 15px;
|
||||
font-size: 11.9px; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
color: gray;
|
||||
font-style: italic; }
|
||||
|
||||
.pointer-container {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -23px;
|
||||
padding-bottom: 13px;
|
||||
position: relative;
|
||||
width: 110%; }
|
||||
|
||||
.pointer {
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
height: 12px;
|
||||
left: 21px;
|
||||
top: -7px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
position: absolute;
|
||||
width: 12px; }
|
||||
|
||||
.height-container {
|
||||
display: none;
|
||||
left: -25px;
|
||||
padding: 0 25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden; }
|
||||
.height-container .section {
|
||||
background: #f9f9f9;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px; }
|
||||
|
||||
.aside, .language {
|
||||
padding: 6px 12px;
|
||||
margin: 12px 0;
|
||||
border-left: 5px solid #dddddd;
|
||||
overflow-y: hidden; }
|
||||
.aside .aside-title, .language .aside-title {
|
||||
font-size: 9px;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 0;
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
-webkit-user-select: none; }
|
||||
.aside p:last-child, .language p:last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.language {
|
||||
border-left: 5px solid #cde9f4; }
|
||||
.language .aside-title {
|
||||
color: #4b8afb; }
|
||||
|
||||
.aside-warning {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
border-collapse: collapse;
|
||||
width: 100%; }
|
||||
.graybox p {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
min-width: 50px; }
|
||||
.graybox td {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 5px 25px 5px 10px;
|
||||
vertical-align: middle; }
|
||||
.graybox tr td:first-of-type {
|
||||
text-align: right;
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
word-break: normal;
|
||||
width: 40px; }
|
||||
|
||||
.slightly-smaller {
|
||||
font-size: 0.9em; }
|
||||
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
margin-left: 25px; }
|
||||
#footer p {
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
font-size: 0.8em; }
|
||||
|
||||
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
|
||||
display: none; }
|
||||
html.dash .main-content {
|
||||
width: 980px;
|
||||
margin-left: 0;
|
||||
border: none;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
padding-bottom: 0; }
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
html.dash .item .token {
|
||||
margin-left: 0; }
|
||||
html.dash .content-wrapper {
|
||||
width: auto; }
|
||||
html.dash #footer {
|
||||
position: static; }
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.jazzy.previewtransitiondemo</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>PreviewTransitionDemo</string>
|
||||
<key>DocSetPlatformFamily</key>
|
||||
<string>jazzy</string>
|
||||
<key>isDashDocset</key>
|
||||
<true/>
|
||||
<key>dashIndexFilePath</key>
|
||||
<string>index.html</string>
|
||||
<key>isJavaScriptEnabled</key>
|
||||
<true/>
|
||||
<key>DashDocSetFamily</key>
|
||||
<string>dashtoc</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C21PreviewTransitionDemo22PTDetailViewController"></a>
|
||||
<a name="//apple_ref/swift/Class/PTDetailViewController" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C21PreviewTransitionDemo22PTDetailViewController">PTDetailViewController</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Base UIViewController for preview transition</p>
|
||||
|
||||
<a href="Classes/PTDetailViewController.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTDetailViewController</span><span class="p">:</span> <span class="kt">UIViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C21PreviewTransitionDemo12ParallaxCell"></a>
|
||||
<a name="//apple_ref/swift/Class/ParallaxCell" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C21PreviewTransitionDemo12ParallaxCell">ParallaxCell</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>UITableViewCell with parallax background</p>
|
||||
|
||||
<a href="Classes/ParallaxCell.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ParallaxCell</span><span class="p">:</span> <span class="kt">UITableViewCell</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C21PreviewTransitionDemo21PTTableViewController"></a>
|
||||
<a name="//apple_ref/swift/Class/PTTableViewController" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C21PreviewTransitionDemo21PTTableViewController">PTTableViewController</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Base UITableViewController for preview transition</p>
|
||||
|
||||
<a href="Classes/PTTableViewController.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTTableViewController</span><span class="p">:</span> <span class="kt">UITableViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,101 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>PTDetailViewController Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/PTDetailViewController" class="dashAnchor"></a>
|
||||
<a title="PTDetailViewController Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
PTDetailViewController Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>PTDetailViewController</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTDetailViewController</span><span class="p">:</span> <span class="kt">UIViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Base UIViewController for preview transition</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo22PTDetailViewController17popViewControllerFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/popViewController()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo22PTDetailViewController17popViewControllerFT_T_">popViewController()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Pops the top view controller from the navigation stack and updates the display with custom animation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">popViewController</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,121 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>PTTableViewController Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/PTTableViewController" class="dashAnchor"></a>
|
||||
<a title="PTTableViewController Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
PTTableViewController Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>PTTableViewController</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PTTableViewController</span><span class="p">:</span> <span class="kt">UITableViewController</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Base UITableViewController for preview transition</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo21PTTableViewController18pushViewControllerFCS_22PTDetailViewControllerT_"></a>
|
||||
<a name="//apple_ref/swift/Method/pushViewController(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo21PTTableViewController18pushViewControllerFCS_22PTDetailViewControllerT_">pushViewController(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Pushes a view controller onto the receiver’s stack and updates the display whith custom animation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">pushViewController</span><span class="p">(</span><span class="nv">viewController</span><span class="p">:</span> <span class="kt">PTDetailViewController</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>viewController</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The view controller to push onto the stack.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,298 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ParallaxCell Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ParallaxCell" class="dashAnchor"></a>
|
||||
<a title="ParallaxCell Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ParallaxCell Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ParallaxCell</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ParallaxCell</span><span class="p">:</span> <span class="kt">UITableViewCell</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>UITableViewCell with parallax background</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell13separatorViewGSqCSo6UIView_"></a>
|
||||
<a name="//apple_ref/swift/Property/separatorView" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell13separatorViewGSqCSo6UIView_">separatorView</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Custom separator view</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">separatorView</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell10differenceV12CoreGraphics7CGFloat"></a>
|
||||
<a name="//apple_ref/swift/Property/difference" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell10differenceV12CoreGraphics7CGFloat">difference</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>parallax offset</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">difference</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mi">100</span> <span class="c1">// image parallax</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundColorCSo7UIColor"></a>
|
||||
<a name="//apple_ref/swift/Property/foregroundColor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundColorCSo7UIColor">foregroundColor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The foreground view’s background color.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">foregroundColor</span> <span class="o">=</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">blackColor</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundAlphaV12CoreGraphics7CGFloat"></a>
|
||||
<a name="//apple_ref/swift/Property/foregroundAlpha" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC21PreviewTransitionDemo12ParallaxCell15foregroundAlphaV12CoreGraphics7CGFloat">foregroundAlpha</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The foreground view’s alpha.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">foregroundAlpha</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mf">0.5</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo12ParallaxCellcFT5coderCSo7NSCoder_GSqS0__"></a>
|
||||
<a name="//apple_ref/swift/Method/init(coder:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo12ParallaxCellcFT5coderCSo7NSCoder_GSqS0__">init(coder:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a view from data in a given unarchiver.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">required</span> <span class="nf">init</span><span class="p">?(</span><span class="n">coder</span> <span class="nv">aDecoder</span><span class="p">:</span> <span class="kt">NSCoder</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>aDecoder</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An unarchiver object.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized UITableViewCell object.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC21PreviewTransitionDemo12ParallaxCell8setImageFTCSo7UIImage5titleSS_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/setImage(_:title:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC21PreviewTransitionDemo12ParallaxCell8setImageFTCSo7UIImage5titleSS_T_">setImage(_:title:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Sets the contents of the background image and title label</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">setImage</span><span class="p">(</span><span class="nv">image</span><span class="p">:</span> <span class="kt">UIImage</span><span class="p">,</span> <span class="nv">title</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>image</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The image object which set to the backgroundImageView</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>title</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The text to be displayed in the Cell</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
/* Credit to https://gist.github.com/wataru420/2048287 */
|
||||
.highlight {
|
||||
/* Comment */
|
||||
/* Error */
|
||||
/* Keyword */
|
||||
/* Operator */
|
||||
/* Comment.Multiline */
|
||||
/* Comment.Preproc */
|
||||
/* Comment.Single */
|
||||
/* Comment.Special */
|
||||
/* Generic.Deleted */
|
||||
/* Generic.Deleted.Specific */
|
||||
/* Generic.Emph */
|
||||
/* Generic.Error */
|
||||
/* Generic.Heading */
|
||||
/* Generic.Inserted */
|
||||
/* Generic.Inserted.Specific */
|
||||
/* Generic.Output */
|
||||
/* Generic.Prompt */
|
||||
/* Generic.Strong */
|
||||
/* Generic.Subheading */
|
||||
/* Generic.Traceback */
|
||||
/* Keyword.Constant */
|
||||
/* Keyword.Declaration */
|
||||
/* Keyword.Pseudo */
|
||||
/* Keyword.Reserved */
|
||||
/* Keyword.Type */
|
||||
/* Literal.Number */
|
||||
/* Literal.String */
|
||||
/* Name.Attribute */
|
||||
/* Name.Builtin */
|
||||
/* Name.Class */
|
||||
/* Name.Constant */
|
||||
/* Name.Entity */
|
||||
/* Name.Exception */
|
||||
/* Name.Function */
|
||||
/* Name.Namespace */
|
||||
/* Name.Tag */
|
||||
/* Name.Variable */
|
||||
/* Operator.Word */
|
||||
/* Text.Whitespace */
|
||||
/* Literal.Number.Float */
|
||||
/* Literal.Number.Hex */
|
||||
/* Literal.Number.Integer */
|
||||
/* Literal.Number.Oct */
|
||||
/* Literal.String.Backtick */
|
||||
/* Literal.String.Char */
|
||||
/* Literal.String.Doc */
|
||||
/* Literal.String.Double */
|
||||
/* Literal.String.Escape */
|
||||
/* Literal.String.Heredoc */
|
||||
/* Literal.String.Interpol */
|
||||
/* Literal.String.Other */
|
||||
/* Literal.String.Regex */
|
||||
/* Literal.String.Single */
|
||||
/* Literal.String.Symbol */
|
||||
/* Name.Builtin.Pseudo */
|
||||
/* Name.Variable.Class */
|
||||
/* Name.Variable.Global */
|
||||
/* Name.Variable.Instance */
|
||||
/* Literal.Number.Integer.Long */ }
|
||||
.highlight .c {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2; }
|
||||
.highlight .k {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .o {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .cm {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cp {
|
||||
color: #999999;
|
||||
font-weight: bold; }
|
||||
.highlight .c1 {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cs {
|
||||
color: #999999;
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
.highlight .gd {
|
||||
color: #000000;
|
||||
background-color: #ffdddd; }
|
||||
.highlight .gd .x {
|
||||
color: #000000;
|
||||
background-color: #ffaaaa; }
|
||||
.highlight .ge {
|
||||
color: #000000;
|
||||
font-style: italic; }
|
||||
.highlight .gr {
|
||||
color: #aa0000; }
|
||||
.highlight .gh {
|
||||
color: #999999; }
|
||||
.highlight .gi {
|
||||
color: #000000;
|
||||
background-color: #ddffdd; }
|
||||
.highlight .gi .x {
|
||||
color: #000000;
|
||||
background-color: #aaffaa; }
|
||||
.highlight .go {
|
||||
color: #888888; }
|
||||
.highlight .gp {
|
||||
color: #555555; }
|
||||
.highlight .gs {
|
||||
font-weight: bold; }
|
||||
.highlight .gu {
|
||||
color: #aaaaaa; }
|
||||
.highlight .gt {
|
||||
color: #aa0000; }
|
||||
.highlight .kc {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kd {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kp {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kr {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kt {
|
||||
color: #445588; }
|
||||
.highlight .m {
|
||||
color: #009999; }
|
||||
.highlight .s {
|
||||
color: #d14; }
|
||||
.highlight .na {
|
||||
color: #008080; }
|
||||
.highlight .nb {
|
||||
color: #0086B3; }
|
||||
.highlight .nc {
|
||||
color: #445588;
|
||||
font-weight: bold; }
|
||||
.highlight .no {
|
||||
color: #008080; }
|
||||
.highlight .ni {
|
||||
color: #800080; }
|
||||
.highlight .ne {
|
||||
color: #990000;
|
||||
font-weight: bold; }
|
||||
.highlight .nf {
|
||||
color: #990000; }
|
||||
.highlight .nn {
|
||||
color: #555555; }
|
||||
.highlight .nt {
|
||||
color: #000080; }
|
||||
.highlight .nv {
|
||||
color: #008080; }
|
||||
.highlight .ow {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .w {
|
||||
color: #bbbbbb; }
|
||||
.highlight .mf {
|
||||
color: #009999; }
|
||||
.highlight .mh {
|
||||
color: #009999; }
|
||||
.highlight .mi {
|
||||
color: #009999; }
|
||||
.highlight .mo {
|
||||
color: #009999; }
|
||||
.highlight .sb {
|
||||
color: #d14; }
|
||||
.highlight .sc {
|
||||
color: #d14; }
|
||||
.highlight .sd {
|
||||
color: #d14; }
|
||||
.highlight .s2 {
|
||||
color: #d14; }
|
||||
.highlight .se {
|
||||
color: #d14; }
|
||||
.highlight .sh {
|
||||
color: #d14; }
|
||||
.highlight .si {
|
||||
color: #d14; }
|
||||
.highlight .sx {
|
||||
color: #d14; }
|
||||
.highlight .sr {
|
||||
color: #009926; }
|
||||
.highlight .s1 {
|
||||
color: #d14; }
|
||||
.highlight .ss {
|
||||
color: #990073; }
|
||||
.highlight .bp {
|
||||
color: #999999; }
|
||||
.highlight .vc {
|
||||
color: #008080; }
|
||||
.highlight .vg {
|
||||
color: #008080; }
|
||||
.highlight .vi {
|
||||
color: #008080; }
|
||||
.highlight .il {
|
||||
color: #009999; }
|
||||
@@ -0,0 +1,331 @@
|
||||
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
vertical-align: baseline; }
|
||||
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: Helvetica, freesans, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
word-wrap: break-word; }
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
font-weight: 100;
|
||||
color: black; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid #e2e2e2; }
|
||||
|
||||
h4 {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin-top: 21px; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.1em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
color: #777; }
|
||||
|
||||
.section-name {
|
||||
color: gray;
|
||||
display: block;
|
||||
font-family: Helvetica;
|
||||
font-size: 22px;
|
||||
font-weight: 100;
|
||||
margin-bottom: 15px; }
|
||||
|
||||
pre, code {
|
||||
font: 0.95em Menlo, monospace;
|
||||
color: #777;
|
||||
word-wrap: normal; }
|
||||
|
||||
p code, li code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px; }
|
||||
|
||||
a {
|
||||
color: #0088cc;
|
||||
text-decoration: none; }
|
||||
|
||||
ul {
|
||||
padding-left: 15px; }
|
||||
|
||||
li {
|
||||
line-height: 1.8em; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
border-left: 4px solid #ccc; }
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 980px; }
|
||||
|
||||
header {
|
||||
font-size: 0.85em;
|
||||
line-height: 26px;
|
||||
background-color: #414141;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1; }
|
||||
header img {
|
||||
padding-right: 6px;
|
||||
vertical-align: -4px;
|
||||
height: 16px; }
|
||||
header a {
|
||||
color: #fff; }
|
||||
header p {
|
||||
float: left;
|
||||
color: #999; }
|
||||
header .header-right {
|
||||
float: right;
|
||||
margin-left: 16px; }
|
||||
|
||||
#breadcrumbs {
|
||||
background-color: #f2f2f2;
|
||||
height: 27px;
|
||||
padding-top: 17px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
margin-top: 26px; }
|
||||
#breadcrumbs #carat {
|
||||
height: 10px;
|
||||
margin: 0 5px; }
|
||||
|
||||
.sidebar {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e2e2e2;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
width: 230px;
|
||||
word-wrap: normal; }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
background: #fff;
|
||||
padding-left: 0; }
|
||||
|
||||
.nav-group-name {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
font-size: 1.1em;
|
||||
font-weight: 100;
|
||||
padding: 15px 0 15px 20px; }
|
||||
.nav-group-name > a {
|
||||
color: #333; }
|
||||
|
||||
.nav-group-tasks {
|
||||
margin-top: 5px; }
|
||||
|
||||
.nav-group-task {
|
||||
font-size: 0.9em;
|
||||
list-style-type: none; }
|
||||
.nav-group-task a {
|
||||
color: #888; }
|
||||
|
||||
.main-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin-left: 246px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-bottom: 60px;
|
||||
top: 70px;
|
||||
width: 734px; }
|
||||
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
|
||||
margin-bottom: 1em; }
|
||||
.main-content p {
|
||||
line-height: 1.8em; }
|
||||
.main-content section .section:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
.main-content section .task-group-section .task-group:first-of-type {
|
||||
padding-top: 10px; }
|
||||
.main-content section .task-group-section .task-group:first-of-type .section-name {
|
||||
padding-top: 15px; }
|
||||
|
||||
.section {
|
||||
padding: 0 25px; }
|
||||
|
||||
.highlight {
|
||||
background-color: #eee;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
padding: 0 40px 40px 0;
|
||||
margin-bottom: -25px;
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
|
||||
.section-name {
|
||||
margin: 0;
|
||||
margin-left: 18px; }
|
||||
|
||||
.task-group-section {
|
||||
padding-left: 6px;
|
||||
border-top: 1px solid #e2e2e2; }
|
||||
|
||||
.task-group {
|
||||
padding-top: 0px; }
|
||||
|
||||
.task-name-container a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.item {
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
.item code {
|
||||
background-color: transparent;
|
||||
padding: 0; }
|
||||
.item .token {
|
||||
padding-left: 3px;
|
||||
margin-left: 15px;
|
||||
font-size: 11.9px; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
color: gray;
|
||||
font-style: italic; }
|
||||
|
||||
.pointer-container {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -23px;
|
||||
padding-bottom: 13px;
|
||||
position: relative;
|
||||
width: 110%; }
|
||||
|
||||
.pointer {
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
height: 12px;
|
||||
left: 21px;
|
||||
top: -7px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
position: absolute;
|
||||
width: 12px; }
|
||||
|
||||
.height-container {
|
||||
display: none;
|
||||
left: -25px;
|
||||
padding: 0 25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden; }
|
||||
.height-container .section {
|
||||
background: #f9f9f9;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px; }
|
||||
|
||||
.aside, .language {
|
||||
padding: 6px 12px;
|
||||
margin: 12px 0;
|
||||
border-left: 5px solid #dddddd;
|
||||
overflow-y: hidden; }
|
||||
.aside .aside-title, .language .aside-title {
|
||||
font-size: 9px;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 0;
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
-webkit-user-select: none; }
|
||||
.aside p:last-child, .language p:last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.language {
|
||||
border-left: 5px solid #cde9f4; }
|
||||
.language .aside-title {
|
||||
color: #4b8afb; }
|
||||
|
||||
.aside-warning {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
border-collapse: collapse;
|
||||
width: 100%; }
|
||||
.graybox p {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
min-width: 50px; }
|
||||
.graybox td {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 5px 25px 5px 10px;
|
||||
vertical-align: middle; }
|
||||
.graybox tr td:first-of-type {
|
||||
text-align: right;
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
word-break: normal;
|
||||
width: 40px; }
|
||||
|
||||
.slightly-smaller {
|
||||
font-size: 0.9em; }
|
||||
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
margin-left: 25px; }
|
||||
#footer p {
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
font-size: 0.8em; }
|
||||
|
||||
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
|
||||
display: none; }
|
||||
html.dash .main-content {
|
||||
width: 980px;
|
||||
margin-left: 0;
|
||||
border: none;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
padding-bottom: 0; }
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
html.dash .item .token {
|
||||
margin-left: 0; }
|
||||
html.dash .content-wrapper {
|
||||
width: auto; }
|
||||
html.dash #footer {
|
||||
position: static; }
|
||||
|
After Width: | Height: | Size: 274 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>PreviewTransitionDemo Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="PreviewTransitionDemo Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
PreviewTransitionDemo Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/Ramotion/preview-transition/master/header.png" alt="header"></p>
|
||||
<a href='#preview_transition_a_href_http_twitter_com_ramotion_img_src_https_img_shields_io_badge_twitter_ramotion_blue_svg_style_flat_alt_twitter_a' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='preview_transition_a_href_http_twitter_com_ramotion_img_src_https_img_shields_io_badge_twitter_ramotion_blue_svg_style_flat_alt_twitter_a'>Preview-transition <a href="http://twitter.com/Ramotion"><img src="https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat" alt="Twitter"></a></h1>
|
||||
|
||||
<p><a href="https://travis-ci.org/Ramotion/preview-transition.svg?branch=master"><img src="https://img.shields.io/travis/Ramotion/preview-transition.svg" alt="Travis"></a>
|
||||
<a href="https://github.com/Ramotion/preview-transition"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
|
||||
<a href="https://cocoapods.org/pods/PreviewTransition"><img src="https://img.shields.io/cocoapods/p/PreviewTransition.svg" alt="CocoaPods"></a>
|
||||
<a href="http://cocoapods.org/pods/PreviewTransition"><img src="https://img.shields.io/cocoapods/v/PreviewTransition.svg" alt="CocoaPods"></a>
|
||||
<a href="https://cdn.rawgit.com/Ramotion/preview-transition/master/docs/index.html"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/PreviewTransition.svg" alt="CocoaPods"></a>
|
||||
<a href="https://codebeat.co/projects/github-com-ramotion-preview-transition"><img src="https://codebeat.co/badges/b99f71fe-b7e7-4a08-94bd-d98307d176ea" alt="codebeat badge"></a></p>
|
||||
|
||||
<p><a href="https://dribbble.com/shots/2724735-iOS-Preview-Transition-Open-Source">shot on dribbble</a>:
|
||||
<p align="center">
|
||||
<a href="https://dribbble.com/shots/2694049-iOS-Pagination-Controller-Open-Source"><img src="https://raw.githubusercontent.com/Ramotion/preview-transition/master/preview.gif" width="890" height="668" alt="StackViewController Example App" /></a>
|
||||
</p></p>
|
||||
|
||||
<p>The <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">iPhone mockup</a> available <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">here</a>.</p>
|
||||
<a href='#requirements' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='requirements'>Requirements</h2>
|
||||
|
||||
<ul>
|
||||
<li>iOS 8.0+</li>
|
||||
<li>Xcode 7.3</li>
|
||||
</ul>
|
||||
<a href='#licence' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='licence'>Licence</h2>
|
||||
|
||||
<p>Preview-transition is released under the MIT license.
|
||||
See <a href="./LICENSE">LICENSE</a> for details.</p>
|
||||
|
||||
<p>Just add the Source folder to your project or use <a href="https://cocoapods.org">CocoaPods</a> like this:
|
||||
<code>ruby
|
||||
pod 'PreviewTransition'
|
||||
</code></p>
|
||||
|
||||
<p>or <a href="https://github.com/Carthage/Carthage">Carthage</a> users can simply add to their <code>Cartfile</code>:
|
||||
<code>
|
||||
github "Ramotion/preview-transition"
|
||||
</code></p>
|
||||
<a href='#usage' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='usage'>Usage</h2>
|
||||
|
||||
<p>1) <code>import PreviewTransition</code></p>
|
||||
|
||||
<p>2) Create UITableViewController inherit, inheriting from <code>PTTableViewController</code></p>
|
||||
|
||||
<p>3) Add UITableViewDelegate methods</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">numberOfRowsInSection</span> <span class="nv">section</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Int</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="o"><</span><span class="kt">RowsCount</span><span class="o">></span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">cellForRowAtIndexPath</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">NSIndexPath</span><span class="p">)</span> <span class="o">-></span> <span class="kt">UITableViewCell</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">tableView</span><span class="o">.</span><span class="nf">dequeueReusableCellWithIdentifier</span><span class="p">(</span><span class="o"><</span><span class="kt">CellIdentifier</span><span class="o">></span><span class="p">,</span> <span class="nv">forIndexPath</span><span class="p">:</span> <span class="n">indexPath</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>4) add a ParallaxCell</p>
|
||||
|
||||
<p>storyboards:
|
||||
create a cell and inherit from <code>ParallaxCell</code>; don’t forget set the identifier <code><CellIdentifier></code></p>
|
||||
|
||||
<p>or programmatically:
|
||||
register a cell in viewDidLoad <code>tableView.registerClass(ParallaxCell, forCellReuseIdentifier:<CellIdentifier>)</code></p>
|
||||
|
||||
<p>5) set cell height</p>
|
||||
|
||||
<p>6) create image names (image sizes must be equal to screen size or bigger)</p>
|
||||
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">images</span> <span class="o">=</span> <span class="p">[</span><span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">]</span> <span class="c1">// image names</span>
|
||||
</code></pre>
|
||||
|
||||
<p>7) set image and text for ParallaxCell</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">willDisplayCell</span> <span class="nv">cell</span><span class="p">:</span> <span class="kt">UITableViewCell</span><span class="p">,</span> <span class="n">forRowAtIndexPath</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">NSIndexPath</span><span class="p">)</span> <span class="p">{</span>
|
||||
|
||||
<span class="k">guard</span> <span class="k">let</span> <span class="nv">cell</span> <span class="o">=</span> <span class="n">cell</span> <span class="k">as?</span> <span class="kt">ParallaxCell</span> <span class="k">else</span> <span class="p">{</span>
|
||||
<span class="k">return</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">let</span> <span class="nv">imageName</span> <span class="o">=</span> <span class="n">images</span><span class="p">[</span><span class="n">indexPath</span><span class="o">.</span><span class="n">row</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="k">let</span> <span class="nv">image</span> <span class="o">=</span> <span class="kt">UIImage</span><span class="p">(</span><span class="nv">named</span><span class="p">:</span> <span class="n">imageName</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">cell</span><span class="o">.</span><span class="nf">setImage</span><span class="p">(</span><span class="n">image</span><span class="p">,</span> <span class="nv">title</span><span class="p">:</span> <span class="o"><</span><span class="kt">SetText</span><span class="o">></span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>your tableViewController should look like <a href="https://github.com/Ramotion/preview-transition/blob/master/PreviewTransitionDemo/PreviewTransitionDemo/ViewController/DemoTableViewController.swift">DemoTableViewController</a></p>
|
||||
|
||||
<p>Method <code>public override func tableView(tableView: didSelectRowAtIndexPath indexPath:)</code> we will add later. (step 10)</p>
|
||||
|
||||
<p>8) Create UIViewController, inheriting from <code>PTDetailViewController</code></p>
|
||||
|
||||
<p>9) Add action for backButton and call <code>popViewController()</code></p>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">backButtonHandler</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="nf">popViewController</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>10) Push this UIViewController in UITableViewController. Add method</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">didSelectRowAtIndexPath</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">NSIndexPath</span><span class="p">)</span> <span class="p">{</span>
|
||||
|
||||
<span class="c1">// create viewController</span>
|
||||
<span class="kd">let</span> <span class="o"><</span><span class="kt">YourViewController</span><span class="o">></span> <span class="o">=</span> <span class="n">storyboard</span><span class="p">?</span><span class="o">.</span><span class="nf">instantiateViewControllerWithIdentifier</span><span class="p">(</span><span class="o"><</span><span class="n">identifier</span><span class="o">></span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="k">case</span> <span class="k">let</span> <span class="nv">viewController</span> <span class="k">as</span> <span class="o"><</span><span class="kt">YourViewController</span><span class="o">></span> <span class="o">=</span> <span class="n">viewController</span> <span class="p">{</span>
|
||||
<span class="nf">pushViewController</span><span class="p">(</span><span class="n">viewController</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>11) Configure UINavigationBar</p>
|
||||
<pre class="highlight swift"><code><span class="c1">// transparent background</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="nf">setBackgroundImage</span><span class="p">(</span><span class="kt">UIImage</span><span class="p">(),</span> <span class="nv">forBarMetrics</span><span class="p">:</span> <span class="o">.</span><span class="kt">Default</span><span class="p">)</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">shadowImage</span> <span class="o">=</span> <span class="kt">UIImage</span><span class="p">()</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">translucent</span> <span class="o">=</span> <span class="kc">true</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">tintColor</span> <span class="o">=</span> <span class="o">.</span><span class="nf">whiteColor</span><span class="p">()</span>
|
||||
|
||||
<span class="c1">// set font</span>
|
||||
<span class="k">if</span> <span class="k">let</span> <span class="nv">font</span> <span class="o">=</span> <span class="kt">UIFont</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="o"><</span><span class="kt">Font</span> <span class="n">name</span><span class="o">></span> <span class="p">,</span> <span class="nv">size</span><span class="p">:</span> <span class="mi">18</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">titleTextAttributes</span> <span class="o">=</span> <span class="p">[</span>
|
||||
<span class="kt">NSForegroundColorAttributeName</span> <span class="p">:</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">whiteColor</span><span class="p">(),</span>
|
||||
<span class="kt">NSFontAttributeName</span> <span class="p">:</span> <span class="n">font</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
<a href='#about' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='about'>About</h2>
|
||||
|
||||
<p>The project maintained by <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">app development agency</a> <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">Ramotion Inc.</a>
|
||||
See our other <a href="https://github.com/ramotion">open-source projects</a> or <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">hire</a> us to design, develop, and grow your product.</p>
|
||||
|
||||
<p><a href="https://twitter.com/intent/tweet?text=https://github.com/ramotion/preview-transition"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter URL"></a>
|
||||
<a href="https://twitter.com/ramotion"><img src="https://img.shields.io/twitter/follow/ramotion.svg?style=social" alt="Twitter Follow"></a></p>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
window.jazzy = {'docset': false}
|
||||
if (typeof window.dash != 'undefined') {
|
||||
document.documentElement.className += ' dash'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
if (navigator.userAgent.match(/xcode/i)) {
|
||||
document.documentElement.className += ' xcode'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
|
||||
// On doc load, toggle the URL hash discussion if present
|
||||
$(document).ready(function() {
|
||||
if (!window.jazzy.docset) {
|
||||
var linkToHash = $('a[href="' + window.location.hash +'"]');
|
||||
linkToHash.trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
// On token click, toggle its discussion and animate token.marginLeft
|
||||
$(".token").click(function(event) {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var link = $(this);
|
||||
var animationDuration = 300;
|
||||
var tokenOffset = "15px";
|
||||
var original = link.css('marginLeft') == tokenOffset;
|
||||
link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
|
||||
$content = link.parent().parent().next();
|
||||
$content.slideToggle(animationDuration);
|
||||
|
||||
// Keeps the document from jumping to the hash.
|
||||
var href = $(this).attr('href');
|
||||
if (history.pushState) {
|
||||
history.pushState({}, '', href);
|
||||
} else {
|
||||
location.hash = href;
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
DemoTableViewController.swift
|
||||
public class DemoTableViewController: PTTableViewController
|
||||
public class DemoTableViewController : PTTableViewController
|
||||
DemoDetailViewController.swift
|
||||
public class DemoDetailViewController: PTDetailViewController
|
||||
public class DemoDetailViewController : PTDetailViewController
|
||||
|
After Width: | Height: | Size: 274 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>PreviewTransitionDemo Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="PreviewTransitionDemo Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">PreviewTransitionDemo Docs</a> (82% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">PreviewTransitionDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
PreviewTransitionDemo Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTDetailViewController.html">PTDetailViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/PTTableViewController.html">PTTableViewController</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ParallaxCell.html">ParallaxCell</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/Ramotion/preview-transition/master/header.png" alt="header"></p>
|
||||
<a href='#preview_transition_a_href_http_twitter_com_ramotion_img_src_https_img_shields_io_badge_twitter_ramotion_blue_svg_style_flat_alt_twitter_a' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='preview_transition_a_href_http_twitter_com_ramotion_img_src_https_img_shields_io_badge_twitter_ramotion_blue_svg_style_flat_alt_twitter_a'>Preview-transition <a href="http://twitter.com/Ramotion"><img src="https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat" alt="Twitter"></a></h1>
|
||||
|
||||
<p><a href="https://travis-ci.org/Ramotion/preview-transition.svg?branch=master"><img src="https://img.shields.io/travis/Ramotion/preview-transition.svg" alt="Travis"></a>
|
||||
<a href="https://github.com/Ramotion/preview-transition"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
|
||||
<a href="https://cocoapods.org/pods/PreviewTransition"><img src="https://img.shields.io/cocoapods/p/PreviewTransition.svg" alt="CocoaPods"></a>
|
||||
<a href="http://cocoapods.org/pods/PreviewTransition"><img src="https://img.shields.io/cocoapods/v/PreviewTransition.svg" alt="CocoaPods"></a>
|
||||
<a href="https://cdn.rawgit.com/Ramotion/preview-transition/master/docs/index.html"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/PreviewTransition.svg" alt="CocoaPods"></a>
|
||||
<a href="https://codebeat.co/projects/github-com-ramotion-preview-transition"><img src="https://codebeat.co/badges/b99f71fe-b7e7-4a08-94bd-d98307d176ea" alt="codebeat badge"></a></p>
|
||||
|
||||
<p><a href="https://dribbble.com/shots/2724735-iOS-Preview-Transition-Open-Source">shot on dribbble</a>:
|
||||
<p align="center">
|
||||
<a href="https://dribbble.com/shots/2694049-iOS-Pagination-Controller-Open-Source"><img src="https://raw.githubusercontent.com/Ramotion/preview-transition/master/preview.gif" width="890" height="668" alt="StackViewController Example App" /></a>
|
||||
</p></p>
|
||||
|
||||
<p>The <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">iPhone mockup</a> available <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">here</a>.</p>
|
||||
<a href='#requirements' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='requirements'>Requirements</h2>
|
||||
|
||||
<ul>
|
||||
<li>iOS 8.0+</li>
|
||||
<li>Xcode 7.3</li>
|
||||
</ul>
|
||||
<a href='#licence' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='licence'>Licence</h2>
|
||||
|
||||
<p>Preview-transition is released under the MIT license.
|
||||
See <a href="./LICENSE">LICENSE</a> for details.</p>
|
||||
|
||||
<p>Just add the Source folder to your project or use <a href="https://cocoapods.org">CocoaPods</a> like this:
|
||||
<code>ruby
|
||||
pod 'PreviewTransition'
|
||||
</code></p>
|
||||
|
||||
<p>or <a href="https://github.com/Carthage/Carthage">Carthage</a> users can simply add to their <code>Cartfile</code>:
|
||||
<code>
|
||||
github "Ramotion/preview-transition"
|
||||
</code></p>
|
||||
<a href='#usage' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='usage'>Usage</h2>
|
||||
|
||||
<p>1) <code>import PreviewTransition</code></p>
|
||||
|
||||
<p>2) Create UITableViewController inherit, inheriting from <code>PTTableViewController</code></p>
|
||||
|
||||
<p>3) Add UITableViewDelegate methods</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">numberOfRowsInSection</span> <span class="nv">section</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Int</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="o"><</span><span class="kt">RowsCount</span><span class="o">></span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">cellForRowAtIndexPath</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">NSIndexPath</span><span class="p">)</span> <span class="o">-></span> <span class="kt">UITableViewCell</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">tableView</span><span class="o">.</span><span class="nf">dequeueReusableCellWithIdentifier</span><span class="p">(</span><span class="o"><</span><span class="kt">CellIdentifier</span><span class="o">></span><span class="p">,</span> <span class="nv">forIndexPath</span><span class="p">:</span> <span class="n">indexPath</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>4) add a ParallaxCell</p>
|
||||
|
||||
<p>storyboards:
|
||||
create a cell and inherit from <code>ParallaxCell</code>; don’t forget set the identifier <code><CellIdentifier></code></p>
|
||||
|
||||
<p>or programmatically:
|
||||
register a cell in viewDidLoad <code>tableView.registerClass(ParallaxCell, forCellReuseIdentifier:<CellIdentifier>)</code></p>
|
||||
|
||||
<p>5) set cell height</p>
|
||||
|
||||
<p>6) create image names (image sizes must be equal to screen size or bigger)</p>
|
||||
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">images</span> <span class="o">=</span> <span class="p">[</span><span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">,</span> <span class="n">image_name</span><span class="p">]</span> <span class="c1">// image names</span>
|
||||
</code></pre>
|
||||
|
||||
<p>7) set image and text for ParallaxCell</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">willDisplayCell</span> <span class="nv">cell</span><span class="p">:</span> <span class="kt">UITableViewCell</span><span class="p">,</span> <span class="n">forRowAtIndexPath</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">NSIndexPath</span><span class="p">)</span> <span class="p">{</span>
|
||||
|
||||
<span class="k">guard</span> <span class="k">let</span> <span class="nv">cell</span> <span class="o">=</span> <span class="n">cell</span> <span class="k">as?</span> <span class="kt">ParallaxCell</span> <span class="k">else</span> <span class="p">{</span>
|
||||
<span class="k">return</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">let</span> <span class="nv">imageName</span> <span class="o">=</span> <span class="n">images</span><span class="p">[</span><span class="n">indexPath</span><span class="o">.</span><span class="n">row</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="k">let</span> <span class="nv">image</span> <span class="o">=</span> <span class="kt">UIImage</span><span class="p">(</span><span class="nv">named</span><span class="p">:</span> <span class="n">imageName</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">cell</span><span class="o">.</span><span class="nf">setImage</span><span class="p">(</span><span class="n">image</span><span class="p">,</span> <span class="nv">title</span><span class="p">:</span> <span class="o"><</span><span class="kt">SetText</span><span class="o">></span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>your tableViewController should look like <a href="https://github.com/Ramotion/preview-transition/blob/master/PreviewTransitionDemo/PreviewTransitionDemo/ViewController/DemoTableViewController.swift">DemoTableViewController</a></p>
|
||||
|
||||
<p>Method <code>public override func tableView(tableView: didSelectRowAtIndexPath indexPath:)</code> we will add later. (step 10)</p>
|
||||
|
||||
<p>8) Create UIViewController, inheriting from <code>PTDetailViewController</code></p>
|
||||
|
||||
<p>9) Add action for backButton and call <code>popViewController()</code></p>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">backButtonHandler</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="nf">popViewController</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>10) Push this UIViewController in UITableViewController. Add method</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">didSelectRowAtIndexPath</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">NSIndexPath</span><span class="p">)</span> <span class="p">{</span>
|
||||
|
||||
<span class="c1">// create viewController</span>
|
||||
<span class="kd">let</span> <span class="o"><</span><span class="kt">YourViewController</span><span class="o">></span> <span class="o">=</span> <span class="n">storyboard</span><span class="p">?</span><span class="o">.</span><span class="nf">instantiateViewControllerWithIdentifier</span><span class="p">(</span><span class="o"><</span><span class="n">identifier</span><span class="o">></span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="k">case</span> <span class="k">let</span> <span class="nv">viewController</span> <span class="k">as</span> <span class="o"><</span><span class="kt">YourViewController</span><span class="o">></span> <span class="o">=</span> <span class="n">viewController</span> <span class="p">{</span>
|
||||
<span class="nf">pushViewController</span><span class="p">(</span><span class="n">viewController</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>11) Configure UINavigationBar</p>
|
||||
<pre class="highlight swift"><code><span class="c1">// transparent background</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="nf">setBackgroundImage</span><span class="p">(</span><span class="kt">UIImage</span><span class="p">(),</span> <span class="nv">forBarMetrics</span><span class="p">:</span> <span class="o">.</span><span class="kt">Default</span><span class="p">)</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">shadowImage</span> <span class="o">=</span> <span class="kt">UIImage</span><span class="p">()</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">translucent</span> <span class="o">=</span> <span class="kc">true</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">tintColor</span> <span class="o">=</span> <span class="o">.</span><span class="nf">whiteColor</span><span class="p">()</span>
|
||||
|
||||
<span class="c1">// set font</span>
|
||||
<span class="k">if</span> <span class="k">let</span> <span class="nv">font</span> <span class="o">=</span> <span class="kt">UIFont</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="o"><</span><span class="kt">Font</span> <span class="n">name</span><span class="o">></span> <span class="p">,</span> <span class="nv">size</span><span class="p">:</span> <span class="mi">18</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="kt">UINavigationBar</span><span class="o">.</span><span class="nf">appearance</span><span class="p">()</span><span class="o">.</span><span class="n">titleTextAttributes</span> <span class="o">=</span> <span class="p">[</span>
|
||||
<span class="kt">NSForegroundColorAttributeName</span> <span class="p">:</span> <span class="kt">UIColor</span><span class="o">.</span><span class="nf">whiteColor</span><span class="p">(),</span>
|
||||
<span class="kt">NSFontAttributeName</span> <span class="p">:</span> <span class="n">font</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
<a href='#about' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='about'>About</h2>
|
||||
|
||||
<p>The project maintained by <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">app development agency</a> <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">Ramotion Inc.</a>
|
||||
See our other <a href="https://github.com/ramotion">open-source projects</a> or <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=preview-transition">hire</a> us to design, develop, and grow your product.</p>
|
||||
|
||||
<p><a href="https://twitter.com/intent/tweet?text=https://github.com/ramotion/preview-transition"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter URL"></a>
|
||||
<a href="https://twitter.com/ramotion"><img src="https://img.shields.io/twitter/follow/ramotion.svg?style=social" alt="Twitter Follow"></a></p>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
window.jazzy = {'docset': false}
|
||||
if (typeof window.dash != 'undefined') {
|
||||
document.documentElement.className += ' dash'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
if (navigator.userAgent.match(/xcode/i)) {
|
||||
document.documentElement.className += ' xcode'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
|
||||
// On doc load, toggle the URL hash discussion if present
|
||||
$(document).ready(function() {
|
||||
if (!window.jazzy.docset) {
|
||||
var linkToHash = $('a[href="' + window.location.hash +'"]');
|
||||
linkToHash.trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
// On token click, toggle its discussion and animate token.marginLeft
|
||||
$(".token").click(function(event) {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var link = $(this);
|
||||
var animationDuration = 300;
|
||||
var tokenOffset = "15px";
|
||||
var original = link.css('marginLeft') == tokenOffset;
|
||||
link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
|
||||
$content = link.parent().parent().next();
|
||||
$content.slideToggle(animationDuration);
|
||||
|
||||
// Keeps the document from jumping to the hash.
|
||||
var href = $(this).attr('href');
|
||||
if (history.pushState) {
|
||||
history.pushState({}, '', href);
|
||||
} else {
|
||||
location.hash = href;
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
DemoTableViewController.swift
|
||||
public class DemoTableViewController: PTTableViewController
|
||||
public class DemoTableViewController : PTTableViewController
|
||||
DemoDetailViewController.swift
|
||||
public class DemoDetailViewController: PTDetailViewController
|
||||
public class DemoDetailViewController : PTDetailViewController
|
||||
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 13 MiB |
|
After Width: | Height: | Size: 7.4 MiB |