Google Analytics I've forgotten

Dealing with GAI through an extension.

Create an extension of UIViewcontroller.

extension UIViewController {
  
  func setScreenName(name: String) {
    self.title = name
    self.sendScreenView()
  }
  
  func sendScreenView() {
    let tracker = GAI.sharedInstance().defaultTracker
    tracker.set(kGAIScreenName, value: self.title)
    var build = GAIDictionaryBuilder.createScreenView().build() as [NSObject : AnyObject]
    tracker.send(build)
  }
  
  func trackEvent(category: String, action: String, label: String, value: NSNumber?) {
    let tracker = GAI.sharedInstance().defaultTracker
    let trackDictionary = GAIDictionaryBuilder.createEventWithCategory(category, action: action, label: label, value: value).build() as [NSObject : AnyObject]
    tracker.send(trackDictionary)
  }
  
}

but if I want another tracker for a different GA property, then I need to switch the default tracker.

extension UIViewController {

 func sendScreenView() {
   var tracker = GAI.sharedInstance().trackerWithTrackingId("UA-XXXXX-1")
   var tracker2 = GAI.sharedInstance().trackerWithTrackingId("UA-XXXX-2")


    tracker.set(kGAIScreenName, value: self.title)
    var build = GAIDictionaryBuilder.createScreenView().build() as [NSObject : AnyObject]
    tracker.send(build)
  }

And, as far as I can tell, there doesn't seem to be any restrictions on naming the event category and so forth when creating the the tracked events.