Bläddra i källkod

删除了 pod 'RealmSwift'
pod 'TangramKit'
pod 'CryptoSwift'
pod 'SwiftDate'
// SwiftMoyaNetWorkCacheModel.swift

// ExtensionMethod.swift
// RealmUtility.swift
// Rx_RealmUtillit.swift

nanxinlin 6 år sedan
förälder
incheckning
569e0f5355

+ 0 - 7
RainbowPlanet/Podfile

@@ -14,8 +14,6 @@ target 'RainbowPlanet' do
   # json解析
   pod 'SwiftyJSON'
   pod 'ObjectMapper'
-  # 数据存储
-  pod 'RealmSwift'
   # 图片加载
   pod 'Kingfisher'
   pod 'Nuke'
@@ -23,11 +21,8 @@ target 'RainbowPlanet' do
   pod 'Gifu'
   # 自动布局
   pod 'SnapKit'
-  pod 'TangramKit'
   # 键盘
   pod 'IQKeyboardManagerSwift'
-  # 加密
-  pod 'CryptoSwift'
   # 弹框
   pod 'MBProgressHUD'
   # 下拉刷新
@@ -48,8 +43,6 @@ target 'RainbowPlanet' do
   pod 'EFQRCode'
   # 小红点
   pod 'PPBadgeViewSwift'
-  # 日期时间处理
-  pod 'SwiftDate'
   # pop动画
   pod 'FWPopupView'
   # 存储数据Keychain

+ 1 - 23
RainbowPlanet/Podfile.lock

@@ -1,7 +1,6 @@
 PODS:
   - Alamofire (4.8.1)
   - BMKLocationKit (1.5.0)
-  - CryptoSwift (0.15.0)
   - DeviceKit (1.12.0)
   - EFQRCode (4.5.0):
     - swift_qrcodejs (~> 1.0.1)
@@ -55,11 +54,6 @@ PODS:
     - Nuke (~> 7.0)
   - ObjectMapper (3.4.2)
   - PPBadgeViewSwift (2.2.2)
-  - Realm (3.13.1):
-    - Realm/Headers (= 3.13.1)
-  - Realm/Headers (3.13.1)
-  - RealmSwift (3.13.1):
-    - Realm (= 3.13.1)
   - Result (4.1.0)
   - RxAtomic (4.4.2)
   - RxCocoa (4.4.2):
@@ -68,10 +62,8 @@ PODS:
     - RxAtomic (>= 4.4.2, ~> 4.4)
   - SnapKit (4.2.0)
   - swift_qrcodejs (1.0.1)
-  - SwiftDate (5.1.0)
   - SwiftyJSON (4.2.0)
   - SwiftyStarRatingView (1.0.4)
-  - TangramKit (1.3.1)
   - UMCAnalytics (6.0.3):
     - UMCCommon
   - UMCCommon (2.0.1)
@@ -97,7 +89,6 @@ PODS:
 DEPENDENCIES:
   - Alamofire
   - BMKLocationKit
-  - CryptoSwift
   - DeviceKit
   - EFQRCode
   - FSPagerView
@@ -116,14 +107,11 @@ DEPENDENCIES:
   - Nuke-WebP-Plugin
   - ObjectMapper
   - PPBadgeViewSwift
-  - RealmSwift
   - RxCocoa
   - RxSwift
   - SnapKit
-  - SwiftDate
   - SwiftyJSON
   - SwiftyStarRatingView
-  - TangramKit
   - UMCAnalytics
   - UMCCommon
   - UMCCommonLog
@@ -138,7 +126,6 @@ SPEC REPOS:
   https://github.com/cocoapods/specs.git:
     - Alamofire
     - BMKLocationKit
-    - CryptoSwift
     - DeviceKit
     - EFQRCode
     - FBRetainCycleDetector
@@ -159,18 +146,14 @@ SPEC REPOS:
     - Nuke-WebP-Plugin
     - ObjectMapper
     - PPBadgeViewSwift
-    - Realm
-    - RealmSwift
     - Result
     - RxAtomic
     - RxCocoa
     - RxSwift
     - SnapKit
     - swift_qrcodejs
-    - SwiftDate
     - SwiftyJSON
     - SwiftyStarRatingView
-    - TangramKit
     - UMCAnalytics
     - UMCCommon
     - UMCCommonLog
@@ -181,7 +164,6 @@ SPEC REPOS:
 SPEC CHECKSUMS:
   Alamofire: 16ce2c353fb72865124ddae8a57c5942388f4f11
   BMKLocationKit: 40d267478acd8704ddebd0e9deaddc727b13df9f
-  CryptoSwift: 769f58a9e89f64e8796c2e59ce5f002dc81a2438
   DeviceKit: f5dbd2e70cafd420d6a09379b8800cdf5fe92ba5
   EFQRCode: 842f431e660da841f518993af8f4cbd275601d84
   FBRetainCycleDetector: 46f8179bbb1c587deee3ea838a1a3ee02acf5015
@@ -202,18 +184,14 @@ SPEC CHECKSUMS:
   Nuke-WebP-Plugin: 7dcbb669d736a7d6d3f3a44742e825c18ff982da
   ObjectMapper: 0d4402610f4e468903ae64629eec4784531e5c51
   PPBadgeViewSwift: 96a41852df7437e9d948565a1bc894f757c29933
-  Realm: 50071da38fe079e0735e47c9f2eae738c68c5996
-  RealmSwift: 8a1e6a02b7a08cd17a31e3115143fb69fe5f3fb9
   Result: bd966fac789cc6c1563440b348ab2598cc24d5c7
   RxAtomic: d00e97c10db88c6f08540e0bf2752fc5a2404167
   RxCocoa: 477990dc3b4c3ff55fb0ac77e1cc06244e0aaec8
   RxSwift: 74c29b693c8e42b0f64400e8b06564575742d649
   SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
   swift_qrcodejs: c181fe5c849d30c699546a23762d7e3dd143ab37
-  SwiftDate: 6329e58969a2de31cea7f1ee1143b247693196e7
   SwiftyJSON: c4bcba26dd9ec7a027fc8eade48e2c911f229e96
   SwiftyStarRatingView: a2b0057700e0adeb8e7442c55d99cb53b531d2f4
-  TangramKit: 1b4ee065845919057bdbe930ba39deecbbff181e
   UMCAnalytics: ff58714ada407682c4a07548156f94bcec92f055
   UMCCommon: 0263a057a2e1ae1da4c8308541e56904a493ce13
   UMCCommonLog: 05a2d5de21858e3d870551562cff405c1366d244
@@ -221,6 +199,6 @@ SPEC CHECKSUMS:
   UMCSecurityPlugins: 0831a08f3988f3cea9f1d3a7626cd9bee4fef150
   UMCShare: 552b29753f1b4da87b51d96545ed19e6263df397
 
-PODFILE CHECKSUM: a5cbc1b3dda3fa1c714008d5d0e71c430ffc9108
+PODFILE CHECKSUM: 338a17450a35e9f9265a15f08e15830aab4ddc09
 
 COCOAPODS: 1.5.3

