Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
/Pods
/Podfile.lock
.DS_Store

# Swift PM
Package.resolved

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
.swiftpm

.build/
Binary file not shown.
17 changes: 4 additions & 13 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ScrollStackController",
platforms: [.iOS(.v11)],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "ScrollStackController",
targets: ["ScrollStackController"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
targets: ["ScrollStackController"]
),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "ScrollStackController",
dependencies: []),
.testTarget(
name: "ScrollStackControllerTests",
dependencies: ["ScrollStackController"]),
dependencies: []
),
]
)
3 changes: 3 additions & 0 deletions Sources/ScrollStackController/ScrollStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
/// Remove all existing rows and put in place the new list based upon passed views.
///
/// - Parameter views: views to set.
@discardableResult
open func setRows(views: [UIView]) -> [ScrollStackRow] {
removeAllRows(animated: false)
return addRows(views: views)
Expand All @@ -267,6 +268,7 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
/// - location: location inside the stack of the new row.
/// - animated: `true` to animate operation, by default is `false`.
/// - completion: completion: optional completion callback to call at the end of insertion.
@discardableResult
open func addRow(view: UIView, at location: InsertLocation = .bottom, animated: Bool = false, completion: (() -> Void)? = nil) -> ScrollStackRow? {
guard let index = indexForLocation(location) else {
return nil
Expand All @@ -280,6 +282,7 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
/// - Parameter controllers: controllers to add as rows.
/// - Parameter location: location inside the stack of the new row.
/// - Parameter animated: `true` to animate operatio, by default is `false`.
@discardableResult
open func addRows(views: [UIView], at location: InsertLocation = .bottom, animated: Bool = false) -> [ScrollStackRow] {
enumerateItems(views, insertAt: location) {
addRow(view: $0, at: location, animated: animated)
Expand Down