Skip to content

Commit

Permalink
feat: Update example with UITableView with automatic dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanpe Catalán committed Feb 14, 2018
1 parent e89de65 commit 1459828
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="120" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="UCB-SP-lQk">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="UCB-SP-lQk">
<rect key="frame" x="0.0" y="263" width="375" height="264"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" red="0.1061807256" green="0.84678786989999999" blue="0.031482450150000001" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
Expand Down Expand Up @@ -207,7 +207,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-482" y="-6"/>
<point key="canvasLocation" x="-897" y="-376"/>
</scene>
</scenes>
<resources>
Expand Down
7 changes: 7 additions & 0 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class ViewController: UIViewController {
return skeletonTypeSelector.selectedSegmentIndex == 0 ? .solid : .gradient
}

override func viewDidLoad() {
super.viewDidLoad()
tableview.isSkeletonable = true
tableview.rowHeight = UITableViewAutomaticDimension
tableview.estimatedRowHeight = 200
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
view.showAnimatedSkeleton()
Expand Down

0 comments on commit 1459828

Please sign in to comment.