Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift scrollview auto fit content height

CGRect contentRect = CGRectZero;

for (UIView *view in self.scrollView.subviews) {
    contentRect = CGRectUnion(contentRect, view.frame);
}
self.scrollView.contentSize = contentRect.size;
Comment

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
Comment

PREVIOUS NEXT
Code Example
Swift :: simple alert swifti 
Swift :: xcode how to know which textfield is selected 
Swift :: sf symbols 
Swift :: uitextview text alignment 
Swift :: Swift Remove an Element from an Array 
Swift :: hello world in swift 
Swift :: ForEach tabs swiftui 
Swift :: swift add navigation bar 
Swift :: swift set keyboard next functionality 
Swift :: How to convert String into Array of character 
Swift :: Function Inside Swift Struct 
Swift :: Swift Loop Over Array 
Swift :: swift enum nib 
Swift :: Swift Handling Errors Using do-catch Statement 
Swift :: how to send a file from file manager in mail swift 
Swift :: table view content size not return correctly 
Swift :: abs swift 
Swift :: Swift Autoclosure 
Swift :: swift md5 cryptokit 
Swift :: Closure as function parameter 
Swift :: Example: Multiple Return Values 
Swift :: change textview link color swift 
Swift :: how to use IBOutlet variables as static in swift 
Swift :: jsonserialization swift 
Swift :: secure password field in textfield swift 
Swift :: swift class init 
Swift :: .next() enum swift 
Ruby :: ruby get current datetime utc 
Ruby :: ruby memory location 
Ruby :: rails get source method 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =