StackTextView
A text view that can dynamically adapt to the content size. All UIView
can be stacked in the text view to implement the Facebook-like add-post UI.
The following demo is that UIImageView
and UIButton
are stacked in the text view.
Requirements
- iOS 8.0 or higher
- Swift 3.0 or higher
Installation
pod "StackTextView"
Usage
Import
import StackTextView
StackTextView
The text view that can dynamically adapt to the content size.
var arrangedSubviews: [UIView]
the list of views arranged by the stack text view.
var spacing: CGFloat
the distance in points between the adjacent edges of the stack view’s arranged views. (default 0.0
)
Functions
func addArrangedSubview(UIView)
Adds a view to the end of the arrangedSubviews array.
func insertArrangedSubview(UIView, at: Int)
Adds the provided view to the array of arranged subviews at the specified index.
func removeArrangedSubview(UIView)
Removes the provided view from the stack’s array of arranged subviews.
Apps using StackTextView
If you are using StackTextView in your app and want to be listed here, simply create a pull request.
I am always curious who is using my projects :)
Hikingbook - by Zheng-Xiang Ke
Demo
StackTextViewDemo is a simple demo app which shows the usage of StackTextView.
Author
Zheng-Xiang Ke, [email protected]
License
StackTextView is available under the MIT license. See the LICENSE file for more info.