Implemented Categories#18
Open
max-simon wants to merge 2 commits intoiOS-Dev-Kurs:masterfrom
max-simon:master
Open
Implemented Categories#18max-simon wants to merge 2 commits intoiOS-Dev-Kurs:masterfrom max-simon:master
max-simon wants to merge 2 commits intoiOS-Dev-Kurs:masterfrom
max-simon:master
Conversation
added 2 commits
April 27, 2016 23:12
Categories help you to get your communication specified by talking about a global category. Change a category easy with a Message.type and define which categories you can deal with.
Member
|
Hi Max, erstmal super coole Idee mit den 2/2 Pt. schonmal 💯 Damit ich das mergen kann darf es jedoch keine Auswirkungen auf die anderen Subklassen haben sondern "opt-in" sein. Ein weiterer
Du kannst das gern implementieren, sonst mach ich das mal bei Gelegenheit. Funktioniert mit |
| // Implementation of Topics | ||
| enum Topic : String { | ||
| case none = "none", Science = "Science", Apples = "Apples", Relativity = "Relativity", Physics = "Physics" // Add Topics here | ||
| var description: String { |
Member
There was a problem hiding this comment.
Die rawValues brauchst du nicht, Topic muss nicht von String ableiten denke ich.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Categories help you to get your communication specified by talking
about a global category. Change a category easy with a Message.type and
define which categories you can deal with.
Important: please add a default case to your switch-Statements when asking for the Message-type (this will not be executed :))
How to Work with Topics?
If you want to create a topic go to Chatter.swift and add the Topic in the enum (with Description!)
In the initializer of your chatter give possibleTopics a list of toppings your chatter want to talk about. (by default none)
If you want to give individual answers for a ask to change the topic you can write them to sayNoToTopicChangeWith and sayYesToTopicChangeWith
You can create your own Question to ask someone to change the topic. The Last word is computed and is the name of the topic.
Now in your functions nextMessage() and responseForMessage you can ask the variable theCurrentTopic which Toping is now. With this you can adjust your answers to the topic.