Skip to content

Commit f19499a

Browse files
authored
Merge pull request #19 from rmnblm/develop
@discardableResult in setRows/addRow/addRows, remove .swiftpm, cleanup of Package.swift
2 parents 10bec3f + f7eedf0 commit f19499a

4 files changed

Lines changed: 56 additions & 13 deletions

File tree

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
11
/Pods
22
/Podfile.lock
33
.DS_Store
4+
5+
# Swift PM
6+
Package.resolved
7+
8+
## User settings
9+
xcuserdata/
10+
11+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
12+
*.xcscmblueprint
13+
*.xccheckout
14+
15+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
16+
build/
17+
DerivedData/
18+
*.moved-aside
19+
*.pbxuser
20+
!default.pbxuser
21+
*.mode1v3
22+
!default.mode1v3
23+
*.mode2v3
24+
!default.mode2v3
25+
*.perspectivev3
26+
!default.perspectivev3
27+
28+
## Obj-C/Swift specific
29+
*.hmap
30+
31+
## App packaging
32+
*.ipa
33+
*.dSYM.zip
34+
*.dSYM
35+
36+
## Playgrounds
37+
timeline.xctimeline
38+
playground.xcworkspace
39+
40+
# Swift Package Manager
41+
#
42+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
43+
# Packages/
44+
# Package.pins
45+
# Package.resolved
46+
# *.xcodeproj
47+
#
48+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
49+
# hence it is not needed unless you have added a package configuration file to your project
50+
.swiftpm
51+
52+
.build/
Binary file not shown.

Package.swift

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
// swift-tools-version:5.3
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

65
let package = Package(
76
name: "ScrollStackController",
87
platforms: [.iOS(.v11)],
98
products: [
10-
// Products define the executables and libraries produced by a package, and make them visible to other packages.
119
.library(
1210
name: "ScrollStackController",
13-
targets: ["ScrollStackController"]),
14-
],
15-
dependencies: [
16-
// Dependencies declare other packages that this package depends on.
17-
// .package(url: /* package url */, from: "1.0.0"),
11+
targets: ["ScrollStackController"]
12+
),
1813
],
1914
targets: [
20-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2215
.target(
2316
name: "ScrollStackController",
24-
dependencies: []),
25-
.testTarget(
26-
name: "ScrollStackControllerTests",
27-
dependencies: ["ScrollStackController"]),
17+
dependencies: []
18+
),
2819
]
2920
)

Sources/ScrollStackController/ScrollStack.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
253253
/// Remove all existing rows and put in place the new list based upon passed views.
254254
///
255255
/// - Parameter views: views to set.
256+
@discardableResult
256257
open func setRows(views: [UIView]) -> [ScrollStackRow] {
257258
removeAllRows(animated: false)
258259
return addRows(views: views)
@@ -267,6 +268,7 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
267268
/// - location: location inside the stack of the new row.
268269
/// - animated: `true` to animate operation, by default is `false`.
269270
/// - completion: completion: optional completion callback to call at the end of insertion.
271+
@discardableResult
270272
open func addRow(view: UIView, at location: InsertLocation = .bottom, animated: Bool = false, completion: (() -> Void)? = nil) -> ScrollStackRow? {
271273
guard let index = indexForLocation(location) else {
272274
return nil
@@ -280,6 +282,7 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
280282
/// - Parameter controllers: controllers to add as rows.
281283
/// - Parameter location: location inside the stack of the new row.
282284
/// - Parameter animated: `true` to animate operatio, by default is `false`.
285+
@discardableResult
283286
open func addRows(views: [UIView], at location: InsertLocation = .bottom, animated: Bool = false) -> [ScrollStackRow] {
284287
enumerateItems(views, insertAt: location) {
285288
addRow(view: $0, at: location, animated: animated)

0 commit comments

Comments
 (0)