Skip to content

Implement missing functions in Date #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 8, 2016
Merged

Implement missing functions in Date #620

merged 2 commits into from
Sep 8, 2016

Conversation

alblue
Copy link
Contributor

@alblue alblue commented Sep 6, 2016

The two NSUnimplemented functions in Date relate to a class property
timeIntervalSinceReferenceDate which matches an instance property
of the same name, and methods relating to the unkeyed coder.

Implement the timeIntervalSinceReferenceDate by instantiating a
new instance and delegating to the instance property, and change
the unkeyed coder implementations to a fatalError indicating that
they are unsupported.

The two NSUnimplemented functions in Date relate to a class property
`timeIntervalSinceReferenceDate` which matches an instance property
of the same name, and methods relating to the unkeyed coder.

Implement the `timeIntervalSinceReferenceDate` by instantiating a
new instance and delegating to the instance property, and change
the unkeyed coder implementations to a fatalError indicating that
they are unsupported.
Rather than having encode/decode functions with NSUnimplemented, ensure
that they have a fatalError to prevent their use intentionally.

Change existing code from using `if` to using `guard` to make the
patterns more swifty.
@parkera
Copy link
Contributor

parkera commented Sep 7, 2016

@swift-ci please test

@parkera parkera merged commit ff652d6 into swiftlang:master Sep 8, 2016
@naithar naithar mentioned this pull request Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants