Skip to content

Commit

Permalink
Merge pull request #169 from 0xLeif/develop
Browse files Browse the repository at this point in the history
2.1.0
  • Loading branch information
0xLeif authored Sep 1, 2020
2 parents e7332f8 + 79bc383 commit fc3c90a
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 20 deletions.
37 changes: 37 additions & 0 deletions Sources/SwiftUIKit/Containers/HScroll.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// HScroll.swift
// SwiftUIKit
//
// Created by Zach Eriksen on 9/1/20.
//

import UIKit

@available(iOS 9.0, *)
public class HScroll: UIView {

public init(withPadding padding: Float = 0,
_ closure: () -> UIView) {
super.init(frame: .zero)

let scrollableView = closure()

let scrollView = ScrollView {
scrollableView
}

embed {
scrollView
}
.configure { parentView in
NSLayoutConstraint.activate([
scrollableView.topAnchor.constraint(equalTo: parentView.topAnchor, constant: CGFloat(padding)),
scrollableView.bottomAnchor.constraint(equalTo: parentView.bottomAnchor, constant: CGFloat(-padding))
])
}
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
37 changes: 37 additions & 0 deletions Sources/SwiftUIKit/Containers/VScroll.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// VScroll.swift
// SwiftUIKit
//
// Created by Zach Eriksen on 9/1/20.
//

import UIKit

@available(iOS 9.0, *)
public class VScroll: UIView {

public init(withPadding padding: Float = 0,
_ closure: () -> UIView) {
super.init(frame: .zero)

let scrollableView = closure()

let scrollView = ScrollView {
scrollableView
}

embed {
scrollView
}
.configure { parentView in
NSLayoutConstraint.activate([
scrollableView.leadingAnchor.constraint(equalTo: parentView.leadingAnchor, constant: CGFloat(padding)),
scrollableView.trailingAnchor.constraint(equalTo: parentView.trailingAnchor, constant: CGFloat(-padding))
])
}
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
20 changes: 0 additions & 20 deletions SwiftUIKit_ccpods.podspec

This file was deleted.

0 comments on commit fc3c90a

Please sign in to comment.