This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from gobbl/fix/menu_list
Fixing menu list
- Loading branch information
Showing
7 changed files
with
135 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// CurrencyConverter.swift | ||
// adam | ||
// | ||
// Created by ariyasuk-k on 6/15/15. | ||
// Copyright (c) 2015 gobbl. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct CurrencyConverter { | ||
|
||
static var symbolDict: NSDictionary? { | ||
get { | ||
if let path = NSBundle.mainBundle().pathForResource("CurrencyList", ofType: "plist") { | ||
return NSDictionary(contentsOfFile: path) | ||
} else { | ||
return nil | ||
} | ||
|
||
} | ||
} | ||
|
||
static func codeToSymbol(code:String) -> String { | ||
if let dict = CurrencyConverter.symbolDict { | ||
// Use your dict here | ||
for (key, value) in dict { | ||
let myKey = key as! String | ||
if code == myKey { | ||
return value as! String | ||
} | ||
} | ||
} | ||
return code | ||
} | ||
|
||
static func symbolToCode(symbol:String) -> String { | ||
if let dict = CurrencyConverter.symbolDict { | ||
// Use your dict here | ||
for (key, value) in dict { | ||
let myValue = value as! String | ||
if symbol == myValue { | ||
return key as! String | ||
} | ||
} | ||
} | ||
return symbol | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>GBP</key> | ||
<string>£</string> | ||
<key>EUR</key> | ||
<string>€</string> | ||
<key>SGD</key> | ||
<string>S$</string> | ||
<key>THB</key> | ||
<string>฿</string> | ||
<key>USD</key> | ||
<string>$</string> | ||
<key>JPY</key> | ||
<string>¥</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.