This is a follow up PR for #7166 adds @objc annotations to Swift catalogMetadata() methods, because the Swift 4 compiler no longer attempts to infer what methods should be visible to Objective-C. As a result of this change in the compiler, no Swift examples were showing up in Dragons after #7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat. For example, `0.1f` should become `(CGFloat)0.1`.
Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```
PiperOrigin-RevId: 220683126
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.
This was an automated change generated by running a find-and-replace regular expression:
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
We can now make use of @available throughout our codebase.
We support Xcode 9 and up, which includes the iOS 11 SDK. This means we can remove any guards for SDKs prior to iOS 11.
This was cleaned up by running a global find-and-replace with the following regular expression:
```
Find:#if defined\(__IPHONE_11_0\) && \(__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0\)\n(.+if \(@available\(iOS 11.0, \*\)\) \{(?:.|\n)*?)(?:#else(?:.|\n)*?)?\n#endif
Replace:$1
```
With some additional cleanup for stragglers that didn't match this pattern. Note that else clauses were intentionally dropped.
Closes https://github.com/material-components/material-components-ios/issues/4909
* [Collections] Update collections to support iPhone X
The collections use the contentInset to compute the width of the cells.
With iPhone X, the width must take into account possible inset of the side.
This patch makes sure that the collection takes into account the adjustedContentInset, which may take the safe area into consideration.
Closes#1980
* Correct respondsToSelect
* Use macro + @available instead of NSInvocation
* Fix CollectionCellsExamples and add a swift version check to the swift example.
* Make UIScrollViewContentInsetAdjustmentAlways the default
* Remove override from CollectionsSectionInsetsExample
All examples now have at least the required `+catalogBreadcrumbs` and `+catalogIsPrimaryDemo`. All examples in the same breadcrumbs path have only one primary demo. There should be only one `-catalogDescription` attached to the primary demo.
Closes#1897
When using the swipe-to-dimiss gesture on large screens, the distance on which the user has to move the item can be big. This commit limits the distance by using the width of the item instead of the width of the collection.
Closes#1780
* [Collections] Add "editing" performance example
New example to demonstrate scrolling performance when a collection
contains a large number of cells. "Editing" mode is currently very
inefficient.
* Refactoring, pulling some code into supplemental
* Making cell identifier symbol unique
* [Collections] Add StylingDelegate methods to control separator display
Adds methods to MDCCollectionViewStylingDelegate, allowing the delegate to control the display of the separator on cells, header and footer.
Closes#1406
* [Collections] Allow custom UIEdgeInsets
MDCCollectionViewController implements custom logic for computing the
`UIEdgeInsets` depending on the `MDCCollectionViewCellStyle` and the
`MDCCollectionViewCellLayoutType`. Subclasses need to override this
functionality to customize their presentation.
* MDCCollectionViewController will use the public
`-collectionView:layout:section` to compute the width of its
supplementary view instead of the internal implementation directly.
* Update the Collections layout example to have different horizontal
edge insets depending on the view's horizontal size class.
Closes#1507
* Add EarlGrey test to verify the insets exampl
* Removing changes to Collection Cells example
* Running code formatter
* Supplemental files.
* Some code clean-up based on willlarche@'s comments
* Removing old header, small cleanup
* Changing block parameter types to match the desired class
* One last id to remove
* Making Earl Grey test a bit better. Some formatting
* Fixing a bug with the flowLayout delegate
* [ReadMes] - Updated readme docs for collection views to include note about using section headers/footers while editing
* Updated docs
* [ReadMes] - Fixed code snippets
* [ReadMes] - Updated indention in code blocks
* [ReadMes] - Corrected indentions in code snippets
* [Collections] - Updated cell editing example
* [Collections] - Updated example spacing
* [Collections] Fixed return statement
* [Collections] - Updated example
* [Collections] - Added TODO comment with bug reference
* [Collections] - Added comment TODO comment to example code as well
* ClangFormat changes.
* Added swiftlint to scripts/format_all.`
* Fix scripts/lint_all to work from any directory.
* Fixed swiftlint invocation.
* Remove the checks for force casting (! operator).
* Some fixes.
* More Swift fixes.
* WIP
* WIP
* Simplified build script and fixed it to build all schemes.
* WIP
* Renamed script to build_all and added better output.
* Add scripts/list_xcode_workspaces.
* Filtered out the CocoaPods schemes.
* Use Xcode to update Swift to v3.
* Updated tracked touches map from NSNumber to Int.
* Fixed button sorting that was not actually sorting.
* targetContentOffset no longer allowed to be nil.
* "Fixed" failing test by reducing random number range?
* Swift 3 syntax change.
* Swift 3 syntax change.
* Removed invalid center-aligning tests.
Fixed default nav bar alignment test.
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has...
Summary:
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has no legal change, since the contributors always retained their copyright despite the copyright notice, but it's a nice acknowledgement.
Changed copyright statement to include non-Google authors.
Command run:
find * \( -name '*\.m' -or -name '*\.h' -or -name '*\.swift' \) -and -not \( -path 'scripts/external*' -name Pods \) -print0 | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'
Added non-source files.
Command run:
grep -Rl 'Copyright .* Google Inc' * --exclude-dir scripts/external --null | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'
Reviewers: featherless, O1 Material components iOS, randallli
Reviewed By: O1 Material components iOS, randallli
Tags: #material_components_ios
Differential Revision: http://codereview.cc/D1415