diff --git a/Tablet.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate b/Tablet.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate index 6ab9c7e..bb497d2 100644 Binary files a/Tablet.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate and b/Tablet.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Tablet/TableRowBuilder.swift b/Tablet/TableRowBuilder.swift index 1cf6335..b101ddc 100644 --- a/Tablet/TableRowBuilder.swift +++ b/Tablet/TableRowBuilder.swift @@ -164,6 +164,24 @@ public class TablePrototypeRowBuilder CGFloat { return UITableViewAutomaticDimension } + + func heightCall(item: DataType, width: CGFloat) -> CGFloat { + + guard let cell = prototypeCell else { return 0 } + + cell.bounds = CGRectMake(0, 0, width, cell.bounds.height) + + cell.configure(item) + + cell.setNeedsLayout() + cell.layoutIfNeeded() + + return cell.contentView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize).height + 1 + } + + // прехит по мере скроллинга в бэк + // прехит не должен прехитить то что уже есть (показанное) + // по мере скроллинга уметь отменять перхит () public override func rowHeight(index: Int) -> CGFloat { @@ -172,22 +190,11 @@ public class TablePrototypeRowBuilder AnyObject? { if case .configure = action { diff --git a/TabletDemo/Classes/Presentation/Views/StoryboardImageTableViewCell.swift b/TabletDemo/Classes/Presentation/Views/StoryboardImageTableViewCell.swift index 5a848f6..498d200 100644 --- a/TabletDemo/Classes/Presentation/Views/StoryboardImageTableViewCell.swift +++ b/TabletDemo/Classes/Presentation/Views/StoryboardImageTableViewCell.swift @@ -30,7 +30,7 @@ class StoryboardImageTableViewCell: UITableViewCell, ConfigurableCell { override func layoutSubviews() { super.layoutSubviews() - //contentView.layoutIfNeeded() + contentView.layoutIfNeeded() subtitleLabel.preferredMaxLayoutWidth = subtitleLabel.bounds.size.width } diff --git a/TabletDemo/TabletDemo.xcodeproj/project.pbxproj b/TabletDemo/TabletDemo.xcodeproj/project.pbxproj index 0a8c7bf..5b1d76e 100644 --- a/TabletDemo/TabletDemo.xcodeproj/project.pbxproj +++ b/TabletDemo/TabletDemo.xcodeproj/project.pbxproj @@ -7,9 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 5058386B1CF6189D00224C58 /* Tablet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5058386A1CF6189D00224C58 /* Tablet.framework */; }; + 5058386C1CF6189D00224C58 /* Tablet.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5058386A1CF6189D00224C58 /* Tablet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; DA08A0531CF4E9B500BBF1F8 /* StoryboardImageTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA08A0521CF4E9B500BBF1F8 /* StoryboardImageTableViewCell.swift */; }; - DA539C901CF50E9900368ACB /* Tablet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA539C8F1CF50E9900368ACB /* Tablet.framework */; }; - DA539C911CF50E9900368ACB /* Tablet.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA539C8F1CF50E9900368ACB /* Tablet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; DAC2D5CA1C9D303E009E9C19 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC2D5C91C9D303E009E9C19 /* AppDelegate.swift */; }; DAC2D5CF1C9D30A7009E9C19 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DAC2D5CD1C9D30A7009E9C19 /* Main.storyboard */; }; DAC2D5D01C9D30A7009E9C19 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DAC2D5CE1C9D30A7009E9C19 /* LaunchScreen.storyboard */; }; @@ -26,7 +26,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - DA539C911CF50E9900368ACB /* Tablet.framework in Embed Frameworks */, + 5058386C1CF6189D00224C58 /* Tablet.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -34,8 +34,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 5058386A1CF6189D00224C58 /* Tablet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Tablet.framework; path = "/Users/max/Library/Developer/Xcode/DerivedData/Tablet-bomgsgklcxthxkeamvdbfmrhqnno/Build/Products/Debug-iphonesimulator/Tablet.framework"; sourceTree = ""; }; DA08A0521CF4E9B500BBF1F8 /* StoryboardImageTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardImageTableViewCell.swift; sourceTree = ""; }; - DA539C8F1CF50E9900368ACB /* Tablet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Tablet.framework; path = "/Users/maxsokolov/Library/Developer/Xcode/DerivedData/Tablet-hgommdyxtgxijceamltarpblrbwc/Build/Products/Debug-iphoneos/Tablet.framework"; sourceTree = ""; }; DAB7EB271BEF787300D2AD5E /* TabletDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TabletDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; DAC2D5C91C9D303E009E9C19 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; DAC2D5CD1C9D30A7009E9C19 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; @@ -52,7 +52,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DA539C901CF50E9900368ACB /* Tablet.framework in Frameworks */, + 5058386B1CF6189D00224C58 /* Tablet.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -69,7 +69,7 @@ DAB7EB1E1BEF787300D2AD5E = { isa = PBXGroup; children = ( - DA539C8F1CF50E9900368ACB /* Tablet.framework */, + 5058386A1CF6189D00224C58 /* Tablet.framework */, DAC2D5C61C9D2FE5009E9C19 /* Classes */, DAC2D5CB1C9D3058009E9C19 /* Resources */, DA539C871CF50B1800368ACB /* Frameworks */,