20 Commits

Author SHA1 Message Date
Dave MacLachlan
ebac2a8eb7 As of iOS 9/macOS 10.11 (circa 2015) removing objective C objects from the NSNotificationCenter in - (void)dealloc. is no longer required (the classic example is: [[NSNotificationCenter defaultCenter] removeObserver:self] but there are several variations).
In many cases this is the only thing being done in - (void)dealloc, so we can remove the whole thing.

PiperOrigin-RevId: 307663440
2020-04-21 13:00:30 -07:00
Robert Moore
0c317f190d
[TextFields] Fix examples layout (#7250)
Fixing the examples layout so the content doesn't overlap the App Bar.

|Before|After|
|---|---|
|![legacy-multi-before](https://user-images.githubusercontent.com/1753199/56600236-3ba35280-65c6-11e9-9276-52acb5cde63b.png)|![legacy-multi-after](https://user-images.githubusercontent.com/1753199/56600242-3f36d980-65c6-11e9-8faf-bc5255bf3bdb.png)|
|![outlined-before](https://user-images.githubusercontent.com/1753199/56600248-42ca6080-65c6-11e9-911f-2cd9828dfb62.png)|![outlined-after](https://user-images.githubusercontent.com/1753199/56600262-49f16e80-65c6-11e9-9775-95d452fec723.png)|
|![controller-styles-before](https://user-images.githubusercontent.com/1753199/56600269-4e1d8c00-65c6-11e9-9359-8e98f0e1cbc1.png)|![controller-styles-after](https://user-images.githubusercontent.com/1753199/56600290-57a6f400-65c6-11e9-9d8f-8f9ac2c243be.png)|

Preparation for #7157
2019-04-23 14:05:34 -04:00
Robert Moore
800188a649
{clang-format} Format the components. (#6347)
This is a follow-up to https://github.com/material-components/material-components-ios/pull/6027

```
find components \( -name "*.h" -or -name "*.m" \) | xargs clang-format -i
```
2019-01-23 11:08:43 -05:00
Robert Moore
03f3351ad5
Global replace of single-precision floats with CGFloat casts. (#5718)
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
2018-11-12 10:50:01 -05:00
Robert Moore
74a27253e8
Global replace of integral single-precision literals with integer literals. (#5709)
Global replace of integral single-precision literals with integer literals.

Regular expression used:
```perl
/[^\w]([0-9]+)\.[0]*[fF]/$1/
```
2018-11-08 14:02:04 -05:00
featherless
2181084272
[automated] Standardize our open source license stanza to what Xcode generates. (#4985)
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.
```
2018-08-31 12:13:07 -04:00
Yarden Eitan
3480c50c67
updated to newest CbC standard (#4956)
Move to the new CbC standard released in CatalogByConvention v2.5.0. See PR: material-foundation/cocoapods-catalog-by-convention#27 for more info on the change.
2018-08-29 20:45:13 -04:00
featherless
bbe4a23fe0
Remove all __IPHONE_11_0 checks now that we no longer support Xcode 8. (#4915)
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
2018-08-28 09:57:30 -04:00
featherless
e923d2d928
[Catalog] Make many examples be dragons. (#3642)
Pivotal story: https://www.pivotaltracker.com/story/show/156939988
Pivotal story: https://www.pivotaltracker.com/story/show/156804299
Pivotal story: https://www.pivotaltracker.com/story/show/156939962
Pivotal story: https://www.pivotaltracker.com/story/show/156982119
Closes: https://github.com/material-components/material-components-ios/issues/3183
2018-05-02 08:31:55 -04:00
featherless
23110ef116
[Catalog] Make all swift copycat demos be dragons. (#3443)
Also removed "(Swift)" from any examples that remained as non-dragons. The catalog does not need to advertise which language a given demo is in.

Pivotal story: https://www.pivotaltracker.com/story/show/156939611

## Screenshots

Before:
![simulator screen shot - iphone se - 2018-04-23 at 14 04 14](https://user-images.githubusercontent.com/45670/39144588-36095450-46ff-11e8-868d-bdb7e8ee5438.png)

After:
![simulator screen shot - iphone se - 2018-04-23 at 13 53 39](https://user-images.githubusercontent.com/45670/39144567-2ad7bf9a-46ff-11e8-9fd5-ef0739d427b3.png)
2018-04-24 15:52:13 -04:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Will Larche
62d5a4fa85 [TextFields] Feature branch merge: Clarity, Safety, Docs, Comments, Formatting (#2634)
* [TextFields] Full width changes. (#2590)

* [TextFields] Propagating changes to themers. (#2585)

* [TextFields] Propagating changes to themers.

* [TextFields] Updates to themer examples.

* [TextFields] Base controller class files (#2582)

* [TextFields] New Base class files.

* [TextFields] Naming corrections.

* [TextFields] Formatting.

* [TextFields] Replacing -Default with -Underline (#2583)

* [TextFields] Adding underline controller.

* [TextFields] Changes to umbrella import file and removing default controllers.

* [TextFields] Renaming one file.

* [TextFields] Updated controller headers. (#2584)

* [TextFields] Updating examples. (#2586)

* [TextFields] Running clang-format on the elements. (#2587)

* [TextFields] Running format on the element itself.

* [TextFields] Minor formatting.

* [TextFields] Updating tests and formatting. (#2588)

* [TextFields] Filled controller changes. (#2589)

* [TextFields] Legacy controller comments, naming, and formatting. (#2591)

* [TextFields] Legacy controller comments, naming, and formatting.

* [TextFields] Adding safety to legacy default init.

* [TextFields] Adding safety to Legacy Default init.

* [TextFields] Formatting Legacy Default.

* [TextFields] Formatting Legacy Full Width.

* [TextFields] Text area comments, updated super, naming, formatting. (#2593)

* [TextFields] Text area updates.

* [TextFields] Clarifying comment.

* [TextFields] Outline changes and formatting. (#2592)

* [TextFields] Updates to styling doc. (#2594)

* [TextFields] Updates to styling doc.

* [TextFields] Updating doc.

* [TextFields] Full width comments, safety, formatting, and underline support. (#2633)

* [TextFields] Adding safety to full width.

* [TextFields] Formatting Full Width.

* [TextFields] PR feedback.

* [TextFields] Safety in init of Base (#2632)

* [TextFields] Adding safety to base init.

* [TextFields] Formatting Base.

* [TextFields] Updates to controller header. (#2636)

* [TextFields] Updates to controller header.

* [TextFields] Updating misleading comments.

* [TextFields] Supplemental file name changes. (#2635)
2017-12-12 11:07:48 -05:00
Randall Li
b1ec22207f
Fixed float conversion build errors (#2602)
* Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480

* More Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480
2017-12-06 15:57:04 -05:00
Will Larche
5dae93c6c4 [TextFields] Adding .placeholderText to controllers (#2149)
* [TextFields] Adding .placeholderText to fix bugs and continue moving API to controller.

* [TextFields] PR feedback.

* [TextFields] Removes ambiguous layout.

* [TextFields] Better code organization and comment.
2017-10-12 09:16:07 -04:00
Will Larche
90e79dd815 [TextFields] iOS 11 example bugs fixed (#2071)
* [TextFields] Example fix for iOS 11.

* [TextFields] iOS 11 bugs fixed.

* [TextFields] Formatting

* [TextFields] Xcode 8 support

* [TextFields] Example layout correction.

* [TextFields] Xcode and iOS safety code.

* [TextFields] typo corrections.

* [TextFields] Code for Xcode conditional.

* [TextFields] Xcode 8 support.

* [TextFields] Pleasing the static analyzer.

* [TextFields] Formatting improvement.

* [TextFields] Swift compiler conditional change and some formatting.

* [TextFields] Swift example notification changes.

* [TextFields] Safer notifcations code in Objc.

* [TextFields] Formatting
2017-10-02 20:30:17 -04:00
Will Larche
3fc78fd868 [TextFields] Adding a doc: menu for styles (#2064)
* [TextFields] Beginning to update the docs to show the new controller styles.

* [TextFields] Correcting the name of a file.

* [TextFields] Adding content to controller styles doc.

* [TextFields] Images for the text field styles doc.

* [TextFields] Renaming styling doc.

* [TextFields] Moving doc images.

* [TextFields] Updating image ref paths.

* [TextFields] Text clarity in doc.

* [TextFields] Updated photo.

* [TextFields] Nits of grammar.

* [TextFields] Spelling correction.
2017-09-28 11:25:41 -04:00
Will Larche
cde864f235 [TextFields] Renaming classes to match the MD spec (#2061)
* [TextFields] Renaming classes to match the spec.

* [TextFields] Renaming examples.
2017-09-27 22:10:47 -04:00
Robert Moore
8940d77d6d [Catalog] Verify all examples provide CatalogByConvention methods (#1911)
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
2017-08-31 08:46:10 -04:00
Will Larche
c3ed6be9d1 [TextFields] New styles: updated default, box, area (#1908)
* [TextFields] New style's API. (#1812)

* [TextFields] New style's API.

* [TextFields] PR feedback.

* [TextFields] Subclassing header.

* [TextFields] Spelling correction.

* [TextFields] Minor correction to API.

* [TextFields] Naming correction.

* [TextFields] Comment update.

* [TextFields] API correction for style.

* [TextFields] Input changes for new styles. (#1814)

* [TextFields] Input changes for new styles.

* [TextFields] PR feedback.

* [TextFields] Removing typo.

* [TextFields] Input changes for new styles. (#1814)

* [TextFields] Input changes for new styles.

* [TextFields] PR feedback.

* [TextFields] Removing typo.

* [TextFields] New default input controller. (#1816)

* [TextField] New default input controller.

* [TextFields] Properties corrections.

* [TextFields] Removing extra logic.

* [TextFields] Code organization.

* [TextFields] Default controller corrections.

* [TextFields] Updating minor full width issues to match other controllers.

* [TextFields] Correcting typos.

* [TextFields] Renaming legacy tests and examples. (#1817)

* [TextFields] Renaming legacy tests and examples. (#1817)

* [TextFields] New text field box style. (#1818)

* [TextFields] New text field box style.

* [TextFields] Formatting issues.

* [TextFields] Updated and new examples for new styles. (#1822)

* [TextFields] Updating tests for new styles and functionality. (#1820)

* [TextFields] Updating tests for new styles and functionality. (#1820)

* [TextFields] New text area style. (#1819)

* [TextFields] New text area style.

* [TextFields] Adding assert for text area init.

* [TextField] Text area corrections.

* [TextFields] Formatting.

* [TextFields] Type safety.

* [TextFields] Legacy full width controller and example (#1855)

* [TextFields] Legacy full width example.

* [TextFields] Legacy full width.

* [TextFields] Adding legacy full width to text fields import file.

* [TextFields] Adding border view. (#1813)

* [TextFields] Adding border view.

* [TextFields] Making Xcode call out missing cases in the future.

* [TextFields] NSCopying style fix.

* [TextFields] Border view.

* [TextFields] Renaming old default to legacy default. (#1815)

* [TextFields] Renaming old default to legacy default.

* [TextFields] Correcting synthesizing of properties.

* [TextFields] Moving some code so it doesn't stick out.

* [TextFields] Correcting new that should be alloc init.

* [TextFields] Removing unneeded logic.

* [TextFields] Supporting old clear button.

* [TextFields] Rounding out main header with all new files (#1863)

* [TextFields] Forgotten imports.

* [TextFields] Correcting alphabetizing.

* [TextFields] Typo correction. (#1864)

* [TextFields] Clear button tint and tests. (#1861)

* [TextFields] Spelling correction. (#1870)

* [TextFields] Naming lost in rebase 'roundedCorners' (#1871)

* [TextFields] Rounded corners work.

* [TextFields] Updating rounded corners rename.

* [TextFields] Correcting naming typo. (#1872)

* [TextFields] Removing MDCTextInputControllerLegacyDefault from IB example. (#1869)

* [TextFields] Removing MDCTextInputControllerLegacyDefault from IB example. (#1869)

* [TextFields] Using class properties by dot syntax.

* [TextFields] Using class properties by dot syntax.

* [TextFields] Class properties access via dot syntax.

* [TextFields] Cleaning up properties.

* [TextFields] Updating legacy full width controller to support new properties.

* [TextFields] Re-adding a file with no history.

* [TextFields] Rebase.

* [TextFields] Art merge correction.

* [TextFields] Minor merge corrections.

* [TextFields] Corrections and additions to kitchen sink (#1899)

* [TextFields] Kitchen sync updates.

* [TextFields] Adding area to kitchen sink.

* [TextFields] Reversing addSubview and tamic off.

* [TextFields] Example updates due to text inset changes. (#1901)

* [TextFields] Adding text insets mode to kitchen sync example.

* [TextFields] Minor example corrections.

* [TextFields] Example updates.

* [TextFields] Adding area to kitchen sink.

* [TextFields] Correcting an example.

* [TextFields] Adding char max to area.

* [TextFields] Reversing addSubview and tamic off.

* [TextFields] Updating controllers for new text inset logic (#1902)

* [TextFields] Lining up some comments better.

* [TextField] Simplifying text inset math.

* [TextFields] Layout logic revamped in controllers.

* [TextFields] Box fix!

* [TextFields] PR feedback.

* [TextFields] Changing insets to react to new property (#1900)

* [TextFields] Creating MDCTextInputAlignmentRectMode.

* [TextFields] Correcting MDCTextInputAlignmentRectMode API.

* [TextFields] AlignmentRectMode implementation.

* [TextFields] Tests for alignment rect.

* [TextFields] MDCTextInputFundamentTextInsetsMode replacing alignment rect mode.

* [TextFields] Text insets mode boiler plate.

* [TextFields] Adding text insets mode to kitchen sync example.

* Revert "[TextFields] Adding text insets mode to kitchen sync example."

This reverts commit 2d4a3ea302d36fc2f79998456e0fcf009ba020d1.

* [TextFields] Moving text insets logic into fundament and updating it to use the new modes.

* [TextFields] Basic text insets affected by text insets mode.

* [TextFields] Improving the line height estimation. (#1905)

* [TextFields] Box style clear button Y fix (#1906)

* [TextFields] Moving clear button const.

* [TextFields] Box clear button polish.

* [TextFields] Autolayout clarity.

* [TextFields] Formatting. (#1907)

* [TextFields] Fixing copyright stanzas.

* [TextFields] One more copyright stanza correction.

* [TextFields] PR feedback.
2017-08-26 08:04:30 -04:00
Will Larche
3bd23322ad [TextFields] Renaming text field controllers to have 'Legacy' (#1876)
* [TextFields] Renaming text field controllers to have 'Legacy'. Also the consequences.

* [TextFields] Reverting a couple naming changes.
2017-08-22 16:48:34 -04:00