             
             // Update UI on main thread.
             dispatch_async(dispatch_get_main_queue()) {
-                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": self.inputCurrency.code, "currencyRate": fetchedInputRate])
-                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": self.outputCurrency.code, "currencyRate": fetchedOutputRate])
+                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": currentInputCurrency, "currencyRate": fetchedInputRate])
+                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": currentOutputCurrency, "currencyRate": fetchedOutputRate])
                 print("Updated input and output currency rates.")
             }
             

    
    func updateCurrentCurrencies() {
        
        func showActivityIndicator() {
            UIApplication.sharedApplication().networkActivityIndicatorVisible = true
            NSNotificationCenter.defaultCenter().postNotificationName("UpdateActivityIndicator", object: nil, userInfo: ["currencyCode": self.inputCurrency.code, "action": "show"])
            NSNotificationCenter.defaultCenter().postNotificationName("UpdateActivityIndicator", object: nil, userInfo: ["currencyCode": self.outputCurrency.code, "action": "show"])
        }
        
        func hideActivityIndicator() {
            // Update UI on main thread.
            dispatch_async(dispatch_get_main_queue()) {
                UIApplication.sharedApplication().networkActivityIndicatorVisible = false
                NSNotificationCenter.defaultCenter().postNotificationName("UpdateActivityIndicator", object: nil, userInfo: ["currencyCode": self.inputCurrency.code, "action": "hide"])
                NSNotificationCenter.defaultCenter().postNotificationName("UpdateActivityIndicator", object: nil, userInfo: ["currencyCode": self.outputCurrency.code, "action": "hide"])
            }
        }
        

            
            // CoreData fetching.
            let inputFetch = NSFetchRequest(entityName: "Currency")
            let inputPredicate = NSPredicate(format: "%K == %@", "code", currentInputCurrency)
            inputFetch.predicate = inputPredicate
            inputFetch.fetchLimit = 2
            let outputFetch = NSFetchRequest(entityName: "Currency")
            let outputPredicate = NSPredicate(format: "%K == %@", "code", currentOutputCurrency)
            outputFetch.predicate = outputPredicate
            outputFetch.fetchLimit = 1
            
