From 02799a28b2131963a1e1725d1a9fadcb79a94fe4 Mon Sep 17 00:00:00 2001 From: Jin Wang Date: Wed, 22 Feb 2017 14:11:47 +1100 Subject: [PATCH] Updated the example to enable toggling between scrolling direction. --- .../Source/AnimatorTableViewController.swift | 3 +++ iOS Example/Source/Base.lproj/Main.storyboard | 21 +++++++++++-------- .../ImageCollectionViewController.swift | 15 ++++++++++--- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/iOS Example/Source/AnimatorTableViewController.swift b/iOS Example/Source/AnimatorTableViewController.swift index d10380e..97f517b 100644 --- a/iOS Example/Source/AnimatorTableViewController.swift +++ b/iOS Example/Source/AnimatorTableViewController.swift @@ -20,6 +20,8 @@ class AnimatorTableViewController: UITableViewController { (TurnAttributeAnimator(), true), (PageAttributeAnimator(), true)] + @IBOutlet weak var isHorizontalScrollToggle: UISwitch! + override func viewDidLoad() { super.viewDidLoad() } @@ -27,6 +29,7 @@ class AnimatorTableViewController: UITableViewController { override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let dist = segue.destination as? ImageCollectionViewController, let indexPath = sender as? IndexPath { dist.animator = animators[indexPath.row] + dist.direction = isHorizontalScrollToggle.isOn ? .horizontal : .vertical } } diff --git a/iOS Example/Source/Base.lproj/Main.storyboard b/iOS Example/Source/Base.lproj/Main.storyboard index 0e0640f..5b389ff 100644 --- a/iOS Example/Source/Base.lproj/Main.storyboard +++ b/iOS Example/Source/Base.lproj/Main.storyboard @@ -32,9 +32,6 @@ - - -