From c9684eb4086c4492a35a234994bc4e1a28281ac8 Mon Sep 17 00:00:00 2001 From: Richard Ross Date: Mon, 28 Mar 2016 15:47:22 -0700 Subject: [PATCH] Add objective-c example app, make swift example use AppKit for proper linking. --- .travis.yml | 12 +- .../project.pbxproj | 420 ++++++++++++++++++ .../xcschemes/LiveQueryDemo-ObjC.xcscheme | 91 ++++ Examples/LiveQueryDemo-ObjC/ChatRoomManager.h | 46 ++ Examples/LiveQueryDemo-ObjC/ChatRoomManager.m | 52 +++ Examples/LiveQueryDemo-ObjC/Info.plist | 32 ++ Examples/LiveQueryDemo-ObjC/Message.h | 24 + Examples/LiveQueryDemo-ObjC/Message.m | 20 + Examples/LiveQueryDemo-ObjC/Room.h | 20 + Examples/LiveQueryDemo-ObjC/Room.m | 20 + Examples/LiveQueryDemo-ObjC/main.m | 150 +++++++ .../LiveQueryDemo.xcodeproj/project.pbxproj | 175 ++++---- .../xcschemes/LiveQueryDemo.xcscheme | 18 +- Examples/LiveQueryDemo/Info.plist | 32 ++ .../contents.xcworkspacedata | 3 + Podfile | 12 +- Podfile.lock | 6 +- .../xcschemes/ParseLiveQuery-OSX.xcscheme | 2 +- .../xcschemes/ParseLiveQuery-iOS.xcscheme | 2 +- 19 files changed, 1035 insertions(+), 102 deletions(-) create mode 100644 Examples/LiveQueryDemo-ObjC.xcodeproj/project.pbxproj create mode 100644 Examples/LiveQueryDemo-ObjC.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo-ObjC.xcscheme create mode 100644 Examples/LiveQueryDemo-ObjC/ChatRoomManager.h create mode 100644 Examples/LiveQueryDemo-ObjC/ChatRoomManager.m create mode 100644 Examples/LiveQueryDemo-ObjC/Info.plist create mode 100644 Examples/LiveQueryDemo-ObjC/Message.h create mode 100644 Examples/LiveQueryDemo-ObjC/Message.m create mode 100644 Examples/LiveQueryDemo-ObjC/Room.h create mode 100644 Examples/LiveQueryDemo-ObjC/Room.m create mode 100644 Examples/LiveQueryDemo-ObjC/main.m create mode 100644 Examples/LiveQueryDemo/Info.plist diff --git a/.travis.yml b/.travis.yml index 0dc0885d..5285c7fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,8 @@ env: matrix: - TEST_TYPE=iOS - TEST_TYPE=OSX - - TEST_TYPE=OSXDemo + - TEST_TYPE=OSXDemoSwift + - TEST_TYPE=OSXDemoObjC - TEST_TYPE=CocoaPods install: - | @@ -25,9 +26,14 @@ script: elif [ "$TEST_TYPE" = OSX ]; then set -o pipefail xcodebuild build -workspace ParseLiveQuery.xcworkspace -sdk macosx -scheme ParseLiveQuery-OSX -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c - elif [ "$TEST_TYPE" = OSXDemo ]; then + elif [ "$TEST_TYPE" = OSXDemoSwift ]; then set -o pipefail - xcodebuild build -workspace ParseLiveQuery.xcworkspace -sdk macosx -scheme LiveQueryDemo -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c + xcodebuild clean -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo | xcpretty -c + xcodebuild build -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo -configuration Debug | xcpretty -c + elif [ "$TEST_TYPE" = OSXDemoObjC ]; then + set -o pipefail + xcodebuild clean -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo-ObjC | xcpretty -c + xcodebuild build -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo-ObjC -configuration Debug | xcpretty -c elif [ "$TEST_TYPE" = CocoaPods ]; then pod lib lint ParseLiveQuery.podspec fi diff --git a/Examples/LiveQueryDemo-ObjC.xcodeproj/project.pbxproj b/Examples/LiveQueryDemo-ObjC.xcodeproj/project.pbxproj new file mode 100644 index 00000000..74f38253 --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC.xcodeproj/project.pbxproj @@ -0,0 +1,420 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8F68026DAC07EBB6ABECA553 /* Pods_LiveQueryDemo_ObjC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8FE714A9B78962AE71BE6E5 /* Pods_LiveQueryDemo_ObjC.framework */; }; + F509D5461CA9E5B8007B15B0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F519CBB41CA9CA04005295C0 /* main.m */; }; + F509D5471CA9E5B8007B15B0 /* Message.m in Sources */ = {isa = PBXBuildFile; fileRef = F519CBBC1CA9CA2B005295C0 /* Message.m */; }; + F509D5481CA9E5B8007B15B0 /* Room.m in Sources */ = {isa = PBXBuildFile; fileRef = F519CBBF1CA9CA34005295C0 /* Room.m */; }; + F509D5491CA9E5B8007B15B0 /* ChatRoomManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F519CBCF1CA9CC4D005295C0 /* ChatRoomManager.m */; }; + F570348B1CAC837800EB3067 /* ParseLiveQuery.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F519CBCA1CA9CB31005295C0 /* ParseLiveQuery.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + F519CBC71CA9CB31005295C0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F519CBC21CA9CB31005295C0 /* ParseLiveQuery.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F5A9BFCA1BE0248D00E78326; + remoteInfo = "ParseLiveQuery-iOS"; + }; + F519CBC91CA9CB31005295C0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F519CBC21CA9CB31005295C0 /* ParseLiveQuery.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F5903CEA1BD999C500C3EFFE; + remoteInfo = "ParseLiveQuery-OSX"; + }; + F57034871CAC836900EB3067 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F519CBC21CA9CB31005295C0 /* ParseLiveQuery.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = F5903CE91BD999C500C3EFFE; + remoteInfo = "ParseLiveQuery-OSX"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 46BB59B59BEB1C1B30D1528A /* Pods-LiveQueryDemo-ObjC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LiveQueryDemo-ObjC.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-LiveQueryDemo-ObjC/Pods-LiveQueryDemo-ObjC.debug.xcconfig"; sourceTree = ""; }; + B8FE714A9B78962AE71BE6E5 /* Pods_LiveQueryDemo_ObjC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LiveQueryDemo_ObjC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BBA908F914DAEEBB466454E2 /* Pods-LiveQueryDemo-ObjC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LiveQueryDemo-ObjC.release.xcconfig"; path = "../Pods/Target Support Files/Pods-LiveQueryDemo-ObjC/Pods-LiveQueryDemo-ObjC.release.xcconfig"; sourceTree = ""; }; + F509D5321CA9E597007B15B0 /* LiveQueryDemo-ObjC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "LiveQueryDemo-ObjC.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + F509D5441CA9E5AF007B15B0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F519CBB41CA9CA04005295C0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + F519CBBB1CA9CA2B005295C0 /* Message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Message.h; sourceTree = ""; }; + F519CBBC1CA9CA2B005295C0 /* Message.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Message.m; sourceTree = ""; }; + F519CBBE1CA9CA34005295C0 /* Room.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Room.h; sourceTree = ""; }; + F519CBBF1CA9CA34005295C0 /* Room.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Room.m; sourceTree = ""; }; + F519CBC21CA9CB31005295C0 /* ParseLiveQuery.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ParseLiveQuery.xcodeproj; path = ../Sources/ParseLiveQuery.xcodeproj; sourceTree = ""; }; + F519CBCE1CA9CC4D005295C0 /* ChatRoomManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatRoomManager.h; sourceTree = ""; }; + F519CBCF1CA9CC4D005295C0 /* ChatRoomManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatRoomManager.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F509D52F1CA9E597007B15B0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F570348B1CAC837800EB3067 /* ParseLiveQuery.framework in Frameworks */, + 8F68026DAC07EBB6ABECA553 /* Pods_LiveQueryDemo_ObjC.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + E0B5CD933BEBE8518E7750F2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + F519CBC21CA9CB31005295C0 /* ParseLiveQuery.xcodeproj */, + B8FE714A9B78962AE71BE6E5 /* Pods_LiveQueryDemo_ObjC.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + F458A68D8FC5F1A206FE6787 /* Pods */ = { + isa = PBXGroup; + children = ( + 46BB59B59BEB1C1B30D1528A /* Pods-LiveQueryDemo-ObjC.debug.xcconfig */, + BBA908F914DAEEBB466454E2 /* Pods-LiveQueryDemo-ObjC.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + F519CBA81CA9CA04005295C0 = { + isa = PBXGroup; + children = ( + F519CBB31CA9CA04005295C0 /* LiveQueryDemo-ObjC */, + F519CBB21CA9CA04005295C0 /* Products */, + F458A68D8FC5F1A206FE6787 /* Pods */, + E0B5CD933BEBE8518E7750F2 /* Frameworks */, + ); + sourceTree = ""; + }; + F519CBB21CA9CA04005295C0 /* Products */ = { + isa = PBXGroup; + children = ( + F509D5321CA9E597007B15B0 /* LiveQueryDemo-ObjC.app */, + ); + name = Products; + sourceTree = ""; + }; + F519CBB31CA9CA04005295C0 /* LiveQueryDemo-ObjC */ = { + isa = PBXGroup; + children = ( + F509D5441CA9E5AF007B15B0 /* Info.plist */, + F519CBB41CA9CA04005295C0 /* main.m */, + F519CBBB1CA9CA2B005295C0 /* Message.h */, + F519CBBC1CA9CA2B005295C0 /* Message.m */, + F519CBBE1CA9CA34005295C0 /* Room.h */, + F519CBBF1CA9CA34005295C0 /* Room.m */, + F519CBCE1CA9CC4D005295C0 /* ChatRoomManager.h */, + F519CBCF1CA9CC4D005295C0 /* ChatRoomManager.m */, + ); + path = "LiveQueryDemo-ObjC"; + sourceTree = ""; + }; + F519CBC31CA9CB31005295C0 /* Products */ = { + isa = PBXGroup; + children = ( + F519CBC81CA9CB31005295C0 /* ParseLiveQuery.framework */, + F519CBCA1CA9CB31005295C0 /* ParseLiveQuery.framework */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F509D5311CA9E597007B15B0 /* LiveQueryDemo-ObjC */ = { + isa = PBXNativeTarget; + buildConfigurationList = F509D5431CA9E597007B15B0 /* Build configuration list for PBXNativeTarget "LiveQueryDemo-ObjC" */; + buildPhases = ( + 87DA45B46CF98727F2E13351 /* 📦 Check Pods Manifest.lock */, + F509D52E1CA9E597007B15B0 /* Sources */, + F509D52F1CA9E597007B15B0 /* Frameworks */, + F509D5301CA9E597007B15B0 /* Resources */, + EA41B3F790AE39BE08641EBB /* 📦 Embed Pods Frameworks */, + A8851B9B8AD727FB055366F2 /* 📦 Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + F57034881CAC836900EB3067 /* PBXTargetDependency */, + ); + name = "LiveQueryDemo-ObjC"; + productName = LiveQueryDemo; + productReference = F509D5321CA9E597007B15B0 /* LiveQueryDemo-ObjC.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F519CBA91CA9CA04005295C0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = parse; + TargetAttributes = { + F509D5311CA9E597007B15B0 = { + CreatedOnToolsVersion = 7.3; + }; + }; + }; + buildConfigurationList = F519CBAC1CA9CA04005295C0 /* Build configuration list for PBXProject "LiveQueryDemo-ObjC" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F519CBA81CA9CA04005295C0; + productRefGroup = F519CBB21CA9CA04005295C0 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = F519CBC31CA9CB31005295C0 /* Products */; + ProjectRef = F519CBC21CA9CB31005295C0 /* ParseLiveQuery.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + F509D5311CA9E597007B15B0 /* LiveQueryDemo-ObjC */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + F519CBC81CA9CB31005295C0 /* ParseLiveQuery.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = ParseLiveQuery.framework; + remoteRef = F519CBC71CA9CB31005295C0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F519CBCA1CA9CB31005295C0 /* ParseLiveQuery.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = ParseLiveQuery.framework; + remoteRef = F519CBC91CA9CB31005295C0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + F509D5301CA9E597007B15B0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 87DA45B46CF98727F2E13351 /* 📦 Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + A8851B9B8AD727FB055366F2 /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-LiveQueryDemo-ObjC/Pods-LiveQueryDemo-ObjC-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + EA41B3F790AE39BE08641EBB /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-LiveQueryDemo-ObjC/Pods-LiveQueryDemo-ObjC-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F509D52E1CA9E597007B15B0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F509D5491CA9E5B8007B15B0 /* ChatRoomManager.m in Sources */, + F509D5481CA9E5B8007B15B0 /* Room.m in Sources */, + F509D5461CA9E5B8007B15B0 /* main.m in Sources */, + F509D5471CA9E5B8007B15B0 /* Message.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + F57034881CAC836900EB3067 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "ParseLiveQuery-OSX"; + targetProxy = F57034871CAC836900EB3067 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + F509D5401CA9E597007B15B0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 46BB59B59BEB1C1B30D1528A /* Pods-LiveQueryDemo-ObjC.debug.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "$(SRCROOT)/LiveQueryDemo-ObjC/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.parse.LiveQueryDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + F509D5411CA9E597007B15B0 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BBA908F914DAEEBB466454E2 /* Pods-LiveQueryDemo-ObjC.release.xcconfig */; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "$(SRCROOT)/LiveQueryDemo-ObjC/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.parse.LiveQueryDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + F519CBB61CA9CA04005295C0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + F519CBB71CA9CA04005295C0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F509D5431CA9E597007B15B0 /* Build configuration list for PBXNativeTarget "LiveQueryDemo-ObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F509D5401CA9E597007B15B0 /* Debug */, + F509D5411CA9E597007B15B0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F519CBAC1CA9CA04005295C0 /* Build configuration list for PBXProject "LiveQueryDemo-ObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F519CBB61CA9CA04005295C0 /* Debug */, + F519CBB71CA9CA04005295C0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F519CBA91CA9CA04005295C0 /* Project object */; +} diff --git a/Examples/LiveQueryDemo-ObjC.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo-ObjC.xcscheme b/Examples/LiveQueryDemo-ObjC.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo-ObjC.xcscheme new file mode 100644 index 00000000..99ab4ab4 --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo-ObjC.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/LiveQueryDemo-ObjC/ChatRoomManager.h b/Examples/LiveQueryDemo-ObjC/ChatRoomManager.h new file mode 100644 index 00000000..0aa9eef2 --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/ChatRoomManager.h @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2016-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +@import Foundation; +@import Parse; +@import ParseLiveQuery; + +#import "Message.h" + +NS_ASSUME_NONNULL_BEGIN + +@class ChatRoomManager; + +@protocol ChatRoomManagerDataSource + +- (PFQuery *)queryForChatRoomManager:(ChatRoomManager *)manager; +- (PFLiveQueryClient *)liveQueryClientForChatRoomManager:(ChatRoomManager *)manager; + +@end + +@protocol ChatRoomManagerDelegate + +- (void)chatRoomManager:(ChatRoomManager *)manager didReceiveMessage:(Message *)message; + +@end + +@interface ChatRoomManager : NSObject + +@property (nonatomic, assign, readonly, getter=isConnected) BOOL connected; +@property (nonatomic, weak, readonly) id dataSource; +@property (nonatomic, weak, readonly) id delegate; + +- (instancetype)initWithDataSource:(id)dataSource delegate:(id)delegate; + +- (void)connect; +- (void)disconnect; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Examples/LiveQueryDemo-ObjC/ChatRoomManager.m b/Examples/LiveQueryDemo-ObjC/ChatRoomManager.m new file mode 100644 index 00000000..9e282765 --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/ChatRoomManager.m @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2016-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "ChatRoomManager.h" + +@interface ChatRoomManager() + +@property (nonatomic, strong) PFLiveQueryClient *client; +@property (nonatomic, strong) PFQuery *query; +@property (nonatomic, strong) PFLiveQuerySubscription *subscription; + +@end + +@implementation ChatRoomManager + +- (instancetype)initWithDataSource:(id)dataSource delegate:(id)delegate{ + self = [super init]; + if (!self) return self; + + _dataSource = dataSource; + _delegate = delegate; + + return self; +} + +- (BOOL)isConnected { + return self.subscription != nil; +} + +- (void)connect { + self.client = [self.dataSource liveQueryClientForChatRoomManager:self]; + self.query = [self.dataSource queryForChatRoomManager:self]; + + __weak typeof(self) weakSelf = self; + self.subscription = [[self.client subscribeToQuery:self.query] addCreateHandler:^(PFQuery *query, PFObject *message) { + [weakSelf.delegate chatRoomManager:weakSelf didReceiveMessage:(Message *)message]; + }]; +} + +- (void)disconnect { + self.client = nil; + self.query = nil; + self.subscription = nil; +} + +@end diff --git a/Examples/LiveQueryDemo-ObjC/Info.plist b/Examples/LiveQueryDemo-ObjC/Info.plist new file mode 100644 index 00000000..56c22a6b --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2016 Parse. All rights reserved. + NSPrincipalClass + NSApplication + + diff --git a/Examples/LiveQueryDemo-ObjC/Message.h b/Examples/LiveQueryDemo-ObjC/Message.h new file mode 100644 index 00000000..ff3b130c --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/Message.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2016-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +@import Parse; + +NS_ASSUME_NONNULL_BEGIN + +@interface Message : PFObject + +@property (nullable, nonatomic, strong) PFUser *author; +@property (nullable, nonatomic, strong) NSString *authorName; +@property (nullable, nonatomic, strong) NSString *message; +@property (nullable, nonatomic, strong) PFObject *room; +@property (nullable, nonatomic, strong) NSString *roomName; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Examples/LiveQueryDemo-ObjC/Message.m b/Examples/LiveQueryDemo-ObjC/Message.m new file mode 100644 index 00000000..68b1fc34 --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/Message.m @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2016-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "Message.h" + +@implementation Message + +@dynamic author, authorName, message, room, roomName; + ++ (NSString *)parseClassName { + return @"Message"; +} + +@end diff --git a/Examples/LiveQueryDemo-ObjC/Room.h b/Examples/LiveQueryDemo-ObjC/Room.h new file mode 100644 index 00000000..c368ad24 --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/Room.h @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2016-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface Room : PFObject + +@property (nullable, nonatomic, strong) NSString *name; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Examples/LiveQueryDemo-ObjC/Room.m b/Examples/LiveQueryDemo-ObjC/Room.m new file mode 100644 index 00000000..b4ebbb15 --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/Room.m @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2016-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "Room.h" + +@implementation Room + +@dynamic name; + ++ (NSString *)parseClassName { + return @"Room"; +} + +@end diff --git a/Examples/LiveQueryDemo-ObjC/main.m b/Examples/LiveQueryDemo-ObjC/main.m new file mode 100644 index 00000000..3107f82b --- /dev/null +++ b/Examples/LiveQueryDemo-ObjC/main.m @@ -0,0 +1,150 @@ +/** + * Copyright (c) 2016-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +@import Foundation; +@import Parse; +@import ParseLiveQuery; + +#import "ChatRoomManager.h" +#import "Message.h" +#import "Room.h" + +BFTask *AttemptLogin() { + puts("Enter username: "); + char buffer[1024]; + fgets(buffer, 1024, stdin); + + NSString *username = [NSString stringWithUTF8String:buffer]; + + NSString *prompt = [NSString stringWithFormat:@"Enter password for %@", username]; + NSString *password = [NSString stringWithUTF8String:getpass([prompt UTF8String])]; + + return [[PFUser logInWithUsernameInBackground:username password:password] continueWithBlock:^id (BFTask *task) { + if (task.result) { + return task.result; + } + + puts("Login failed, please try again."); + return AttemptLogin(); + }]; +} + +BFTask *AttemptRoom() { + puts("Enter chat room to connect to: "); + char buffer[1024]; + fgets(buffer, 1024, stdin); + + NSString *roomName = [NSString stringWithUTF8String:buffer]; + + return [[[[Room query] whereKey:@"name" + equalTo:roomName] + getFirstObjectInBackground] + continueWithBlock:^id _Nullable(BFTask * _Nonnull task) { + if (task.result) { + return task.result; + } + + puts("Room not found, please try again."); + return AttemptRoom(); + }]; +} + +@interface ChatRoomHandler : NSObject + +@property (nonatomic, strong, readonly) Room *room; +@property (nonatomic, strong, readonly) PFLiveQueryClient *client; + +@end + +@implementation ChatRoomHandler + +- (instancetype)initWithRoom:(Room *)room { + self = [super init]; + if (!self) return self; + + _room = room; + _client = [[PFLiveQueryClient alloc] init]; + + return self; +} + +- (PFQuery *)queryForChatRoomManager:(ChatRoomManager *)manager { + return [[[Message query] whereKey:@"room_name" + equalTo:self.room.name] + orderByAscending:@"createdAt"]; +} + +- (PFLiveQueryClient *)liveQueryClientForChatRoomManager:(ChatRoomManager *)manager { + return _client; +} + +- (void)chatRoomManager:(ChatRoomManager *)manager didReceiveMessage:(Message *)message { + NSString *formatted = [NSString stringWithFormat:@"%@ %@ %@", message.createdAt, message.authorName, message.message]; + printf("%s\n", formatted.UTF8String); +} + +@end + +int main(int argc, const char * argv[]) { + @autoreleasepool { + [Message registerSubclass]; + [Room registerSubclass]; + + [Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id configuration) { + configuration.applicationId = @"myAppId"; + configuration.server = @"http://localhost:1337/parse"; + }]]; + + [[AttemptLogin() continueWithBlock:^id (BFTask *task) { + return AttemptRoom(); + }] continueWithBlock:^id (BFTask *task) { + Room *room = task.result; + ChatRoomHandler *handler = [[ChatRoomHandler alloc] initWithRoom:room]; + ChatRoomManager *manager = [[ChatRoomManager alloc] initWithDataSource:handler delegate:handler]; + + // Print out the previous messages + PFQuery *query = [handler queryForChatRoomManager:manager]; + [[query findObjectsInBackground] continueWithBlock:^id (BFTask *task) { + for (Message *message in task.result) { + [handler chatRoomManager:manager didReceiveMessage:message]; + } + + [manager connect]; + return nil; + }]; + + dispatch_io_t stdinChannel = dispatch_io_create(DISPATCH_IO_STREAM, STDIN_FILENO, dispatch_get_main_queue(), ^(int error) { + perror("dispatch_io_create"); + }); + + dispatch_io_set_low_water(stdinChannel, 1); + dispatch_io_read(stdinChannel, 0, SIZE_MAX, dispatch_get_main_queue(), ^(bool done, dispatch_data_t data, int error) { + NSString *messageText = [[[NSString alloc] initWithData:(NSData *)data + encoding:NSUTF8StringEncoding] + stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + + + Message *message = [[Message alloc] init]; + message.author = [PFUser currentUser]; + message.authorName = [PFUser currentUser].username; + message.message = messageText; + message.room = room; + message.roomName = room.name; + + [message saveInBackground]; + }); + + return nil; + }]; + + dispatch_main(); + } + + return 0; +} diff --git a/Examples/LiveQueryDemo.xcodeproj/project.pbxproj b/Examples/LiveQueryDemo.xcodeproj/project.pbxproj index c66b4cb3..3ef1fc42 100644 --- a/Examples/LiveQueryDemo.xcodeproj/project.pbxproj +++ b/Examples/LiveQueryDemo.xcodeproj/project.pbxproj @@ -7,11 +7,11 @@ objects = { /* Begin PBXBuildFile section */ - 7F64F07377979A28C88AF3AE /* Pods_LiveQueryDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6A6F02FD57E57309877DA38 /* Pods_LiveQueryDemo.framework */; }; - 8199A4091CA1EF3300BF61E1 /* ParseLiveQuery.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8199A4061CA1EF1800BF61E1 /* ParseLiveQuery.framework */; }; - F59F85B01C9BB48200566A29 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F85AF1C9BB48200566A29 /* main.swift */; }; - F59F85B81C9BB4B600566A29 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F85B61C9BB4B600566A29 /* Message.swift */; }; - F59F85B91C9BB4B600566A29 /* Room.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F85B71C9BB4B600566A29 /* Room.swift */; }; + B88040BD3E7C225E22705572 /* Pods_LiveQueryDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6A6F02FD57E57309877DA38 /* Pods_LiveQueryDemo.framework */; }; + F509D5281CA9E4D9007B15B0 /* ParseLiveQuery.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8199A4061CA1EF1800BF61E1 /* ParseLiveQuery.framework */; }; + F509D5291CA9E53D007B15B0 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F85B61C9BB4B600566A29 /* Message.swift */; }; + F509D52A1CA9E53D007B15B0 /* Room.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F85B71C9BB4B600566A29 /* Room.swift */; }; + F509D52B1CA9E53D007B15B0 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F85AF1C9BB48200566A29 /* main.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -29,33 +29,15 @@ remoteGlobalIDString = F5903CEA1BD999C500C3EFFE; remoteInfo = "ParseLiveQuery-OSX"; }; - 8199A4071CA1EF2100BF61E1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8199A3FE1CA1EF1800BF61E1 /* ParseLiveQuery.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F5903CE91BD999C500C3EFFE; - remoteInfo = "ParseLiveQuery-OSX"; - }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - F59F85AA1C9BB48200566A29 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 3AC9312CEDA0007F8EAA9880 /* Pods-LiveQueryDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LiveQueryDemo.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-LiveQueryDemo/Pods-LiveQueryDemo.debug.xcconfig"; sourceTree = ""; }; 497772719B97C861F0896BFC /* Pods-LiveQueryDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LiveQueryDemo.release.xcconfig"; path = "../Pods/Target Support Files/Pods-LiveQueryDemo/Pods-LiveQueryDemo.release.xcconfig"; sourceTree = ""; }; 8199A3FE1CA1EF1800BF61E1 /* ParseLiveQuery.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ParseLiveQuery.xcodeproj; path = ../Sources/ParseLiveQuery.xcodeproj; sourceTree = ""; }; E6A6F02FD57E57309877DA38 /* Pods_LiveQueryDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LiveQueryDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F59F85AC1C9BB48200566A29 /* LiveQueryDemo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = LiveQueryDemo; sourceTree = BUILT_PRODUCTS_DIR; }; + F509D5171CA9E4AE007B15B0 /* LiveQueryDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LiveQueryDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F509D5241CA9E4AE007B15B0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F59F85AF1C9BB48200566A29 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; F59F85B61C9BB4B600566A29 /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = ""; }; F59F85B71C9BB4B600566A29 /* Room.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Room.swift; sourceTree = ""; }; @@ -63,12 +45,12 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - F59F85A91C9BB48200566A29 /* Frameworks */ = { + F509D5141CA9E4AE007B15B0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8199A4091CA1EF3300BF61E1 /* ParseLiveQuery.framework in Frameworks */, - 7F64F07377979A28C88AF3AE /* Pods_LiveQueryDemo.framework in Frameworks */, + F509D5281CA9E4D9007B15B0 /* ParseLiveQuery.framework in Frameworks */, + B88040BD3E7C225E22705572 /* Pods_LiveQueryDemo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -118,7 +100,7 @@ F59F85AD1C9BB48200566A29 /* Products */ = { isa = PBXGroup; children = ( - F59F85AC1C9BB48200566A29 /* LiveQueryDemo */, + F509D5171CA9E4AE007B15B0 /* LiveQueryDemo.app */, ); name = Products; sourceTree = ""; @@ -126,6 +108,7 @@ F59F85AE1C9BB48200566A29 /* LiveQueryDemo */ = { isa = PBXGroup; children = ( + F509D5241CA9E4AE007B15B0 /* Info.plist */, F59F85B61C9BB4B600566A29 /* Message.swift */, F59F85B71C9BB4B600566A29 /* Room.swift */, F59F85AF1C9BB48200566A29 /* main.swift */, @@ -136,25 +119,25 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - F59F85AB1C9BB48200566A29 /* LiveQueryDemo */ = { + F509D5161CA9E4AE007B15B0 /* LiveQueryDemo */ = { isa = PBXNativeTarget; - buildConfigurationList = F59F85B31C9BB48200566A29 /* Build configuration list for PBXNativeTarget "LiveQueryDemo" */; + buildConfigurationList = F509D5251CA9E4AE007B15B0 /* Build configuration list for PBXNativeTarget "LiveQueryDemo" */; buildPhases = ( - 15BD0AAA808A79D4D9BF001B /* 📦 Check Pods Manifest.lock */, - F59F85A81C9BB48200566A29 /* Sources */, - F59F85A91C9BB48200566A29 /* Frameworks */, - F59F85AA1C9BB48200566A29 /* CopyFiles */, - 61A2B4349CA47E883546F289 /* 📦 Copy Pods Resources */, + E6F699DDDA9E6B861F705AD5 /* 📦 Check Pods Manifest.lock */, + F509D5131CA9E4AE007B15B0 /* Sources */, + F509D5141CA9E4AE007B15B0 /* Frameworks */, + F509D5151CA9E4AE007B15B0 /* Resources */, + 045C33FD1807E3932888A2F9 /* 📦 Embed Pods Frameworks */, + D9EF05A29B9F1AAC9B62408C /* 📦 Copy Pods Resources */, ); buildRules = ( ); dependencies = ( - 8199A4081CA1EF2100BF61E1 /* PBXTargetDependency */, ); name = LiveQueryDemo; - productName = LiveQueryDemo; - productReference = F59F85AC1C9BB48200566A29 /* LiveQueryDemo */; - productType = "com.apple.product-type.tool"; + productName = AppKitDemo; + productReference = F509D5171CA9E4AE007B15B0 /* LiveQueryDemo.app */; + productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -166,8 +149,8 @@ LastUpgradeCheck = 0720; ORGANIZATIONNAME = Parse; TargetAttributes = { - F59F85AB1C9BB48200566A29 = { - CreatedOnToolsVersion = 7.2.1; + F509D5161CA9E4AE007B15B0 = { + CreatedOnToolsVersion = 7.3; }; }; }; @@ -177,6 +160,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = F59F85A31C9BB48200566A29; productRefGroup = F59F85AD1C9BB48200566A29 /* Products */; @@ -189,7 +173,7 @@ ); projectRoot = ""; targets = ( - F59F85AB1C9BB48200566A29 /* LiveQueryDemo */, + F509D5161CA9E4AE007B15B0 /* LiveQueryDemo */, ); }; /* End PBXProject section */ @@ -211,23 +195,33 @@ }; /* End PBXReferenceProxy section */ +/* Begin PBXResourcesBuildPhase section */ + F509D5151CA9E4AE007B15B0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXShellScriptBuildPhase section */ - 15BD0AAA808A79D4D9BF001B /* 📦 Check Pods Manifest.lock */ = { + 045C33FD1807E3932888A2F9 /* 📦 Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "📦 Check Pods Manifest.lock"; + name = "📦 Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-LiveQueryDemo/Pods-LiveQueryDemo-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 61A2B4349CA47E883546F289 /* 📦 Copy Pods Resources */ = { + D9EF05A29B9F1AAC9B62408C /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -242,30 +236,63 @@ shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-LiveQueryDemo/Pods-LiveQueryDemo-resources.sh\"\n"; showEnvVarsInLog = 0; }; + E6F699DDDA9E6B861F705AD5 /* 📦 Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - F59F85A81C9BB48200566A29 /* Sources */ = { + F509D5131CA9E4AE007B15B0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - F59F85B01C9BB48200566A29 /* main.swift in Sources */, - F59F85B81C9BB4B600566A29 /* Message.swift in Sources */, - F59F85B91C9BB4B600566A29 /* Room.swift in Sources */, + F509D52A1CA9E53D007B15B0 /* Room.swift in Sources */, + F509D5291CA9E53D007B15B0 /* Message.swift in Sources */, + F509D52B1CA9E53D007B15B0 /* main.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 8199A4081CA1EF2100BF61E1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "ParseLiveQuery-OSX"; - targetProxy = 8199A4071CA1EF2100BF61E1 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ + F509D5261CA9E4AE007B15B0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3AC9312CEDA0007F8EAA9880 /* Pods-LiveQueryDemo.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "$(SRCROOT)/LiveQueryDemo/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.parse.LiveQueryDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + F509D5271CA9E4AE007B15B0 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 497772719B97C861F0896BFC /* Pods-LiveQueryDemo.release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "$(SRCROOT)/LiveQueryDemo/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.parse.LiveQueryDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; F59F85B11C9BB48200566A29 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -346,41 +373,23 @@ }; name = Release; }; - F59F85B41C9BB48200566A29 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3AC9312CEDA0007F8EAA9880 /* Pods-LiveQueryDemo.debug.xcconfig */; - buildSettings = { - EMBEDDED_CONTENT_CONTAINS_SWIFT = NO; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - F59F85B51C9BB48200566A29 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 497772719B97C861F0896BFC /* Pods-LiveQueryDemo.release.xcconfig */; - buildSettings = { - EMBEDDED_CONTENT_CONTAINS_SWIFT = NO; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - F59F85A71C9BB48200566A29 /* Build configuration list for PBXProject "LiveQueryDemo" */ = { + F509D5251CA9E4AE007B15B0 /* Build configuration list for PBXNativeTarget "LiveQueryDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( - F59F85B11C9BB48200566A29 /* Debug */, - F59F85B21C9BB48200566A29 /* Release */, + F509D5261CA9E4AE007B15B0 /* Debug */, + F509D5271CA9E4AE007B15B0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - F59F85B31C9BB48200566A29 /* Build configuration list for PBXNativeTarget "LiveQueryDemo" */ = { + F59F85A71C9BB48200566A29 /* Build configuration list for PBXProject "LiveQueryDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( - F59F85B41C9BB48200566A29 /* Debug */, - F59F85B51C9BB48200566A29 /* Release */, + F59F85B11C9BB48200566A29 /* Debug */, + F59F85B21C9BB48200566A29 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Examples/LiveQueryDemo.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo.xcscheme b/Examples/LiveQueryDemo.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo.xcscheme index cc7527f6..61e80c2a 100644 --- a/Examples/LiveQueryDemo.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo.xcscheme +++ b/Examples/LiveQueryDemo.xcodeproj/xcshareddata/xcschemes/LiveQueryDemo.xcscheme @@ -1,6 +1,6 @@ @@ -32,8 +32,8 @@ @@ -55,8 +55,8 @@ runnableDebuggingMode = "0"> @@ -74,8 +74,8 @@ runnableDebuggingMode = "0"> diff --git a/Examples/LiveQueryDemo/Info.plist b/Examples/LiveQueryDemo/Info.plist new file mode 100644 index 00000000..56c22a6b --- /dev/null +++ b/Examples/LiveQueryDemo/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2016 Parse. All rights reserved. + NSPrincipalClass + NSApplication + + diff --git a/ParseLiveQuery.xcworkspace/contents.xcworkspacedata b/ParseLiveQuery.xcworkspace/contents.xcworkspacedata index 0d6f1882..9a4a21e0 100644 --- a/ParseLiveQuery.xcworkspace/contents.xcworkspacedata +++ b/ParseLiveQuery.xcworkspace/contents.xcworkspacedata @@ -14,6 +14,9 @@ + + diff --git a/Podfile b/Podfile index 723a8d5e..c6e0bef4 100644 --- a/Podfile +++ b/Podfile @@ -6,7 +6,7 @@ workspace 'ParseLiveQuery.xcworkspace' target 'ParseLiveQuery-OSX' do project 'Sources/ParseLiveQuery.xcodeproj' - platform :osx, '10.10' + platform :osx, '10.9' pod 'Parse' pod 'Bolts-Swift' pod 'SocketRocket' @@ -22,7 +22,15 @@ end target 'LiveQueryDemo' do project 'Examples/LiveQueryDemo.xcodeproj' - platform :osx, '10.10' + platform :osx, '10.9' + pod 'Parse' + pod 'Bolts-Swift' + pod 'SocketRocket' +end + +target 'LiveQueryDemo-ObjC' do + project 'Examples/LiveQueryDemo-ObjC.xcodeproj' + platform :osx, '10.9' pod 'Parse' pod 'Bolts-Swift' pod 'SocketRocket' diff --git a/Podfile.lock b/Podfile.lock index 1453e50e..34a970c1 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,6 +1,6 @@ PODS: - Bolts-Swift (1.0.1) - - Bolts/Tasks (1.6.0) + - Bolts/Tasks (1.7.0) - Parse (1.13.0): - Bolts/Tasks (~> 1.6) - SocketRocket (0.5.0) @@ -11,11 +11,11 @@ DEPENDENCIES: - SocketRocket SPEC CHECKSUMS: - Bolts: f52a250053bb517ca874523c3913776359ab3def + Bolts: a0058fa3b331c5a1e4402d534f2dae36dbff31e4 Bolts-Swift: 1c4c4955b1aacfc83f6a1998f6ad9627c35f8c4f Parse: f51c24d2feb412e4b2d6cc73d37cb24e8d0089bc SocketRocket: 2c51efccd2d73c99a923407ca4b06e7e9da95dbf -PODFILE CHECKSUM: b9a8e3333816abb217972f59b02783395bc8c2e2 +PODFILE CHECKSUM: 8b4289d8be4dced36d3871d24ac231402f0c5dfd COCOAPODS: 1.0.0.beta.6 diff --git a/Sources/ParseLiveQuery.xcodeproj/xcshareddata/xcschemes/ParseLiveQuery-OSX.xcscheme b/Sources/ParseLiveQuery.xcodeproj/xcshareddata/xcschemes/ParseLiveQuery-OSX.xcscheme index 66b221d0..ebc61a42 100644 --- a/Sources/ParseLiveQuery.xcodeproj/xcshareddata/xcschemes/ParseLiveQuery-OSX.xcscheme +++ b/Sources/ParseLiveQuery.xcodeproj/xcshareddata/xcschemes/ParseLiveQuery-OSX.xcscheme @@ -1,6 +1,6 @@