Deleting a Topic

Deleting a topic is simple. Just call the deleteSynchronous: method like in the following sample code:

Swift 3:

  • // Assume that the target topic has been instantiated.
    
    do{
      // Delete the topic.
      try topic.deleteSynchronous()
    } catch let error as NSError {
      // Handle the error.
      return
    }
  • // Assume that the target topic has been instantiated.
    
    // Delete the topic.
    topic.delete { (topic , error : Error?) -> Void in
      if error != nil {
        // Handle the error.
        return
      }
    }

Objective-C:

  • // Assume that the target topic has been instantiated.
    
    NSError *error = nil;
    
    // Delete the topic.
    [topic deleteSynchronous:&error];
    if (error != nil) {
      // Handle the error.
      return;
    }
  • // Assume that the target topic has been instantiated.
    
    // Delete the topic.
    [topic deleteWithBlock:^(KiiTopic *topic, NSError *error) {
      if (error != nil) {
        // Handle the error.
        return;
      }
    }];