//
//  OpenWeatherMap.swift
//  SwinjectSimpleExample
//
//  Created by Yoichi Tagaya on 8/10/15.
//  Copyright © 2015 Swinject Contributors. All rights reserved.
//

struct OpenWeatherMap {
    // Replace the empty string with YOUR OWN KEY!
    // The key is available for free.
    // http://openweathermap.org
    private static let apiKey = ""
    
    private static let cityIds = [
        6077243, 524901, 5368361, 1835848, 3128760, 4180439,
        2147714, 264371, 1816670, 2643743, 3451190, 1850147
    ]
    
    static let url = "http://api.openweathermap.org/data/2.5/group"
    
    static var parameters: [String: String] {
        return [
            "APPID": apiKey,
            "id": cityIds.map { String($0) }.joinWithSeparator(",")
        ]
    }
}

//
//  OpenWeatherMap.swift
//  SwinjectSimpleExample
//
//  Created by Yoichi Tagaya on 8/10/15.
//  Copyright © 2015 Swinject Contributors. All rights reserved.
//

struct OpenWeatherMap {
    // Replace the empty string with YOUR OWN KEY!
    // The key is available for free.
    // http://openweathermap.org
    private static let apiKey = ""
    
    private static let cityIds = [
        6077243, 524901, 5368361, 1835848, 3128760, 4180439,
        2147714, 264371, 1816670, 2643743, 3451190, 1850147
    ]
    
    static let url = "http://api.openweathermap.org/data/2.5/group"
    
    static var parameters: [String: String] {
        return [
            "APPID": apiKey,
            "id": ",".join(cityIds.map { String($0) })
        ]
    }
}

--- 
+++ 
@@ -22,7 +22,7 @@
     static var parameters: [String: String] {
         return [
             "APPID": apiKey,
-            "id": ",".join(cityIds.map { String($0) })
+            "id": cityIds.map { String($0) }.joinWithSeparator(",")
         ]
     }
 }
Replace `join` on a string with `joinWithSeparator` on a collection of strings.