+ 0 - 42
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -75,11 +75,6 @@
 		A72A7386223396CB00B21995 /* SwiftMoyaNetWorkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A7382223396CB00B21995 /* SwiftMoyaNetWorkManager.swift */; };
 		A72A7387223396CB00B21995 /* SwiftMoyaServiceAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A7383223396CB00B21995 /* SwiftMoyaServiceAPI.swift */; };
 		A72A7388223396CB00B21995 /* ApiMacro.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A7384223396CB00B21995 /* ApiMacro.swift */; };
-		A72A738D2233B2DE00B21995 /* ExtensionMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A738A2233B2DE00B21995 /* ExtensionMethod.swift */; };
-		A72A738E2233B2DE00B21995 /* Rx_RealmUtillit.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A738B2233B2DE00B21995 /* Rx_RealmUtillit.swift */; };
-		A72A738F2233B2DE00B21995 /* RealmUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A738C2233B2DE00B21995 /* RealmUtility.swift */; };
-		A72A73912233B55400B21995 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A73902233B55400B21995 /* Dog.swift */; };
-		A72A73932233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A73922233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift */; };
 		A76390EB2248E27A0067EEE0 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A76390EA2248E27A0067EEE0 /* UserNotifications.framework */; };
 		A775CBFE2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */; };
 		A775CC00223774A300EBDCF8 /* ShoppingMallView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */; };
@@ -217,11 +212,6 @@
 		A72A7382223396CB00B21995 /* SwiftMoyaNetWorkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkManager.swift; sourceTree = "<group>"; };
 		A72A7383223396CB00B21995 /* SwiftMoyaServiceAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftMoyaServiceAPI.swift; sourceTree = "<group>"; };
 		A72A7384223396CB00B21995 /* ApiMacro.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiMacro.swift; sourceTree = "<group>"; };
-		A72A738A2233B2DE00B21995 /* ExtensionMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExtensionMethod.swift; sourceTree = "<group>"; };
-		A72A738B2233B2DE00B21995 /* Rx_RealmUtillit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Rx_RealmUtillit.swift; sourceTree = "<group>"; };
-		A72A738C2233B2DE00B21995 /* RealmUtility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmUtility.swift; sourceTree = "<group>"; };
-		A72A73902233B55400B21995 /* Dog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = "<group>"; };
-		A72A73922233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkCacheModel.swift; sourceTree = "<group>"; };
 		A76390EA2248E27A0067EEE0 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
 		A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallNavigationBarView.swift; sourceTree = "<group>"; };
 		A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallView.swift; sourceTree = "<group>"; };
@@ -559,21 +549,10 @@
 				A72A7383223396CB00B21995 /* SwiftMoyaServiceAPI.swift */,
 				A72A7381223396CB00B21995 /* SwiftMoyaNetWorkService.swift */,
 				A72A7382223396CB00B21995 /* SwiftMoyaNetWorkManager.swift */,
-				A72A73922233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift */,
 			);
 			path = SwiftMoyaService;
 			sourceTree = "<group>";
 		};
