Skip to content

Commit fc3c90a

Browse files
authored
Merge pull request #169 from 0xLeif/develop
2.1.0
2 parents e7332f8 + 79bc383 commit fc3c90a

File tree

3 files changed

+74
-20
lines changed

3 files changed

+74
-20
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// HScroll.swift
3+
// SwiftUIKit
4+
//
5+
// Created by Zach Eriksen on 9/1/20.
6+
//
7+
8+
import UIKit
9+
10+
@available(iOS 9.0, *)
11+
public class HScroll: UIView {
12+
13+
public init(withPadding padding: Float = 0,
14+
_ closure: () -> UIView) {
15+
super.init(frame: .zero)
16+
17+
let scrollableView = closure()
18+
19+
let scrollView = ScrollView {
20+
scrollableView
21+
}
22+
23+
embed {
24+
scrollView
25+
}
26+
.configure { parentView in
27+
NSLayoutConstraint.activate([
28+
scrollableView.topAnchor.constraint(equalTo: parentView.topAnchor, constant: CGFloat(padding)),
29+
scrollableView.bottomAnchor.constraint(equalTo: parentView.bottomAnchor, constant: CGFloat(-padding))
30+
])
31+
}
32+
}
33+
34+
required init?(coder: NSCoder) {
35+
fatalError("init(coder:) has not been implemented")
36+
}
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// VScroll.swift
3+
// SwiftUIKit
4+
//
5+
// Created by Zach Eriksen on 9/1/20.
6+
//
7+
8+
import UIKit
9+
10+
@available(iOS 9.0, *)
11+
public class VScroll: UIView {
12+
13+
public init(withPadding padding: Float = 0,
14+
_ closure: () -> UIView) {
15+
super.init(frame: .zero)
16+
17+
let scrollableView = closure()
18+
19+
let scrollView = ScrollView {
20+
scrollableView
21+
}
22+
23+
embed {
24+
scrollView
25+
}
26+
.configure { parentView in
27+
NSLayoutConstraint.activate([
28+
scrollableView.leadingAnchor.constraint(equalTo: parentView.leadingAnchor, constant: CGFloat(padding)),
29+
scrollableView.trailingAnchor.constraint(equalTo: parentView.trailingAnchor, constant: CGFloat(-padding))
30+
])
31+
}
32+
}
33+
34+
required init?(coder: NSCoder) {
35+
fatalError("init(coder:) has not been implemented")
36+
}
37+
}

SwiftUIKit_ccpods.podspec

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

0 commit comments

Comments
 (0)