Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a9862768c9 | |||
| 638bdd85f7 | |||
| 723ec56928 | |||
| d870af6f60 | |||
| 4c98d75ebf | |||
| 66b65065eb | |||
| 6753c18c88 | |||
| 2c696f793c | |||
| e0fd17dcf9 | |||
| 22dc85ef9a | |||
| db3184c16c | |||
| 1fd7e5f2c1 | |||
| 2d954c904d | |||
| 2de54e1387 | |||
| 686ca24a06 | |||
| a8cb461213 | |||
| 181d20315c | |||
| 583f01a149 | |||
| c6575ac042 | |||
| 9f83a13354 | |||
| a47b2d80f3 | |||
| 6691322781 | |||
| 8bdbc44f39 | |||
| 5ae5c97f00 | |||
| 1108944654 | |||
| 365840db98 |
@@ -20,6 +20,20 @@
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "Common"
|
||||
BuildableName = "Common"
|
||||
BlueprintName = "Common"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
@@ -28,6 +42,66 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "CodeTests"
|
||||
BuildableName = "CodeTests"
|
||||
BlueprintName = "CodeTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "InsetContentViewKeyboardTests"
|
||||
BuildableName = "InsetContentViewKeyboardTests"
|
||||
BlueprintName = "InsetContentViewKeyboardTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "IntrinsicSizeTests"
|
||||
BuildableName = "IntrinsicSizeTests"
|
||||
BlueprintName = "IntrinsicSizeTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "KeyboardTests"
|
||||
BuildableName = "KeyboardTests"
|
||||
BlueprintName = "KeyboardTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "ManagerTests"
|
||||
BuildableName = "ManagerTests"
|
||||
BlueprintName = "ManagerTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "StoryboardTests"
|
||||
BuildableName = "StoryboardTests"
|
||||
BlueprintName = "StoryboardTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
language: swift
|
||||
osx_image: xcode12.5
|
||||
xcode_project: ScrollingContentViewController.xcodeproj
|
||||
xcode_scheme: ScrollingContentViewController
|
||||
xcode_destination: platform=iOS Simulator,OS=14.5,name=iPhone 12 Pro
|
||||
@@ -100,7 +100,6 @@ class SignUpViewController: ScrollingContentViewController {
|
||||
textField.isSecureTextEntry = isSecureTextEntry
|
||||
}
|
||||
|
||||
// swiftlint:disable:next function_body_length
|
||||
private func addConstraints() {
|
||||
logoImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
nameTextField.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
+29
-24
@@ -19,30 +19,35 @@ let package = Package(
|
||||
.target(
|
||||
name: "ScrollingContentViewController",
|
||||
dependencies: []
|
||||
),
|
||||
.testTarget(
|
||||
name: "StoryboardTests",
|
||||
dependencies: ["ScrollingContentViewController"]
|
||||
),
|
||||
.testTarget(
|
||||
name: "CodeTests",
|
||||
dependencies: ["ScrollingContentViewController"]
|
||||
),
|
||||
.testTarget(
|
||||
name: "ManagerTests",
|
||||
dependencies: ["ScrollingContentViewController"]
|
||||
),
|
||||
.testTarget(
|
||||
name: "IntrinsicSizeTests",
|
||||
dependencies: ["ScrollingContentViewController"]
|
||||
),
|
||||
.testTarget(
|
||||
name: "KeyboardTests",
|
||||
dependencies: ["ScrollingContentViewController"]
|
||||
),
|
||||
.testTarget(
|
||||
name: "InsetContentViewKeyboardTests",
|
||||
dependencies: ["ScrollingContentViewController"]
|
||||
)
|
||||
// .target(
|
||||
// name: "Common",
|
||||
// dependencies: ["ScrollingContentViewController"],
|
||||
// path: "Tests/Common"
|
||||
// ),
|
||||
// .testTarget(
|
||||
// name: "StoryboardTests",
|
||||
// dependencies: ["ScrollingContentViewController", "Common"]
|
||||
// ),
|
||||
// .testTarget(
|
||||
// name: "CodeTests",
|
||||
// dependencies: ["ScrollingContentViewController", "Common"]
|
||||
// ),
|
||||
// .testTarget(
|
||||
// name: "ManagerTests",
|
||||
// dependencies: ["ScrollingContentViewController", "Common"]
|
||||
// ),
|
||||
// .testTarget(
|
||||
// name: "IntrinsicSizeTests",
|
||||
// dependencies: ["ScrollingContentViewController"]
|
||||
// ),
|
||||
// .testTarget(
|
||||
// name: "KeyboardTests",
|
||||
// dependencies: ["ScrollingContentViewController"]
|
||||
// ),
|
||||
// .testTarget(
|
||||
// name: "InsetContentViewKeyboardTests",
|
||||
// dependencies: ["ScrollingContentViewController"]
|
||||
// )
|
||||
]
|
||||
)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# ScrollingContentViewController
|
||||
|
||||
[](https://travis-ci.com/drewolbrich/ScrollingContentViewController)
|
||||
[](http://developer.apple.com/ios)
|
||||
[](https://developer.apple.com/swift)
|
||||
[](LICENSE)
|
||||
[](http://twitter.com/drewolbrich)
|
||||
|
||||
* [Overview](#overview)
|
||||
* [Background](#background)
|
||||
@@ -29,7 +27,7 @@ A common UIKit Auto Layout task involves creating a view controller with a fixed
|
||||
|
||||
For example, consider this sign up screen, which fits iPhone Xs, but not iPhone SE with a keyboard:
|
||||
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/master/Images/Overview-Comparison.png" width="888px">
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/main/Images/Overview-Comparison.png" width="888px">
|
||||
|
||||
This case can be handled by nesting the view inside a scroll view. You could do this manually in Interface Builder, as described by Apple's [Working with Scroll Views](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/WorkingwithScrollViews.html) documentation, but many steps are required. If your view contains text fields, you'll have to write code to adjust the view to compensate for the presented keyboard, as described in [Managing the Keyboard](https://developer.apple.com/library/archive/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html#//apple_ref/doc/uid/TP40009542-CH5-SW3). However, handling the keyboard robustly is [surprisingly complicated](#keyboard-resize-filtering), especially if your app presents a sequence of screens with keyboards in the context of a navigation controller, or when device orientation support is required.
|
||||
|
||||
@@ -85,7 +83,7 @@ To configure `ScrollingContentViewController` in a storyboard:
|
||||
|
||||
2. In Interface Builder's outline view, control-click your view controller and connect its [`contentView`](#contentView) outlet to your view controller's root view or any other subview that you want to make scrollable.
|
||||
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/master/Images/Usage-Storyboards.png" width="471px">
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/main/Images/Usage-Storyboards.png" width="471px">
|
||||
|
||||
3. If your view controller defines a [`viewDidLoad`](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621495-viewdidload) method, call `super.viewDidLoad` if you aren't already doing so.
|
||||
|
||||
@@ -123,6 +121,8 @@ To integrate `ScrollingContentViewController` programmatically:
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
view.backgroundColor = .systemBackground
|
||||
|
||||
contentView = UIView()
|
||||
|
||||
// Add all controls to contentView instead of view.
|
||||
@@ -146,7 +146,7 @@ To determine the size of the scroll view's content size, ScrollingContentViewCon
|
||||
|
||||
If the size of your view controller is intentionally highly constrained (e.g. consisting exclusively of constraints with [`required`](https://developer.apple.com/documentation/uikit/uilayoutpriority/1622241-required) priority and lacking [`greaterThanOrEqual`](https://developer.apple.com/documentation/uikit/nslayoutconstraint/relation/greaterthanorequal) relation constraints), you may see Auto Layout constraint errors in Interface Builder if the constraints don't match the simulated size of the view, for example, when you switch between simulated device sizes. The easiest way to resolve this issue is to reduce the priority of one of your constraints. The value 240 is a good choice because it is lower than the default content hugging priority (250) and consequently, it will help avoid the undesirable behavior where text fields and labels without height constraints stretch vertically.
|
||||
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/master/Images/Usage-Auto-Layout-Considerations.png" width="663px">
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/main/Images/Usage-Auto-Layout-Considerations.png" width="663px">
|
||||
|
||||
### Intrinsic Content Size
|
||||
|
||||
@@ -158,7 +158,7 @@ The default `UIView` content hugging priority is [`defaultLow`](https://develope
|
||||
|
||||
The content view is positioned within the scroll view's safe area. Consequently, the content view's background color won't extend underneath the status bar, home indicator, navigation bar, or toolbar.
|
||||
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/master/Images/Caveats-Background-Color-Content-View.png" width="233px">
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/main/Images/Caveats-Background-Color-Content-View.png" width="233px">
|
||||
|
||||
To specify a background color that extends to the edges of the screen:
|
||||
|
||||
@@ -191,7 +191,7 @@ UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSp
|
||||
|
||||
In Interface Builder, it's possible to design a view controller that is intentionally larger than the height of the screen. To do this, change the view controller's simulated size to Freeform and adjust its height. When used with ScrollingContentViewController, the view controller's oversized content view will scroll freely, assuming its constraints require it to be larger than the screen.
|
||||
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/master/Images/Usage-Oversized-View-Controllers.png" width="609px">
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/main/Images/Usage-Oversized-View-Controllers.png" width="609px">
|
||||
|
||||
## Usage Without Subclassing
|
||||
|
||||
@@ -391,7 +391,7 @@ The optional `margin` parameter specifies an extra margin around the first respo
|
||||
|
||||
ScrollingContentViewController inserts a scroll view between the content view and its superview, using Auto Layout to constrain the scroll view's content layout guide to the size of the content view. The content view's size is also constrained to be greater than or equal to the size of the scroll view's safe area, so it can utilize the full area of the screen assigned to the scroll view.
|
||||
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/master/Images/How-It-Works-View-Hierarchy.png" width="496px">
|
||||
<img src="https://github.com/drewolbrich/ScrollingContentViewController/raw/main/Images/How-It-Works-View-Hierarchy.png" width="496px">
|
||||
|
||||
When the content view is first assigned, if it has a superview, the scroll view replaces it in the view hierarchy and all of the superview's constraints that reference the content view are retargeted to the content view. The content view's width and height constraints and autoresizing mask are transferred to the scroll view.
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# Release Steps
|
||||
|
||||
1. Determine the new release number, like `1.6.6` and search and replace the previous version number with it in this file.
|
||||
|
||||
2. Verify that the tests pass:
|
||||
```
|
||||
xcodebuild test -scheme ScrollingContentViewControllerTests -sdk iphonesimulator16.2 -destination "OS=16.2,name=iPhone 14"
|
||||
```
|
||||
|
||||
3. In `Sources > Info.plist`, update `Bundle version string` with the new release number.
|
||||
|
||||
4. In `ScrollingContentViewController.podspec`, update `s.version` with the new release number.
|
||||
|
||||
5. Verify that the Swift package file is valid:
|
||||
```
|
||||
swift package describe
|
||||
```
|
||||
|
||||
6. Verify that the Cocoapods spec file is valid:
|
||||
```
|
||||
pod lib lint
|
||||
```
|
||||
|
||||
7. Commit the updated release number and Cocopods spec file:
|
||||
```
|
||||
git add -A && git commit -m "Release 1.6.6"
|
||||
git push
|
||||
```
|
||||
|
||||
8. Create a tag for the new release. For consistency, **do not** prefix tags with 'v'.
|
||||
```
|
||||
git tag '1.6.6'
|
||||
git push --tags
|
||||
```
|
||||
|
||||
9. Submit the new release to the Cocoapods specs repo:
|
||||
```
|
||||
pod trunk push ScrollingContentViewController.podspec
|
||||
```
|
||||
|
||||
If that doesn't work, first follow the steps at https://guides.cocoapods.org/making/getting-setup-with-trunk.html
|
||||
using the email address in `ScrollingContentViewController.podspec` to register the local device with the Cocoapods trunk.
|
||||
```
|
||||
pod trunk register drew@retroactivefiasco.com 'Drew Olbrich' --description='MacBook Pro'
|
||||
```
|
||||
|
||||
10. Draft a new release on GitHub at https://github.com/drewolbrich/ScrollingContentViewController/releases
|
||||
|
||||
11. For the new release, use the release number 1.6.6 as the title and prefix each item in the description with bullets, indicated by '*'.
|
||||
|
||||
12. Leave **Set as the latest release** checked and click **Publish**.
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'ScrollingContentViewController'
|
||||
s.version = '1.6.2'
|
||||
s.version = '1.6.6'
|
||||
s.summary = 'A Swift library that simplifies making a view controller\'s view scrollable'
|
||||
|
||||
s.description = <<-DESC
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
3A06577C2200A552005BE8CC /* IsUnitTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A06577B2200A552005BE8CC /* IsUnitTest.swift */; };
|
||||
3A1A174626A4839F006EE907 /* UIView+FirstResponder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A1A174526A4839F006EE907 /* UIView+FirstResponder.swift */; };
|
||||
3A1A176026A485BB006EE907 /* CodeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A1A174B26A48489006EE907 /* CodeTests.swift */; };
|
||||
3A1A176126A485C3006EE907 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A1A175626A48489006EE907 /* ContentView.swift */; };
|
||||
3A1A176226A485C3006EE907 /* StoryboardTests.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3A1A175426A48489006EE907 /* StoryboardTests.storyboard */; };
|
||||
3A1A176326A485C3006EE907 /* IntrinsicSizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A1A174926A48489006EE907 /* IntrinsicSizeTests.swift */; };
|
||||
3A1A176426A485C3006EE907 /* IntrinsicSizeContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A1A174E26A48489006EE907 /* IntrinsicSizeContentView.swift */; };
|
||||
@@ -41,6 +40,7 @@
|
||||
3A83273921E700A000E8D95C /* SignUpController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A83273721E700A000E8D95C /* SignUpController.swift */; };
|
||||
3A83273B21E703F600E8D95C /* SignUpControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A83273A21E703F600E8D95C /* SignUpControllerDelegate.swift */; };
|
||||
3A83273C21E703F600E8D95C /* SignUpControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A83273A21E703F600E8D95C /* SignUpControllerDelegate.swift */; };
|
||||
3A89319329D0D127009BD5DD /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A89319229D0D127009BD5DD /* ContentView.swift */; };
|
||||
3AAC048F21E2D4C500D94DA5 /* ScrollingContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AAC048E21E2D4C500D94DA5 /* ScrollingContentViewController.swift */; };
|
||||
3AAC049121E2D4F100D94DA5 /* ScrollingContentViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AAC049021E2D4F100D94DA5 /* ScrollingContentViewManager.swift */; };
|
||||
3AAC049921E2F01C00D94DA5 /* KeyboardObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AAC049421E2F01C00D94DA5 /* KeyboardObserver.swift */; };
|
||||
@@ -209,7 +209,6 @@
|
||||
3A1A175226A48489006EE907 /* ManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagerTests.swift; sourceTree = "<group>"; };
|
||||
3A1A175426A48489006EE907 /* StoryboardTests.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = StoryboardTests.storyboard; sourceTree = "<group>"; };
|
||||
3A1A175526A48489006EE907 /* StoryboardTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardTests.swift; sourceTree = "<group>"; };
|
||||
3A1A175626A48489006EE907 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
3A1A176A26A48701006EE907 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
3A5702CE21E2CBB600E4CC55 /* ScrollingContentViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ScrollingContentViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3A5702D121E2CBB600E4CC55 /* ScrollingContentViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScrollingContentViewController.h; sourceTree = "<group>"; };
|
||||
@@ -224,6 +223,8 @@
|
||||
3A7014BB21EBD723002C6740 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
3A83273721E700A000E8D95C /* SignUpController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpController.swift; sourceTree = "<group>"; };
|
||||
3A83273A21E703F600E8D95C /* SignUpControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpControllerDelegate.swift; sourceTree = "<group>"; };
|
||||
3A89319229D0D127009BD5DD /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
3A89319429D0D3AC009BD5DD /* Release-Steps.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = "Release-Steps.md"; sourceTree = "<group>"; };
|
||||
3AAC048821E2D3FD00D94DA5 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
3AAC048921E2D3FD00D94DA5 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
||||
3AAC048A21E2D3FD00D94DA5 /* ScrollingContentViewController.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; path = ScrollingContentViewController.podspec; sourceTree = "<group>"; };
|
||||
@@ -252,7 +253,6 @@
|
||||
3AC88F4F21E5B7F500EED460 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
3AC88F5021E5B7F600EED460 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
3ACE0D7B220B34BE0093FE5A /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .swiftlint.yml; sourceTree = "<group>"; };
|
||||
3ACE0D7C220B34BE0093FE5A /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = "<group>"; };
|
||||
3AD597D221F420ED00F220A0 /* KeyboardNotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardNotificationManager.swift; sourceTree = "<group>"; };
|
||||
3AD597D421F4221B00F220A0 /* KeyboardNotificationObserving.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardNotificationObserving.swift; sourceTree = "<group>"; };
|
||||
3ADD380921EBFC6200396B7A /* KeyboardFrameEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardFrameEvent.swift; sourceTree = "<group>"; };
|
||||
@@ -338,6 +338,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3A1A174926A48489006EE907 /* IntrinsicSizeTests.swift */,
|
||||
3A1A174E26A48489006EE907 /* IntrinsicSizeContentView.swift */,
|
||||
);
|
||||
path = IntrinsicSizeTests;
|
||||
sourceTree = "<group>";
|
||||
@@ -354,7 +355,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3A1A174D26A48489006EE907 /* InsetContentViewKeyboardTests.swift */,
|
||||
3A1A174E26A48489006EE907 /* IntrinsicSizeContentView.swift */,
|
||||
);
|
||||
path = InsetContentViewKeyboardTests;
|
||||
sourceTree = "<group>";
|
||||
@@ -380,7 +380,6 @@
|
||||
children = (
|
||||
3A1A175426A48489006EE907 /* StoryboardTests.storyboard */,
|
||||
3A1A175526A48489006EE907 /* StoryboardTests.swift */,
|
||||
3A1A175626A48489006EE907 /* ContentView.swift */,
|
||||
);
|
||||
path = StoryboardTests;
|
||||
sourceTree = "<group>";
|
||||
@@ -390,10 +389,10 @@
|
||||
children = (
|
||||
3AAC048921E2D3FD00D94DA5 /* LICENSE */,
|
||||
3AAC048821E2D3FD00D94DA5 /* README.md */,
|
||||
3A89319429D0D3AC009BD5DD /* Release-Steps.md */,
|
||||
3A5B3C98265D3D2100E26100 /* Package.swift */,
|
||||
3AAC048A21E2D3FD00D94DA5 /* ScrollingContentViewController.podspec */,
|
||||
3ACE0D7B220B34BE0093FE5A /* .swiftlint.yml */,
|
||||
3ACE0D7C220B34BE0093FE5A /* .travis.yml */,
|
||||
3A5702D021E2CBB600E4CC55 /* Sources */,
|
||||
3AAC04A521E39FBF00D94DA5 /* Examples */,
|
||||
3A5702DB21E2CBB600E4CC55 /* Tests */,
|
||||
@@ -428,6 +427,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3A1A176A26A48701006EE907 /* Info.plist */,
|
||||
3A89319129D0D127009BD5DD /* Common */,
|
||||
3A1A174A26A48489006EE907 /* CodeTests */,
|
||||
3A1A174C26A48489006EE907 /* InsetContentViewKeyboardTests */,
|
||||
3A1A174826A48489006EE907 /* IntrinsicSizeTests */,
|
||||
@@ -474,6 +474,14 @@
|
||||
path = ManagerExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3A89319129D0D127009BD5DD /* Common */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3A89319229D0D127009BD5DD /* ContentView.swift */,
|
||||
);
|
||||
path = Common;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3AAC04A521E39FBF00D94DA5 /* Examples */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -831,6 +839,7 @@
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3ACE0D7A220B2D790093FE5A /* Run SwiftLint */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
@@ -845,7 +854,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
|
||||
shellScript = "# If we don't do this, then SwiftLint won't be found on M1 macs,\n# because it's installed in /opt/homebrew/bin instead of /usr/local/bin\n# on that platform \nif test -d \"/opt/homebrew/bin/\"; then\n PATH=\"/opt/homebrew/bin/:${PATH}\"\nfi\nexport PATH\n\nif which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -880,10 +889,10 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3A1A176726A485C3006EE907 /* ManagerTests.swift in Sources */,
|
||||
3A1A176126A485C3006EE907 /* ContentView.swift in Sources */,
|
||||
3A1A176526A485C3006EE907 /* StoryboardTests.swift in Sources */,
|
||||
3A1A176826A485C3006EE907 /* InsetContentViewKeyboardTests.swift in Sources */,
|
||||
3A1A176626A485C3006EE907 /* KeyboardTests.swift in Sources */,
|
||||
3A89319329D0D127009BD5DD /* ContentView.swift in Sources */,
|
||||
3A1A176426A485C3006EE907 /* IntrinsicSizeContentView.swift in Sources */,
|
||||
3A1A176026A485BB006EE907 /* CodeTests.swift in Sources */,
|
||||
3A1A176326A485C3006EE907 /* IntrinsicSizeTests.swift in Sources */,
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.6.1</string>
|
||||
<string>1.6.6</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
</dict>
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ScrollingContentScrollView: UIScrollView {
|
||||
/// - view: The view to make visible.
|
||||
/// - animated: If `true`, the scrolling is animated.
|
||||
/// - margin: An optional margin to apply to the view. If left unspecified,
|
||||
/// `scrollToVisibleMargin` is used.
|
||||
/// `visibilityScrollMargin` is used.
|
||||
public func scrollViewToVisible(_ view: UIView, animated: Bool, margin: CGFloat? = nil) {
|
||||
scrollViewFilter?.submitScrollRectEvent(ScrollRectEvent(contentArea: .descendantViewRect(view.bounds, descendantView: view), animated: animated, margin: margin ?? visibilityScrollMargin))
|
||||
|
||||
@@ -124,7 +124,7 @@ public class ScrollingContentScrollView: UIScrollView {
|
||||
/// - Parameters:
|
||||
/// - animated: If `true`, the scrolling is animated.
|
||||
/// - margin: An optional margin to apply to the first responder. If left
|
||||
/// unspecified, `scrollToVisibleMargin` is used.
|
||||
/// unspecified, `visibilityScrollMargin` is used.
|
||||
public func scrollFirstResponderToVisible(animated: Bool, margin: CGFloat? = nil) {
|
||||
guard let view = self.firstResponder as? UIView else {
|
||||
return
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
/// A view assigned `contentView` property in StoryboardTests.storyboard.
|
||||
class ContentView: UIView {
|
||||
/// A content view used by `StoryboardTests`, `CodeTests`, and `ManagerTests`.
|
||||
public class ContentView: UIView {
|
||||
|
||||
/// A constraint that determines the view's width.
|
||||
var widthConstraint: NSLayoutConstraint!
|
||||
public var widthConstraint: NSLayoutConstraint!
|
||||
|
||||
/// A constraint that determine the view's height. This constraint's constant is
|
||||
/// manipulated externally to test the behavior of views of varying heights.
|
||||
var heightConstraint: NSLayoutConstraint!
|
||||
public var heightConstraint: NSLayoutConstraint!
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
Reference in New Issue
Block a user