Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed Dec 24, 2019
2 parents dc86626 + d89f9b8 commit 65119b2
Show file tree
Hide file tree
Showing 16 changed files with 312 additions and 162 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion Configs/ScrollStackController.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can think of it as `UITableView` but with several differences:
|--- |--------------------------------------------------------------------------------- |
| 🕺 | Create complex layout without the boilerplate required by view recyling of `UICollectionView` or `UITableView`. |
| 🧩 | Simplify your architecture by thinking each screen as a separate-indipendent `UIVIewController`. |
| 🌈 | Animate show/hide and resize of rows easily! |
| 🌈 | Animate show/hide and resize of rows easily even with custom animations! |
|| Compact code base, less than 1k LOC with no external dependencies. |
| 🎯 | Easy to use and extensible APIs set. |
| 🧬 | It uses standard UIKit components at its core. No magic, just a combination of `UIScrollView`+`UIStackView`. |
Expand All @@ -42,6 +42,7 @@ You can think of it as `UITableView` but with several differences:
- [Removing / Replacing Rows](#removingreplacingrows)
- [Move Rows](#moverows)
- [Hide / Show Rows](#hideshowrows)
- [Hide / Show Rows with custom animations](#customanimations)
- [Reload Rows](#reloadrows)
- [Sizing Rows](#sizingrows)
- [Fixed Row Size](#fixedrowsize)
Expand Down Expand Up @@ -232,6 +233,63 @@ Keep in mind: when you hide a rows the row still part of the stack and it's not

[↑ Back To Top](#index)

<a name="customanimations"/>

### Hide / Show Rows with custom animations

You can easily show or hide rows with any custom transition; your view controller just need to be conform to the `ScrollStackRowAnimatable` protocol.
This protocol defines a set of animation infos (duration, delay, spring etc.) and two events you can override to perform actions:

```swift
public protocol ScrollStackRowAnimatable {
/// Animation main info.
var animationInfo: ScrollStackAnimationInfo { get }

/// Animation will start to hide or show the row.
func willBeginAnimationTransition(toHide: Bool)

/// Animation to hide/show the row did end.
func didEndAnimationTransition(toHide: Bool)

/// Animation transition.
func animateTransition(toHide: Bool)
}
```

So for example you can replicate the following animation:

![](./Resources/custom_transition.gif)

by using the following code:

```swift
extension WelcomeVC: ScrollStackRowAnimatable {
public var animationInfo: ScrollStackAnimationInfo {
return ScrollStackAnimationInfo(duration: 1, delay: 0, springDamping: 0.8)
}

public func animateTransition(toHide: Bool) {
switch toHide {
case true:
self.view.transform = CGAffineTransform(translationX: -100, y: 0)
self.view.alpha = 0

case false:
self.view.transform = .identity
self.view.alpha = 1
}
}

public func willBeginAnimationTransition(toHide: Bool) {
if toHide == false {
self.view.transform = CGAffineTransform(translationX: -100, y: 0)
self.view.alpha = 0
}
}

}
```

<a name="reloadrows"/>

### Reload Rows
Expand Down
Binary file added Resources/custom_transition.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ScrollStackController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ScrollStackController"
s.version = "1.0.3"
s.version = "1.1.0"
s.summary = "Create complex scrollable layout using UIViewController and simplify your code"
s.homepage = "https://github.com/malcommac/ScrollStackController"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
10 changes: 10 additions & 0 deletions ScrollStackController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
6402E1F22347A8540087963C /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6402E1F12347A8540087963C /* Extension.swift */; };
647C77B32348EA1600CAEB9F /* PricingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 647C77B22348EA1600CAEB9F /* PricingVC.swift */; };
6489C0612349C571003E5344 /* NotesVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6489C0602349C571003E5344 /* NotesVC.swift */; };
649B1E9223B1251400BD6BFD /* ScrollStackRowAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */; };
649B1E9323B1251900BD6BFD /* ScrollStackRowAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */; };
64A8E8B32348CCCE00E893FB /* WelcomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64A8E8B02348CCCE00E893FB /* WelcomeVC.swift */; };
64C02255234735A800A6D844 /* ScrollStackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64C0224F234735A800A6D844 /* ScrollStackViewController.swift */; };
64C02257234735A800A6D844 /* ScrollStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64C02250234735A800A6D844 /* ScrollStack.swift */; };
Expand Down Expand Up @@ -50,6 +52,7 @@
6402E1F12347A8540087963C /* Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extension.swift; sourceTree = "<group>"; };
647C77B22348EA1600CAEB9F /* PricingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PricingVC.swift; sourceTree = "<group>"; };
6489C0602349C571003E5344 /* NotesVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotesVC.swift; sourceTree = "<group>"; };
649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollStackRowAnimator.swift; sourceTree = "<group>"; };
64A8E8B02348CCCE00E893FB /* WelcomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeVC.swift; sourceTree = "<group>"; };
64C0224F234735A800A6D844 /* ScrollStackViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollStackViewController.swift; sourceTree = "<group>"; };
64C02250234735A800A6D844 /* ScrollStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollStack.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -131,6 +134,7 @@
children = (
64C0228523475A0E00A6D844 /* ScrollStack+Protocols.swift */,
64C02253234735A800A6D844 /* UIView+AutoLayout_Extensions.swift */,
649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */,
);
path = Support;
sourceTree = "<group>";
Expand Down Expand Up @@ -346,6 +350,7 @@
64C02259234735A800A6D844 /* ScrollStackRow.swift in Sources */,
64C02255234735A800A6D844 /* ScrollStackViewController.swift in Sources */,
64C02257234735A800A6D844 /* ScrollStack.swift in Sources */,
649B1E9223B1251400BD6BFD /* ScrollStackRowAnimator.swift in Sources */,
64C0225D234735A800A6D844 /* UIView+AutoLayout_Extensions.swift in Sources */,
64C0225B234735A800A6D844 /* ScrollStackSeparator.swift in Sources */,
);
Expand All @@ -371,6 +376,7 @@
64C0226C2347360800A6D844 /* ViewController.swift in Sources */,
64C022812347582D00A6D844 /* ScrollStackSeparator.swift in Sources */,
64C0227E2347582D00A6D844 /* ScrollStack.swift in Sources */,
649B1E9323B1251900BD6BFD /* ScrollStackRowAnimator.swift in Sources */,
64C022682347360800A6D844 /* AppDelegate.swift in Sources */,
647C77B32348EA1600CAEB9F /* PricingVC.swift in Sources */,
6402E1F22347A8540087963C /* Extension.swift in Sources */,
Expand Down Expand Up @@ -529,6 +535,7 @@
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 0;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -537,6 +544,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.1.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.ScrollStackController.ScrollStackController-iOS";
PRODUCT_NAME = ScrollStackController;
Expand All @@ -552,6 +560,7 @@
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 0;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -560,6 +569,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.ScrollStackController.ScrollStackController-iOS";
PRODUCT_NAME = ScrollStackController;
SKIP_INSTALL = YES;
Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>ScrollStackController-tvOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>ScrollStackControllerDemo.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
Expand Down
Loading

0 comments on commit 65119b2

Please sign in to comment.