From 0c0e0f2058dced002dfca28ef2ed7688ef3d253c Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Tue, 17 May 2016 15:41:17 +0300 Subject: [PATCH] fix Swift 2.2 deprecation warnings --- GATracker.swift | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/GATracker.swift b/GATracker.swift index e8acc41..054f64a 100644 --- a/GATracker.swift +++ b/GATracker.swift @@ -129,12 +129,10 @@ class GATracker { /* An event hit with category, action, label */ - if label == nil { - label = "" - } - + let label = label ?? "" + //event parameters category, action and label - var params = ["ec" : category, "ea" : action, "el" : label!] + var params = ["ec" : category, "ea" : action, "el" : label] if (customParameters != nil) { for (key, value) in customParameters! { params.updateValue(value, forKey: key) @@ -147,12 +145,10 @@ class GATracker { /* An event hit with category, interval, name, label */ - if label == nil { - label = "" - } - + let label = label ?? "" + //measure parameters category, interval, name and label - var params = ["utc" : category, "utv" : name, "utl" : label!, "utt" : "\(interval)"] + var params = ["utc" : category, "utv" : name, "utl" : label, "utt" : "\(interval)"] if (customParameters != nil) { for (key, value) in customParameters! { params.updateValue(value, forKey: key)