diff --git a/.gitignore b/.gitignore index 33a6a59..3e2205e 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,5 @@ Example/Pods # mac OS .DS_Store +/Example/Podfile.lock +/Example/RxRealmDataSources.xcworkspace/xcshareddata diff --git a/Example/RxRealmDataSources.xcodeproj/project.pbxproj b/Example/RxRealmDataSources.xcodeproj/project.pbxproj index b1fc325..d3778ab 100644 --- a/Example/RxRealmDataSources.xcodeproj/project.pbxproj +++ b/Example/RxRealmDataSources.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 145AC3CBCB09D8F547291B1D /* Pods_Demo_RxRealmDataSources_MacExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F784B7D7B4997170AC744C0 /* Pods_Demo_RxRealmDataSources_MacExample.framework */; }; 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; @@ -30,17 +29,21 @@ 9CA89C651DFDF1A4008ADCD2 /* CollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CA89C641DFDF1A4008ADCD2 /* CollectionViewController.swift */; }; 9CB0B5751DF9E9E800F947D0 /* Lap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CB0B5741DF9E9E800F947D0 /* Lap.swift */; }; 9CB0B5771DF9EA0F00F947D0 /* Timer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CB0B5761DF9EA0F00F947D0 /* Timer.swift */; }; - A0F623D0059D4D5BF38B60D9 /* Pods_Demo_RxRealmDataSources_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CAA1529C0E19B1E708B0776 /* Pods_Demo_RxRealmDataSources_Example.framework */; }; + C2AA37282514491D85F03F8C /* Pods_Demo_RxRealmDataSources_MacExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E989E69EE47D8259CD1C1FC /* Pods_Demo_RxRealmDataSources_MacExample.framework */; }; + C35122078F202541CCA2A4CF /* Pods_Demo_RxRealmDataSources_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C0165E100730CC230A7ED68 /* Pods_Demo_RxRealmDataSources_Example.framework */; }; + E6063F6F208E2094004423D7 /* OutlineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6063F6E208E2094004423D7 /* OutlineViewController.swift */; }; + E6063F72208E256F004423D7 /* TreeItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6063F70208E256F004423D7 /* TreeItem.swift */; }; + E6063F7B208F31BB004423D7 /* DataRandomizerTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6063F7A208F31BB004423D7 /* DataRandomizerTree.swift */; }; + E6063F7C208F31BB004423D7 /* DataRandomizerTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6063F7A208F31BB004423D7 /* DataRandomizerTree.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0369C60B6B5004A423A164C9 /* Pods-Demo-RxRealmDataSources_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example.debug.xcconfig"; sourceTree = ""; }; + 0F18398C20503792E18B6EC5 /* Pods-Demo-RxRealmDataSources_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example.release.xcconfig"; sourceTree = ""; }; 2234A7252CB12801B9D5CC59 /* RxRealmDataSources.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = RxRealmDataSources.podspec; path = ../RxRealmDataSources.podspec; sourceTree = ""; }; - 2BFC2E5B87B46AEC0715AB69 /* Pods-RxRealmDataSources_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxRealmDataSources_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RxRealmDataSources_Tests/Pods-RxRealmDataSources_Tests.debug.xcconfig"; sourceTree = ""; }; 389E1B2B7B345E4DD32A154F /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 3CAA1529C0E19B1E708B0776 /* Pods_Demo_RxRealmDataSources_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Demo_RxRealmDataSources_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3FC4E7E2D70508F61AC94626 /* Pods-RxRealmDataSources_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxRealmDataSources_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RxRealmDataSources_Tests/Pods-RxRealmDataSources_Tests.release.xcconfig"; sourceTree = ""; }; - 433CFEEAC500E1915E943474 /* Pods-Demo-RxRealmDataSources_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example.debug.xcconfig"; sourceTree = ""; }; - 4F784B7D7B4997170AC744C0 /* Pods_Demo_RxRealmDataSources_MacExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Demo_RxRealmDataSources_MacExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 40C04A3DB3B2604895AEB697 /* Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig"; sourceTree = ""; }; + 4E989E69EE47D8259CD1C1FC /* Pods_Demo_RxRealmDataSources_MacExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Demo_RxRealmDataSources_MacExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD01AFB9204008FA782 /* RxRealmDataSources_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RxRealmDataSources_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -48,10 +51,7 @@ 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 608B2F81EBE23EAF84A87062 /* Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig"; sourceTree = ""; }; - 678ED4D6B7FB3D0B89984A16 /* Pods_Demo_RxRealmDataSources_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Demo_RxRealmDataSources_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6EBE80B271B15C2CEC56038E /* Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig"; sourceTree = ""; }; - 6F8E8F0B4B2A0D71CF549B85 /* Pods-RxRealmDataSources_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxRealmDataSources_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RxRealmDataSources_Example/Pods-RxRealmDataSources_Example.debug.xcconfig"; sourceTree = ""; }; + 8C0165E100730CC230A7ED68 /* Pods_Demo_RxRealmDataSources_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Demo_RxRealmDataSources_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9C530D071DFDD7340096144C /* DataRandomizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DataRandomizer.swift; path = RxRealmDataSources/DataRandomizer.swift; sourceTree = ""; }; 9C5B02CF1E1678C80009FBDE /* RxRealmDataSources_MacExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RxRealmDataSources_MacExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9C5B02D11E1678C80009FBDE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -68,8 +68,10 @@ 9CA89C641DFDF1A4008ADCD2 /* CollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewController.swift; sourceTree = ""; }; 9CB0B5741DF9E9E800F947D0 /* Lap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Lap.swift; sourceTree = ""; }; 9CB0B5761DF9EA0F00F947D0 /* Timer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Timer.swift; sourceTree = ""; }; - BC02907133053010FAE53FD9 /* Pods-RxRealmDataSources_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxRealmDataSources_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-RxRealmDataSources_Example/Pods-RxRealmDataSources_Example.release.xcconfig"; sourceTree = ""; }; - E709FF280BD1C0E98E09724E /* Pods-Demo-RxRealmDataSources_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example.release.xcconfig"; sourceTree = ""; }; + A049FE6F97A21C6D931D3A1C /* Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig"; sourceTree = ""; }; + E6063F6E208E2094004423D7 /* OutlineViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutlineViewController.swift; sourceTree = ""; }; + E6063F70208E256F004423D7 /* TreeItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeItem.swift; sourceTree = ""; }; + E6063F7A208F31BB004423D7 /* DataRandomizerTree.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = DataRandomizerTree.swift; path = RxRealmDataSources/DataRandomizerTree.swift; sourceTree = ""; }; F047F94251BA9258A7A94AEE /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; /* End PBXFileReference section */ @@ -78,7 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A0F623D0059D4D5BF38B60D9 /* Pods_Demo_RxRealmDataSources_Example.framework in Frameworks */, + C35122078F202541CCA2A4CF /* Pods_Demo_RxRealmDataSources_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -86,23 +88,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 145AC3CBCB09D8F547291B1D /* Pods_Demo_RxRealmDataSources_MacExample.framework in Frameworks */, + C2AA37282514491D85F03F8C /* Pods_Demo_RxRealmDataSources_MacExample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 58AC3B8249FCD1A734C4B7BC /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3CAA1529C0E19B1E708B0776 /* Pods_Demo_RxRealmDataSources_Example.framework */, - 4F784B7D7B4997170AC744C0 /* Pods_Demo_RxRealmDataSources_MacExample.framework */, - 678ED4D6B7FB3D0B89984A16 /* Pods_Demo_RxRealmDataSources_Tests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 607FACC71AFB9204008FA782 = { isa = PBXGroup; children = ( @@ -111,8 +103,8 @@ 607FACD21AFB9204008FA782 /* iOS Example */, 9C5B02D01E1678C80009FBDE /* macOS Example */, 607FACD11AFB9204008FA782 /* Products */, - F29E453A66420BEFA081E479 /* Pods */, - 58AC3B8249FCD1A734C4B7BC /* Frameworks */, + 82E5B77B6199518C6E426A62 /* Pods */, + EF4570CBA3EF15A5AAB7F948 /* Frameworks */, ); sourceTree = ""; }; @@ -154,6 +146,17 @@ name = "Podspec Metadata"; sourceTree = ""; }; + 82E5B77B6199518C6E426A62 /* Pods */ = { + isa = PBXGroup; + children = ( + 0369C60B6B5004A423A164C9 /* Pods-Demo-RxRealmDataSources_Example.debug.xcconfig */, + 0F18398C20503792E18B6EC5 /* Pods-Demo-RxRealmDataSources_Example.release.xcconfig */, + A049FE6F97A21C6D931D3A1C /* Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig */, + 40C04A3DB3B2604895AEB697 /* Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 9C530D091DFDDDEC0096144C /* Assets */ = { isa = PBXGroup; children = ( @@ -169,6 +172,7 @@ isa = PBXGroup; children = ( 9C530D071DFDD7340096144C /* DataRandomizer.swift */, + E6063F7A208F31BB004423D7 /* DataRandomizerTree.swift */, 9CA89C601DFDF0E4008ADCD2 /* Data Entities */, ); name = "Cross Platform Classes"; @@ -210,6 +214,7 @@ 9C5B02E11E167A3D0009FBDE /* MenuViewController.swift */, 9C5B02E01E16791C0009FBDE /* 1. Table View Data Source */, 9C5B02EB1E16C4D40009FBDE /* 2. Collection View Data Source */, + E6063F6D208E2060004423D7 /* 3. Outline view Data Source */, ); name = "View Controllers"; sourceTree = ""; @@ -246,6 +251,7 @@ children = ( 9CB0B5741DF9E9E800F947D0 /* Lap.swift */, 9CB0B5761DF9EA0F00F947D0 /* Timer.swift */, + E6063F70208E256F004423D7 /* TreeItem.swift */, ); name = "Data Entities"; path = RxRealmDataSources; @@ -260,19 +266,21 @@ name = "2. Collection View Data Source"; sourceTree = ""; }; - F29E453A66420BEFA081E479 /* Pods */ = { + E6063F6D208E2060004423D7 /* 3. Outline view Data Source */ = { isa = PBXGroup; children = ( - 6F8E8F0B4B2A0D71CF549B85 /* Pods-RxRealmDataSources_Example.debug.xcconfig */, - BC02907133053010FAE53FD9 /* Pods-RxRealmDataSources_Example.release.xcconfig */, - 2BFC2E5B87B46AEC0715AB69 /* Pods-RxRealmDataSources_Tests.debug.xcconfig */, - 3FC4E7E2D70508F61AC94626 /* Pods-RxRealmDataSources_Tests.release.xcconfig */, - 433CFEEAC500E1915E943474 /* Pods-Demo-RxRealmDataSources_Example.debug.xcconfig */, - E709FF280BD1C0E98E09724E /* Pods-Demo-RxRealmDataSources_Example.release.xcconfig */, - 608B2F81EBE23EAF84A87062 /* Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig */, - 6EBE80B271B15C2CEC56038E /* Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig */, + E6063F6E208E2094004423D7 /* OutlineViewController.swift */, ); - name = Pods; + name = "3. Outline view Data Source"; + sourceTree = ""; + }; + EF4570CBA3EF15A5AAB7F948 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8C0165E100730CC230A7ED68 /* Pods_Demo_RxRealmDataSources_Example.framework */, + 4E989E69EE47D8259CD1C1FC /* Pods_Demo_RxRealmDataSources_MacExample.framework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ @@ -282,12 +290,11 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "RxRealmDataSources_Example" */; buildPhases = ( - 19F49B5A97B1CF11435191CB /* [CP] Check Pods Manifest.lock */, + 52A16AEA2F8FE7F6F8AB4685 /* [CP] Check Pods Manifest.lock */, 607FACCC1AFB9204008FA782 /* Sources */, 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, - E14D2B725468BD930A30E223 /* [CP] Embed Pods Frameworks */, - 0B94A67A8A2F4532561A0C17 /* [CP] Copy Pods Resources */, + 45AD4BAB0011E997C5F3A03C /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -302,12 +309,11 @@ isa = PBXNativeTarget; buildConfigurationList = 9C5B02DB1E1678C80009FBDE /* Build configuration list for PBXNativeTarget "RxRealmDataSources_MacExample" */; buildPhases = ( - 1E9ABA061FA7F580EBAF12EA /* [CP] Check Pods Manifest.lock */, + 3B26E4403B1F7167F977F871 /* [CP] Check Pods Manifest.lock */, 9C5B02CB1E1678C80009FBDE /* Sources */, 9C5B02CC1E1678C80009FBDE /* Frameworks */, 9C5B02CD1E1678C80009FBDE /* Resources */, - 3954C9255BC6A9A3899B15EF /* [CP] Embed Pods Frameworks */, - 580B5F323BBAD77271FF4249 /* [CP] Copy Pods Resources */, + 9D0F92AD170E274992609D31 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -383,40 +389,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0B94A67A8A2F4532561A0C17 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 19F49B5A97B1CF11435191CB /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Demo-RxRealmDataSources_Example-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 1E9ABA061FA7F580EBAF12EA /* [CP] Check Pods Manifest.lock */ = { + 3B26E4403B1F7167F977F871 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -434,19 +407,19 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 3954C9255BC6A9A3899B15EF /* [CP] Embed Pods Frameworks */ = { + 45AD4BAB0011E997C5F3A03C /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Realm-macOS/Realm.framework", - "${BUILT_PRODUCTS_DIR}/RealmSwift-macOS/RealmSwift.framework", - "${BUILT_PRODUCTS_DIR}/RxCocoa-macOS/RxCocoa.framework", - "${BUILT_PRODUCTS_DIR}/RxRealm-macOS/RxRealm.framework", - "${BUILT_PRODUCTS_DIR}/RxRealmDataSources-macOS/RxRealmDataSources.framework", - "${BUILT_PRODUCTS_DIR}/RxSwift-macOS/RxSwift.framework", + "${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Realm-iOS/Realm.framework", + "${BUILT_PRODUCTS_DIR}/RealmSwift-iOS/RealmSwift.framework", + "${BUILT_PRODUCTS_DIR}/RxCocoa-iOS/RxCocoa.framework", + "${BUILT_PRODUCTS_DIR}/RxRealm-iOS/RxRealm.framework", + "${BUILT_PRODUCTS_DIR}/RxRealmDataSources-iOS/RxRealmDataSources.framework", + "${BUILT_PRODUCTS_DIR}/RxSwift-iOS/RxSwift.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -459,37 +432,40 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 580B5F323BBAD77271FF4249 /* [CP] Copy Pods Resources */ = { + 52A16AEA2F8FE7F6F8AB4685 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Demo-RxRealmDataSources_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - E14D2B725468BD930A30E223 /* [CP] Embed Pods Frameworks */ = { + 9D0F92AD170E274992609D31 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Realm-iOS/Realm.framework", - "${BUILT_PRODUCTS_DIR}/RealmSwift-iOS/RealmSwift.framework", - "${BUILT_PRODUCTS_DIR}/RxCocoa-iOS/RxCocoa.framework", - "${BUILT_PRODUCTS_DIR}/RxRealm-iOS/RxRealm.framework", - "${BUILT_PRODUCTS_DIR}/RxRealmDataSources-iOS/RxRealmDataSources.framework", - "${BUILT_PRODUCTS_DIR}/RxSwift-iOS/RxSwift.framework", + "${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Realm-macOS/Realm.framework", + "${BUILT_PRODUCTS_DIR}/RealmSwift-macOS/RealmSwift.framework", + "${BUILT_PRODUCTS_DIR}/RxCocoa-macOS/RxCocoa.framework", + "${BUILT_PRODUCTS_DIR}/RxRealm-macOS/RxRealm.framework", + "${BUILT_PRODUCTS_DIR}/RxRealmDataSources-macOS/RxRealmDataSources.framework", + "${BUILT_PRODUCTS_DIR}/RxSwift-macOS/RxSwift.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -502,7 +478,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_Example/Pods-Demo-RxRealmDataSources_Example-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Demo-RxRealmDataSources_MacExample/Pods-Demo-RxRealmDataSources_MacExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -517,6 +493,7 @@ 9CA37C471DF853E500C1DF6C /* PersonCell.swift in Sources */, 9CB0B5751DF9E9E800F947D0 /* Lap.swift in Sources */, 9CA89C651DFDF1A4008ADCD2 /* CollectionViewController.swift in Sources */, + E6063F7B208F31BB004423D7 /* DataRandomizerTree.swift in Sources */, 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 9CB0B5771DF9EA0F00F947D0 /* Timer.swift in Sources */, 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, @@ -528,12 +505,15 @@ buildActionMask = 2147483647; files = ( 9C5B02E81E16AB080009FBDE /* DataRandomizer.swift in Sources */, + E6063F7C208F31BB004423D7 /* DataRandomizerTree.swift in Sources */, + E6063F6F208E2094004423D7 /* OutlineViewController.swift in Sources */, 9C5B02EA1E16AB0C0009FBDE /* Timer.swift in Sources */, 9C5B02F21E16C8270009FBDE /* CollectionItem.swift in Sources */, 9C5B02ED1E16C50F0009FBDE /* CollectionViewController.swift in Sources */, 9C5B02E21E167A3D0009FBDE /* MenuViewController.swift in Sources */, 9C5B02E91E16AB0C0009FBDE /* Lap.swift in Sources */, 9C5B02D21E1678C80009FBDE /* AppDelegate.swift in Sources */, + E6063F72208E256F004423D7 /* TreeItem.swift in Sources */, 9C5B02E61E16AABA0009FBDE /* TableViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -669,7 +649,7 @@ }; 607FACF01AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 433CFEEAC500E1915E943474 /* Pods-Demo-RxRealmDataSources_Example.debug.xcconfig */; + baseConfigurationReference = 0369C60B6B5004A423A164C9 /* Pods-Demo-RxRealmDataSources_Example.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -687,7 +667,7 @@ }; 607FACF11AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E709FF280BD1C0E98E09724E /* Pods-Demo-RxRealmDataSources_Example.release.xcconfig */; + baseConfigurationReference = 0F18398C20503792E18B6EC5 /* Pods-Demo-RxRealmDataSources_Example.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -705,7 +685,7 @@ }; 9C5B02DC1E1678C80009FBDE /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 608B2F81EBE23EAF84A87062 /* Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig */; + baseConfigurationReference = A049FE6F97A21C6D931D3A1C /* Pods-Demo-RxRealmDataSources_MacExample.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -730,7 +710,7 @@ }; 9C5B02DD1E1678C80009FBDE /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6EBE80B271B15C2CEC56038E /* Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig */; + baseConfigurationReference = 40C04A3DB3B2604895AEB697 /* Pods-Demo-RxRealmDataSources_MacExample.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; diff --git a/Example/RxRealmDataSources.xcodeproj/xcshareddata/xcschemes/RxRealmDataSources_MacExample.xcscheme b/Example/RxRealmDataSources.xcodeproj/xcshareddata/xcschemes/RxRealmDataSources_MacExample.xcscheme new file mode 100644 index 0000000..c848f66 --- /dev/null +++ b/Example/RxRealmDataSources.xcodeproj/xcshareddata/xcschemes/RxRealmDataSources_MacExample.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/RxRealmDataSources/DataRandomizerTree.swift b/Example/RxRealmDataSources/DataRandomizerTree.swift new file mode 100644 index 0000000..1f468ab --- /dev/null +++ b/Example/RxRealmDataSources/DataRandomizerTree.swift @@ -0,0 +1,107 @@ +// +// DataRandomizerTree.swift +// RxRealmDataSources +// +// Created by Sergiy Vynnychenko on 4/24/18. +// Copyright © 2018 CocoaPods. All rights reserved. +// + +import Foundation +import RealmSwift +import RxSwift + +class DataRandomizerTree { + + private let bag = DisposeBag() + private let rootItem = TreeItem() + + lazy var config: Realm.Configuration = { + var config = Realm.Configuration.defaultConfiguration + config.inMemoryIdentifier = UUID().uuidString + return config + }() + + private lazy var realm: Realm = { + let realm: Realm + do { + realm = try Realm(configuration: self.config) + return realm + } + catch let e { + print(e) + fatalError() + } + }() + + init() { + try! realm.write { + rootItem.title = "1" + rootItem.time = 40 + realm.add(rootItem) + } + } + + private func insertChild() { + let items = realm.objects(TreeItem.self) + let index = items.count.random() + let parent = items[index] + let newItem = TreeItem() + + + try! realm.write { + newItem.title = "\(parent.title)+1" + newItem.time = parent.time * 3.14 + newItem.parent = parent + + realm.add(newItem) + print("tree item: added child for \(parent.title)]") + } + } + + private func updateItem() { + let items = realm.objects(TreeItem.self) + let index = items.count.random() + let item = items[index] + + try! realm.write { + print("tree item: going to update \(item.title)") + item.title += "+" + } + } + + private func deleteItem() { + let items = realm.objects(TreeItem.self).filter("children.@count = 0") + if items.count > 0 { + let item = items[items.count.random()] + + let parentTitle = item.parent?.title ?? "root item" + print("tree item: going to delete \(item.title) of parent \(parentTitle)") + + try! realm.write { + realm.delete(item) + } + } + } + + func start() { + // insert some laps + Observable.interval(1.0, scheduler: MainScheduler.instance) + .subscribe(onNext: {[weak self] _ in + self?.insertChild() + }) + .disposed(by: bag) + + Observable.interval(1.0, scheduler: MainScheduler.instance) + .subscribe(onNext: {[weak self] _ in + self?.updateItem() + }) + .disposed(by: bag) + + Observable.interval(2.0, scheduler: MainScheduler.instance) + .subscribe(onNext: {[weak self] _ in + self?.deleteItem() + }) + .disposed(by: bag) + } +} + diff --git a/Example/RxRealmDataSources/TreeItem.swift b/Example/RxRealmDataSources/TreeItem.swift new file mode 100644 index 0000000..b0081c4 --- /dev/null +++ b/Example/RxRealmDataSources/TreeItem.swift @@ -0,0 +1,44 @@ +// +// TreeItem.swift +// RxRealmDataSources +// +// Created by Sergiy Vynnychenko on 4/23/18. +// Copyright © 2018 CocoaPods. All rights reserved. +// + +import Foundation +import RealmSwift +import RxRealmDataSources + +@objcMembers class TreeItem: Object, RxOutlineViewRealmDataItem { + + override static func primaryKey() -> String? { return "key" } + + dynamic var key : String = UUID().uuidString + dynamic var title : String = "" + dynamic var time : Double = 0 + dynamic var children = LinkingObjects(fromType: TreeItem.self, property: "parent") + dynamic var parent : TreeItem? { didSet { _indexInParent = (parent == nil) ? -1 : parent!.childrenCount } } + dynamic var _indexInParent : Int = -1 + + // RxOutlineViewRealmDataItem implementation + var isExpandable : Bool { return childrenCount > 0 } + var childrenCount : Int { return children.count } + var indexInParent : Int { return _indexInParent} + + func childAt(idx: Int) -> RxOutlineViewRealmDataItem? { + guard idx >= 0 else { return nil } + guard idx < children.count else { return nil } + + return children[idx] + } + + func getParent() -> RxOutlineViewRealmDataItem? { + return parent + } + + func getChildren() -> [RxOutlineViewRealmDataItem] { + return children.toArray() + } +} + diff --git a/Example/RxRealmDataSources_MacExample/Base.lproj/Main.storyboard b/Example/RxRealmDataSources_MacExample/Base.lproj/Main.storyboard index 4915a22..dd66fee 100644 --- a/Example/RxRealmDataSources_MacExample/Base.lproj/Main.storyboard +++ b/Example/RxRealmDataSources_MacExample/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -669,6 +669,9 @@ + + + @@ -689,8 +692,12 @@ + + + + @@ -720,7 +727,7 @@ - + @@ -808,7 +815,7 @@ - + @@ -887,7 +894,7 @@ - + @@ -921,5 +928,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/RxRealmDataSources_MacExample/MenuViewController.swift b/Example/RxRealmDataSources_MacExample/MenuViewController.swift index cd572e4..1824a59 100644 --- a/Example/RxRealmDataSources_MacExample/MenuViewController.swift +++ b/Example/RxRealmDataSources_MacExample/MenuViewController.swift @@ -11,8 +11,8 @@ import Cocoa class MenuViewController: NSViewController { @IBOutlet var tableView: NSTableView! - let menuItems = ["Table Demo", "Collection Demo"] - let targetNames = ["TableViewController", "CollectionViewController"] + let menuItems = ["Table Demo", "Collection Demo", "Tree Demo"] + let targetNames = ["TableViewController", "CollectionViewController", "OutlineViewController"] override func viewWillAppear() { super.viewWillAppear() @@ -22,7 +22,7 @@ class MenuViewController: NSViewController { extension MenuViewController: NSTableViewDataSource { func numberOfRows(in tableView: NSTableView) -> Int { - return 2 + return 3 } func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat { diff --git a/Example/RxRealmDataSources_MacExample/OutlineViewController.swift b/Example/RxRealmDataSources_MacExample/OutlineViewController.swift new file mode 100644 index 0000000..cd136db --- /dev/null +++ b/Example/RxRealmDataSources_MacExample/OutlineViewController.swift @@ -0,0 +1,59 @@ +// +// OutlineViewController.swift +// RxRealmDataSources_MacExample +// +// Created by Loki on 4/23/18. +// Copyright © 2018 CocoaPods. All rights reserved. +// + +import Cocoa +import RealmSwift + +import RxSwift +import RxCocoa +import RxRealm +import RxRealmDataSources + +class OutlineViewController: NSViewController { + + @IBOutlet weak var outlineView: NSOutlineView! + + private let bag = DisposeBag() + private let data = DataRandomizerTree() + + override func viewDidLoad() { + super.viewDidLoad() + + let dataSource = RxOutlineViewRealmDataSource(cellIdentifier: "Title", cellType: NSTableCellView.self) { + cell, columnId, treeItem in + + guard let columnId = columnId else { return } + + switch columnId { + case "Title": + cell.textField!.stringValue = treeItem.title + case "Time": + cell.textField!.stringValue = "\(treeItem.time)" + default: + break + } + } + dataSource.delegate = self + + let realm = try! Realm(configuration: data.config) + let items = Observable.changeset(from: realm.objects(TreeItem.self)) + .share() + + items + .bind(to: outlineView.rx.realmChanges(dataSource)) + .disposed(by: bag) + + data.start() + } +} + +extension OutlineViewController: NSOutlineViewDelegate { + func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat { + return 20.0 + } +} diff --git a/Example/RxRealmDataSources_MacExample/TableViewController.swift b/Example/RxRealmDataSources_MacExample/TableViewController.swift index bf93a69..424ce68 100644 --- a/Example/RxRealmDataSources_MacExample/TableViewController.swift +++ b/Example/RxRealmDataSources_MacExample/TableViewController.swift @@ -25,7 +25,7 @@ class TableViewController: NSViewController { super.viewDidLoad() // create data source - let dataSource = RxTableViewRealmDataSource(cellIdentifier: "Cell", cellType: NSTableCellView.self) {cell, row, lap in + let dataSource = RxTableViewRealmDataSource(cellIdentifier: "Cell", cellType: NSTableCellView.self) {cell, row, columnId, lap in cell.textField!.stringValue = "\(lap.text)" } dataSource.delegate = self diff --git a/README.md b/README.md index 69fb1ea..fa0061e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# RxRealmDataSources +# RxRealmDataSources (fork) [![Version](https://img.shields.io/cocoapods/v/RxRealmDataSources.svg?style=flat)](http://cocoapods.org/pods/RxRealmDataSources) [![License](https://img.shields.io/cocoapods/l/RxRealmDataSources.svg?style=flat)](http://cocoapods.org/pods/RxRealmDataSources) @@ -55,6 +55,38 @@ laps .bindTo(collectionView.rx.realmChanges(dataSource)) .disposed(by: bag) ``` +### Binding to NSOutlineView + +Check out the included demo app to see this in action. + +```swift +// create data source +let dataSource = RxOutlineViewRealmDataSource(cellIdentifier: "Title", cellType: NSTableCellView.self) { + cell, columnId, treeItem in + + guard let columnId = columnId else { return } + + switch columnId { + case "Title": + cell.textField!.stringValue = treeItem.title + case "Time": + cell.textField!.stringValue = "\(treeItem.time)" + default: + break + } +} +dataSource.delegate = self + +// RxRealm to get Observable +let realm = try! Realm(configuration: data.config) +let items = Observable.changeset(from: realm.objects(TreeItem.self)) + .share() + +// bind to table view +items + .bind(to: outlineView.rx.realmChanges(dataSource)) + .disposed(by: bag) +``` ### Reacting to cell taps @@ -75,13 +107,9 @@ This library depends on __RxSwift__, __RealmSwift__, and __RxRealm__. RxRealm is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby -pod "RxRealmDataSources" +pod "RxRealmDataSources", :git => 'https://github.com/serg-vinnie/RxRealmDataSources.git' ``` -## TODO - -* Test add platforms and add compatibility for the pod - ## License This library belongs to _RxSwiftCommunity_. It has been created by Marin Todorov. diff --git a/RxRealmDataSources.podspec b/RxRealmDataSources.podspec index 02826af..fefcb1b 100644 --- a/RxRealmDataSources.podspec +++ b/RxRealmDataSources.podspec @@ -23,8 +23,8 @@ Pod::Spec.new do |s| s.frameworks = 'Foundation' - s.dependency 'RealmSwift', '~> 3.0' + s.dependency 'RealmSwift', '~> 3.7.3' s.dependency 'RxSwift', '~> 4.0' s.dependency 'RxCocoa', '~> 4.0' - s.dependency 'RxRealm', '~> 0.7.3' + s.dependency 'RxRealm', '~> 0.7.5' end diff --git a/RxRealmDataSources.xcodeproj b/RxRealmDataSources.xcodeproj new file mode 100644 index 0000000..cb841f6 Binary files /dev/null and b/RxRealmDataSources.xcodeproj differ diff --git a/Pod/Classes/Reactive+RxRealmDataSources.swift b/RxRealmDataSources/Classes/Reactive+RxRealmDataSources.swift similarity index 85% rename from Pod/Classes/Reactive+RxRealmDataSources.swift rename to RxRealmDataSources/Classes/Reactive+RxRealmDataSources.swift index c51ca48..49ab90d 100644 --- a/Pod/Classes/Reactive+RxRealmDataSources.swift +++ b/RxRealmDataSources/Classes/Reactive+RxRealmDataSources.swift @@ -95,6 +95,22 @@ extension Reactive where Base: NSTableView { } } +extension Reactive where Base: NSOutlineView { + public func realmChanges(_ dataSource: RxOutlineViewRealmDataSource) + -> RealmBindObserver, RxOutlineViewRealmDataSource> { + + base.delegate = dataSource + base.dataSource = dataSource + + return RealmBindObserver(dataSource: dataSource) {ds, results, changes in + if dataSource.outlineView == nil { + dataSource.outlineView = self.base + } + ds.applyChanges(items: AnyRealmCollection(results), changes: changes) + } + } +} + extension Reactive where Base: NSCollectionView { public func realmChanges(_ dataSource: RxCollectionViewRealmDataSource) diff --git a/Pod/Classes/RealmBindObserver.swift b/RxRealmDataSources/Classes/RealmBindObserver.swift similarity index 100% rename from Pod/Classes/RealmBindObserver.swift rename to RxRealmDataSources/Classes/RealmBindObserver.swift diff --git a/Pod/Classes/RxCollectionViewRealmDataSource.swift b/RxRealmDataSources/Classes/RxCollectionViewRealmDataSource.swift similarity index 100% rename from Pod/Classes/RxCollectionViewRealmDataSource.swift rename to RxRealmDataSources/Classes/RxCollectionViewRealmDataSource.swift diff --git a/RxRealmDataSources/Classes/RxOutlineViewRealmDataItem.swift b/RxRealmDataSources/Classes/RxOutlineViewRealmDataItem.swift new file mode 100644 index 0000000..0c3b2a7 --- /dev/null +++ b/RxRealmDataSources/Classes/RxOutlineViewRealmDataItem.swift @@ -0,0 +1,17 @@ +// +// RxOutlineViewRealmDataItem.swift +// Pods +// +// Created by Loki on 4/23/18. +// + +public protocol RxOutlineViewRealmDataItem { + var key : String { get } + var childrenCount : Int { get } + var isExpandable : Bool { get } + var indexInParent : Int { get } + + func childAt(idx: Int) -> RxOutlineViewRealmDataItem? + func getParent() -> RxOutlineViewRealmDataItem? + func getChildren() -> [RxOutlineViewRealmDataItem] +} diff --git a/RxRealmDataSources/Classes/RxOutlineViewRealmDataSource.swift b/RxRealmDataSources/Classes/RxOutlineViewRealmDataSource.swift new file mode 100644 index 0000000..b31c75b --- /dev/null +++ b/RxRealmDataSources/Classes/RxOutlineViewRealmDataSource.swift @@ -0,0 +1,135 @@ +// +// RxOutlineViewRealmDataSource.swift +// Pods-Demo-RxRealmDataSources_MacExample +// +// Created by Loki on 4/23/18. +// + +import Foundation +import RealmSwift +import RxSwift +import RxCocoa +import RxRealm + +#if os(OSX) +import Cocoa + +public typealias OutlineCellFactory = (NSOutlineView, String?, E) -> NSTableCellView +public typealias OutlineCellConfig = (CellType, String?, E) -> Void + +open class RxOutlineViewRealmDataSource: NSObject, NSOutlineViewDataSource, NSOutlineViewDelegate { + + private var items: AnyRealmCollection? + + // MARK: - Configuration + + public var outlineView: NSOutlineView? + public var animated = true + public var rowAnimations = ( + insert: NSTableView.AnimationOptions.effectFade, + update: NSTableView.AnimationOptions.effectFade, + delete: NSTableView.AnimationOptions.effectFade) + + public weak var delegate: NSOutlineViewDelegate? + public weak var dataSource: NSOutlineViewDataSource? + + // MARK: - Init + public let cellIdentifier: String + public let cellFactory: OutlineCellFactory + + public init(cellIdentifier: String, cellFactory: @escaping OutlineCellFactory) { + self.cellIdentifier = cellIdentifier + self.cellFactory = cellFactory + } + + public init(cellIdentifier: String, cellType: CellType.Type, cellConfig: @escaping OutlineCellConfig) where CellType: NSTableCellView { + self.cellIdentifier = cellIdentifier + self.cellFactory = { ov, columnId, model in + let cell = ov.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: cellIdentifier), owner: ov) as! CellType + cellConfig(cell, columnId, model) + return cell + } + } + + private func objectBy(key: Any) -> RxOutlineViewRealmDataItem? { + guard let items = items else { return nil } + guard let key = key as? String else { return nil } + guard let index = items.index(matching: "key = %s", key) else { return nil } + + return items[index] as? RxOutlineViewRealmDataItem + } + + + // MARK: - NSOutlineViewDataSource protocol + public func outlineView(_ outlineView: NSOutlineView, viewFor tableColumn: NSTableColumn?, item: Any) -> NSView? { + guard let object = objectBy(key: item) as? E else { return nil } + let columnId = tableColumn?.identifier.rawValue + return cellFactory(outlineView, columnId, object) + } + + public func outlineView(_ outlineView: NSOutlineView, numberOfChildrenOfItem item: Any?) -> Int { + guard let item = item else { + if let rootItems = items?.filter("parent = null", 0) { + return rootItems.count + } + return 0 + } + + guard let object = objectBy(key: item) else { return 0 } + return object.childrenCount + } + + public func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any { + guard let item = item else { + guard let items = items else { return false } + if let rootItems = Array(items.filter("parent = null", 0)) as? [RxOutlineViewRealmDataItem] { + return rootItems[index].key + } + return false + } + + guard let object = objectBy(key: item) else { return false } + guard let child = object.childAt(idx: index) else { return false} + + return child.key + } + + public func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool { + guard let object = objectBy(key: item) else { return false } + return object.isExpandable + } + + // MARK: - Proxy unimplemented data source and delegate methods + open override func responds(to aSelector: Selector!) -> Bool { + if RxOutlineViewRealmDataSource.instancesRespond(to: aSelector) { + return true + } else if let delegate = delegate { + return delegate.responds(to: aSelector) + } else if let dataSource = dataSource { + return dataSource.responds(to: aSelector) + } else { + return false + } + } + + open override func forwardingTarget(for aSelector: Selector!) -> Any? { + return delegate ?? dataSource + } + + // MARK: - Applying changeset to the table view + private let fromRow = {(row: Int) in return IndexPath(item: row, section: 0)} + + func applyChanges(items: AnyRealmCollection, changes: RealmChangeset?) { + if self.items == nil { + self.items = items + } + + guard let outlineView = outlineView else { + fatalError("You have to bind a outline view to the data source.") + } + + outlineView.reloadData() + } +} + +#endif diff --git a/Pod/Classes/RxTableViewRealmDataSource.swift b/RxRealmDataSources/Classes/RxTableViewRealmDataSource.swift similarity index 94% rename from Pod/Classes/RxTableViewRealmDataSource.swift rename to RxRealmDataSources/Classes/RxTableViewRealmDataSource.swift index d2da35c..064f757 100644 --- a/Pod/Classes/RxTableViewRealmDataSource.swift +++ b/RxRealmDataSources/Classes/RxTableViewRealmDataSource.swift @@ -121,8 +121,8 @@ import RxRealm import Cocoa - public typealias TableCellFactory = (RxTableViewRealmDataSource, NSTableView, Int, E) -> NSTableCellView - public typealias TableCellConfig = (CellType, Int, E) -> Void + public typealias TableCellFactory = (RxTableViewRealmDataSource, NSTableView, Int, String?, E) -> NSTableCellView + public typealias TableCellConfig = (CellType, Int, String?, E) -> Void open class RxTableViewRealmDataSource: NSObject, NSTableViewDataSource, NSTableViewDelegate { @@ -151,9 +151,9 @@ import RxRealm public init(cellIdentifier: String, cellType: CellType.Type, cellConfig: @escaping TableCellConfig) where CellType: NSTableCellView { self.cellIdentifier = cellIdentifier - self.cellFactory = { ds, tv, row, model in + self.cellFactory = { ds, tv, row, columnId, model in let cell = tv.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: cellIdentifier), owner: tv) as! CellType - cellConfig(cell, row, model) + cellConfig(cell, row, columnId, model) return cell } } @@ -164,7 +164,8 @@ import RxRealm } public func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { - return cellFactory(self, tableView, row, items![row]) + let columnId = tableColumn?.identifier.rawValue + return cellFactory(self, tableView, row, columnId, items![row]) } // MARK: - Proxy unimplemented data source and delegate methods @@ -215,7 +216,7 @@ import RxRealm tableView.beginUpdates() tableView.removeRows(at: IndexSet(changes.deleted), withAnimation: rowAnimations.delete) tableView.insertRows(at: IndexSet(changes.inserted), withAnimation: rowAnimations.insert) - tableView.reloadData(forRowIndexes: IndexSet(changes.updated), columnIndexes: IndexSet([0])) + tableView.reloadData(forRowIndexes: IndexSet(changes.updated), columnIndexes: IndexSet(Array(0 ..< tableView.numberOfColumns))) tableView.endUpdates() } } diff --git a/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.pbxproj b/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5474313 --- /dev/null +++ b/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.pbxproj @@ -0,0 +1,370 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + E6CEF4FD21D6BD82004D0FF0 /* RxRealmDataSources.h in Headers */ = {isa = PBXBuildFile; fileRef = E6CEF4FB21D6BD82004D0FF0 /* RxRealmDataSources.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E6CEF50921D6BD9E004D0FF0 /* RxCollectionViewRealmDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6CEF50321D6BD9E004D0FF0 /* RxCollectionViewRealmDataSource.swift */; }; + E6CEF50A21D6BD9E004D0FF0 /* RxOutlineViewRealmDataItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6CEF50421D6BD9E004D0FF0 /* RxOutlineViewRealmDataItem.swift */; }; + E6CEF50B21D6BD9E004D0FF0 /* RxOutlineViewRealmDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6CEF50521D6BD9E004D0FF0 /* RxOutlineViewRealmDataSource.swift */; }; + E6CEF50C21D6BD9E004D0FF0 /* RxTableViewRealmDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6CEF50621D6BD9E004D0FF0 /* RxTableViewRealmDataSource.swift */; }; + E6CEF50D21D6BD9E004D0FF0 /* Reactive+RxRealmDataSources.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6CEF50721D6BD9E004D0FF0 /* Reactive+RxRealmDataSources.swift */; }; + E6CEF50E21D6BD9E004D0FF0 /* RealmBindObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6CEF50821D6BD9E004D0FF0 /* RealmBindObserver.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + E6CEF4F821D6BD82004D0FF0 /* RxRealmDataSources.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxRealmDataSources.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E6CEF4FB21D6BD82004D0FF0 /* RxRealmDataSources.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RxRealmDataSources.h; sourceTree = ""; }; + E6CEF4FC21D6BD82004D0FF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E6CEF50321D6BD9E004D0FF0 /* RxCollectionViewRealmDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxCollectionViewRealmDataSource.swift; sourceTree = ""; }; + E6CEF50421D6BD9E004D0FF0 /* RxOutlineViewRealmDataItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxOutlineViewRealmDataItem.swift; sourceTree = ""; }; + E6CEF50521D6BD9E004D0FF0 /* RxOutlineViewRealmDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxOutlineViewRealmDataSource.swift; sourceTree = ""; }; + E6CEF50621D6BD9E004D0FF0 /* RxTableViewRealmDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxTableViewRealmDataSource.swift; sourceTree = ""; }; + E6CEF50721D6BD9E004D0FF0 /* Reactive+RxRealmDataSources.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Reactive+RxRealmDataSources.swift"; sourceTree = ""; }; + E6CEF50821D6BD9E004D0FF0 /* RealmBindObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmBindObserver.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E6CEF4F521D6BD82004D0FF0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + E6CEF4EE21D6BD82004D0FF0 = { + isa = PBXGroup; + children = ( + E6CEF50F21D6BDB4004D0FF0 /* Classes */, + E6CEF4FA21D6BD82004D0FF0 /* RxRealmDataSources */, + E6CEF4F921D6BD82004D0FF0 /* Products */, + ); + sourceTree = ""; + }; + E6CEF4F921D6BD82004D0FF0 /* Products */ = { + isa = PBXGroup; + children = ( + E6CEF4F821D6BD82004D0FF0 /* RxRealmDataSources.framework */, + ); + name = Products; + sourceTree = ""; + }; + E6CEF4FA21D6BD82004D0FF0 /* RxRealmDataSources */ = { + isa = PBXGroup; + children = ( + E6CEF4FB21D6BD82004D0FF0 /* RxRealmDataSources.h */, + E6CEF4FC21D6BD82004D0FF0 /* Info.plist */, + ); + path = RxRealmDataSources; + sourceTree = ""; + }; + E6CEF50F21D6BDB4004D0FF0 /* Classes */ = { + isa = PBXGroup; + children = ( + E6CEF50721D6BD9E004D0FF0 /* Reactive+RxRealmDataSources.swift */, + E6CEF50821D6BD9E004D0FF0 /* RealmBindObserver.swift */, + E6CEF50321D6BD9E004D0FF0 /* RxCollectionViewRealmDataSource.swift */, + E6CEF50421D6BD9E004D0FF0 /* RxOutlineViewRealmDataItem.swift */, + E6CEF50521D6BD9E004D0FF0 /* RxOutlineViewRealmDataSource.swift */, + E6CEF50621D6BD9E004D0FF0 /* RxTableViewRealmDataSource.swift */, + ); + path = Classes; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + E6CEF4F321D6BD82004D0FF0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + E6CEF4FD21D6BD82004D0FF0 /* RxRealmDataSources.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + E6CEF4F721D6BD82004D0FF0 /* RxRealmDataSources */ = { + isa = PBXNativeTarget; + buildConfigurationList = E6CEF50021D6BD82004D0FF0 /* Build configuration list for PBXNativeTarget "RxRealmDataSources" */; + buildPhases = ( + E6CEF4F321D6BD82004D0FF0 /* Headers */, + E6CEF4F421D6BD82004D0FF0 /* Sources */, + E6CEF4F521D6BD82004D0FF0 /* Frameworks */, + E6CEF4F621D6BD82004D0FF0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RxRealmDataSources; + productName = RxRealmDataSources; + productReference = E6CEF4F821D6BD82004D0FF0 /* RxRealmDataSources.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E6CEF4EF21D6BD82004D0FF0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = Rx; + TargetAttributes = { + E6CEF4F721D6BD82004D0FF0 = { + CreatedOnToolsVersion = 10.1; + LastSwiftMigration = 1010; + }; + }; + }; + buildConfigurationList = E6CEF4F221D6BD82004D0FF0 /* Build configuration list for PBXProject "RxRealmDataSources" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = E6CEF4EE21D6BD82004D0FF0; + productRefGroup = E6CEF4F921D6BD82004D0FF0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E6CEF4F721D6BD82004D0FF0 /* RxRealmDataSources */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E6CEF4F621D6BD82004D0FF0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E6CEF4F421D6BD82004D0FF0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E6CEF50E21D6BD9E004D0FF0 /* RealmBindObserver.swift in Sources */, + E6CEF50C21D6BD9E004D0FF0 /* RxTableViewRealmDataSource.swift in Sources */, + E6CEF50A21D6BD9E004D0FF0 /* RxOutlineViewRealmDataItem.swift in Sources */, + E6CEF50D21D6BD9E004D0FF0 /* Reactive+RxRealmDataSources.swift in Sources */, + E6CEF50921D6BD9E004D0FF0 /* RxCollectionViewRealmDataSource.swift in Sources */, + E6CEF50B21D6BD9E004D0FF0 /* RxOutlineViewRealmDataSource.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + E6CEF4FE21D6BD82004D0FF0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + E6CEF4FF21D6BD82004D0FF0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + E6CEF50121D6BD82004D0FF0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = RxRealmDataSources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Rx.RxRealmDataSources; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + E6CEF50221D6BD82004D0FF0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = RxRealmDataSources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Rx.RxRealmDataSources; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E6CEF4F221D6BD82004D0FF0 /* Build configuration list for PBXProject "RxRealmDataSources" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E6CEF4FE21D6BD82004D0FF0 /* Debug */, + E6CEF4FF21D6BD82004D0FF0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E6CEF50021D6BD82004D0FF0 /* Build configuration list for PBXNativeTarget "RxRealmDataSources" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E6CEF50121D6BD82004D0FF0 /* Debug */, + E6CEF50221D6BD82004D0FF0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E6CEF4EF21D6BD82004D0FF0 /* Project object */; +} diff --git a/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..45db376 --- /dev/null +++ b/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/RxRealmDataSources/RxRealmDataSources.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/RxRealmDataSources/RxRealmDataSources/Info.plist b/RxRealmDataSources/RxRealmDataSources/Info.plist new file mode 100644 index 0000000..d55b5c1 --- /dev/null +++ b/RxRealmDataSources/RxRealmDataSources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2018 Rx. All rights reserved. + + diff --git a/RxRealmDataSources/RxRealmDataSources/RxRealmDataSources.h b/RxRealmDataSources/RxRealmDataSources/RxRealmDataSources.h new file mode 100644 index 0000000..b15317f --- /dev/null +++ b/RxRealmDataSources/RxRealmDataSources/RxRealmDataSources.h @@ -0,0 +1,19 @@ +// +// RxRealmDataSources.h +// RxRealmDataSources +// +// Created by Loki on 12/28/18. +// Copyright © 2018 Rx. All rights reserved. +// + +#import + +//! Project version number for RxRealmDataSources. +FOUNDATION_EXPORT double RxRealmDataSourcesVersionNumber; + +//! Project version string for RxRealmDataSources. +FOUNDATION_EXPORT const unsigned char RxRealmDataSourcesVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +