Skip to content

Commit 65119b2

Browse files
committed
Merge branch 'release/1.1.0'
2 parents dc86626 + d89f9b8 commit 65119b2

File tree

16 files changed

+312
-162
lines changed

16 files changed

+312
-162
lines changed

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Configs/ScrollStackController.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>$(MARKETING_VERSION)</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:5.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

README.md

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

233234
[↑ Back To Top](#index)
234235

236+
<a name="customanimations"/>
237+
238+
### Hide / Show Rows with custom animations
239+
240+
You can easily show or hide rows with any custom transition; your view controller just need to be conform to the `ScrollStackRowAnimatable` protocol.
241+
This protocol defines a set of animation infos (duration, delay, spring etc.) and two events you can override to perform actions:
242+
243+
```swift
244+
public protocol ScrollStackRowAnimatable {
245+
/// Animation main info.
246+
var animationInfo: ScrollStackAnimationInfo { get }
247+
248+
/// Animation will start to hide or show the row.
249+
func willBeginAnimationTransition(toHide: Bool)
250+
251+
/// Animation to hide/show the row did end.
252+
func didEndAnimationTransition(toHide: Bool)
253+
254+
/// Animation transition.
255+
func animateTransition(toHide: Bool)
256+
}
257+
```
258+
259+
So for example you can replicate the following animation:
260+
261+
![](./Resources/custom_transition.gif)
262+
263+
by using the following code:
264+
265+
```swift
266+
extension WelcomeVC: ScrollStackRowAnimatable {
267+
public var animationInfo: ScrollStackAnimationInfo {
268+
return ScrollStackAnimationInfo(duration: 1, delay: 0, springDamping: 0.8)
269+
}
270+
271+
public func animateTransition(toHide: Bool) {
272+
switch toHide {
273+
case true:
274+
self.view.transform = CGAffineTransform(translationX: -100, y: 0)
275+
self.view.alpha = 0
276+
277+
case false:
278+
self.view.transform = .identity
279+
self.view.alpha = 1
280+
}
281+
}
282+
283+
public func willBeginAnimationTransition(toHide: Bool) {
284+
if toHide == false {
285+
self.view.transform = CGAffineTransform(translationX: -100, y: 0)
286+
self.view.alpha = 0
287+
}
288+
}
289+
290+
}
291+
```
292+
235293
<a name="reloadrows"/>
236294

237295
### Reload Rows

Resources/custom_transition.gif

898 KB
Loading

ScrollStackController.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "ScrollStackController"
3-
s.version = "1.0.3"
3+
s.version = "1.1.0"
44
s.summary = "Create complex scrollable layout using UIViewController and simplify your code"
55
s.homepage = "https://github.com/malcommac/ScrollStackController"
66
s.license = { :type => "MIT", :file => "LICENSE" }

ScrollStackController.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
6402E1F22347A8540087963C /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6402E1F12347A8540087963C /* Extension.swift */; };
1212
647C77B32348EA1600CAEB9F /* PricingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 647C77B22348EA1600CAEB9F /* PricingVC.swift */; };
1313
6489C0612349C571003E5344 /* NotesVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6489C0602349C571003E5344 /* NotesVC.swift */; };
14+
649B1E9223B1251400BD6BFD /* ScrollStackRowAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */; };
15+
649B1E9323B1251900BD6BFD /* ScrollStackRowAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */; };
1416
64A8E8B32348CCCE00E893FB /* WelcomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64A8E8B02348CCCE00E893FB /* WelcomeVC.swift */; };
1517
64C02255234735A800A6D844 /* ScrollStackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64C0224F234735A800A6D844 /* ScrollStackViewController.swift */; };
1618
64C02257234735A800A6D844 /* ScrollStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64C02250234735A800A6D844 /* ScrollStack.swift */; };
@@ -50,6 +52,7 @@
5052
6402E1F12347A8540087963C /* Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extension.swift; sourceTree = "<group>"; };
5153
647C77B22348EA1600CAEB9F /* PricingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PricingVC.swift; sourceTree = "<group>"; };
5254
6489C0602349C571003E5344 /* NotesVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotesVC.swift; sourceTree = "<group>"; };
55+
649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollStackRowAnimator.swift; sourceTree = "<group>"; };
5356
64A8E8B02348CCCE00E893FB /* WelcomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeVC.swift; sourceTree = "<group>"; };
5457
64C0224F234735A800A6D844 /* ScrollStackViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollStackViewController.swift; sourceTree = "<group>"; };
5558
64C02250234735A800A6D844 /* ScrollStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollStack.swift; sourceTree = "<group>"; };
@@ -131,6 +134,7 @@
131134
children = (
132135
64C0228523475A0E00A6D844 /* ScrollStack+Protocols.swift */,
133136
64C02253234735A800A6D844 /* UIView+AutoLayout_Extensions.swift */,
137+
649B1E9123B1251400BD6BFD /* ScrollStackRowAnimator.swift */,
134138
);
135139
path = Support;
136140
sourceTree = "<group>";
@@ -346,6 +350,7 @@
346350
64C02259234735A800A6D844 /* ScrollStackRow.swift in Sources */,
347351
64C02255234735A800A6D844 /* ScrollStackViewController.swift in Sources */,
348352
64C02257234735A800A6D844 /* ScrollStack.swift in Sources */,
353+
649B1E9223B1251400BD6BFD /* ScrollStackRowAnimator.swift in Sources */,
349354
64C0225D234735A800A6D844 /* UIView+AutoLayout_Extensions.swift in Sources */,
350355
64C0225B234735A800A6D844 /* ScrollStackSeparator.swift in Sources */,
351356
);
@@ -371,6 +376,7 @@
371376
64C0226C2347360800A6D844 /* ViewController.swift in Sources */,
372377
64C022812347582D00A6D844 /* ScrollStackSeparator.swift in Sources */,
373378
64C0227E2347582D00A6D844 /* ScrollStack.swift in Sources */,
379+
649B1E9323B1251900BD6BFD /* ScrollStackRowAnimator.swift in Sources */,
374380
64C022682347360800A6D844 /* AppDelegate.swift in Sources */,
375381
647C77B32348EA1600CAEB9F /* PricingVC.swift in Sources */,
376382
6402E1F22347A8540087963C /* Extension.swift in Sources */,
@@ -529,6 +535,7 @@
529535
APPLICATION_EXTENSION_API_ONLY = YES;
530536
CLANG_ENABLE_MODULES = YES;
531537
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
538+
CURRENT_PROJECT_VERSION = 0;
532539
DEFINES_MODULE = YES;
533540
DYLIB_COMPATIBILITY_VERSION = 1;
534541
DYLIB_CURRENT_VERSION = 1;
@@ -537,6 +544,7 @@
537544
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
538545
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
539546
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
547+
MARKETING_VERSION = 1.1.0;
540548
ONLY_ACTIVE_ARCH = NO;
541549
PRODUCT_BUNDLE_IDENTIFIER = "com.ScrollStackController.ScrollStackController-iOS";
542550
PRODUCT_NAME = ScrollStackController;
@@ -552,6 +560,7 @@
552560
APPLICATION_EXTENSION_API_ONLY = YES;
553561
CLANG_ENABLE_MODULES = YES;
554562
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
563+
CURRENT_PROJECT_VERSION = 0;
555564
DEFINES_MODULE = YES;
556565
DYLIB_COMPATIBILITY_VERSION = 1;
557566
DYLIB_CURRENT_VERSION = 1;
@@ -560,6 +569,7 @@
560569
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
561570
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
562571
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
572+
MARKETING_VERSION = 1.1.0;
563573
PRODUCT_BUNDLE_IDENTIFIER = "com.ScrollStackController.ScrollStackController-iOS";
564574
PRODUCT_NAME = ScrollStackController;
565575
SKIP_INSTALL = YES;

ScrollStackController.xcodeproj/xcshareddata/xcschemes/ScrollStackController-tvOS.xcscheme

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)