Introducing ClassKit

WWDC 2018

Posted by Den on August 06, 2018 · 8 mins read
Introducing ClassKit

Introducing ClassKit

WWDC 2018

Introducing ClassKit

WWDC 2018

Apple School Manager

  • Create managed Apple IDs
  • Create rosters
  • Manage content and devices
  • Opt in for progress reporting
  • Purchase apps in bulk

Schoolwork

  • A new education app for students and teachers
  • View assigned handouts
  • Create new handouts
  • View progress reports

LifeCycle of a Handout

  • Content is represented via CLSContext
  • One main app context (root context)
  • App content is added to the app context
  • Define content as early as possible

Developer Mode

  • Settings > Developer > ClassKit API

Framework Classes

CLSDataStore

  • Maintains the context tree
  • Exposes the mainAppContext as a property
  • Keeps track of modified objects
    - Objects saved by calling CLSDataStore.save(completion: )
  • One shared instance

CLSContext

Context Identity

  • identifier property
  • Context identifier Path
    - Identifies a context within a context tree
    - Array of context identifiers

Context Identifier Path

Context Lookup

Using absolute context path
Using relative context path
Using predicate

CLSDataStore Delegate

  • Works in conjunction with path query methods
  • Used to create missing contexts on demand
  • Useful for apps with dynamic content

CLSActivity

  • Always associated with contexts
  • Created by calling CLSContext.createNewActivity() → CLSActivity
  • Access current using CLSContext.currentActivity: CLSActivity?
  • Creating a new activity is akin to a new attempt
Adding progress

CLSActivityItem

  • Abstract class with three subclasses
  • Always set the same subclass for primary activity items
  • Provide clear and concise titles
  • Make use of additional activity items
Adding activity items

Steps for Adopting ClassKit

  • Define CLSContext structure
  • Add CLSActivity and CLSActivityItems
  • Support deep linking
  • Test with Developer Mode and Schoolwork

Defining CLSContext Tree

CLSContext

  • Use clear titles !!!
  • Define contexts early
  • Take advantage of displayOrder

CLSActivity

Demo

[ Sample App Link ]