Skip to content

Instantly share code, notes, and snippets.

@ErAshu
Last active December 19, 2018 11:26
Show Gist options
  • Save ErAshu/fc91adf44b50fcaa767a7aac39f2a887 to your computer and use it in GitHub Desktop.
Save ErAshu/fc91adf44b50fcaa767a7aac39f2a887 to your computer and use it in GitHub Desktop.
Swift :- US States Array
//
// CountryState.swift
//
// Created by Ashutosh Kumar on 19/12/18.
// Copyright © 2018 AppiKate. All rights reserved.
//
/**
usage:
let usStates = CountryUtilities.USStateList()
*/
import Foundation
import UIKit
struct CountryUtilities {
static func USStateList() -> [[String : String]] {
let stateList = [
[ "code": "AK", "name": "Alaska" ],
[ "code": "AL", "name": "Alabama" ],
[ "code": "AR", "name": "Arkansas" ],
[ "code": "AS", "name": "American Samoa" ],
[ "code": "AZ", "name": "Arizona" ],
[ "code": "CA", "name": "California" ],
[ "code": "CO", "name": "Colorado" ],
[ "code": "CT", "name": "Connecticut" ],
[ "code": "DC", "name": "District of Columbia" ],
[ "code": "DE", "name": "Delaware" ],
[ "code": "FL", "name": "Florida" ],
[ "code": "GA", "name": "Georgia" ],
[ "code": "GU", "name": "Guam" ],
[ "code": "HI", "name": "Hawaii" ],
[ "code": "IA", "name": "Iowa" ],
[ "code": "ID", "name": "Idaho" ],
[ "code": "IL", "name": "Illinois" ],
[ "code": "IN", "name": "Indiana" ],
[ "code": "KS", "name": "Kansas" ],
[ "code": "KY", "name": "Kentucky" ],
[ "code": "LA", "name": "Louisiana" ],
[ "code": "MA", "name": "Massachusetts" ],
[ "code": "MD", "name": "Maryland" ],
[ "code": "ME", "name": "Maine" ],
[ "code": "MI", "name": "Michigan" ],
[ "code": "MN", "name": "Minnesota" ],
[ "code": "MO", "name": "Missouri" ],
[ "code": "MS", "name": "Mississippi" ],
[ "code": "MT", "name": "Montana" ],
[ "code": "NC", "name": "North Carolina" ],
[ "code": "ND", "name": "North Dakota" ],
[ "code": "NE", "name": "Nebraska" ],
[ "code": "NH", "name": "New Hampshire" ],
[ "code": "NJ", "name": "New Jersey" ],
[ "code": "NM", "name": "New Mexico" ],
[ "code": "NV", "name": "Nevada" ],
[ "code": "NY", "name": "New York" ],
[ "code": "OH", "name": "Ohio" ],
[ "code": "OK", "name": "Oklahoma" ],
[ "code": "OR", "name": "Oregon" ],
[ "code": "PA", "name": "Pennsylvania" ],
[ "code": "PR", "name": "Puerto Rico" ],
[ "code": "RI", "name": "Rhode Island" ],
[ "code": "SC", "name": "South Carolina" ],
[ "code": "SD", "name": "South Dakota" ],
[ "code": "TN", "name": "Tennessee" ],
[ "code": "TX", "name": "Texas" ],
[ "code": "UT", "name": "Utah" ],
[ "code": "VA", "name": "Virginia" ],
[ "code": "VI", "name": "Virgin Islands" ],
[ "code": "VT", "name": "Vermont" ],
[ "code": "WA", "name": "Washington" ],
[ "code": "WI", "name": "Wisconsin" ],
[ "code": "WV", "name": "West Virginia" ],
[ "code": "WY", "name": "Wyoming" ]
]
return stateList
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment