├── HXCurrencyConversion ├── Assets.xcassets │ ├── Contents.json │ ├── arrow_right.imageset │ │ ├── arrow_right.png │ │ ├── arrow_right@2x.png │ │ ├── arrow_right@3x.png │ │ └── Contents.json │ ├── transformation.imageset │ │ ├── transformation.png │ │ ├── transformation@2x.png │ │ ├── transformation@3x.png │ │ └── Contents.json │ ├── LaunchImage.launchimage │ │ ├── Default-568h@2x.png │ │ ├── Default-667h@2x.png │ │ └── Contents.json │ ├── currency_exchange.imageset │ │ ├── currency_exchange.png │ │ ├── currency_exchange@2x.png │ │ ├── currency_exchange@3x.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── xiaoguo.gif ├── Swift │ ├── Main │ │ ├── HXCurrencyConversion-Bridging-Header.h │ │ └── ViewController │ │ │ ├── HXHomeSwiftViewController.swift │ │ │ ├── HXCurrencySelectionSwiftViewController.swift │ │ │ └── HXHomeSwiftViewController.xib │ ├── Currency │ │ └── HXCurrencySwiftManager.swift │ └── Network │ │ └── HXRequestSwiftManager.swift ├── OC │ ├── Main │ │ └── ViewController │ │ │ ├── HXHomeViewController.h │ │ │ ├── HXCurrencySelectionViewController.h │ │ │ ├── HXHomeViewController.m │ │ │ ├── HXCurrencySelectionViewController.m │ │ │ └── HXHomeViewController.xib │ ├── Currency │ │ ├── HXCurrencyManager.h │ │ └── HXCurrencyManager.m │ └── Network │ │ ├── HXRequestManager.h │ │ └── HXRequestManager.m ├── AppDelegate.h ├── main.m ├── Info.plist ├── AppDelegate.m └── currencycodetable.plist ├── HXCurrencyConversion.xcodeproj ├── xcuserdata │ └── huangxuan518.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── HXCurrencyConversion.xcscheme ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj └── README.md /HXCurrencyConversion/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /HXCurrencyConversion/xiaoguo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/xiaoguo.gif -------------------------------------------------------------------------------- /HXCurrencyConversion/Swift/Main/HXCurrencyConversion-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /HXCurrencyConversion.xcodeproj/xcuserdata/huangxuan518.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/arrow_right.imageset/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/arrow_right.imageset/arrow_right.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/arrow_right.imageset/arrow_right@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/arrow_right.imageset/arrow_right@2x.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/arrow_right.imageset/arrow_right@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/arrow_right.imageset/arrow_right@3x.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/transformation.imageset/transformation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/transformation.imageset/transformation.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/transformation.imageset/transformation@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/transformation.imageset/transformation@2x.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/transformation.imageset/transformation@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/transformation.imageset/transformation@3x.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/currency_exchange.imageset/currency_exchange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/currency_exchange.imageset/currency_exchange.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/currency_exchange.imageset/currency_exchange@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/currency_exchange.imageset/currency_exchange@2x.png -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/currency_exchange.imageset/currency_exchange@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangxuan518/HXCurrencyConversion/HEAD/HXCurrencyConversion/Assets.xcassets/currency_exchange.imageset/currency_exchange@3x.png -------------------------------------------------------------------------------- /HXCurrencyConversion.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Main/ViewController/HXHomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HXHomeViewController.h 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/3. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HXHomeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HXCurrencyConversion/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/3. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /HXCurrencyConversion/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/3. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/arrow_right.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "arrow_right.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "arrow_right@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "arrow_right@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/transformation.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "transformation.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "transformation@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "transformation@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/currency_exchange.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "currency_exchange.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "currency_exchange@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "currency_exchange@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Main/ViewController/HXCurrencySelectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HXCurrencySelectionViewController.h 3 | // https://github.com/huangxuan518/HXInternationalizationDemo 4 | // 5 | // Created by 黄轩 on 16/7/29. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HXCurrencySelectionViewController : UIViewController 12 | 13 | @property (nonatomic,copy) NSString *currentCurrency; //当前货币码 14 | 15 | @property (nonatomic,copy) void (^completion)(HXCurrencySelectionViewController *vc, NSString *currency); 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /HXCurrencyConversion.xcodeproj/xcuserdata/huangxuan518.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | HXCurrencyConversion.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E4B8246E1D51C7C90053DEB3 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HXCurrencyConversion 如果对你有一点点帮助,请给一颗★,你的支持是对我的最大鼓励! 2 | 货币转换器 3 | 4 | 该货币转换器支持全球100多个国家的货币互转,汇率为在线实时获取,如果对你有帮助可以下载! 5 | 6 | 该项目有OC版和Swift版,希望对你有所帮助! 7 | 8 | # 效果图 9 | ![image](https://github.com/huangxuan518/HXCurrencyConversion/blob/master/HXCurrencyConversion/xiaoguo.gif) 10 | 11 | # 支持货币 12 | 13 | 目前支持173种货币,基本上包括了全球大部分国家货币,如果缺少你所需要的货币,可以在currencycodetable.plist文件中添加,key为货币代码,value为货币名称 14 | 15 | # 其他说明 16 | 17 | 默认原始币种类型为USD,目标币种类型为CNY,当用户重新选择了币种,本地会做一个缓存,下次进入会将之前选择的货币类型显示,方便使用,币种更换需要点击转换,才会显示最新的汇率和币种对应的转换货币数量,由于货币比较多,可以用搜索功能搜索,支持中英文搜索,不区分大小写 18 | 19 | # 在线预览 20 | 21 | https://appetize.io/app/8q9p3qhefm2tz7xr6ec2n73azw 22 | 23 | # 博客交流 24 | 25 | http://blog.libuqing.com/ 26 | 27 | 28 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Currency/HXCurrencyManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // HXCurrencyManager.h 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/4. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HXCurrencyManager : NSObject 12 | 13 | //所有币种 14 | - (NSArray *)allCurrencies; 15 | 16 | //货币代码转货币名 17 | - (NSString *)toCurrencyName:(NSString *)currency; 18 | 19 | //保存当前待转换币种 20 | - (void)saveFromCurrency:(NSString *)fromCurrency; 21 | //保存目标货币 22 | - (void)saveToCurrency:(NSString *)toCurrency; 23 | 24 | //获取当前待转换币种 25 | - (NSString *)currentFromCurrency; 26 | //获取目标货币 27 | - (NSString *)currentToCurrency; 28 | 29 | + (instancetype)shareInstance; 30 | 31 | #define kCurrencyManager [HXCurrencyManager shareInstance] 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UIRequiredDeviceCapabilities 31 | 32 | armv7 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationPortrait 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Network/HXRequestManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // HXRequestManager.h 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/4. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define apikey @"fd0a97bd4bcb79b91c50b47c7fa8246d" 12 | 13 | @interface HXRequestManager : NSObject 14 | 15 | /** 16 | * 支持的币种查询 http://apis.baidu.com/apistore/currencyservice/type 17 | * 18 | * @param success <#success description#> 19 | * @param failure <#failure description#> 20 | */ 21 | - (void)getCurrencySupportListRequest:(void(^)(NSArray *responseAry, NSInteger responseCode))success 22 | failure:(void(^)(NSString *localizedDescription))failure ; 23 | 24 | /** 25 | * 汇率转换 http://apis.baidu.com/apistore/currencyservice/currency?fromCurrency=%@&toCurrency=%@&amount=%@ 26 | * 27 | * @param fromCurrency 待转化的币种 28 | * @param toCurrency 转化后的币种 29 | * @param amount 转化金额 30 | * @param success <#success description#> 31 | * @param failure <#failure description#> 32 | */ 33 | - (void)getExchangeRateConversionReuqestWithFromCurrency:(NSString *)fromCurrency 34 | toCurrency:(NSString *)toCurrency 35 | amount:(NSString *)amount 36 | success:(void(^)(NSDictionary *responseDic, NSInteger responseCode))success 37 | failure:(void(^)(NSString *localizedDescription))failure; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "8.0", 8 | "subtype" : "736h", 9 | "scale" : "3x" 10 | }, 11 | { 12 | "orientation" : "landscape", 13 | "idiom" : "iphone", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "8.0", 16 | "subtype" : "736h", 17 | "scale" : "3x" 18 | }, 19 | { 20 | "extent" : "full-screen", 21 | "idiom" : "iphone", 22 | "subtype" : "667h", 23 | "filename" : "Default-667h@2x.png", 24 | "minimum-system-version" : "8.0", 25 | "orientation" : "portrait", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "orientation" : "portrait", 30 | "idiom" : "iphone", 31 | "extent" : "full-screen", 32 | "minimum-system-version" : "7.0", 33 | "scale" : "2x" 34 | }, 35 | { 36 | "extent" : "full-screen", 37 | "idiom" : "iphone", 38 | "subtype" : "retina4", 39 | "filename" : "Default-568h@2x.png", 40 | "minimum-system-version" : "7.0", 41 | "orientation" : "portrait", 42 | "scale" : "2x" 43 | }, 44 | { 45 | "orientation" : "portrait", 46 | "idiom" : "iphone", 47 | "extent" : "full-screen", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "orientation" : "portrait", 52 | "idiom" : "iphone", 53 | "extent" : "full-screen", 54 | "scale" : "2x" 55 | }, 56 | { 57 | "orientation" : "portrait", 58 | "idiom" : "iphone", 59 | "extent" : "full-screen", 60 | "subtype" : "retina4", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /HXCurrencyConversion/Swift/Currency/HXCurrencySwiftManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HXCurrencySwiftManager.swift 3 | // HXCurrencyConversion 4 | // 5 | // Created by 黄轩 on 16/8/15. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let sharedKraken = HXCurrencySwiftManager() 12 | 13 | class HXCurrencySwiftManager: NSObject { 14 | 15 | var _data:NSDictionary? 16 | let kfromCurrency = "fromCurrency" 17 | let ktoCurrency = "toCurrency" 18 | 19 | class var sharedInstance: HXCurrencySwiftManager { 20 | return sharedKraken 21 | } 22 | 23 | func data() -> NSDictionary 24 | { 25 | if (_data == nil) 26 | { 27 | let plistPath = NSBundle.mainBundle().pathForResource("currencycodetable", ofType: "plist") 28 | _data = NSMutableDictionary(contentsOfFile: plistPath!) 29 | } 30 | return _data!; 31 | } 32 | 33 | func allCurrencies() -> NSArray 34 | { 35 | return self.data().allKeys; 36 | } 37 | 38 | func toCurrencyName(currency:String) -> String 39 | { 40 | return self.data()[currency] as! String; 41 | } 42 | 43 | //保存当前待转换币种 44 | func saveFromCurrency(fromCurrency:String) 45 | { 46 | let defaults = NSUserDefaults.standardUserDefaults() 47 | defaults.setValue(fromCurrency, forKey: kfromCurrency) 48 | defaults.synchronize() 49 | } 50 | 51 | //保存目标货币 52 | func saveToCurrency(toCurrency:String) 53 | { 54 | let defaults = NSUserDefaults.standardUserDefaults() 55 | defaults.setValue(toCurrency, forKey: ktoCurrency) 56 | defaults.synchronize() 57 | } 58 | 59 | //获取当前待转换币种 60 | func currentFromCurrency() ->String 61 | { 62 | let defaults = NSUserDefaults.standardUserDefaults() 63 | let fromCurrency = defaults.objectForKey(kfromCurrency) as? String 64 | 65 | if (fromCurrency!.isEmpty) { 66 | return "USD"; 67 | } 68 | return fromCurrency!; 69 | } 70 | 71 | //获取目标货币 72 | func currentToCurrency() ->String 73 | { 74 | let defaults = NSUserDefaults.standardUserDefaults() 75 | let toCurrency = defaults.objectForKey(ktoCurrency) as? String 76 | 77 | if (toCurrency!.isEmpty) { 78 | return "CNY"; 79 | } 80 | return toCurrency!; 81 | } 82 | } 83 | 84 | 85 | -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Currency/HXCurrencyManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // HXCurrencyManager.m 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/4. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import "HXCurrencyManager.h" 10 | 11 | #define FromCurrency @"fromCurrency" 12 | #define ToCurrency @"toCurrency" 13 | 14 | @interface HXCurrencyManager () 15 | 16 | @property (nonatomic,strong) NSDictionary *data; 17 | 18 | @end 19 | 20 | @implementation HXCurrencyManager 21 | 22 | + (instancetype)shareInstance { 23 | static HXCurrencyManager *_manager = nil; 24 | static dispatch_once_t oncePredicate; 25 | dispatch_once(&oncePredicate, ^{ 26 | _manager = [[self alloc] init]; 27 | }); 28 | return _manager; 29 | } 30 | 31 | - (NSDictionary *)data { 32 | if (!_data) { 33 | NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"currencycodetable" ofType:@"plist"]; 34 | _data = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 35 | } 36 | return _data; 37 | } 38 | 39 | - (NSArray *)allCurrencies { 40 | return self.data.allKeys; 41 | } 42 | 43 | //货币代码转货币名 44 | - (NSString *)toCurrencyName:(NSString *)currency { 45 | return self.data[currency]; 46 | } 47 | 48 | //保存当前待转换币种 49 | - (void)saveFromCurrency:(NSString *)fromCurrency { 50 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 51 | [defaults setValue:fromCurrency forKey:FromCurrency]; 52 | [defaults synchronize]; 53 | } 54 | 55 | //保存目标货币 56 | - (void)saveToCurrency:(NSString *)toCurrency { 57 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 58 | [defaults setValue:toCurrency forKey:ToCurrency]; 59 | [defaults synchronize]; 60 | } 61 | 62 | //获取当前待转换币种 63 | - (NSString *)currentFromCurrency { 64 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 65 | NSString *fromCurrency = [defaults objectForKey:FromCurrency]; 66 | if (fromCurrency.length > 0) { 67 | return fromCurrency; 68 | } 69 | return @"USD"; 70 | } 71 | 72 | //获取目标货币 73 | - (NSString *)currentToCurrency { 74 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 75 | NSString *toCurrency = [defaults objectForKey:ToCurrency]; 76 | if (toCurrency.length > 0) { 77 | return toCurrency; 78 | } 79 | return @"CNY"; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /HXCurrencyConversion/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/3. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "HXHomeViewController.h" 11 | #import "HXCurrencyConversion-Swift.h" 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | // Override point for customization after application launch. 22 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | 25 | //OC版入口 26 | //HXHomeViewController *vc = [HXHomeViewController new]; 27 | //swift版入口 28 | HXHomeSwiftViewController *vc = [HXHomeSwiftViewController new]; 29 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; 30 | self.window.rootViewController = nav; 31 | 32 | [self.window makeKeyAndVisible]; 33 | 34 | return YES; 35 | } 36 | 37 | - (void)applicationWillResignActive:(UIApplication *)application { 38 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 39 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 40 | } 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application { 43 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 44 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 45 | } 46 | 47 | - (void)applicationWillEnterForeground:(UIApplication *)application { 48 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 49 | } 50 | 51 | - (void)applicationDidBecomeActive:(UIApplication *)application { 52 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 53 | } 54 | 55 | - (void)applicationWillTerminate:(UIApplication *)application { 56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Swift/Network/HXRequestSwiftManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HXRequestSwiftManager.swift 3 | // HXCurrencyConversion 4 | // 5 | // Created by 黄轩 on 16/8/5. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HXRequestSwiftManager: NSObject { 12 | 13 | func getCurrencySupportListRequest(completionHandler success: (NSArray?, String?) -> (), faileHandler failure: (String?) -> ()) 14 | { 15 | let httpUrl = "http://apis.baidu.com/apistore/currencyservice/type" 16 | let httpArg = "" 17 | 18 | let req = NSMutableURLRequest(URL: NSURL(string: httpUrl + "?" + httpArg)!) 19 | req.timeoutInterval = 6 20 | req.HTTPMethod = "GET" 21 | req.addValue("fd0a97bd4bcb79b91c50b47c7fa8246d", forHTTPHeaderField: "apikey") 22 | NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { 23 | (response, data, error) -> Void in 24 | 25 | if (error != nil) { 26 | failure(error!.localizedDescription) 27 | } else { 28 | let dic = self.toArrayOrNSDictionary(data) as! NSDictionary; 29 | let errMsg = dic["errMsg"] as! String 30 | let responseAry = dic["retData"] as? NSArray; 31 | success(responseAry, errMsg); 32 | } 33 | } 34 | } 35 | 36 | func getExchangeRateConversionReuqestWithFromCurrency(fromCurrency: String, toCurrency: String, amount: String, completionHandler success: (NSDictionary?, String?) -> (), faileHandler failure: (String?) -> ()) 37 | { 38 | let httpUrl = "http://apis.baidu.com/apistore/currencyservice/currency" 39 | let httpArg = "fromCurrency=" + (fromCurrency as String) + "&toCurrency=" + (toCurrency as String) + "&amount=" + (amount as String) 40 | 41 | let req = NSMutableURLRequest(URL: NSURL(string: httpUrl + "?" + httpArg)!) 42 | req.timeoutInterval = 6 43 | req.HTTPMethod = "GET" 44 | req.addValue("fd0a97bd4bcb79b91c50b47c7fa8246d", forHTTPHeaderField: "apikey") 45 | NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { 46 | (response, data, error) -> Void in 47 | 48 | if (error != nil) { 49 | failure(error!.localizedDescription) 50 | } else { 51 | let dic = self.toArrayOrNSDictionary(data) as! NSDictionary; 52 | let errMsg = dic["errMsg"] as! String 53 | let responseDic = dic["retData"] as? NSDictionary; 54 | success(responseDic, errMsg); 55 | } 56 | } 57 | } 58 | 59 | func toArrayOrNSDictionary(jsonData:NSData!)-> AnyObject { 60 | let data = try! NSJSONSerialization.JSONObjectWithData(jsonData!, options: NSJSONReadingOptions.AllowFragments) 61 | return data 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /HXCurrencyConversion.xcodeproj/xcuserdata/huangxuan518.xcuserdatad/xcschemes/HXCurrencyConversion.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Network/HXRequestManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // HXRequestManager.m 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/4. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import "HXRequestManager.h" 10 | 11 | @implementation HXRequestManager 12 | 13 | #pragma mark - Request 14 | 15 | /** 16 | * 支持的币种查询 http://apis.baidu.com/apistore/currencyservice/type 17 | * 18 | * @param success <#success description#> 19 | * @param failure <#failure description#> 20 | */ 21 | - (void)getCurrencySupportListRequest:(void(^)(NSArray *responseAry, NSInteger responseCode))success 22 | failure:(void(^)(NSString *localizedDescription))failure { 23 | 24 | NSString *httpUrl = @"http://apis.baidu.com/apistore/currencyservice/type"; 25 | NSString *httpArg = @""; 26 | 27 | NSString *urlStr = [[NSString alloc] initWithFormat: @"%@?%@",httpUrl,httpArg]; 28 | 29 | NSURL *url = [NSURL URLWithString:urlStr]; 30 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval:10]; 31 | [request setHTTPMethod:@"GET"]; 32 | [request addValue:apikey forHTTPHeaderField:@"apikey"]; 33 | [NSURLConnection sendAsynchronousRequest:request 34 | queue:[NSOperationQueue mainQueue] 35 | completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){ 36 | if (error) { 37 | failure(error.localizedDescription); 38 | } else { 39 | NSInteger responseCode = [(NSHTTPURLResponse *)response statusCode]; 40 | NSDictionary *dic = [self toArrayOrNSDictionary:data]; 41 | NSArray *ary = dic[@"retData"]; 42 | success(ary,responseCode); 43 | } 44 | }]; 45 | } 46 | 47 | /** 48 | * 汇率转换 http://apis.baidu.com/apistore/currencyservice/currency?fromCurrency=%@&toCurrency=%@&amount=%@ 49 | * 50 | * @param fromCurrency 待转化的币种 51 | * @param toCurrency 转化后的币种 52 | * @param amount 转化金额 53 | * @param success <#success description#> 54 | * @param failure <#failure description#> 55 | */ 56 | - (void)getExchangeRateConversionReuqestWithFromCurrency:(NSString *)fromCurrency 57 | toCurrency:(NSString *)toCurrency 58 | amount:(NSString *)amount 59 | success:(void(^)(NSDictionary *responseDic, NSInteger responseCode))success 60 | failure:(void(^)(NSString *localizedDescription))failure { 61 | NSString *httpUrl = @"http://apis.baidu.com/apistore/currencyservice/currency"; 62 | NSString *httpArg = [NSString stringWithFormat:@"fromCurrency=%@&toCurrency=%@&amount=%@",fromCurrency,toCurrency,amount]; 63 | 64 | NSString *urlStr = [[NSString alloc] initWithFormat: @"%@?%@",httpUrl,httpArg]; 65 | NSURL *url = [NSURL URLWithString:urlStr]; 66 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval:10]; 67 | [request setHTTPMethod:@"GET"]; 68 | [request addValue:apikey forHTTPHeaderField:@"apikey"]; 69 | [NSURLConnection sendAsynchronousRequest:request 70 | queue:[NSOperationQueue mainQueue] 71 | completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){ 72 | if (error) { 73 | failure(error.localizedDescription); 74 | } else { 75 | NSInteger responseCode = [(NSHTTPURLResponse *)response statusCode]; 76 | NSDictionary *dic = [self toArrayOrNSDictionary:data]; 77 | NSDictionary *responseDic = dic[@"retData"]; 78 | 79 | success(responseDic,responseCode); 80 | } 81 | }]; 82 | } 83 | 84 | // 将JSON串转化为字典或者数组 85 | - (id)toArrayOrNSDictionary:(NSData *)jsonData { 86 | NSError *error = nil; 87 | id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData 88 | options:NSJSONReadingAllowFragments 89 | error:&error]; 90 | if (jsonObject != nil && error == nil) { 91 | return jsonObject; 92 | } else { 93 | // 解析错误 94 | return nil; 95 | } 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Swift/Main/ViewController/HXHomeSwiftViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HXHomeSwiftViewController.swift 3 | // HXCurrencyConversion 4 | // 5 | // Created by 黄轩 on 16/8/5. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HXHomeSwiftViewController : UIViewController { 12 | 13 | @IBOutlet weak var _displayLabel: UILabel! //显示Label 1人民币 = 5.2555泰铢 14 | @IBOutlet weak var _exchangeRateLabel: UILabel! //汇率 15 | @IBOutlet weak var _fromCurrencyLabel: UILabel! //待转换币种Label 16 | @IBOutlet weak var _toCurrencyLabel: UILabel! //转换后币种Label 17 | @IBOutlet weak var _updateTimeLabel: UILabel! //更新时间 18 | 19 | var _fromCurrency: String? //待转化的币种 20 | var _toCurrency: String? //转化后的币种 21 | var _amount: String? //转化金额 22 | 23 | var _request: HXRequestSwiftManager? //请求 24 | 25 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?){ 26 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 27 | 28 | _fromCurrency = HXCurrencySwiftManager.sharedInstance.currentFromCurrency(); 29 | _toCurrency = HXCurrencySwiftManager.sharedInstance.currentToCurrency(); 30 | _amount = "1"; 31 | } 32 | 33 | required init?(coder aDecoder: NSCoder) { 34 | fatalError("init(coder:) has not been implemented") 35 | } 36 | 37 | override func viewDidLoad() { 38 | super.viewDidLoad() 39 | // Do any additional setup after loading the view, typically from a nib. 40 | self.title = "货币转换"; 41 | 42 | self.exchangeRateConversionReuqest() 43 | } 44 | 45 | func exchangeRateConversionReuqest() { 46 | 47 | weak var weakSelf = self 48 | self.request().getExchangeRateConversionReuqestWithFromCurrency(_fromCurrency!, toCurrency: _toCurrency!, amount: _amount!, completionHandler: {(responseDic, msg) -> () in 49 | 50 | weakSelf!.refreshData(responseDic!) 51 | 52 | }, faileHandler: {(errMsg) -> () in 53 | print(errMsg) 54 | }); 55 | } 56 | 57 | //输入金额改变 58 | @IBAction func textFieldEditingChange(sender: UITextField) { 59 | _amount = sender.text; 60 | } 61 | 62 | @IBAction func exchangeButtonAction(sender: UIButton) { 63 | let str = _fromCurrency; 64 | _fromCurrency = _toCurrency; 65 | _toCurrency = str; 66 | 67 | self.initUI(); 68 | } 69 | 70 | //转换 71 | @IBAction func transformationButtonAction(sender: UIButton) { 72 | self.view.endEditing(true) 73 | 74 | self.exchangeRateConversionReuqest() 75 | } 76 | 77 | //币种选择 78 | @IBAction func currencySelectionButtonAction(sender: UIButton) { 79 | 80 | let vc = HXCurrencySelectionSwiftViewController() 81 | if (sender.tag == 10) { 82 | //待转换货币码 83 | vc.currentCurrency = _fromCurrency; 84 | } else if (sender.tag == 11) { 85 | //转换后货币码 86 | vc.currentCurrency = _toCurrency; 87 | } 88 | 89 | weak var weakSelf = self 90 | vc.completion = { 91 | (vc:HXCurrencySelectionSwiftViewController, currency:String) in 92 | 93 | if (sender.tag == 10) { 94 | //待转换货币码 95 | if (weakSelf!._fromCurrency != currency) { 96 | weakSelf!._fromCurrency = currency; 97 | } 98 | } else if (sender.tag == 11) { 99 | //转换后货币码 100 | if (weakSelf!._toCurrency != currency) { 101 | weakSelf!._toCurrency = currency; 102 | } 103 | } 104 | 105 | self.initUI(); 106 | }; 107 | 108 | let nav = UINavigationController(rootViewController: vc) 109 | self.navigationController?.presentViewController(nav, animated: true, completion: { () -> Void in 110 | 111 | }) 112 | } 113 | 114 | func refreshData(dataDic:NSDictionary) 115 | { 116 | let date = dataDic["date"] as! String 117 | let time = dataDic["time"] as! String 118 | let fromCurrency = dataDic["fromCurrency"] as! String 119 | let fromCurrencyCompany = HXCurrencySwiftManager.sharedInstance.toCurrencyName(fromCurrency) 120 | let toCurrency = dataDic["toCurrency"] as! String 121 | let toCurrencyCompany = HXCurrencySwiftManager.sharedInstance.toCurrencyName(toCurrency) 122 | 123 | let amount:NSInteger = NSInteger(dataDic["amount"]!.integerValue) 124 | let currency:CGFloat = CGFloat(dataDic["currency"]!.floatValue) 125 | let convertedamount:CGFloat = CGFloat(dataDic["convertedamount"]!.floatValue) 126 | 127 | _displayLabel.text = "\(amount)\(fromCurrencyCompany)=\(String(format: "%.4f", convertedamount))\(toCurrencyCompany)" 128 | _exchangeRateLabel.text = String(format: "当前汇率:%.4f", currency) 129 | 130 | self.initUI() 131 | 132 | _updateTimeLabel.text = "数据仅供参考,交易时以银行柜台成交价为准 更新时间:\(date) \(time)" 133 | } 134 | 135 | func initUI() 136 | { 137 | HXCurrencySwiftManager().saveFromCurrency(_fromCurrency!) 138 | HXCurrencySwiftManager().saveToCurrency(_toCurrency!) 139 | 140 | _fromCurrencyLabel.text = "原始币种类型:\(HXCurrencySwiftManager.sharedInstance.toCurrencyName(_fromCurrency!))\(_fromCurrency!)" 141 | 142 | _toCurrencyLabel.text = "目标币种类型:\(HXCurrencySwiftManager.sharedInstance.toCurrencyName(_toCurrency!))\(_toCurrency!)" 143 | } 144 | 145 | func request() -> HXRequestSwiftManager 146 | { 147 | if (_request == nil) 148 | { 149 | _request = HXRequestSwiftManager() 150 | } 151 | return _request!; 152 | } 153 | } 154 | 155 | -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Main/ViewController/HXHomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HXHomeViewController.m 3 | // HXCurrencyConversion https://github.com/huangxuan518/HXCurrencyConversion 4 | // 博客地址 http://blog.libuqing.com/ 5 | // Created by 黄轩 on 16/8/3. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import "HXHomeViewController.h" 10 | #import "HXCurrencySelectionViewController.h" 11 | 12 | #import "HXRequestManager.h" 13 | #import "HXCurrencyManager.h" 14 | 15 | @interface HXHomeViewController () 16 | 17 | @property (weak, nonatomic) IBOutlet UILabel *exchangeRateLabel; //汇率 18 | @property (weak, nonatomic) IBOutlet UILabel *displayLabel; //显示Label 1人民币 = 5.2555泰铢 19 | @property (weak, nonatomic) IBOutlet UILabel *fromCurrencyLabel; //待转换币种Label 20 | @property (weak, nonatomic) IBOutlet UILabel *toCurrencyLabel; //转换后币种Label 21 | @property (weak, nonatomic) IBOutlet UILabel *updateTimeLabel; //更新时间 22 | 23 | @property (nonatomic,copy) NSString *fromCurrency; //待转化的币种 24 | @property (nonatomic,copy) NSString *toCurrency; //转化后的币种 25 | @property (nonatomic,copy) NSString *amount; //转化金额 26 | 27 | @property (nonatomic,strong) HXRequestManager *request; 28 | 29 | @end 30 | 31 | @implementation HXHomeViewController 32 | 33 | - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 34 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 35 | if (self) { 36 | _fromCurrency = [kCurrencyManager currentFromCurrency]; 37 | _toCurrency = [kCurrencyManager currentToCurrency]; 38 | _amount = @"1"; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)viewDidLoad { 44 | [super viewDidLoad]; 45 | // Do any additional setup after loading the view from its nib. 46 | self.title = @"货币转换"; 47 | 48 | [self exchangeRateConversionReuqest]; 49 | } 50 | 51 | #pragma mark - request 52 | 53 | //转换 54 | - (void)exchangeRateConversionReuqest { 55 | [self.request getExchangeRateConversionReuqestWithFromCurrency:_fromCurrency toCurrency:_toCurrency amount:_amount success:^(NSDictionary *responseDic, NSInteger responseCode) { 56 | 57 | [self refreshData:responseDic]; 58 | 59 | } failure:^(NSString *localizedDescription) { 60 | NSLog(@"Httperror: %@", localizedDescription); 61 | }]; 62 | } 63 | 64 | 65 | #pragma mark - Action 66 | 67 | //输入金额改变 68 | - (IBAction)textFieldEditingChange:(UITextField *)sender { 69 | _amount = sender.text; 70 | } 71 | 72 | - (IBAction)exchangeButtonAction:(UIButton *)sender { 73 | NSString *str = _fromCurrency; 74 | _fromCurrency = _toCurrency; 75 | _toCurrency = str; 76 | 77 | [self initUI]; 78 | } 79 | 80 | //转换 81 | - (IBAction)transformationButtonAction:(UIButton *)sender { 82 | [self.view endEditing:YES]; 83 | 84 | [self exchangeRateConversionReuqest]; 85 | } 86 | 87 | - (void)refreshData:(NSDictionary *)dataDic { 88 | 89 | NSString *date = dataDic[@"date"]; 90 | NSString *time = dataDic[@"time"]; 91 | NSString *fromCurrency = dataDic[@"fromCurrency"]; 92 | NSString *toCurrency = dataDic[@"toCurrency"]; 93 | NSString *amount = dataDic[@"amount"]; 94 | float currency = [dataDic[@"currency"] floatValue]; 95 | float convertedamount = [dataDic[@"convertedamount"] floatValue]; 96 | 97 | _exchangeRateLabel.text = [NSString stringWithFormat:@"当前汇率:%.4f",currency]; 98 | [self initUI]; 99 | _updateTimeLabel.text = [NSString stringWithFormat:@"数据仅供参考,交易时以银行柜台成交价为准 更新时间:%@ %@",date,time]; 100 | _displayLabel.text = [NSString stringWithFormat:@"%@%@=%.4f%@",[self stringDisposeWithFloatString:amount],[kCurrencyManager toCurrencyName:fromCurrency],convertedamount,[kCurrencyManager toCurrencyName:toCurrency]]; 101 | } 102 | 103 | - (void)initUI { 104 | [kCurrencyManager saveFromCurrency:_fromCurrency]; 105 | [kCurrencyManager saveToCurrency:_toCurrency]; 106 | 107 | _fromCurrencyLabel.text = [NSString stringWithFormat:@"原始币种类型:%@ %@",[kCurrencyManager toCurrencyName:_fromCurrency],_fromCurrency]; 108 | _toCurrencyLabel.text = [NSString stringWithFormat:@"目标币种类型:%@ %@",[kCurrencyManager toCurrencyName:_toCurrency],_toCurrency]; 109 | } 110 | 111 | //币种选择 112 | - (IBAction)currencySelectionButtonAction:(UIButton *)sender { 113 | HXCurrencySelectionViewController *vc = [HXCurrencySelectionViewController new]; 114 | if (sender.tag == 10) { 115 | //待转换货币码 116 | vc.currentCurrency = _fromCurrency; 117 | } else if (sender.tag == 11) { 118 | //转换后货币码 119 | vc.currentCurrency = _toCurrency; 120 | } 121 | vc.completion = ^(HXCurrencySelectionViewController *vc, NSString *currency) { 122 | if (sender.tag == 10) { 123 | //待转换货币码 124 | if (_fromCurrency != currency) { 125 | _fromCurrency = currency; 126 | } 127 | } else if (sender.tag == 11) { 128 | //转换后货币码 129 | if (_toCurrency != currency) { 130 | _toCurrency = currency; 131 | } 132 | } 133 | 134 | [self initUI]; 135 | }; 136 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; 137 | [self.navigationController presentViewController:nav animated:YES completion:nil]; 138 | } 139 | 140 | - (NSString *)stringDisposeWithFloatString:(NSString *)floatStr { 141 | NSString *str = [NSString stringWithFormat:@"%.4f",floatStr.floatValue]; 142 | NSUInteger len = str.length; 143 | for (int i = 0; i < len; i++) 144 | { 145 | if (![str hasSuffix:@"0"]) 146 | break; 147 | else 148 | str = [str substringToIndex:[str length]-1]; 149 | } 150 | if ([str hasSuffix:@"."])//避免像2.0000这样的被解析成2. 151 | { 152 | return [str substringToIndex:[str length]-1];//s.substring(0, len - i - 1); 153 | } 154 | else 155 | { 156 | return str; 157 | } 158 | } 159 | 160 | #pragma mark - 懒加载 161 | 162 | - (HXRequestManager *)request { 163 | if (!_request) { 164 | _request = [HXRequestManager new]; 165 | } 166 | return _request; 167 | } 168 | 169 | - (void)didReceiveMemoryWarning { 170 | [super didReceiveMemoryWarning]; 171 | // Dispose of any resources that can be recreated. 172 | } 173 | 174 | @end 175 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Swift/Main/ViewController/HXCurrencySelectionSwiftViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HXCurrencySelectionSwiftViewController.swift 3 | // HXCurrencyConversion 4 | // 5 | // Created by 黄轩 on 16/8/15. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HXCurrencySelectionSwiftViewController: UIViewController,UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate { 12 | 13 | var currentCurrency:String? //当前货币码 14 | var completion: (HXCurrencySelectionSwiftViewController, String) -> () = {vc, currency in } 15 | 16 | var _tableView:UITableView? 17 | var _dataAry:NSMutableArray? 18 | var _searchText:String? //搜索词 19 | 20 | override func viewDidLoad() { 21 | super.viewDidLoad() 22 | 23 | // Do any additional setup after loading the view. 24 | self.view.backgroundColor = UIColor.whiteColor() 25 | self.title = "货币选择" 26 | 27 | let item = UIBarButtonItem(title: "取消", style: UIBarButtonItemStyle.Done, target: self, action: "cancleButtonAction") 28 | self.navigationItem.leftBarButtonItem = item; 29 | 30 | _dataAry = NSMutableArray(); 31 | 32 | self.addSearchBar() 33 | } 34 | 35 | func addSearchBar() 36 | { 37 | let searchBar = UISearchBar(frame:CGRectMake(0, 0, self.tableView().frame.size.width, 44)); 38 | searchBar.placeholder = "搜索"; 39 | searchBar.delegate = self; 40 | self.tableView().tableHeaderView = searchBar; 41 | self.view.addSubview(self.tableView()) 42 | } 43 | 44 | //所有币种 45 | func currencyAry() -> NSArray 46 | { 47 | return HXCurrencySwiftManager.sharedInstance.allCurrencies(); 48 | } 49 | 50 | func dataAry() -> NSArray 51 | { 52 | if _searchText != nil && !_searchText!.isEmpty 53 | { 54 | //搜索则返回搜索数据 55 | return _dataAry!; 56 | } 57 | else 58 | { 59 | //反之返回所有数据 60 | return self.currencyAry(); 61 | } 62 | } 63 | 64 | //行 65 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int 66 | { 67 | return self.dataAry().count; 68 | } 69 | 70 | //cell 71 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell 72 | { 73 | var cell = tableView.dequeueReusableCellWithIdentifier("CellID") 74 | if ((cell == nil)) { 75 | cell = UITableViewCell(style:UITableViewCellStyle.Subtitle, reuseIdentifier:"CellID") 76 | } 77 | 78 | let str = self.dataAry()[indexPath.row] as! String 79 | 80 | //货币代码 81 | let currency = str; 82 | //货币名称 83 | let currencyName = HXCurrencySwiftManager.sharedInstance.toCurrencyName(str) 84 | 85 | cell!.textLabel!.text = currency; 86 | cell!.detailTextLabel?.text = currencyName; 87 | 88 | if currentCurrency != nil && !currentCurrency!.isEmpty 89 | { 90 | if(currentCurrency?.rangeOfString(currency) != nil) 91 | { 92 | cell!.accessoryType = UITableViewCellAccessoryType.Checkmark; 93 | } 94 | else 95 | { 96 | cell!.accessoryType = UITableViewCellAccessoryType.None; 97 | } 98 | } 99 | else 100 | { 101 | cell!.accessoryType = UITableViewCellAccessoryType.None; 102 | } 103 | 104 | return cell!; 105 | } 106 | 107 | //高度 108 | func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat 109 | { 110 | return 45; 111 | } 112 | 113 | //点击事件方法 114 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) 115 | { 116 | tableView.deselectRowAtIndexPath(indexPath, animated: true) 117 | 118 | self.completion(self,(self.dataAry()[indexPath.row] as! String)) 119 | 120 | self.cancleButtonAction() 121 | } 122 | 123 | //已经开始编辑时的回调 124 | func searchBarTextDidBeginEditing(searchBar:UISearchBar) 125 | { 126 | searchBar.showsCancelButton = true; 127 | self.tableView().frame = CGRectMake(self.tableView().frame.origin.x, self.tableView().frame.origin.y, UIScreen.mainScreen().bounds.size.width, UIScreen.mainScreen().bounds.size.height - 252) 128 | } 129 | 130 | //编辑文字改变的回调 131 | func searchBar(searchBar: UISearchBar, textDidChange searchText: String) 132 | { 133 | _searchText = searchText; 134 | 135 | self.ittemSearchResultsDataAryWithSearchText(searchText) 136 | self.tableView().reloadData() 137 | } 138 | 139 | //取消按钮点击的回调 140 | func searchBarCancelButtonClicked(searchBar:UISearchBar) 141 | { 142 | searchBar.showsCancelButton = false; 143 | _searchText = nil; 144 | searchBar.text = nil; 145 | self.view.endEditing(true) 146 | self.tableView().frame = UIScreen.mainScreen().bounds; 147 | self.tableView().reloadData() 148 | } 149 | 150 | //搜索结果按钮点击的回调 151 | func searchBarResultsListButtonClicked(searchBar:UISearchBar) 152 | { 153 | self.cancleButtonAction() 154 | } 155 | 156 | //根据搜索词来查找符合的数据 157 | func ittemSearchResultsDataAryWithSearchText(searchText:String) 158 | { 159 | _dataAry?.removeAllObjects() 160 | 161 | weak var weakSelf = self 162 | self.currencyAry().enumerateObjectsUsingBlock { (str, idx, stop) -> Void in 163 | 164 | //货币代码 165 | let currency = str as! String; 166 | //货币名称 167 | let currencyName = HXCurrencySwiftManager.sharedInstance.toCurrencyName(currency) 168 | 169 | 170 | if (!currency.isEmpty) && (!currencyName.isEmpty) 171 | { 172 | if((currency.rangeOfString(self._searchText!, options: NSStringCompareOptions.CaseInsensitiveSearch) != nil) || (currencyName.rangeOfString(self._searchText!, options: NSStringCompareOptions.CaseInsensitiveSearch) != nil)) { 173 | weakSelf!._dataAry!.addObject(str) 174 | } 175 | } else { 176 | if (!currency.isEmpty) { 177 | if(currency.rangeOfString(self._searchText!, options: NSStringCompareOptions.CaseInsensitiveSearch) != nil) { 178 | weakSelf!._dataAry!.addObject(str) 179 | } 180 | } 181 | else if (!currencyName.isEmpty) 182 | { 183 | if(currencyName.rangeOfString(self._searchText!, options: NSStringCompareOptions.CaseInsensitiveSearch) != nil) { 184 | weakSelf!._dataAry!.addObject(str) 185 | } 186 | } 187 | } 188 | } 189 | } 190 | 191 | //取消按钮 192 | func cancleButtonAction() 193 | { 194 | self.view.endEditing(true) 195 | self.navigationController?.dismissViewControllerAnimated(true, completion: { () -> Void in 196 | 197 | }) 198 | } 199 | 200 | func tableView() -> UITableView 201 | { 202 | if (_tableView == nil) 203 | { 204 | _tableView = UITableView(frame: UIScreen.mainScreen().bounds, style:UITableViewStyle.Plain) 205 | _tableView!.dataSource = self 206 | _tableView!.delegate = self 207 | _tableView!.backgroundColor = UIColor.clearColor() 208 | } 209 | return _tableView!; 210 | } 211 | 212 | override func didReceiveMemoryWarning() { 213 | super.didReceiveMemoryWarning() 214 | // Dispose of any resources that can be recreated. 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Main/ViewController/HXCurrencySelectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HXCurrencySelectionViewController.m 3 | // https://github.com/huangxuan518/HXInternationalizationDemo 4 | // 5 | // Created by 黄轩 on 16/7/29. 6 | // Copyright © 2016年 黄轩. All rights reserved. 7 | // 8 | 9 | #import "HXCurrencySelectionViewController.h" 10 | #import "HXCurrencyManager.h" 11 | 12 | @interface HXCurrencySelectionViewController () 13 | 14 | @property (nonatomic,strong) UITableView *tableView; 15 | @property (nonatomic,strong) NSMutableArray *dataAry; 16 | @property (nonatomic,copy) NSString *searchText;//搜索词 17 | 18 | @end 19 | 20 | @implementation HXCurrencySelectionViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | // Do any additional setup after loading the view. 25 | self.view.backgroundColor = [UIColor whiteColor]; 26 | 27 | self.title = @"货币选择"; 28 | UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonItemStyleDone target:self action:@selector(cancleButtonAction:)]; 29 | self.navigationItem.leftBarButtonItem = item; 30 | 31 | _dataAry = [NSMutableArray new]; 32 | 33 | [self addSearchBar]; 34 | } 35 | 36 | - (void)addSearchBar { 37 | UISearchBar *searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 44)]; 38 | searchBar.placeholder = @"搜索"; 39 | searchBar.delegate = self; 40 | self.tableView.tableHeaderView = searchBar; 41 | [self.view addSubview:self.tableView]; 42 | } 43 | 44 | #pragma mark - data 45 | 46 | //所有币种 47 | - (NSArray *)currencyAry { 48 | return kCurrencyManager.allCurrencies; 49 | } 50 | 51 | - (NSArray *)dataAry { 52 | if (_searchText.length > 0) { 53 | //搜索则返回搜索数据 54 | return _dataAry; 55 | } 56 | else 57 | { 58 | //反之返回所有数据 59 | return self.currencyAry; 60 | } 61 | } 62 | 63 | #pragma mark UITableViewDataSource/UITableViewDelegate 64 | 65 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 66 | return self.dataAry.count; 67 | } 68 | 69 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 70 | 71 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CellID"]; 72 | if (!cell) { 73 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"CellID"]; 74 | } 75 | 76 | NSString *str = self.dataAry[indexPath.row]; 77 | 78 | //货币代码 79 | NSString *currency = str; 80 | //货币名称 81 | NSString *currencyName = [kCurrencyManager toCurrencyName:str]; 82 | 83 | if (_searchText.length > 0) { 84 | cell.textLabel.attributedText = [self searchTitle:currency key:_searchText keyColor:[UIColor redColor]]; 85 | cell.detailTextLabel.attributedText = [self searchTitle:currencyName key:_searchText keyColor:[UIColor redColor]]; 86 | } else { 87 | cell.textLabel.text = currency; 88 | cell.detailTextLabel.text = currencyName; 89 | } 90 | 91 | if (_currentCurrency.length > 0) { 92 | if([_currentCurrency rangeOfString:currency].location != NSNotFound) 93 | { 94 | cell.accessoryType = UITableViewCellAccessoryCheckmark; 95 | } 96 | else 97 | { 98 | cell.accessoryType = UITableViewCellAccessoryNone; 99 | } 100 | } else { 101 | cell.accessoryType = UITableViewCellAccessoryNone; 102 | } 103 | 104 | return cell; 105 | } 106 | 107 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 108 | return 45; 109 | } 110 | 111 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 112 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 113 | 114 | if (_completion) { 115 | _completion(self,self.dataAry[indexPath.row]); 116 | } 117 | 118 | [self cancleButtonAction:nil]; 119 | } 120 | 121 | #pragma mark - UISearchBar Delegate 122 | 123 | //已经开始编辑时的回调 124 | - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar { 125 | searchBar.showsCancelButton = YES; 126 | self.tableView.frame = CGRectMake(self.tableView.frame.origin.x, self.tableView.frame.origin.y, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 252); 127 | } 128 | 129 | //编辑文字改变的回调 130 | - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { 131 | NSLog(@"searchText:%@",searchText); 132 | _searchText = searchText; 133 | 134 | [self ittemSearchResultsDataAryWithSearchText:searchText]; 135 | 136 | [self.tableView reloadData]; 137 | } 138 | 139 | //取消按钮点击的回调 140 | - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { 141 | searchBar.showsCancelButton = NO; 142 | _searchText = nil; 143 | searchBar.text = nil; 144 | [self.view endEditing:YES]; 145 | self.tableView.frame = [UIScreen mainScreen].bounds; 146 | [self.tableView reloadData]; 147 | } 148 | 149 | //搜索结果按钮点击的回调 150 | - (void)searchBarResultsListButtonClicked:(UISearchBar *)searchBar { 151 | NSLog(@"%@",searchBar.text); 152 | [self cancleButtonAction:nil]; 153 | } 154 | 155 | #pragma mark - 自定义方法 156 | 157 | //根据搜索词来查找符合的数据 158 | - (void)ittemSearchResultsDataAryWithSearchText:(NSString *)searchText { 159 | [_dataAry removeAllObjects]; 160 | 161 | [self.currencyAry enumerateObjectsUsingBlock:^(NSString *str, NSUInteger idx, BOOL * _Nonnull stop) { 162 | //货币代码 163 | NSString *currency = str; 164 | //货币名称 165 | NSString *currencyName = [kCurrencyManager toCurrencyName:str]; 166 | 167 | 168 | if (currency.length > 0 && currencyName.length > 0) { 169 | if([currency rangeOfString:_searchText options:NSCaseInsensitiveSearch].location != NSNotFound || [currencyName rangeOfString:_searchText options:NSCaseInsensitiveSearch].location != NSNotFound) { 170 | [_dataAry addObject:str]; 171 | } 172 | } else { 173 | if (currency.length > 0) { 174 | if([currency rangeOfString:_searchText options:NSCaseInsensitiveSearch].location != NSNotFound) { 175 | [_dataAry addObject:str]; 176 | } 177 | } else if (currencyName.length > 0) { 178 | if([currencyName rangeOfString:_searchText options:NSCaseInsensitiveSearch].location != NSNotFound) { 179 | [_dataAry addObject:str]; 180 | } 181 | } 182 | } 183 | }]; 184 | } 185 | 186 | // 设置文字中关键字高亮 187 | - (NSMutableAttributedString *)searchTitle:(NSString *)title key:(NSString *)key keyColor:(UIColor *)keyColor { 188 | 189 | if (title.length == 0) { 190 | title = @""; 191 | } 192 | 193 | NSMutableAttributedString *titleStr = [[NSMutableAttributedString alloc] initWithString:title]; 194 | NSString *copyStr = title; 195 | 196 | NSMutableString *xxstr = [NSMutableString new]; 197 | for (int i = 0; i < key.length; i++) { 198 | [xxstr appendString:@"*"]; 199 | } 200 | 201 | while ([copyStr rangeOfString:key options:NSCaseInsensitiveSearch].location != NSNotFound) { 202 | 203 | NSRange range = [copyStr rangeOfString:key options:NSCaseInsensitiveSearch]; 204 | 205 | [titleStr addAttribute:NSForegroundColorAttributeName value:keyColor range:range]; 206 | copyStr = [copyStr stringByReplacingCharactersInRange:NSMakeRange(range.location, range.length) withString:xxstr]; 207 | } 208 | return titleStr; 209 | } 210 | 211 | #pragma mark - Action 212 | 213 | //取消按钮 214 | - (void)cancleButtonAction:(UIButton *)button { 215 | [self.view endEditing:YES]; 216 | [self.navigationController dismissViewControllerAnimated:YES completion:nil]; 217 | } 218 | 219 | #pragma mark - 懒加载 220 | 221 | - (UITableView *)tableView { 222 | if (!_tableView) { 223 | _tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain]; 224 | _tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight; 225 | _tableView.dataSource = self; 226 | _tableView.delegate = self; 227 | _tableView.backgroundColor = [UIColor clearColor]; 228 | } 229 | return _tableView; 230 | } 231 | 232 | - (void)didReceiveMemoryWarning { 233 | [super didReceiveMemoryWarning]; 234 | // Dispose of any resources that can be recreated. 235 | } 236 | 237 | @end 238 | -------------------------------------------------------------------------------- /HXCurrencyConversion/currencycodetable.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AED 6 | 阿联酋迪拉姆 7 | AFN 8 | 阿富汗尼 9 | ALL 10 | 阿尔巴尼列克 11 | AMD 12 | 亚美尼亚德拉姆 13 | ANG 14 | 荷兰盾 15 | AOA 16 | 安哥拉宽扎 17 | ARS 18 | 阿根廷比索 19 | AUD 20 | 澳元 21 | AWG 22 | 阿鲁巴弗罗林 23 | AZN 24 | 阿塞拜疆马纳特 25 | BAM 26 | 波黑可兑换马克 27 | BBD 28 | 巴巴多斯元 29 | BDT 30 | 孟加拉国塔卡 31 | BGN 32 | 保加利亚列弗 33 | BHD 34 | 巴林第纳尔 35 | BIF 36 | 布隆迪法郎 37 | BMD 38 | 百慕大元 39 | BND 40 | 文莱元 41 | BOB 42 | 玻利维亚诺 43 | BRL 44 | 巴西雷亚尔 45 | BSD 46 | 巴哈马元 47 | BTN 48 | 不丹努扎姆 49 | BWP 50 | 博茨瓦纳普拉 51 | BYR 52 | 白俄罗斯卢布 53 | BZD 54 | 伯利兹元 55 | CAD 56 | 加元 57 | CDF 58 | 刚果法郎 59 | CHF 60 | 瑞士法郎 61 | CLF 62 | 智利比索(基金) 63 | CLP 64 | 智利比索 65 | CNH 66 | 中国离岸人民币 67 | CNY 68 | 人民币 69 | COP 70 | 哥伦比亚比索 71 | CRC 72 | 哥斯达黎加科朗 73 | CUP 74 | 古巴比索 75 | CVE 76 | 佛得角埃斯库多 77 | CYP 78 | 塞普路斯镑 79 | CZK 80 | 捷克克朗 81 | DEM 82 | 德国马克 83 | DJF 84 | 吉布提法郎 85 | DKK 86 | 丹麦克郎 87 | DOP 88 | 多米尼加比索 89 | DZD 90 | 阿尔及利亚第纳尔 91 | ECS 92 | 厄瓜多尔苏克雷 93 | EGP 94 | 埃及镑 95 | ERN 96 | 厄立特里亚纳克法 97 | ETB 98 | 埃塞俄比亚比尔 99 | EUR 100 | 欧元 101 | FJD 102 | 斐济元 103 | FKP 104 | 福克兰群岛镑 105 | FRF 106 | 法国法郎 107 | GBP 108 | 英镑 109 | GEL 110 | 格鲁吉亚拉里 111 | GHS 112 | 加纳塞地 113 | GIP 114 | 直布罗陀镑 115 | GMD 116 | 冈比亚达拉西 117 | GNF 118 | 几内亚法郎 119 | GTQ 120 | 危地马拉格查尔 121 | GYD 122 | 圭亚那元 123 | HKD 124 | 港币 125 | HNL 126 | 洪都拉斯伦皮拉 127 | HRK 128 | 克罗地亚库纳 129 | HTG 130 | 海地古德 131 | HUF 132 | 匈牙利福林 133 | IDR 134 | 印度尼西亚卢比 135 | IEP 136 | 爱尔兰镑 137 | ILS 138 | 以色列新谢克尔 139 | INR 140 | 印度卢比 141 | IQD 142 | 伊拉克第纳尔 143 | IRR 144 | 伊朗里亚尔 145 | ISK 146 | 冰岛克郎 147 | ITL 148 | 意大利里拉 149 | JMD 150 | 牙买加元 151 | JOD 152 | 约旦第纳尔 153 | JPY 154 | 日元 155 | KES 156 | 肯尼亚先令 157 | KGS 158 | 吉尔吉斯斯坦索姆 159 | KHR 160 | 柬埔寨瑞尔 161 | KMF 162 | 科摩罗法郎 163 | KPW 164 | 朝鲜元 165 | KRW 166 | 韩元 167 | KWD 168 | 科威特第纳尔 169 | KYD 170 | 开曼群岛元 171 | KZT 172 | 哈萨克斯坦腾格 173 | LAK 174 | 老挝基普 175 | LBP 176 | 黎巴嫩镑 177 | LKR 178 | 斯里兰卡卢比 179 | LRD 180 | 利比里亚元 181 | LSL 182 | 莱索托洛蒂 183 | LTL 184 | 立陶宛立特 185 | LVL 186 | 拉脱维亚拉特 187 | LYD 188 | 利比亚第纳尔 189 | MAD 190 | 摩洛哥迪拉姆 191 | MDL 192 | 摩尔多瓦列伊 193 | MGA 194 | 马达加斯加阿里亚里 195 | MKD 196 | 马其顿代纳尔 197 | MMK 198 | 缅甸元 199 | MNT 200 | 蒙古图格里克 201 | MOP 202 | 澳门元 203 | MRO 204 | 毛里塔尼亚乌吉亚 205 | MUR 206 | 毛里求斯卢比 207 | MVR 208 | 马尔代夫拉菲亚 209 | MWK 210 | 马拉维克瓦查 211 | MXN 212 | 墨西哥比索 213 | MXV 214 | 墨西哥MXV 215 | MYR 216 | 马来西亚林吉特 217 | MZN 218 | 莫桑比克新梅蒂卡尔 219 | NAD 220 | 纳米比亚元 221 | NGN 222 | 尼日利亚奈拉 223 | NIO 224 | 尼加拉瓜新科多巴 225 | NOK 226 | 挪威克朗 227 | NPR 228 | 尼泊尔卢比 229 | NZD 230 | 新西兰元 231 | OMR 232 | 阿曼里亚尔 233 | PAB 234 | 巴拿马巴波亚 235 | PEN 236 | 秘鲁新索尔 237 | PGK 238 | 巴布亚新几内亚基那 239 | PHP 240 | 菲律宾比索 241 | PKR 242 | 巴基斯坦卢比 243 | PLN 244 | 波兰兹罗提 245 | PYG 246 | 巴拉圭瓜拉尼 247 | QAR 248 | 卡塔尔里亚尔 249 | RON 250 | 罗马尼亚列伊 251 | RSD 252 | 塞尔维亚第纳尔 253 | RUB 254 | 俄罗斯卢布 255 | RWF 256 | 卢旺达法郎 257 | SAR 258 | 沙特里亚尔 259 | SBD 260 | 所罗门群岛元 261 | SCR 262 | 塞舌尔卢比 263 | SDG 264 | 苏丹磅 265 | SEK 266 | 瑞典克朗 267 | SGD 268 | 新加坡元 269 | SHP 270 | 圣赫勒拿镑 271 | SIT 272 | 斯洛文尼亚托拉尔 273 | SLL 274 | 塞拉利昂利昂 275 | SOS 276 | 索马里先令 277 | SRD 278 | 苏里南元 279 | STD 280 | 圣多美多布拉 281 | SVC 282 | 萨尔瓦多科朗 283 | SYP 284 | 叙利亚镑 285 | SZL 286 | 斯威士兰里兰吉尼 287 | THB 288 | 泰铢 289 | TJS 290 | 塔吉克斯坦索莫尼 291 | TMT 292 | 土库曼斯坦马纳特 293 | TND 294 | 突尼斯第纳尔 295 | TOP 296 | 汤加潘加 297 | TRY 298 | 土耳其里拉 299 | TTD 300 | 特立尼达多巴哥元 301 | TWD 302 | 新台币 303 | TZS 304 | 坦桑尼亚先令 305 | UAH 306 | 乌克兰格里夫纳 307 | UGX 308 | 乌干达先令 309 | USD 310 | 美元 311 | UYU 312 | 乌拉圭比索 313 | UZS 314 | 乌兹别克斯坦苏姆 315 | VEF 316 | 委内瑞拉玻利瓦尔 317 | VND 318 | 越南盾 319 | VUV 320 | 瓦努阿图瓦图 321 | WST 322 | 萨摩亚塔拉 323 | XAF 324 | 中非法郎 325 | XAG 326 | 银价盎司 327 | XAU 328 | 金价盎司 329 | XCD 330 | 东加勒比元 331 | XCP 332 | 铜价盎司 333 | XDR 334 | IMF特别提款权 335 | XOF 336 | 西非法郎 337 | XPD 338 | 钯价盎司 339 | XPF 340 | 太平洋法郎 341 | XPT 342 | 珀价盎司 343 | YER 344 | 也门里亚尔 345 | ZAR 346 | 南非兰特 347 | ZMW 348 | 赞比亚克瓦查 349 | ZWL 350 | 津巴布韦元 351 | 352 | 353 | -------------------------------------------------------------------------------- /HXCurrencyConversion/OC/Main/ViewController/HXHomeViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 42 | 53 | 64 | 75 | 87 | 98 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 132 | 143 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /HXCurrencyConversion/Swift/Main/ViewController/HXHomeSwiftViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 42 | 53 | 64 | 75 | 87 | 98 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 129 | 143 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /HXCurrencyConversion.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E440C69D1D617043002DC9BD /* HXCurrencySwiftManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E440C69C1D617043002DC9BD /* HXCurrencySwiftManager.swift */; }; 11 | E440C69F1D6198A8002DC9BD /* HXCurrencySelectionSwiftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E440C69E1D6198A8002DC9BD /* HXCurrencySelectionSwiftViewController.swift */; }; 12 | E49A5D861D5336EF00CCBE4B /* xiaoguo.gif in Resources */ = {isa = PBXBuildFile; fileRef = E49A5D851D5336EF00CCBE4B /* xiaoguo.gif */; }; 13 | E49A5D881D5337EA00CCBE4B /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = E49A5D871D5337EA00CCBE4B /* README.md */; }; 14 | E4A7CFE01D62C38200AE5C95 /* HXCurrencyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E4A7CFD41D62C38200AE5C95 /* HXCurrencyManager.m */; }; 15 | E4A7CFE11D62C38200AE5C95 /* HXCurrencySelectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4A7CFD91D62C38200AE5C95 /* HXCurrencySelectionViewController.m */; }; 16 | E4A7CFE21D62C38200AE5C95 /* HXHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4A7CFDB1D62C38200AE5C95 /* HXHomeViewController.m */; }; 17 | E4A7CFE31D62C38200AE5C95 /* HXHomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E4A7CFDC1D62C38200AE5C95 /* HXHomeViewController.xib */; }; 18 | E4A7CFE41D62C38200AE5C95 /* HXRequestManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E4A7CFDF1D62C38200AE5C95 /* HXRequestManager.m */; }; 19 | E4B824741D51C7C90053DEB3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E4B824731D51C7C90053DEB3 /* main.m */; }; 20 | E4B824771D51C7C90053DEB3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E4B824761D51C7C90053DEB3 /* AppDelegate.m */; }; 21 | E4B8247F1D51C7C90053DEB3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E4B8247E1D51C7C90053DEB3 /* Assets.xcassets */; }; 22 | E4B824951D51E2210053DEB3 /* currencycodetable.plist in Resources */ = {isa = PBXBuildFile; fileRef = E4B824941D51E2210053DEB3 /* currencycodetable.plist */; }; 23 | E4BC6D8C1D54745F00CB4CA6 /* HXHomeSwiftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4BC6D8B1D54745F00CB4CA6 /* HXHomeSwiftViewController.swift */; }; 24 | E4BC6D911D547B1200CB4CA6 /* HXHomeSwiftViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E4BC6D901D547B1200CB4CA6 /* HXHomeSwiftViewController.xib */; }; 25 | E4BC6D931D5480A700CB4CA6 /* HXRequestSwiftManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4BC6D921D5480A700CB4CA6 /* HXRequestSwiftManager.swift */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | E440C69C1D617043002DC9BD /* HXCurrencySwiftManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXCurrencySwiftManager.swift; sourceTree = ""; }; 30 | E440C69E1D6198A8002DC9BD /* HXCurrencySelectionSwiftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXCurrencySelectionSwiftViewController.swift; sourceTree = ""; }; 31 | E49A5D851D5336EF00CCBE4B /* xiaoguo.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = xiaoguo.gif; sourceTree = ""; }; 32 | E49A5D871D5337EA00CCBE4B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 33 | E4A7CFD31D62C38200AE5C95 /* HXCurrencyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HXCurrencyManager.h; sourceTree = ""; }; 34 | E4A7CFD41D62C38200AE5C95 /* HXCurrencyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HXCurrencyManager.m; sourceTree = ""; }; 35 | E4A7CFD81D62C38200AE5C95 /* HXCurrencySelectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HXCurrencySelectionViewController.h; sourceTree = ""; }; 36 | E4A7CFD91D62C38200AE5C95 /* HXCurrencySelectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HXCurrencySelectionViewController.m; sourceTree = ""; }; 37 | E4A7CFDA1D62C38200AE5C95 /* HXHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HXHomeViewController.h; sourceTree = ""; }; 38 | E4A7CFDB1D62C38200AE5C95 /* HXHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HXHomeViewController.m; sourceTree = ""; }; 39 | E4A7CFDC1D62C38200AE5C95 /* HXHomeViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HXHomeViewController.xib; sourceTree = ""; }; 40 | E4A7CFDE1D62C38200AE5C95 /* HXRequestManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HXRequestManager.h; sourceTree = ""; }; 41 | E4A7CFDF1D62C38200AE5C95 /* HXRequestManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HXRequestManager.m; sourceTree = ""; }; 42 | E4B8246F1D51C7C90053DEB3 /* HXCurrencyConversion.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HXCurrencyConversion.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | E4B824731D51C7C90053DEB3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | E4B824751D51C7C90053DEB3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | E4B824761D51C7C90053DEB3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | E4B8247E1D51C7C90053DEB3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | E4B824831D51C7C90053DEB3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | E4B824941D51E2210053DEB3 /* currencycodetable.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = currencycodetable.plist; sourceTree = ""; }; 49 | E4BC6D8B1D54745F00CB4CA6 /* HXHomeSwiftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXHomeSwiftViewController.swift; sourceTree = ""; }; 50 | E4BC6D8D1D5477CF00CB4CA6 /* HXCurrencyConversion-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HXCurrencyConversion-Bridging-Header.h"; sourceTree = ""; }; 51 | E4BC6D901D547B1200CB4CA6 /* HXHomeSwiftViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HXHomeSwiftViewController.xib; sourceTree = ""; }; 52 | E4BC6D921D5480A700CB4CA6 /* HXRequestSwiftManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXRequestSwiftManager.swift; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | E4B8246C1D51C7C90053DEB3 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | E4A7CFD11D62C38200AE5C95 /* OC */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | E4A7CFD51D62C38200AE5C95 /* Main */, 70 | E4A7CFD21D62C38200AE5C95 /* Currency */, 71 | E4A7CFDD1D62C38200AE5C95 /* Network */, 72 | ); 73 | path = OC; 74 | sourceTree = ""; 75 | }; 76 | E4A7CFD21D62C38200AE5C95 /* Currency */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | E4A7CFD31D62C38200AE5C95 /* HXCurrencyManager.h */, 80 | E4A7CFD41D62C38200AE5C95 /* HXCurrencyManager.m */, 81 | ); 82 | path = Currency; 83 | sourceTree = ""; 84 | }; 85 | E4A7CFD51D62C38200AE5C95 /* Main */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | E4A7CFD71D62C38200AE5C95 /* ViewController */, 89 | ); 90 | path = Main; 91 | sourceTree = ""; 92 | }; 93 | E4A7CFD71D62C38200AE5C95 /* ViewController */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | E4A7CFDA1D62C38200AE5C95 /* HXHomeViewController.h */, 97 | E4A7CFDB1D62C38200AE5C95 /* HXHomeViewController.m */, 98 | E4A7CFDC1D62C38200AE5C95 /* HXHomeViewController.xib */, 99 | E4A7CFD81D62C38200AE5C95 /* HXCurrencySelectionViewController.h */, 100 | E4A7CFD91D62C38200AE5C95 /* HXCurrencySelectionViewController.m */, 101 | ); 102 | path = ViewController; 103 | sourceTree = ""; 104 | }; 105 | E4A7CFDD1D62C38200AE5C95 /* Network */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | E4A7CFDE1D62C38200AE5C95 /* HXRequestManager.h */, 109 | E4A7CFDF1D62C38200AE5C95 /* HXRequestManager.m */, 110 | ); 111 | path = Network; 112 | sourceTree = ""; 113 | }; 114 | E4B824661D51C7C90053DEB3 = { 115 | isa = PBXGroup; 116 | children = ( 117 | E49A5D871D5337EA00CCBE4B /* README.md */, 118 | E4B824711D51C7C90053DEB3 /* HXCurrencyConversion */, 119 | E4B824701D51C7C90053DEB3 /* Products */, 120 | ); 121 | sourceTree = ""; 122 | }; 123 | E4B824701D51C7C90053DEB3 /* Products */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | E4B8246F1D51C7C90053DEB3 /* HXCurrencyConversion.app */, 127 | ); 128 | name = Products; 129 | sourceTree = ""; 130 | }; 131 | E4B824711D51C7C90053DEB3 /* HXCurrencyConversion */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | E4A7CFD11D62C38200AE5C95 /* OC */, 135 | E4BC6D7E1D54723500CB4CA6 /* Swift */, 136 | E4B824751D51C7C90053DEB3 /* AppDelegate.h */, 137 | E4B824761D51C7C90053DEB3 /* AppDelegate.m */, 138 | E4B824721D51C7C90053DEB3 /* Supporting Files */, 139 | ); 140 | path = HXCurrencyConversion; 141 | sourceTree = ""; 142 | }; 143 | E4B824721D51C7C90053DEB3 /* Supporting Files */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | E49A5D851D5336EF00CCBE4B /* xiaoguo.gif */, 147 | E4B824941D51E2210053DEB3 /* currencycodetable.plist */, 148 | E4B8247E1D51C7C90053DEB3 /* Assets.xcassets */, 149 | E4B824831D51C7C90053DEB3 /* Info.plist */, 150 | E4B824731D51C7C90053DEB3 /* main.m */, 151 | ); 152 | name = "Supporting Files"; 153 | sourceTree = ""; 154 | }; 155 | E4BC6D7E1D54723500CB4CA6 /* Swift */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | E4BC6D801D54723500CB4CA6 /* Main */, 159 | E4BC6D7F1D54723500CB4CA6 /* Currency */, 160 | E4BC6D811D54723500CB4CA6 /* Network */, 161 | ); 162 | path = Swift; 163 | sourceTree = ""; 164 | }; 165 | E4BC6D7F1D54723500CB4CA6 /* Currency */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | E440C69C1D617043002DC9BD /* HXCurrencySwiftManager.swift */, 169 | ); 170 | path = Currency; 171 | sourceTree = ""; 172 | }; 173 | E4BC6D801D54723500CB4CA6 /* Main */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | E4BC6D8D1D5477CF00CB4CA6 /* HXCurrencyConversion-Bridging-Header.h */, 177 | E4BC6D821D54726500CB4CA6 /* ViewController */, 178 | ); 179 | path = Main; 180 | sourceTree = ""; 181 | }; 182 | E4BC6D811D54723500CB4CA6 /* Network */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | E4BC6D921D5480A700CB4CA6 /* HXRequestSwiftManager.swift */, 186 | ); 187 | path = Network; 188 | sourceTree = ""; 189 | }; 190 | E4BC6D821D54726500CB4CA6 /* ViewController */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | E4BC6D8B1D54745F00CB4CA6 /* HXHomeSwiftViewController.swift */, 194 | E4BC6D901D547B1200CB4CA6 /* HXHomeSwiftViewController.xib */, 195 | E440C69E1D6198A8002DC9BD /* HXCurrencySelectionSwiftViewController.swift */, 196 | ); 197 | path = ViewController; 198 | sourceTree = ""; 199 | }; 200 | /* End PBXGroup section */ 201 | 202 | /* Begin PBXNativeTarget section */ 203 | E4B8246E1D51C7C90053DEB3 /* HXCurrencyConversion */ = { 204 | isa = PBXNativeTarget; 205 | buildConfigurationList = E4B824861D51C7C90053DEB3 /* Build configuration list for PBXNativeTarget "HXCurrencyConversion" */; 206 | buildPhases = ( 207 | E4B8246B1D51C7C90053DEB3 /* Sources */, 208 | E4B8246C1D51C7C90053DEB3 /* Frameworks */, 209 | E4B8246D1D51C7C90053DEB3 /* Resources */, 210 | ); 211 | buildRules = ( 212 | ); 213 | dependencies = ( 214 | ); 215 | name = HXCurrencyConversion; 216 | productName = HXCurrencyConversion; 217 | productReference = E4B8246F1D51C7C90053DEB3 /* HXCurrencyConversion.app */; 218 | productType = "com.apple.product-type.application"; 219 | }; 220 | /* End PBXNativeTarget section */ 221 | 222 | /* Begin PBXProject section */ 223 | E4B824671D51C7C90053DEB3 /* Project object */ = { 224 | isa = PBXProject; 225 | attributes = { 226 | LastUpgradeCheck = 0720; 227 | ORGANIZATIONNAME = "黄轩"; 228 | TargetAttributes = { 229 | E4B8246E1D51C7C90053DEB3 = { 230 | CreatedOnToolsVersion = 7.2.1; 231 | DevelopmentTeam = T42HZ6WKUR; 232 | }; 233 | }; 234 | }; 235 | buildConfigurationList = E4B8246A1D51C7C90053DEB3 /* Build configuration list for PBXProject "HXCurrencyConversion" */; 236 | compatibilityVersion = "Xcode 3.2"; 237 | developmentRegion = English; 238 | hasScannedForEncodings = 0; 239 | knownRegions = ( 240 | en, 241 | Base, 242 | ); 243 | mainGroup = E4B824661D51C7C90053DEB3; 244 | productRefGroup = E4B824701D51C7C90053DEB3 /* Products */; 245 | projectDirPath = ""; 246 | projectRoot = ""; 247 | targets = ( 248 | E4B8246E1D51C7C90053DEB3 /* HXCurrencyConversion */, 249 | ); 250 | }; 251 | /* End PBXProject section */ 252 | 253 | /* Begin PBXResourcesBuildPhase section */ 254 | E4B8246D1D51C7C90053DEB3 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | E4BC6D911D547B1200CB4CA6 /* HXHomeSwiftViewController.xib in Resources */, 259 | E4A7CFE31D62C38200AE5C95 /* HXHomeViewController.xib in Resources */, 260 | E4B8247F1D51C7C90053DEB3 /* Assets.xcassets in Resources */, 261 | E4B824951D51E2210053DEB3 /* currencycodetable.plist in Resources */, 262 | E49A5D861D5336EF00CCBE4B /* xiaoguo.gif in Resources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXResourcesBuildPhase section */ 267 | 268 | /* Begin PBXSourcesBuildPhase section */ 269 | E4B8246B1D51C7C90053DEB3 /* Sources */ = { 270 | isa = PBXSourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | E440C69F1D6198A8002DC9BD /* HXCurrencySelectionSwiftViewController.swift in Sources */, 274 | E4A7CFE21D62C38200AE5C95 /* HXHomeViewController.m in Sources */, 275 | E4B824771D51C7C90053DEB3 /* AppDelegate.m in Sources */, 276 | E49A5D881D5337EA00CCBE4B /* README.md in Sources */, 277 | E4BC6D8C1D54745F00CB4CA6 /* HXHomeSwiftViewController.swift in Sources */, 278 | E4A7CFE01D62C38200AE5C95 /* HXCurrencyManager.m in Sources */, 279 | E4A7CFE11D62C38200AE5C95 /* HXCurrencySelectionViewController.m in Sources */, 280 | E4B824741D51C7C90053DEB3 /* main.m in Sources */, 281 | E440C69D1D617043002DC9BD /* HXCurrencySwiftManager.swift in Sources */, 282 | E4A7CFE41D62C38200AE5C95 /* HXRequestManager.m in Sources */, 283 | E4BC6D931D5480A700CB4CA6 /* HXRequestSwiftManager.swift in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | /* End PBXSourcesBuildPhase section */ 288 | 289 | /* Begin XCBuildConfiguration section */ 290 | E4B824841D51C7C90053DEB3 /* Debug */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | ALWAYS_SEARCH_USER_PATHS = NO; 294 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 295 | CLANG_CXX_LIBRARY = "libc++"; 296 | CLANG_ENABLE_MODULES = YES; 297 | CLANG_ENABLE_OBJC_ARC = YES; 298 | CLANG_WARN_BOOL_CONVERSION = YES; 299 | CLANG_WARN_CONSTANT_CONVERSION = YES; 300 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 301 | CLANG_WARN_EMPTY_BODY = YES; 302 | CLANG_WARN_ENUM_CONVERSION = YES; 303 | CLANG_WARN_INT_CONVERSION = YES; 304 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 305 | CLANG_WARN_UNREACHABLE_CODE = YES; 306 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 307 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 308 | COPY_PHASE_STRIP = NO; 309 | DEBUG_INFORMATION_FORMAT = dwarf; 310 | ENABLE_STRICT_OBJC_MSGSEND = YES; 311 | ENABLE_TESTABILITY = YES; 312 | GCC_C_LANGUAGE_STANDARD = gnu99; 313 | GCC_DYNAMIC_NO_PIC = NO; 314 | GCC_NO_COMMON_BLOCKS = YES; 315 | GCC_OPTIMIZATION_LEVEL = 0; 316 | GCC_PREPROCESSOR_DEFINITIONS = ( 317 | "DEBUG=1", 318 | "$(inherited)", 319 | ); 320 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 321 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 322 | GCC_WARN_UNDECLARED_SELECTOR = YES; 323 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 324 | GCC_WARN_UNUSED_FUNCTION = YES; 325 | GCC_WARN_UNUSED_VARIABLE = YES; 326 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 327 | MTL_ENABLE_DEBUG_INFO = YES; 328 | ONLY_ACTIVE_ARCH = YES; 329 | SDKROOT = iphoneos; 330 | }; 331 | name = Debug; 332 | }; 333 | E4B824851D51C7C90053DEB3 /* Release */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_CXX_LIBRARY = "libc++"; 339 | CLANG_ENABLE_MODULES = YES; 340 | CLANG_ENABLE_OBJC_ARC = YES; 341 | CLANG_WARN_BOOL_CONVERSION = YES; 342 | CLANG_WARN_CONSTANT_CONVERSION = YES; 343 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 344 | CLANG_WARN_EMPTY_BODY = YES; 345 | CLANG_WARN_ENUM_CONVERSION = YES; 346 | CLANG_WARN_INT_CONVERSION = YES; 347 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 348 | CLANG_WARN_UNREACHABLE_CODE = YES; 349 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 350 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 351 | COPY_PHASE_STRIP = NO; 352 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 353 | ENABLE_NS_ASSERTIONS = NO; 354 | ENABLE_STRICT_OBJC_MSGSEND = YES; 355 | GCC_C_LANGUAGE_STANDARD = gnu99; 356 | GCC_NO_COMMON_BLOCKS = YES; 357 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 358 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 359 | GCC_WARN_UNDECLARED_SELECTOR = YES; 360 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 361 | GCC_WARN_UNUSED_FUNCTION = YES; 362 | GCC_WARN_UNUSED_VARIABLE = YES; 363 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 364 | MTL_ENABLE_DEBUG_INFO = NO; 365 | SDKROOT = iphoneos; 366 | VALIDATE_PRODUCT = YES; 367 | }; 368 | name = Release; 369 | }; 370 | E4B824871D51C7C90053DEB3 /* Debug */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 375 | CLANG_ENABLE_MODULES = YES; 376 | CODE_SIGN_IDENTITY = "iPhone Developer"; 377 | DEFINES_MODULE = YES; 378 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 379 | INFOPLIST_FILE = HXCurrencyConversion/Info.plist; 380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 382 | PRODUCT_BUNDLE_IDENTIFIER = com.yiss.yiapp; 383 | PRODUCT_NAME = "$(TARGET_NAME)"; 384 | SWIFT_OBJC_BRIDGING_HEADER = "HXCurrencyConversion/Swift/Main/HXCurrencyConversion-Bridging-Header.h"; 385 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 386 | }; 387 | name = Debug; 388 | }; 389 | E4B824881D51C7C90053DEB3 /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 393 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 394 | CLANG_ENABLE_MODULES = YES; 395 | CODE_SIGN_IDENTITY = "iPhone Developer"; 396 | DEFINES_MODULE = YES; 397 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 398 | INFOPLIST_FILE = HXCurrencyConversion/Info.plist; 399 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 400 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 401 | PRODUCT_BUNDLE_IDENTIFIER = com.yiss.yiapp; 402 | PRODUCT_NAME = "$(TARGET_NAME)"; 403 | SWIFT_OBJC_BRIDGING_HEADER = "HXCurrencyConversion/Swift/Main/HXCurrencyConversion-Bridging-Header.h"; 404 | }; 405 | name = Release; 406 | }; 407 | /* End XCBuildConfiguration section */ 408 | 409 | /* Begin XCConfigurationList section */ 410 | E4B8246A1D51C7C90053DEB3 /* Build configuration list for PBXProject "HXCurrencyConversion" */ = { 411 | isa = XCConfigurationList; 412 | buildConfigurations = ( 413 | E4B824841D51C7C90053DEB3 /* Debug */, 414 | E4B824851D51C7C90053DEB3 /* Release */, 415 | ); 416 | defaultConfigurationIsVisible = 0; 417 | defaultConfigurationName = Release; 418 | }; 419 | E4B824861D51C7C90053DEB3 /* Build configuration list for PBXNativeTarget "HXCurrencyConversion" */ = { 420 | isa = XCConfigurationList; 421 | buildConfigurations = ( 422 | E4B824871D51C7C90053DEB3 /* Debug */, 423 | E4B824881D51C7C90053DEB3 /* Release */, 424 | ); 425 | defaultConfigurationIsVisible = 0; 426 | defaultConfigurationName = Release; 427 | }; 428 | /* End XCConfigurationList section */ 429 | }; 430 | rootObject = E4B824671D51C7C90053DEB3 /* Project object */; 431 | } 432 | --------------------------------------------------------------------------------