Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It become unstable behavior when implement UITableViewDelegate method that return estimatedHeight #50

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Example/Example/Source/View/CustomCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="1Yt-G9-XLh">
<rect key="frame" x="16" y="12" width="288" height="29"/>
<rect key="frame" x="16" y="20" width="288" height="12.5"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="1Yt-G9-XLh" secondAttribute="trailing" constant="16" id="16y-Fk-ZGr"/>
<constraint firstItem="1Yt-G9-XLh" firstAttribute="top" secondItem="Nkn-4U-4HG" secondAttribute="top" constant="12" id="4TM-hJ-T41"/>
<constraint firstAttribute="bottom" secondItem="1Yt-G9-XLh" secondAttribute="bottom" constant="12" id="Uss-nM-AFy"/>
<constraint firstItem="1Yt-G9-XLh" firstAttribute="top" secondItem="Nkn-4U-4HG" secondAttribute="top" constant="20" id="4TM-hJ-T41"/>
<constraint firstAttribute="bottom" secondItem="1Yt-G9-XLh" secondAttribute="bottom" constant="20" id="Uss-nM-AFy"/>
<constraint firstItem="1Yt-G9-XLh" firstAttribute="leading" secondItem="Nkn-4U-4HG" secondAttribute="leading" constant="16" id="whD-KL-Wuu"/>
</constraints>
</tableViewCellContentView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="67" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="BcM-CL-hAq">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="BcM-CL-hAq">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</tableView>
Expand Down Expand Up @@ -64,7 +64,7 @@
<!--Cell Test View Controller-->
<scene sceneID="jWk-E2-WcO">
<objects>
<viewController storyboardIdentifier="CellTestViewController" id="2il-9E-XWT" customClass="CellTestViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="CellTestViewController" automaticallyAdjustsScrollViewInsets="NO" id="2il-9E-XWT" customClass="CellTestViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="H2Q-pa-LbX"/>
<viewControllerLayoutGuide type="bottom" id="Kkh-V3-GNh"/>
Expand All @@ -73,7 +73,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="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vaa-lv-eMm">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vaa-lv-eMm">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</tableView>
Expand Down Expand Up @@ -106,7 +106,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="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" estimatedSectionHeaderHeight="-1" sectionFooterHeight="28" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="vBw-Jz-wwf">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vBw-Jz-wwf">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</tableView>
Expand Down
4 changes: 0 additions & 4 deletions Hakuba/Source/Core/Hakuba.swift
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,6 @@ extension Hakuba: UITableViewDelegate {
return getCellmodel(at: indexPath)?.height ?? 0
}

public func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return self.tableView(tableView, heightForRowAt: indexPath)
}

public func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
return cellForRow(at: indexPath)?.willSelect(tableView, at: indexPath)
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Features
-----
* Don't have to write the code for `UITableViewDelegate` and `UITableViewDataSource` protocols
* Easy to manage your sections and cells (append/reset/insert/remove/update)
* Support dynamic cell height from **ios7**
* Support UITableViewAutomaticDimension
* Don't have to worry about cell identifier
* Handling cell selection by trailing closure
* Easy to implement header/footer view (floating callback)
Expand Down