-		A72A73892233B2DE00B21995 /* RealmUtility */ = {
-			isa = PBXGroup;
-			children = (
-				A72A738C2233B2DE00B21995 /* RealmUtility.swift */,
-				A72A738B2233B2DE00B21995 /* Rx_RealmUtillit.swift */,
-				A72A738A2233B2DE00B21995 /* ExtensionMethod.swift */,
-			);
-			path = RealmUtility;
-			sourceTree = "<group>";
-		};
 		A775CBFC2237483E00EBDCF8 /* View */ = {
 			isa = PBXGroup;
 			children = (
@@ -882,7 +861,6 @@
 		A77F2CAB2232010F001BD3F6 /* ViewController */ = {
 			isa = PBXGroup;
 			children = (
-				A72A73902233B55400B21995 /* Dog.swift */,
 				A77F2CAD2232010F001BD3F6 /* MineViewController.swift */,
 				A77F2CAC2232010F001BD3F6 /* MineViewController.xib */,
 			);
@@ -947,7 +925,6 @@
 				A72A727B22321DDF00B21995 /* Countdown */,
 				A72A727522321DDE00B21995 /* SwiftProgressHUD */,
 				A775CC0122377AB700EBDCF8 /* EmptyView */,
-				A72A73892233B2DE00B21995 /* RealmUtility */,
 				A72A727F22321DDF00B21995 /* CGView */,
 				A72A728B22321DE000B21995 /* Extension */,
 				A72A728122321DDF00B21995 /* MJRefreshEX */,
@@ -1174,7 +1151,6 @@
 			inputPaths = (
 				"${SRCROOT}/Pods/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet-frameworks.sh",
 				"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
-				"${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework",
 				"${BUILT_PRODUCTS_DIR}/DeviceKit/DeviceKit.framework",
 				"${BUILT_PRODUCTS_DIR}/EFQRCode/EFQRCode.framework",
 				"${BUILT_PRODUCTS_DIR}/FBRetainCycleDetector/FBRetainCycleDetector.framework",
@@ -1194,17 +1170,13 @@
 				"${BUILT_PRODUCTS_DIR}/Nuke-WebP-Plugin/NukeWebPPlugin.framework",
 				"${BUILT_PRODUCTS_DIR}/ObjectMapper/ObjectMapper.framework",
 				"${BUILT_PRODUCTS_DIR}/PPBadgeViewSwift/PPBadgeViewSwift.framework",
-				"${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
-				"${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework",
 				"${BUILT_PRODUCTS_DIR}/Result/Result.framework",
 				"${BUILT_PRODUCTS_DIR}/RxAtomic/RxAtomic.framework",
 				"${BUILT_PRODUCTS_DIR}/RxCocoa/RxCocoa.framework",
 				"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
 				"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
-				"${BUILT_PRODUCTS_DIR}/SwiftDate/SwiftDate.framework",
 				"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
 				"${BUILT_PRODUCTS_DIR}/SwiftyStarRatingView/SwiftyStarRatingView.framework",
-				"${BUILT_PRODUCTS_DIR}/TangramKit/TangramKit.framework",
 				"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
 				"${BUILT_PRODUCTS_DIR}/swift_qrcodejs/swift_qrcodejs.framework",
 			);
@@ -1213,7 +1185,6 @@
 			);
 			outputPaths = (
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DeviceKit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EFQRCode.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBRetainCycleDetector.framework",
@@ -1233,17 +1204,13 @@
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NukeWebPPlugin.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ObjectMapper.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PPBadgeViewSwift.framework",
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxAtomic.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftDate.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyStarRatingView.framework",
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TangramKit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/swift_qrcodejs.framework",
 			);
@@ -1302,7 +1269,6 @@
 				A72A726822321DBD00B21995 /* UMManager.swift in Sources */,
 				A77F2CB92232010F001BD3F6 /* ShoppingCartViewController.swift in Sources */,
 				A72A72B822321DE000B21995 /* Extension+UserDefaults.swift in Sources */,
-				A72A738D2233B2DE00B21995 /* ExtensionMethod.swift in Sources */,
 				A72A72A222321DE000B21995 /* LBXScanNetAnimation.swift in Sources */,
 				A7778CB82244E97A00C7C47A /* BindPhoneNumberViewController.swift in Sources */,
 				A72A72D322321E2700B21995 /* CacheMacro.swift in Sources */,
@@ -1316,7 +1282,6 @@
 				A72A737E2233966800B21995 /* RootInfoModel.swift in Sources */,
 				A72A7333223256E100B21995 /* PayManager.swift in Sources */,
 				A775CC00223774A300EBDCF8 /* ShoppingMallView.swift in Sources */,
-				A72A738F2233B2DE00B21995 /* RealmUtility.swift in Sources */,
 				A72A72D622321E2700B21995 /* ThirdPartyMacro.swift in Sources */,
 				A72A72A622321DE000B21995 /* LBXScanViewStyle.swift in Sources */,
 				A72A72B422321DE000B21995 /* Extension+UIImage.swift in Sources */,
@@ -1335,7 +1300,6 @@
 				A72A7385223396CB00B21995 /* SwiftMoyaNetWorkService.swift in Sources */,
 				A72A72A822321DE000B21995 /* LBXScanWrapper.swift in Sources */,
 				A7778CB32244D73400C7C47A /* ThirdPartyLoginViewController.swift in Sources */,
-				A72A73932233BFCD00B21995 /* SwiftMoyaNetWorkCacheModel.swift in Sources */,
 				A7A97FDB2238FBAD0070F84D /* VerticalListCellModel.swift in Sources */,
 				A72A72BD22321DE000B21995 /* Extension+UIColor.swift in Sources */,
 				A77F2CC822320627001BD3F6 /* WRCustomNavigationBar.swift in Sources */,
@@ -1344,7 +1308,6 @@
 				A7A97FDA2238FBAD0070F84D /* VerticalListSectionModel.swift in Sources */,
 				A72A72A522321DE000B21995 /* LBXScanLineAnimation.swift in Sources */,
 				A72A72C322321DE000B21995 /* Extension+Date.swift in Sources */,
-				A72A73912233B55400B21995 /* Dog.swift in Sources */,
 				A7778CAB2244B12500C7C47A /* CountDownManager.swift in Sources */,
 				A775CBFE2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift in Sources */,
 				A72A72C622321DE000B21995 /* WebView.swift in Sources */,
@@ -1363,7 +1326,6 @@
 				A72A72B522321DE000B21995 /* Extension+UITextView.swift in Sources */,
 				A72A733722325EED00B21995 /* AlipayResultModel.swift in Sources */,
 				A77F2C9C2231FDCF001BD3F6 /* BaseView.swift in Sources */,
-				A72A738E2233B2DE00B21995 /* Rx_RealmUtillit.swift in Sources */,
 				A72A7388223396CB00B21995 /* ApiMacro.swift in Sources */,
 				A72A72B922321DE000B21995 /* Extension+Array.swift in Sources */,
 				A7778CDD2246121500C7C47A /* PhoneCountryAreaListMdoel.swift in Sources */,
@@ -1577,8 +1539,6 @@
 					"-framework",
 					"\"CoreTelephony\"",
 					"-framework",
-					"\"CryptoSwift\"",
-					"-framework",
 					"\"DeviceKit\"",
 					"-framework",
 					"\"FBRetainCycleDetector\"",
@@ -1702,8 +1662,6 @@
 					"-framework",
 					"\"CoreTelephony\"",
 					"-framework",
-					"\"CryptoSwift\"",
-					"-framework",
 					"\"DeviceKit\"",
 					"-framework",
 					"\"FBRetainCycleDetector\"",

+ 0 - 27
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift

@@ -26,33 +26,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         return true
     }
 
-    func applicationWillResignActive(_ application: UIApplication) {
-        // 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.
-        // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
-    }
-
-    func applicationDidEnterBackground(_ application: UIApplication) {
-        // 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.
-        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
-    }
-
-    func applicationWillEnterForeground(_ application: UIApplication) {
-        // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
-    }
-
-    func applicationDidBecomeActive(_ application: UIApplication) {
-        // 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.
-    }
-
-    func applicationWillTerminate(_ application: UIApplication) {
-        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-    }
-
-    func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {
-        //register to receive notifications
-        application.registerForRemoteNotifications()
-    }
-
 
 }
 

+ 0 - 6
RainbowPlanet/RainbowPlanet/Define/NotificationCenterMacro.swift

@@ -11,9 +11,3 @@ import Foundation
 
 /// 定位
 let kLocationModelChangeNotificationName = Notification.Name(rawValue: "LocationModelChange")
-
-/// 我的页面监听数据改变
-let kMineUserQueryModelTokenModelChangeNotificationName = Notification.Name(rawValue: "kMineUserQueryModelTokenModelChangeNotificationName")
-
-/// 银行卡列表页面
-let kBankCardListViewControllerNotificationName = Notification.Name(rawValue: "kBankCardListViewControllerNotificationName")

+ 2 - 3
RainbowPlanet/RainbowPlanet/Define/ThirdPartyMacro.swift

@@ -31,8 +31,7 @@ let kWeiboAppSecret  = "79d36bfe6b75638ece14d5d852e785c4"
 //MARK: - 百度地图
 let kBaiduMapAppKey  = "v7wFjrAQdlaBVC50CjwuRESC3Lu0xkhj"
 
-//MARK: - 闪验
-let kShanYanAppId  = ""
-let kShanYanAppKey  = ""
+//MARK: - 百度地图
+let kAppKey  = "v7wFjrAQdlaBVC50CjwuRESC3Lu0xkhj"
 
 

+ 3 - 0
RainbowPlanet/RainbowPlanet/Manager/UMManager/UMManager.swift

@@ -122,6 +122,9 @@ public extension UMManager {
             }
         }
         UMessage.setBadgeClear(true)//设置是否允许SDK自动清空角标
+        UMessage.openDebugMode(true)
+        UMessage.setWebViewClassString("UMWebViewController")
+        UMessage.addLaunch()
     }
 }
 

+ 0 - 23
RainbowPlanet/RainbowPlanet/Modules/MineModule/Mine/ViewController/Dog.swift

@@ -1,23 +0,0 @@
-//
-//  Dog.swift
-//  RealmTest
-//
-//  Created by 南鑫林 on 2017/12/25.
-//  Copyright © 2017年 南鑫林. All rights reserved.
-//
-
-import Foundation
-import RealmSwift
-
-class Dog: Object {
-    @objc dynamic var id: Int = 0
-    @objc dynamic var name: String?
-    override static func primaryKey() -> String? {
-        return "id"
-    }
-    
-}
-
-class Cat: Object {
-    @objc dynamic var name: String?
-}

+ 0 - 1
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/PhoneCountryArea/ViewController/PhoneCountryAreaViewController.swift

@@ -8,7 +8,6 @@
 
 import UIKit
 import SwiftyJSON
