Last active
September 23, 2020 20:11
-
-
Save regularberry/2349344d6c715119ab1e5f72f89c5ae5 to your computer and use it in GitHub Desktop.
This file contains 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
import ClassKit | |
class ActivityCreator: NSObject, CLSDataStoreDelegate { | |
static let shared = ActivityCreator() | |
override init() { | |
super.init() | |
CLSDataStore.shared.delegate = self | |
} | |
func createContext(forIdentifier identifier: String, parentContext: CLSContext, parentIdentifierPath: [String]) -> CLSContext? { | |
if identifier == "MATH-JAM" { | |
let context = CLSContext(type: .game, identifier: "MATH-JAM", title: "Math Jam") | |
context.topic = .math | |
return context | |
} else if identifier == "WORD-JAM" { | |
let context = CLSContext(type: .game, identifier: "WORD-JAM", title: "Word Jam") | |
context.topic = .literacyAndWriting | |
return context | |
} else { | |
return nil | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment