Skip to content

Add phrase lookup method #40

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 16, 2017
Merged

Add phrase lookup method #40

merged 2 commits into from
Sep 16, 2017

Conversation

1ec5
Copy link
Member

@1ec5 1ec5 commented Sep 15, 2017

Added a method to look up a phrase format string by name. This allows clients to actually use the phrase support that was added in #38.

Also migrated to the Xcode 8.3 project format, since Xcode automatically accepted all its recommendations for some reason.

/cc @bsudekum

Added a method to look up a phrase format string by name.
@1ec5 1ec5 self-assigned this Sep 15, 2017
@1ec5 1ec5 requested a review from bsudekum September 15, 2017 20:55
*/
public func phrase(named name: PhraseName) -> String {
let phrases = instructions["phrase"] as! [String: String]
return phrases["\(name)"]!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to make this return optional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PhraseName is a limited set of values, so if a valid PhraseName is passed in, I think the return value should be required.

@1ec5 1ec5 merged commit a55c12a into master Sep 16, 2017
@1ec5 1ec5 deleted the 1ec5-phrase-name branch September 16, 2017 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants