Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift scrollview auto fit content height

let contentRect: CGRect = scrollView.subviews.reduce(into: .zero) { rect, view in
    rect = rect.union(view.frame)
}
scrollView.contentSize = contentRect.size
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #scrollview #auto #fit #content #height
ADD COMMENT
Topic
Name
3+3 =