Skip to content

Instantly share code, notes, and snippets.

@thedore17
Created October 5, 2015 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedore17/d854184ae7ca1ecbda15 to your computer and use it in GitHub Desktop.
Save thedore17/d854184ae7ca1ecbda15 to your computer and use it in GitHub Desktop.
open govtrack to district
func setWebViewMapWith(state: String, district: String) {
if (district != "0") {
districtUrl = "https://www.govtrack.us/congress/members/embed/mapframe?state=\(state)&district=\(district)"
}else {
districtUrl = "https://www.govtrack.us/congress/members/embed/mapframe?state=\(state)"
}
setWebViewUrl(districtUrl)
}
func setWebViewUrl(url: String) {
let targetUrl = NSURL (string: districtUrl);
let requestObj = NSURLRequest(URL: targetUrl!);
districtWebView.loadRequest(requestObj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment