diff --git a/HakawaiDemoSwift/.DS_Store b/HakawaiDemoSwift/.DS_Store new file mode 100644 index 0000000..a7c21bc Binary files /dev/null and b/HakawaiDemoSwift/.DS_Store differ diff --git a/HakawaiDemoSwift/HakawaiDemoSwift.xcodeproj/project.pbxproj b/HakawaiDemoSwift/HakawaiDemoSwift.xcodeproj/project.pbxproj new file mode 100755 index 0000000..a97ec09 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift.xcodeproj/project.pbxproj @@ -0,0 +1,450 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 98642551B770836A30D7E1D4 /* Pods_HakawaiDemoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E4504D25EEE97F7E2EDAECD /* Pods_HakawaiDemoSwift.framework */; }; + CDD0343A20A61F5100E1F0BD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDD0343920A61F5100E1F0BD /* AppDelegate.swift */; }; + CDD0343F20A61F5100E1F0BD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CDD0343D20A61F5100E1F0BD /* Main.storyboard */; }; + CDD0344120A61F5100E1F0BD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CDD0344020A61F5100E1F0BD /* Assets.xcassets */; }; + CDD0344420A61F5100E1F0BD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CDD0344220A61F5100E1F0BD /* LaunchScreen.storyboard */; }; + CDD0344D20A6202000E1F0BD /* MentionsDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDD0344C20A6202000E1F0BD /* MentionsDemoViewController.swift */; }; + CDD0344F20A6245800E1F0BD /* MentionsEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDD0344E20A6245800E1F0BD /* MentionsEntity.swift */; }; + CDD0345120A6256200E1F0BD /* MentionsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDD0345020A6256200E1F0BD /* MentionsManager.swift */; }; + CDD0345320A62BE100E1F0BD /* CustomChooserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDD0345220A62BE100E1F0BD /* CustomChooserView.swift */; }; + CDD0345520A62D4900E1F0BD /* CustomChooserView.xib in Resources */ = {isa = PBXBuildFile; fileRef = CDD0345420A62D4900E1F0BD /* CustomChooserView.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 5068325EF39877E795382F41 /* Pods-HakawaiDemoSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HakawaiDemoSwift.release.xcconfig"; path = "Pods/Target Support Files/Pods-HakawaiDemoSwift/Pods-HakawaiDemoSwift.release.xcconfig"; sourceTree = ""; }; + 7E4504D25EEE97F7E2EDAECD /* Pods_HakawaiDemoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HakawaiDemoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 90ED0D547272B7A1C2EF2D01 /* Pods-HakawaiDemoSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HakawaiDemoSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HakawaiDemoSwift/Pods-HakawaiDemoSwift.debug.xcconfig"; sourceTree = ""; }; + CDD0343620A61F5100E1F0BD /* HakawaiDemoSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HakawaiDemoSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CDD0343920A61F5100E1F0BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + CDD0343E20A61F5100E1F0BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + CDD0344020A61F5100E1F0BD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + CDD0344320A61F5100E1F0BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + CDD0344520A61F5100E1F0BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CDD0344C20A6202000E1F0BD /* MentionsDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentionsDemoViewController.swift; sourceTree = ""; }; + CDD0344E20A6245800E1F0BD /* MentionsEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentionsEntity.swift; sourceTree = ""; }; + CDD0345020A6256200E1F0BD /* MentionsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentionsManager.swift; sourceTree = ""; }; + CDD0345220A62BE100E1F0BD /* CustomChooserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomChooserView.swift; sourceTree = ""; }; + CDD0345420A62D4900E1F0BD /* CustomChooserView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomChooserView.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CDD0343320A61F5100E1F0BD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 98642551B770836A30D7E1D4 /* Pods_HakawaiDemoSwift.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1B103C0EBD37FB6DC9559F16 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7E4504D25EEE97F7E2EDAECD /* Pods_HakawaiDemoSwift.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + B48DF5B547229E57D68EF420 /* Pods */ = { + isa = PBXGroup; + children = ( + 90ED0D547272B7A1C2EF2D01 /* Pods-HakawaiDemoSwift.debug.xcconfig */, + 5068325EF39877E795382F41 /* Pods-HakawaiDemoSwift.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + CDD0342D20A61F5100E1F0BD = { + isa = PBXGroup; + children = ( + CDD0343820A61F5100E1F0BD /* HakawaiDemoSwift */, + CDD0343720A61F5100E1F0BD /* Products */, + B48DF5B547229E57D68EF420 /* Pods */, + 1B103C0EBD37FB6DC9559F16 /* Frameworks */, + ); + sourceTree = ""; + }; + CDD0343720A61F5100E1F0BD /* Products */ = { + isa = PBXGroup; + children = ( + CDD0343620A61F5100E1F0BD /* HakawaiDemoSwift.app */, + ); + name = Products; + sourceTree = ""; + }; + CDD0343820A61F5100E1F0BD /* HakawaiDemoSwift */ = { + isa = PBXGroup; + children = ( + CDD0343920A61F5100E1F0BD /* AppDelegate.swift */, + CDD0343D20A61F5100E1F0BD /* Main.storyboard */, + CDD0344B20A61FDF00E1F0BD /* Mentions */, + CDD0345720A6306800E1F0BD /* Resources */, + CDD0345620A6303700E1F0BD /* Supporting Files */, + ); + path = HakawaiDemoSwift; + sourceTree = ""; + }; + CDD0344B20A61FDF00E1F0BD /* Mentions */ = { + isa = PBXGroup; + children = ( + CDD0344C20A6202000E1F0BD /* MentionsDemoViewController.swift */, + CDD0344E20A6245800E1F0BD /* MentionsEntity.swift */, + CDD0345020A6256200E1F0BD /* MentionsManager.swift */, + CDD0345220A62BE100E1F0BD /* CustomChooserView.swift */, + CDD0345420A62D4900E1F0BD /* CustomChooserView.xib */, + ); + path = Mentions; + sourceTree = ""; + }; + CDD0345620A6303700E1F0BD /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CDD0344520A61F5100E1F0BD /* Info.plist */, + ); + path = "Supporting Files"; + sourceTree = ""; + }; + CDD0345720A6306800E1F0BD /* Resources */ = { + isa = PBXGroup; + children = ( + CDD0344220A61F5100E1F0BD /* LaunchScreen.storyboard */, + CDD0344020A61F5100E1F0BD /* Assets.xcassets */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CDD0343520A61F5100E1F0BD /* HakawaiDemoSwift */ = { + isa = PBXNativeTarget; + buildConfigurationList = CDD0344820A61F5100E1F0BD /* Build configuration list for PBXNativeTarget "HakawaiDemoSwift" */; + buildPhases = ( + 55E33F4E9F4D98EDEFA48751 /* [CP] Check Pods Manifest.lock */, + CDD0343220A61F5100E1F0BD /* Sources */, + CDD0343320A61F5100E1F0BD /* Frameworks */, + CDD0343420A61F5100E1F0BD /* Resources */, + B333E3F830DB18DCD0A59ED9 /* [CP] Embed Pods Frameworks */, + 742FE208B92B56EB35F19DD6 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HakawaiDemoSwift; + productName = HakawaiDemoSwift; + productReference = CDD0343620A61F5100E1F0BD /* HakawaiDemoSwift.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CDD0342E20A61F5100E1F0BD /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = com.linkedin; + TargetAttributes = { + CDD0343520A61F5100E1F0BD = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = CDD0343120A61F5100E1F0BD /* Build configuration list for PBXProject "HakawaiDemoSwift" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CDD0342D20A61F5100E1F0BD; + productRefGroup = CDD0343720A61F5100E1F0BD /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CDD0343520A61F5100E1F0BD /* HakawaiDemoSwift */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CDD0343420A61F5100E1F0BD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDD0344420A61F5100E1F0BD /* LaunchScreen.storyboard in Resources */, + CDD0344120A61F5100E1F0BD /* Assets.xcassets in Resources */, + CDD0345520A62D4900E1F0BD /* CustomChooserView.xib in Resources */, + CDD0343F20A61F5100E1F0BD /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 55E33F4E9F4D98EDEFA48751 /* [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-HakawaiDemoSwift-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; + }; + 742FE208B92B56EB35F19DD6 /* [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-HakawaiDemoSwift/Pods-HakawaiDemoSwift-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + B333E3F830DB18DCD0A59ED9 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-HakawaiDemoSwift/Pods-HakawaiDemoSwift-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Hakawai/Hakawai.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Hakawai.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HakawaiDemoSwift/Pods-HakawaiDemoSwift-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CDD0343220A61F5100E1F0BD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDD0344F20A6245800E1F0BD /* MentionsEntity.swift in Sources */, + CDD0344D20A6202000E1F0BD /* MentionsDemoViewController.swift in Sources */, + CDD0345320A62BE100E1F0BD /* CustomChooserView.swift in Sources */, + CDD0345120A6256200E1F0BD /* MentionsManager.swift in Sources */, + CDD0343A20A61F5100E1F0BD /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CDD0343D20A61F5100E1F0BD /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CDD0343E20A61F5100E1F0BD /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + CDD0344220A61F5100E1F0BD /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CDD0344320A61F5100E1F0BD /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CDD0344620A61F5100E1F0BD /* 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_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = 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_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 = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + 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; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + CDD0344720A61F5100E1F0BD /* 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_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = 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_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 = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + 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; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CDD0344920A61F5100E1F0BD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 90ED0D547272B7A1C2EF2D01 /* Pods-HakawaiDemoSwift.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = HLS658NRU7; + INFOPLIST_FILE = "$(SRCROOT)/HakawaiDemoSwift/Supporting Files/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.linkedin.HakawaiDemoSwift; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CDD0344A20A61F5100E1F0BD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5068325EF39877E795382F41 /* Pods-HakawaiDemoSwift.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = HLS658NRU7; + INFOPLIST_FILE = "$(SRCROOT)/HakawaiDemoSwift/Supporting Files/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.linkedin.HakawaiDemoSwift; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CDD0343120A61F5100E1F0BD /* Build configuration list for PBXProject "HakawaiDemoSwift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CDD0344620A61F5100E1F0BD /* Debug */, + CDD0344720A61F5100E1F0BD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CDD0344820A61F5100E1F0BD /* Build configuration list for PBXNativeTarget "HakawaiDemoSwift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CDD0344920A61F5100E1F0BD /* Debug */, + CDD0344A20A61F5100E1F0BD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CDD0342E20A61F5100E1F0BD /* Project object */; +} diff --git a/HakawaiDemoSwift/HakawaiDemoSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/HakawaiDemoSwift/HakawaiDemoSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..497484d --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/HakawaiDemoSwift/HakawaiDemoSwift.xcworkspace/contents.xcworkspacedata b/HakawaiDemoSwift/HakawaiDemoSwift.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..fd91970 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/HakawaiDemoSwift/HakawaiDemoSwift.xcworkspace/xcuserdata/sergstavitskii.xcuserdatad/UserInterfaceState.xcuserstate b/HakawaiDemoSwift/HakawaiDemoSwift.xcworkspace/xcuserdata/sergstavitskii.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..19145ea Binary files /dev/null and b/HakawaiDemoSwift/HakawaiDemoSwift.xcworkspace/xcuserdata/sergstavitskii.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/AppDelegate.swift b/HakawaiDemoSwift/HakawaiDemoSwift/AppDelegate.swift new file mode 100755 index 0000000..8293908 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/AppDelegate.swift @@ -0,0 +1,50 @@ +// +// AppDelegate.swift +// HakawaiDemoSwift +// +// Copyright (c) 2014 LinkedIn Corp. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Base.lproj/Main.storyboard b/HakawaiDemoSwift/HakawaiDemoSwift/Base.lproj/Main.storyboard new file mode 100755 index 0000000..30e9b5c --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Base.lproj/Main.storyboard @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/CustomChooserView.swift b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/CustomChooserView.swift new file mode 100755 index 0000000..d4d1f03 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/CustomChooserView.swift @@ -0,0 +1,87 @@ +// +// CustomChooserView.swift +// HakawaiDemoSwift +// +// Copyright (c) 2014 LinkedIn Corp. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// + +import UIKit +import Hakawai + +class CustomChooserView: UIView { + + @IBOutlet weak var pickerView: UIPickerView! + + weak var delegate: HKWCustomChooserViewDelegate? + var borderMode: HKWChooserBorderMode = .top + + // Protocol factory method + @objc(chooserViewWithFrame:delegate:) + class func chooserView(withFrame frame: CGRect, delegate: HKWCustomChooserViewDelegate) -> Any { + let item = Bundle.main.loadNibNamed("CustomChooserView", owner: nil, options: nil)?[0] as! CustomChooserView + item.delegate = delegate + item.frame = frame + item.setNeedsLayout() + return item + } + + override func awakeFromNib() { + super.awakeFromNib() + pickerView.dataSource = self + pickerView.delegate = self + } +} + +// MARK: - HKWChooserViewProtocol +extension CustomChooserView: HKWChooserViewProtocol { + func becomeVisible() { + isHidden = false + setNeedsLayout() + } + + func resetScrollPositionAndHide() { + // Don't do anything + isHidden = true + } + + func reloadData() { + pickerView.reloadComponent(0) + } + + +} + +// MARK: - UIPickerViewDataSource +extension CustomChooserView: UIPickerViewDataSource { + + func numberOfComponents(in pickerView: UIPickerView) -> Int { + return 1 + } + + func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { + return delegate?.numberOfModelObjects() ?? 0 + } +} + +//MARK: - UIPickerViewDelegate +extension CustomChooserView: UIPickerViewDelegate { + + func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { + let model = delegate?.modelObject(for: row) as! HKWMentionsEntityProtocol + return model.entityName() + } +} + +// MARK: - Controls +extension CustomChooserView { + + @IBAction func chooseButtonTapped(_ sender: UIButton) { + let idx = pickerView.selectedRow(inComponent: 0) + delegate?.modelObjectSelected(at: idx) + } +} diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/CustomChooserView.xib b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/CustomChooserView.xib new file mode 100755 index 0000000..3a57ec6 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/CustomChooserView.xib @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsDemoViewController.swift b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsDemoViewController.swift new file mode 100755 index 0000000..ca7e377 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsDemoViewController.swift @@ -0,0 +1,71 @@ +// +// MentionsDemoViewController.swift +// HakawaiDemoSwift +// +// Copyright (c) 2014 LinkedIn Corp. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// + +import UIKit +import Hakawai + +class MentionsDemoViewController: UIViewController { + + //MARK: - Outlets + @IBOutlet weak var textView: HKWTextView! + @IBOutlet weak var mentionsListButton: UIButton! + + private var plugin: HKWMentionsPlugin? + + override func viewDidLoad() { + super.viewDidLoad() + setupUI() + } +} + +// MARK: - +extension MentionsDemoViewController { + + private func setupUI() { + textView.layer.borderWidth = 0.5 + textView.layer.borderColor = UIColor.lightGray.cgColor + // Set up the mentions system + let mode = HKWMentionsChooserPositionMode.enclosedTop + // In this demo, the user may explicitly begin a mention with either the '@' or '+' characters + let controlCharacters = CharacterSet(charactersIn: "@+") + // The user may also begin a mention by typing three characters (set searchLength to 0 to disable) + let mentionsPlugin = HKWMentionsPlugin(chooserMode: mode, + controlCharacters: controlCharacters, + searchLength: 3) + + // NOTE: If you want to see an example of a custom chooser, uncomment the following line. +// mentionsPlugin?.chooserViewClass = CustomChooserView.self + + // If the text view loses focus while the mention chooser is up, and then regains focus, it will automatically put + // the mentions chooser back up + mentionsPlugin?.resumeMentionsCreationEnabled = true + // Add edge insets so chooser view doesn't overlap the text view's cosmetic grey border + mentionsPlugin?.chooserViewEdgeInsets = UIEdgeInsetsMake(2, 0.5, 0.5, 0.5) + plugin = mentionsPlugin + plugin?.chooserViewBackgroundColor = .lightGray + // The mentions plug-in requires a delegate, which provides it with mentions entities in response to a query string + mentionsPlugin?.delegate = MentionsManager.shared + textView.controlFlowPlugin = mentionsPlugin + } +} + +// MARK: - Controls +extension MentionsDemoViewController { + + @IBAction func listMentionsButtonTapped(_ sender: UIButton) { + print("There are mention(s): \(String(describing: plugin?.mentions().count)) @% \(String(describing: plugin?.mentions()))") + } + + @IBAction func doneEditingButtonTapped(_ sender: UIButton) { + textView.resignFirstResponder() + } +} diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsEntity.swift b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsEntity.swift new file mode 100755 index 0000000..8671e20 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsEntity.swift @@ -0,0 +1,41 @@ +// +// MentionsEntity.swift +// HakawaiDemoSwift +// +// Copyright (c) 2014 LinkedIn Corp. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// + +import Foundation +import Hakawai + +class MentionsEntity: NSObject { + + private var name: String? + private var id: String! + + init(name: String, id: String) { + self.name = name + self.id = id + } +} + +extension MentionsEntity: HKWMentionsEntityProtocol { + + func entityId() -> String! { + return id + } + + func entityName() -> String! { + return name + } + + func entityMetadata() -> [AnyHashable : Any]! { + return [id: name] + } +} + diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsManager.swift b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsManager.swift new file mode 100755 index 0000000..d3a017e --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Mentions/MentionsManager.swift @@ -0,0 +1,87 @@ +// +// MentionsManager.swift +// HakawaiDemoSwift +// +// Copyright (c) 2014 LinkedIn Corp. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// + +import UIKit +import Hakawai + +class MentionsManager: NSObject { + + static let shared = MentionsManager() + + private let mentionsCellId = "mentionsCell" + private let mentionsCellHeight: CGFloat = 44.0 + private var fakeData = [MentionsEntity]() + + private func setupFakeData() { + fakeData = [MentionsEntity(name: "Alan Perlis", id: "1"), + MentionsEntity(name: "Maurice Wilkes", id: "2"), + MentionsEntity(name: "Richard Hamming", id: "3"), + MentionsEntity(name: "James Wilkinson", id: "4"), + MentionsEntity(name: "John McCarthy", id: "5"), + MentionsEntity(name: "Edsger Dijkstra", id: "6"), + MentionsEntity(name: "Charles Bachman", id: "7"), + MentionsEntity(name: "Donald Knuth", id: "8"), + MentionsEntity(name: "Allen Newell", id: "9"), + MentionsEntity(name: "Herbert Simon", id: "10"), + MentionsEntity(name: "Michael Rabin", id: "11") + ] + } +} + +//MARK: - HKWMentionsDelegate +extension MentionsManager: HKWMentionsDelegate { + + // In this method, the plug-in gives us a search string and some metadata, as well as a block. Our responsibility is to + // perform whatever work is necessary to get the entities for that search string (network call, database query, etc), + // and then to call the completion block with an array of entity objects corresponding to the search string. See the + // documentation for the method for more details. + func asyncRetrieveEntities(forKeyString keyString: String!, searchType type: HKWMentionsSearchType, controlCharacter character: unichar, + completion completionBlock: (([Any]?, Bool, Bool) -> Void)!) { + guard completionBlock != nil else { + return + } + setupFakeData() + let data = fakeData + var buffer = [MentionsEntity]() + if keyString.count == 0 { + buffer = data + } + else { + for entity in data { + let name = entity.entityName() + if (name!.lowercased().contains(keyString.lowercased())) { + buffer.append(entity) + } + } + } + completionBlock(buffer, false, true) + } + + // In this method, the plug-in gives us a mentions entity (one we previously returned in response to a query), and asks + // us to provide a table view cell corresponding to that entity to be presented to the user. + func cell(forMentionsEntity entity: HKWMentionsEntityProtocol!, withMatch matchString: String!, tableView: UITableView!) -> UITableViewCell! { + var cell = tableView.dequeueReusableCell(withIdentifier: mentionsCellId) + if cell == nil { + cell = UITableViewCell(style: .subtitle, reuseIdentifier: mentionsCellId) + cell?.backgroundColor = .lightGray + } + cell?.textLabel?.text = entity.entityName() + cell?.detailTextLabel?.text = entity.entityId() + return cell + } + + func heightForCell(forMentionsEntity entity: HKWMentionsEntityProtocol!, tableView: UITableView!) -> CGFloat { + return mentionsCellHeight + } + + +} diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/HakawaiDemoSwift/HakawaiDemoSwift/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..1d060ed --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Resources/Base.lproj/LaunchScreen.storyboard b/HakawaiDemoSwift/HakawaiDemoSwift/Resources/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..f83f6fd --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Resources/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HakawaiDemoSwift/HakawaiDemoSwift/Supporting Files/Info.plist b/HakawaiDemoSwift/HakawaiDemoSwift/Supporting Files/Info.plist new file mode 100755 index 0000000..89d7858 --- /dev/null +++ b/HakawaiDemoSwift/HakawaiDemoSwift/Supporting Files/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/HakawaiDemoSwift/Podfile b/HakawaiDemoSwift/Podfile new file mode 100755 index 0000000..47a3638 --- /dev/null +++ b/HakawaiDemoSwift/Podfile @@ -0,0 +1,7 @@ +platform :ios, '11.0' +use_frameworks! + +target 'HakawaiDemoSwift' do + pod 'Hakawai' +end + diff --git a/HakawaiDemoSwift/Podfile.lock b/HakawaiDemoSwift/Podfile.lock new file mode 100755 index 0000000..6654fef --- /dev/null +++ b/HakawaiDemoSwift/Podfile.lock @@ -0,0 +1,17 @@ +PODS: + - Hakawai (5.1.4): + - Hakawai/Core (= 5.1.4) + - Hakawai/Mentions (= 5.1.4) + - Hakawai/Core (5.1.4) + - Hakawai/Mentions (5.1.4): + - Hakawai/Core + +DEPENDENCIES: + - Hakawai + +SPEC CHECKSUMS: + Hakawai: b525498fdef6485445127d615a65cbee5f0cfea2 + +PODFILE CHECKSUM: 8afb544880f2856932d1fd9950c29e8e1627c5ba + +COCOAPODS: 1.3.1