-import TangramKit
 
 class PhoneCountryAreaViewController: BaseViewController {
 

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/ThirdPartyLogin/ViewController/ThirdPartyLoginViewController.swift

@@ -26,7 +26,7 @@ class ThirdPartyLoginViewController: BaseViewController {
         view.backgroundColor = UIColor.white
         setupViews()
         setupLayouts()
-        
+        UMessage.addCardMessage(withLabel: "home")        
     }
 
     override func setupViews() {

+ 0 - 1
RainbowPlanet/RainbowPlanet/Service/RootModel/RootModel.swift

@@ -4,7 +4,6 @@
 
 import Foundation 
 import ObjectMapper
-import RealmSwift
 
 class RootModel : NSObject, NSCoding, Mappable{
 

+ 0 - 48
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaNetWorkCacheModel.swift

@@ -1,48 +0,0 @@
-//
-//  SwiftMoyaNetWorkCacheModel.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/3/9.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import RealmSwift
-
-class SwiftMoyaNetWorkCacheModel: Object{
-
-    @objc dynamic var data: String!
-    @objc dynamic var path: String!
-
-
-    /**
-     * Instantiate the instance using the passed dictionary values to set the properties values
-     */
-    class func fromDictionary(dictionary: [String:Any]) -> SwiftMoyaNetWorkCacheModel  {
-        let this = SwiftMoyaNetWorkCacheModel()
-        if let dataValue = dictionary["data"] as? String{
-            this.data = dataValue
-        }
-        if let pathValue = dictionary["path"] as? String{
-            this.path = pathValue
-        }
-        return this
-    }
-
-    /**
-     * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
-     */
-    func toDictionary() -> [String:Any]
-    {
-        var dictionary = [String:Any]()
-        if data != nil{
-            dictionary["data"] = data
-        }
-        if path != nil{
-            dictionary["path"] = path
-        }
-        return dictionary
-    }
-
-
-}

+ 1 - 63
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaNetWorkManager.swift

@@ -14,7 +14,6 @@ import ObjectMapper
 import RxAtomic
 import RxSwift
 import RxCocoa
-import RealmSwift
 /// 超时时长
 private var requestTimeOut:Double = 20
 
@@ -122,22 +121,14 @@ public class SwiftMoyaNetWorkManager: NSObject {
             return
         }
 
-        //获取缓存
-        if isCache {
-            getIsCache(target: target, isCache: isCache, completion: completion)
-        }
-
         provider.rx
             .request(target)
             .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated))
             .observeOn(MainScheduler.instance)
             .subscribe(onSuccess: {
                 [weak self] (response) in
-                self?.getResponseStatusCode(response: response, completion: {[weak self] (data) in
+                self?.getResponseStatusCode(response: response, completion: { (data) in
                     completion(data)
-                    //设置缓存
-                    self?.setIsCache(target: target,isCache: isCache)
-
                 })
             }) {
                 [weak self] (error) in
@@ -185,59 +176,6 @@ public class SwiftMoyaNetWorkManager: NSObject {
     }
 
 
-    /// 添加缓存
-    ///
-    /// - Parameters:
-    ///   - target: 路径
-    ///   - isCache: 缓存
-    func setIsCache(target: MultiTarget,isCache:Bool) {
-        if isCache {
-            Rx_RealmUtillit.creatDB(self.dataBaseName).subscribe().disposed(by: disposeBag)
-            var dic = Dictionary<String, Any>()
-            dic.updateValue(target.target.path, forKey: "path")
-            dic.updateValue(target.target.path, forKey: "data")
-            let cacheModel = SwiftMoyaNetWorkCacheModel.init(value: dic)
-
-            Rx_RealmUtillit.getDefaultRealm().subscribe(onNext: { (realm) in
-                mPrint("realmPath:", realm?.configuration.fileURL as Any)
-
-            }).disposed(by: disposeBag)
-
-            Rx_RealmUtillit.getObject(type: SwiftMoyaNetWorkCacheModel.self, filter: "path = '\(target.target.path)'").subscribe(onNext: {[weak self] (objects) in
-
-                if objects!.count > 0 {
-                    Rx_RealmUtillit.updateObject(SwiftMoyaNetWorkCacheModel.self, value: dic, update: true).subscribe(onNext: { (error) in
-
-                    }).disposed(by: (self?.disposeBag)!)
-
-                } else {
-                    Rx_RealmUtillit.addObject(cacheModel).subscribe(onNext: { (error) in
-
-                    }).disposed(by: (self?.disposeBag)!)
-                }
-            }).disposed(by: disposeBag)
-        }
-    }
-
-    func getIsCache(target: MultiTarget,isCache:Bool,completion: @escaping successCallback) {
-        if isCache {
-            Rx_RealmUtillit.openReferenceDB(self.dataBaseName).subscribe().disposed(by: disposeBag)
-
-            Rx_RealmUtillit.getDefaultRealm().subscribe(onNext: { (realm) in
-                mPrint("realmPath:", realm?.configuration.fileURL as Any)
-
-            }).disposed(by: disposeBag)
-
-            Rx_RealmUtillit.getObject(type: SwiftMoyaNetWorkCacheModel.self, filter: "path = '\(target.target.path)'").subscribe(onNext: { (objects) in
-                if objects!.count > 0 {
-                    //TODO: 需要处理的
-                    completion("")
-                }
-            }).disposed(by: disposeBag)
-        }
-    }
-
-
     // MARK: - 取消所有请求
     /// 取消所有请求
     func cancelAllRequest() {

+ 0 - 2
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+String.swift

@@ -7,8 +7,6 @@
 //
 
 import Foundation
-import CryptoSwift
-
 extension String {
     
     /// 实现一个我们自定的字符串类,可以方便的通过索引获取某一个字符值,或某一部分字符串。同时也可以通过索引,给某一部分赋值

+ 0 - 26
RainbowPlanet/RainbowPlanet/Tools/RealmUtility/ExtensionMethod.swift

@@ -1,26 +0,0 @@
-//
-//  ExtensionMethod.swift
-//  RealmTest
-//
-//  Created by 南鑫林 on 2017/12/15.
-//  Copyright © 2017年 南鑫林. All rights reserved.
-//
-
-import Foundation
-
-
-/// 创建数据库的名字
-///
-/// - db: db
-public enum dataBaseName: String {
-    case db = "db"
-}
-
-/// 在run debug的状态打印所需要的信息
-///
-/// - Parameter items: 所要打印的内容
-public func mPrint(_ items: Any...) {
-    #if DEBUG
-    debugPrint(items)
-    #endif
-}

+ 0 - 417
RainbowPlanet/RainbowPlanet/Tools/RealmUtility/RealmUtility.swift

@@ -1,417 +0,0 @@
-//
-//  RealmUtility.swift
-//  RealmTest
-//
-//  Created by 南鑫林 on 2017/12/13.
-//  Copyright © 2017年 南鑫林. All rights reserved.
-//  Realm数据库单例工具
-
-import Foundation
-import RealmSwift
-
-class RealmUtility: NSObject {
-    
-    //MARK: - 单例实例
-    /// 获取RealmUtility的实例
-    static var `default`: RealmUtility  = RealmUtility()
-    private override init() {
-        super.init()
-    }
-    
-    //MARK: - 创建数据库
-    /// 创建数据库
-    ///
-    /// - Parameters:
-    ///   - dataBaseName: 数据库名字
-    ///   - isReadOnly: 是否是只读
-    /// - Returns: Realm实例
-    @discardableResult
-    public func creatDB(_ dataBaseName: String, isReadOnly: Bool = false) -> Realm? {
-        let realm = openDB(dataBaseName, isReadOnly: isReadOnly)
-        return realm
-    }
-    
-    /// 打开数据库
-    ///
-    /// - Parameter name: 数据库名字
-    /// - isReadOnly: 是否是只读
-    /// - Returns: Realm实例
-    @discardableResult
-    private func openDB(_ dataBaseName: String, isReadOnly: Bool = false) -> Realm? {
-        guard let dbPath = getCreatDatabasePath(dataBaseName) else {
-            return nil
-        }
-        var config = Realm.Configuration()
-        config.fileURL = dbPath
-        config.readOnly = isReadOnly
-        Realm.Configuration.defaultConfiguration = config
-        do {
-            let realm = try Realm.init(configuration: config)
-            return realm
-        }catch let error {
-            mPrint("打开或者创建数据库失败:\n\(error.localizedDescription)")
-            return nil
-        }
-    }
-    
-    
-    /// 设置通过Realm()获取数据库的配置
-    ///
-    /// - Parameters:
-    ///   - realmName: 数据库的名字
-    ///   - isReadOnly: 是否是这是只读
-    public func setDefaltRealmConfiguration(_ realmName: String,isReference: Bool = false, isReadOnly: Bool = false) -> Bool{
-        var realmPath: URL?
-        if isReference {
-            realmPath = getReferenceDatabasePaeh(realmName)
-        }else {
-            realmPath = getCreatDatabasePath(realmName)
-        }
-        if realmPath == nil {
-            return false
-        }
-        var config = Realm.Configuration()
-        config.fileURL = realmPath
-        config.readOnly = isReadOnly
-        Realm.Configuration.defaultConfiguration = config
-        return true
-    }
-    
-    /// 打开预植的数据库
-    ///
-    /// - Parameters:
-    ///   - dataBaseName: 数据库名字
-    ///   - isReadOnly: 是否是只读
-    /// - Returns: Realm实例
-    @discardableResult
-    public func openReferenceDB(_ dataBaseName: String, isReadOnly: Bool = true) -> Realm? {
-        guard let dbPath = getReferenceDatabasePaeh(dataBaseName) else {
-            return nil
-        }
-        var config = Realm.Configuration()
-        config.fileURL = dbPath
-        config.readOnly = isReadOnly
-        Realm.Configuration.defaultConfiguration = config
-        do {
-            let realm = try Realm.init(configuration: config)
-            return realm
-        }catch let error {
-            mPrint("打开或者创建数据库失败:\n\(error.localizedDescription)")
-            return nil
-        }
-    }
-    
-    /// 获取当前默认的数据
-    ///
-    /// - Returns: 返回默认的Realm的数据库实例
-    @discardableResult
-    public func getDefaultRealm() -> Realm? {
-        do {
-            return try Realm()
-        }catch let error {
-            mPrint("获取默认的Realm的数据库失败:\n\(error.localizedDescription)")
-            return nil
-        }
-    }
-    
-    //MARK: - 增
-    /// 创建表 || 更新表
-    ///
-    /// - Parameters:
-    ///   - type: 表向对应的对象
-    ///   - value: 值
-    ///   - update: 是否是更新, 如果是"true", Realm会查找对象并更新它, 否则添加对象
-    ///   - result: 最后添加对象是成功, 如果成功将对象返回
-    public func creatObject(_ type: RealmSwift.Object.Type, value: Any? = nil, update: Bool = false, result: ((RealmSwift.Object?, Error?) -> Void)? = nil){
-        let realm = getDefaultRealm()
-        do {
-            try realm?.write {
-                let object = (value == nil) ? realm?.create(type) : realm?.create(type, value: value!, update: update)
-                result?(object, nil)
-            }
-        } catch let error {
-            mPrint("获取默认的Realm的数据库失败:\n\(error.localizedDescription)")
-            result?(nil, error)
-        }
-    }
-    
-   
-    /// 添加数据 || 根据主键更新数据
-    ///
-    /// - Parameters:
-    ///   - object: 要添加的数据
-    ///   - update: 是否更新, 如果是true
-    ///   - result: 添加数据的状态
-    public func addObject(_ object: RealmSwift.Object, update: Bool = false, result: ((Error?) -> Void)? = nil) {
-        let realm = getDefaultRealm()
-        do {
-            try realm?.write {
-                realm?.add(object, update: update)
-                result?(nil)
-            }
-        } catch let error {
-            mPrint("添加数据失败:\n \(error.localizedDescription)")
-            result?(error)
-        }
-    }
-    
-    //MARK: - 删
-    /// 删除数据
-    ///
-    /// - Parameters:
-    ///   - object: 要删除的对象
-    ///   - result: 删除的状态
-    public func deleteObject(_ object: RealmSwift.Object, result: ((Error?) -> Void)? = nil) {
-        let realm = getDefaultRealm()
-        do {
-            try realm?.write {
-                realm?.delete(object)
-                result?(nil)
-            }
-        } catch let error {
-            mPrint("添加数据失败:\n \(error.localizedDescription)")
-            result?(error)
-        }
-    }
-    
-    
-    /// 删除当前数据库中所有的数据
-    ///
-    /// - Parameter result: 删除的状态
-    public func deleteAllObject(result: ((Error?) -> Void)? = nil) {
-        let realm = getDefaultRealm()
-        do {
-            try realm?.write {
-                realm?.deleteAll()
-                result?(nil)
-            }
-        } catch let error {
-            mPrint("添加数据失败:\n \(error.localizedDescription)")
-            result?(error)
-        }
-    }
-    
-    /// 删除当前打开的数据库
-    ///
-    /// - Parameter dataBaseName: 数据库的名字
-    /// - Returns: 删除的状态
-    @discardableResult
-    public func deleteCreatDBFile() -> Bool {
-       return  autoreleasepool { () -> Bool in
-            let realmURL = Realm.Configuration.defaultConfiguration.fileURL!
-            let realmURLs = [
-                realmURL,
-                realmURL.appendingPathExtension("lock"),
-                realmURL.appendingPathExtension("note"),
-                realmURL.appendingPathExtension("management")
-            ]
-            for URL in realmURLs {
-                do {
-                    try FileManager.default.removeItem(at: URL)
-                    return true
-                } catch {
-                    // 错误处理
-                    return false
-                }
-            }
-            return false
-        }
-    }
-    
-    //MARK: - 改
-    /// 根据主键进行更新
-    ///
-    /// - Parameters:
-    ///   - object: 要更新的对象
-    ///   - update: 是否根据主键更新, 如果是"false"则是添加数据
-    ///   - result: 更新数据的结果
-    public func updateObject(_ object: RealmSwift.Object, update: Bool = true, result: ((Error?) -> Void)? = nil) {
-        addObject(object, update: update, result: result)
-    }
-    
-    
-    /// 根据主键进行更新
-    ///
-    /// - Parameters:
-    ///   - type: 要更新的对象类型
-    ///   - value: 要更新的值, 例如: ["id": 1, "price": 9000.0]
-    ///   - update: 是否根据主键进行更新, 如果为"false"则为创建表
-    ///   - result: 更新的结果
-    public func updateObject(_ type: RealmSwift.Object.Type, value: Any? = nil, update: Bool = true, result: ((RealmSwift.Object?, Error?) -> Void)? = nil) {
-        creatObject(type, value: value, update: update, result: result)
-    }
-    
-    
-    /// 直接更新对象
-    ///
-    /// - Parameters:
-    ///   - property: 要更改的属性
-    ///   - value: 更改的值
-    /// - Returns: 更改的结果
-    @discardableResult
-    public func updateObject( property: inout Any, value: Any) -> Bool {
-        let realm = getDefaultRealm()
-        do {
-            try realm?.write {
-                 property = value
-            }
-            return true
-        } catch let error {
-            mPrint("直接更新对象属性错误: \(error.localizedDescription)")
-            return false
-        }
-    }
-    
-    
-    /// 更改表中所有的字段的值
-    ///
-    /// - Parameters:
-    ///   - type: 表的对象类型
-    ///   - key: 要更改的字段名
-    ///   - value: 更改的值
-    /// - Returns: 返回更改结果
-    public func updateObjects(type: RealmSwift.Object.Type, key: String, value: Any) -> Bool {
-        let objects = getObjects(type: type)
-        do {
-            try getDefaultRealm()?.write {
-                objects?.setValue(value, forKeyPath: key)
-            }
-            return true
-        } catch let error {
-            mPrint("更改一个表中的所有数据错误: \(error.localizedDescription)")
-            return false
-        }
-    }
-    
-    
-    /// 根据主键进行对某个对象中的数据进行更新
-    ///
-    /// - Parameters:
-    ///   - type: 表类型
-    ///   - primaryKey: 主键
-    ///   - key: 要更改属性
-    ///   - value: 更改的值
-    /// - Returns: 更改的状态
-    public func updateObject(type: RealmSwift.Object.Type, primaryKey: Any, key: String, value: Any) -> Bool {
-        let object = getObjectWithPrimaryKey(type: type, primaryKey: primaryKey)
-        do {
-            try getDefaultRealm()?.write {
-                object?.setValue(value, forKeyPath: key)
-            }
-            return true
-        } catch let error {
-            mPrint("更新数据出错: \(error.localizedDescription)")
-            return false
-        }
-    }
-    
-    //MARK: - 查
-    /// 查找一个表中的所有的数据
-    ///
-    /// - Parameter type: 对象类型
-    /// - Returns: 查到的数据
-    public func getObjects(type: RealmSwift.Object.Type) -> RealmSwift.Results<RealmSwift.Object>?{
-         return getDefaultRealm()?.objects(type)
-    }
-    
-    /// 根据主键查找某个对象
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - primaryKey: 主键
-    /// - Returns: 查到的数据
-    public func getObjectWithPrimaryKey(type: RealmSwift.Object.Type, primaryKey: Any) -> RealmSwift.Object? {
-        return getDefaultRealm()?.object(ofType: type, forPrimaryKey: primaryKey)
-    }
-    
-    
-    /// 使用断言字符串查询
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - filter: 过滤条件
-    /// - Returns: 查询到的数据
-    /// - example:
-    ///   - var tanDogs = realm.objects(Dog.self).filter("color = 'tan' AND name BEGINSWITH 'B'")
-    public func getObject(type: RealmSwift.Object.Type, filter: String) -> RealmSwift.Results<RealmSwift.Object>? {
-        return getObjects(type: type)?.filter(filter)
-    }
-    
-    
-    /// 使用谓词进行查询
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - predicate: 谓词对象
-    /// - Returns: 查询到的数据
-    /// - example:
-    ///   - let predicate = NSPredicate(format: "color = %@ AND name BEGINSWITH %@", "tan", "B")
-    ///   - tanDogs = realm.objects(Dog.self).filter(predicate)
-    public func getObject(type: RealmSwift.Object.Type, predicate: NSPredicate) -> RealmSwift.Results<RealmSwift.Object>? {
-        return getObjects(type: type)?.filter(predicate)
-    }
-
-
-    /// 对查询的数据进行排序,请注意, 不支持 将多个属性用作排序基准,此外也无法链式排序(只有最后一个 sorted 调用会被使用)。 如果要对多个属性进行排序,请使用 sorted(by:) 方法,然后向其中输入多个 SortDescriptor 对象。
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - filter: 过滤条件
-    ///   - sortedKey: 需要排序的字段
-    /// - Returns: 最后的结果
-    public func getObject(type: RealmSwift.Object.Type, filter: String, sortedKey: String) -> RealmSwift.Results<RealmSwift.Object>? {
-        return getObject(type: type, filter: filter)?.sorted(byKeyPath: sortedKey)
-    }
-    
-    
-    /// 对查询的数据进行排序, 请注意, 不支持 将多个属性用作排序基准,此外也无法链式排序(只有最后一个 sorted 调用会被使用)。 如果要对多个属性进行排序,请使用 sorted(by:) 方法,然后向其中输入多个 SortDescriptor 对象。
-    ///
-    /// - Parameters:
-    ///   - type: 队形类型
-    ///   - predicate: 谓词对象
-    ///   - sortedKey: 排序的字段
-    /// - Returns: 排序后的数据
-    public func getObject(type: RealmSwift.Object.Type, predicate: NSPredicate, sortedKey: String) -> RealmSwift.Results<RealmSwift.Object>? {
-        return getObject(type: type, predicate: predicate)?.sorted(byKeyPath: sortedKey)
-    }
-    
-    
-}
-
-extension RealmUtility {
-    /// 在创建数据库的时候要保存的数据库路径, 保存在caches 文件中
-    ///
-    /// - Paramter fileName: 数据库名字
-    /// - Returns: 数据库保存的路径
-    private func getCreatDatabasePath(_ fileName: String) -> URL? {
-        let cachesPaeh = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first
-        guard var filePath = cachesPaeh else {
-            return nil
-        }
-        filePath = filePath + "/DB/\(fileName)"
-        
-        do {
-            if !FileManager.default.fileExists(atPath: filePath) {
-                try FileManager.default.createDirectory(atPath: filePath, withIntermediateDirectories: true, attributes: nil)
-            }
-        }catch let error {
-            mPrint("创建数据库文件夹:\(error.localizedDescription)")
-            return nil
-        }
-        let path = filePath + "/\(fileName).realm"
-        mPrint(path)
-        return URL.init(string: path)
-    }
-    
-    
-    /// 获取引用的数据的路径
-    ///
-    /// - Parameter fileName: 数据库的名字
-    /// - Returns: 本地引用的数据库的路径
-    private func getReferenceDatabasePaeh(_ fileName: String) -> URL? {
-        let path = Bundle.main.path(forResource: fileName, ofType: "realm")
-        let url = path != nil ? URL.init(string: path!) : nil
-        return url
-    }
-    
-}

+ 0 - 352
RainbowPlanet/RainbowPlanet/Tools/RealmUtility/Rx_RealmUtillit.swift

@@ -1,352 +0,0 @@
-//
-//  Rx_RealmUtillit.swift
-//  RealmTest
-//
-//  Created by 南鑫林 on 2017/12/25.
-//  Copyright © 2017年 南鑫林. All rights reserved.
-//
-
-import Foundation
-import RxSwift
-import RealmSwift
-class Rx_RealmUtillit: NSObject {
-    //MARK: - 创建数据库
-    /// 创建数据库
-    ///
-    /// - Parameters:
-    ///   - dataBaseName: 数据库名字
-    ///   - isReadOnly: 是否是只读
-    /// - Returns: Realm消息
-    @discardableResult
-    class func creatDB(_ dataBaseName: String, isReadOnly: Bool = false) -> Observable<Realm?> {
-        return Observable.create({ (observable) -> Disposable in
-            let realm = RealmUtility.default.creatDB(dataBaseName, isReadOnly: isReadOnly)
-            observable.onNext(realm)
-            return Disposables.create ()
-        })
-    }
-    
-    
-    /// 设置默认数据库配置
-    ///
-    /// - Parameters:
-    ///   - realmName: 数据库名字
-    ///   - isReference: 是否是引用数据库
-    ///   - isReadOnly: 是否是只读
-    /// - Returns: 结果
-    @discardableResult
-    class func setDefaltRealmConfiguration(_ realmName: String,isReference: Bool = false, isReadOnly: Bool = false) -> Observable<Bool> {
-        return Observable.create({ (observable) -> Disposable in
-            let isSuccess = RealmUtility.default.setDefaltRealmConfiguration(realmName, isReference: isReference, isReadOnly: isReadOnly)
-            observable.onNext(isSuccess)
-            return Disposables.create()
-        })
-    }
-    
-    /// 打开预植的数据库
-    ///
-    /// - Parameters:
-    ///   - dataBaseName: 数据库名字
-    ///   - isReadOnly: 是否是只读
-    /// - Returns: Realm实例
-    @discardableResult
-    class func openReferenceDB(_ dataBaseName: String, isReadOnly: Bool = true) -> Observable<Realm?> {
-        return Observable.create({ (observable) -> Disposable in
-            let realm = RealmUtility.default.openReferenceDB(dataBaseName, isReadOnly: isReadOnly)
-            observable.onNext(realm)
-            return Disposables.create {
-                
-            }
-        })
-    }
-    
-    /// 获取当前默认的数据
-    ///
-    /// - Returns: 返回默认的Realm的数据库实例
-    @discardableResult
-    class func getDefaultRealm() -> Observable<Realm?>  {
-        return Observable.create({ (observable) -> Disposable in
-            let realm = RealmUtility.default.getDefaultRealm()
-            observable.onNext(realm)
-            return Disposables.create {
-                
-            }
-        })
-    }
-    
-    //MARK: - 增
-    /// 创建表 || 更新表
-    ///
-    /// - Parameters:
-    ///   - type: 表向对应的对象
-    ///   - value: 值
-    ///   - update: 是否是更新, 如果是"true", Realm会查找对象并更新它, 否则添加对象
-    /// - Returns: 创建的对象或者更新过后的对象
-    @discardableResult
-    class func creatObject(_ type: RealmSwift.Object.Type, value: Any? = nil, update: Bool = false) -> Observable<(RealmSwift.Object?, Error?)>{
-        return Observable.create { (observable) -> Disposable in
-            RealmUtility.default.creatObject(type, value: value, update: update, result: { (object, error) in
-                observable.onNext((object, error))
-            })
-            return Disposables.create {
-                
-            }
-        }
-    }
-    
-    /// 添加数据 || 根据主键更新数据
-    ///
-    /// - Parameters:
-    ///   - object: 要添加的数据
-    ///   - update: 是否更新, 如果是true
-    /// - Returns: 添加数据是否成功, error为空则成功, 不为空则失败
-    class func addObject(_ object: RealmSwift.Object, update: Bool = false) -> Observable<Error?> {
-        return Observable.create({ (observable) -> Disposable in
-            RealmUtility.default.addObject(object, update: update, result: { (error) in
-                observable.onNext(error)
-            })
-            return Disposables.create {
-                
-            }
-        })
-    }
-    
-    //MARK: - 删
-    /// 删除数据
-    ///
-    /// - Parameters:
-    ///   - object: 要删除的对象
-    /// - Returns: 删除数据是否成功, error为空则成功, 不为空则失败
-    class func deleteObject(_ object: RealmSwift.Object) -> Observable<Error?> {
-        return Observable.create({ (observable) -> Disposable in
-            RealmUtility.default.deleteObject(object, result: { (error) in
-                observable.onNext(error)
-            })
-            return Disposables.create {
-                
-            }
-        })
-    }
-    
-    /// 删除当前数据库中所有的数据
-    ///
-    /// - Returns: 添加数据库中的所有数据是否成功, error为空则成功, 不为空则失败
-    @discardableResult
-    class func deleteAllObject() -> Observable<Error?> {
-        return Observable.create({ (observable) -> Disposable in
-            RealmUtility.default.deleteAllObject(result: { (error) in
-                observable.onNext(error)
-            })
-            return Disposables.create {
-                
-            }
-        })
-    }
-    
-    /// 删除当前打开的数据库
-    ///
-    /// - Parameter dataBaseName: 数据库的名字
-    /// - Returns: 删除当前打开的数据是否成功
-    @discardableResult
-    class func deleteCreatDBFile() -> Observable<Bool> {
-        return Observable.create({ (observable) -> Disposable in
-            let isSuccess = RealmUtility.default.deleteCreatDBFile()
-            observable.onNext(isSuccess)
-            return Disposables.create()
-        })
-    }
-    
-    //MARK: - 改
-    /// 根据主键进行更新
-    ///
-    /// - Parameters:
-    ///   - object: 要更新的对象
-    ///   - update: 是否根据主键更新, 如果是"false"则是添加数据
-    /// - Returns: 根据主键进行更新是否成功, error为空则成功, 不为空则失败
-    @discardableResult
-    class func updateObject(_ object: RealmSwift.Object, update: Bool = true) -> Observable<Error?> {
-        
-        return Observable.create({ (observable) -> Disposable in
-            RealmUtility.default.updateObject(object, update: update, result: { (error) in
-                observable.onNext(error)
-            })
-            return Disposables.create()
-        })
-    }
-    
-    
-    /// 根据主键进行更新
-    ///
-    /// - Parameters:
-    ///   - type: 要更新的对象类型
-    ///   - value: 要更新的值, 例如: ["id": 1, "price": 9000.0]
-    ///   - update: 是否根据主键进行更新, 如果为"false"则为创建表
-    /// - Returns: 根据主键进行更新是否成功, error为空则成功, 不为空则失败
-    @discardableResult
-    class func updateObject(_ type: RealmSwift.Object.Type, value: Any? = nil, update: Bool = true) -> Observable<(RealmSwift.Object?, Error?)> {
-        return Observable.create({ (observable) -> Disposable in
-            RealmUtility.default.updateObject(type, value: value, update: update, result: { (object, error) in
-                observable.onNext((object, error))
-            })
-            return Disposables.create()
-        })
-    }
-    
-    
-    /// 直接更新对象
-    ///
-    /// - Parameters:
-    ///   - property: 要更改的属性
-    ///   - value: 更改的值
-    /// - Returns: 更改的结果
-//    @discardableResult
-//    public class func updateObject(_ property: inout Any, value: Any) -> Observable<Bool> {
-//        return Observable.create({ (observable) -> Disposable in
-//            let isSuccess = RealmUtility.default.updateObject(property: &property, value: value)
-//            observable.onNext(isSuccess)
-//            return Disposables.create()
-//        })
-//    }
-
-    
-    /// 更改表中所有的字段的值
-    ///
-    /// - Parameters:
-    ///   - type: 表的对象类型
-    ///   - key: 要更改的字段名
-    ///   - value: 更改的值
-    /// - Returns: 更改表中所有的字段的值是否成功
-    @discardableResult
-    class func updateObjects(type: RealmSwift.Object.Type, key: String, value: Any) -> Observable<Bool> {
-        return Observable.create({ (observable) -> Disposable in
-            let isSuccess = RealmUtility.default.updateObjects(type: type, key: key, value: value)
-            observable.onNext(isSuccess)
-            return Disposables.create()
-        })
-    }
-    
-    
-    /// 根据主键进行对某个对象中的数据进行更新
-    ///
-    /// - Parameters:
-    ///   - type: 表类型
-    ///   - primaryKey: 主键
-    ///   - key: 要更改属性
-    ///   - value: 更改的值
-    /// - Returns: 根据主键进行对某个对象中的数据进行更新是否成功
-    @discardableResult
-    class func updateObject(type: RealmSwift.Object.Type, primaryKey: Any, key: String, value: Any) -> Observable<Bool> {
-        return Observable.create({ (observable) -> Disposable in
-            let isSuccess = RealmUtility.default.updateObject(type: type, primaryKey: primaryKey, key: key, value: value)
-            observable.onNext(isSuccess)
-            return Disposables.create()
-        })
-    }
-    
-    //MARK: - 查
-    /// 查找一个表中的所有的数据
-    ///
-    /// - Parameter type: 对象类型
-    /// - Returns: 查到的数据
-    @discardableResult
-    class func getObjects(type: RealmSwift.Object.Type) -> Observable<RealmSwift.Results<RealmSwift.Object>?>{
-        return Observable.create({ (obsevable) -> Disposable in
-            let objects = RealmUtility.default.getObjects(type: type)
-            obsevable.onNext(objects)
-            return Disposables.create()
-        })
-    }
-    
-    /// 根据主键查找某个对象
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - primaryKey: 主键
-    /// - Returns: 查到的数据
-    @discardableResult
-    class func getObjectWithPrimaryKey(type: RealmSwift.Object.Type, primaryKey: Any) -> Observable<RealmSwift.Object?> {
-        return Observable.create({ (observable) -> Disposable in
-            let object = RealmUtility.default.getObjectWithPrimaryKey(type: type, primaryKey: primaryKey)
-            observable.onNext(object)
-            return Disposables.create()
-        })
-    }
-    
-    
-    /// 使用断言字符串查询
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - filter: 过滤条件
-    /// - Returns: 查询到的数据
-    /// - example:
-    ///   - var tanDogs = realm.objects(Dog.self).filter("color = 'tan' AND name BEGINSWITH 'B'")
-    @discardableResult
-    class func getObject(type: RealmSwift.Object.Type, filter: String) -> Observable<RealmSwift.Results<RealmSwift.Object>?> {
-        return Observable.create({ (observable) -> Disposable in
-            let objects = RealmUtility.default.getObject(type: type, filter: filter)
-            observable.onNext(objects)
-            return Disposables.create()
-        })
-    }
-    
-    
-    /// 使用谓词进行查询
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - predicate: 谓词对象
-    /// - Returns: 查询到的数据
-    /// - example:
-    ///   - let predicate = NSPredicate(format: "color = %@ AND name BEGINSWITH %@", "tan", "B")
-    ///   - tanDogs = realm.objects(Dog.self).filter(predicate)
-    @discardableResult
-    class func getObject(type: RealmSwift.Object.Type, predicate: NSPredicate) -> Observable<RealmSwift.Results<RealmSwift.Object>?> {
-        return Observable.create({ (observable) -> Disposable in
-            let object = RealmUtility.default.getObject(type: type, predicate: predicate)
-            observable.onNext(object)
-            return Disposables.create()
-        })
-    }
-    
-    
-    /// 对查询的数据进行排序
-    ///
-    /// - Parameters:
-    ///   - type: 对象类型
-    ///   - filter: 过滤条件
-    ///   - sortedKey: 需要排序的字段
-    /// - Returns: 最后的结果
-    /// - notice: 请注意, 不支持 将多个属性用作排序基准,此外也无法链式排序(只有最后一个 sorted 调用会被使用)。 如果要对多个属性进行排序,请使用 sorted(by:) 方法,然后向其中输入多个 SortDescriptor 对象。
-    @discardableResult
-    class func getObject(type: RealmSwift.Object.Type, filter: String, sortedKey: String) -> Observable<RealmSwift.Results<RealmSwift.Object>?> {
-        return Observable.create({ (observable) -> Disposable in
-            let object = RealmUtility.default.getObject(type: type, filter: filter, sortedKey: sortedKey)
-            observable.onNext(object)
-            return Disposables.create()
-        })
-    }
-    
-    /// 对查询的数据进行排序
-    ///
-    /// - Parameters:
-    ///   - type: 队形类型
-    ///   - predicate: 谓词对象
-    ///   - sortedKey: 排序的字段
-    /// - Returns: 排序后的数据
-    /// - notice: 请注意, 不支持 将多个属性用作排序基准,此外也无法链式排序(只有最后一个 sorted 调用会被使用)。 如果要对多个属性进行排序,请使用 sorted(by:) 方法,然后向其中输入多个 SortDescriptor 对象。
-    @discardableResult
-    class func getObject(type: RealmSwift.Object.Type, predicate: NSPredicate, sortedKey: String) -> Observable<RealmSwift.Results<RealmSwift.Object>?> {
-        return Observable.create({ (observable) -> Disposable in
-            let objects = RealmUtility.default.getObject(type: type, predicate: predicate, sortedKey: sortedKey)
-            observable.onNext(objects)
-            return Disposables.create()
-        })
-    }
-}
-
-
-
-
-
-