GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - FluidGroup/StackScrollView: 📋 iOS Form UI Builder in Swift (powered by UICollectionView)

BranchesTags
Open more actions menu

Latest commit

 

History

91 Commits
91 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
PinFlexLayoutDemo
PinFlexLayoutDemo
 
 
Resources
Resources
 
 
StackScrollView-Demo
StackScrollView-Demo
 
 
StackScrollView.xcodeproj
StackScrollView.xcodeproj
 
 
StackScrollView.xcworkspace
StackScrollView.xcworkspace
 
 
StackScrollView
StackScrollView
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Package.swift
Package.swift
 
 
Podfile
Podfile
 
 
Podfile.lock
Podfile.lock
 
 
README.md
README.md
 
 
StackScrollView.podspec
StackScrollView.podspec
 
 

Repository files navigation

StackScrollView

CI Status Version License Platform Carthage compatible

⚠️ This sample is using demo-components. StackScrollView does not have default-components. StackScrollView is like UIStackView. So, we need to create the components we need.

What is this?

StackScrollView builds form UI easily.

StackScrollView includes UICollectionView. UICollectionView calculates size of view by AutoLayout, then that display. (Use systemLayoutSizeFitting)

  • We call StackCell instead of Cell on StackScrollView.
  • We no longer need to consider reusing Cells.
  • StackCell requires constraint based layout.

Usage

Basic usage

let stack = StackScrollView()

stack.append(view: ...)

stack.remove(view: ..., animated: true)

APIs

StackScrollView

func append(view: UIView)
func remove(view: UIView, animated: Bool)
func scroll(to view: UIView, at position: UICollectionViewScrollPosition, animated: Bool)

StackCellType

StackScrollView does not required StackCellType. if StackCell has StackCellType, be easy that control StackCell.

func scrollToSelf(animated: Bool)
func scrollToSelf(at position: UICollectionViewScrollPosition, animated: Bool)
func updateLayout(animated: Bool)
func remove()

Demo has included this APIs usage.

Create CustomCell from Code

We have to set constraints completely.

final class LabelStackCell: UIView {
  
  private let label = UILabel()
  
  init(title: String) {
    super.init(frame: .zero)
    
    addSubview(label)
    label.translatesAutoresizingMaskIntoConstraints = false
    
    label.topAnchor.constraint(greaterThanOrEqualTo: topAnchor, constant: 8).isActive = true
    label.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: 8).isActive = true
    label.rightAnchor.constraint(equalTo: rightAnchor, constant: 8).isActive = true
    label.leftAnchor.constraint(equalTo: leftAnchor, constant: 8).isActive = true
    label.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
    heightAnchor.constraint(greaterThanOrEqualToConstant: 40).isActive = true
    
    label.font = UIFont.preferredFont(forTextStyle: .body)
    label.text = title
  }
}
let stack = StackScrollView()
stack.append(view: LabelStackCell(title: "Label"))

Create CustomCell from XIB

We can use UIView from XIB.

This framework has NibLoader<T: UIView>. It might be useful for you.

Create everything

You can create any Cell. Please, check StackScrollView-Demo

ManualLayout

You can create Cell with ManualLayout.

If you use ManualLayout, the Cell have to use ManualLayoutStackCellType. Then, return self-size based on maximum size in size(maxWidth:maxHeight)

Author

muukii, [email protected]

License

StackScrollView is available under the MIT license. See the LICENSE file for more info.

About

📋 iOS Form UI Builder in Swift (powered by UICollectionView)

Topics

formuicollectionviewuistackviewuistackview-scrollable

Resources

Readme
MIT license
Activity
Custom properties

Stars

416 stars

Watchers

11 watching

Forks

30 forks
Report repository

Releases

Sponsor this project

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.