Skip to content

Commit

Permalink
Fix for jumping table view when editing last row
Browse files Browse the repository at this point in the history
  • Loading branch information
jurezove authored and Jure Zove committed May 2, 2016
1 parent 3c7785d commit 9ab3871
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2556DA351C5EB0B100D62DF8"
BuildableName = "UITextView featuring Auto Layout.app"
BlueprintName = "UITextView featuring Auto Layout"
ReferencedContainer = "container:UITextView featuring Auto Layout.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
Expand All @@ -13,6 +29,15 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2556DA351C5EB0B100D62DF8"
BuildableName = "UITextView featuring Auto Layout.app"
BlueprintName = "UITextView featuring Auto Layout"
ReferencedContainer = "container:UITextView featuring Auto Layout.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
Expand All @@ -26,6 +51,16 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2556DA351C5EB0B100D62DF8"
BuildableName = "UITextView featuring Auto Layout.app"
BlueprintName = "UITextView featuring Auto Layout"
ReferencedContainer = "container:UITextView featuring Auto Layout.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
Expand All @@ -35,6 +70,16 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2556DA351C5EB0B100D62DF8"
BuildableName = "UITextView featuring Auto Layout.app"
BlueprintName = "UITextView featuring Auto Layout"
ReferencedContainer = "container:UITextView featuring Auto Layout.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>UITextView featuring Auto Layout.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
4 changes: 4 additions & 0 deletions UITextView featuring Auto Layout/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ class ViewController: UITableViewController {

extension ViewController: UITextViewDelegate {
func textViewDidChange(textView: UITextView) {
let currentOffset = tableView.contentOffset
UIView.setAnimationsEnabled(false)
tableView.beginUpdates()
tableView.endUpdates()
UIView.setAnimationsEnabled(true)
tableView.setContentOffset(currentOffset, animated: false)
}
}

Expand Down

0 comments on commit 9ab3871

Please sign in to comment.