detroit-labs / sheetpresentation Goto Github PK
View Code? Open in Web Editor NEWA UIPresentationController and attendant clases for iOS to present a view controller pinned to the bottom of the screen like an action sheet.
License: MIT License
A UIPresentationController and attendant clases for iOS to present a view controller pinned to the bottom of the screen like an action sheet.
License: MIT License
Thank you for your awesome work.
I found there is a use-case that cause the height always is 0 when using UIScrollView inside the sheet ViewController. Could you please help to take a look and suggest how to fix it properly?
Below is the sample ScrollView within ViewController. This ViewController works normal with default presentation.
import UIKit
final class Label: UILabel {
init(_ text: String) {
super.init(frame: .zero)
self.text = text
textColor = .darkText
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
final class SampleScrollViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let scrollView = UIScrollView()
let stackView = UIStackView(arrangedSubviews: (1...10).map { Label("Text \($0)") })
stackView.axis = .vertical
stackView.spacing = 8
scrollView.addSubview(stackView)
view.addSubview(scrollView)
stackView.translatesAutoresizingMaskIntoConstraints = false
scrollView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
stackView.topAnchor.constraint(equalTo: scrollView.topAnchor),
stackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor),
stackView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor),
stackView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor),
stackView.widthAnchor.constraint(equalTo: view.widthAnchor),
])
NSLayoutConstraint.activate([
scrollView.topAnchor.constraint(equalTo: view.topAnchor),
scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
])
}
}
This enum case cannot have an availability clause given the current package configuration.
See the discussion here and the swift bug.
The other option, besides removing the clause, is to update the package base to iOS 11 (it is currently ios 10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.