diff --git a/TouchInApp/TouchInApp.xcodeproj/project.pbxproj b/TouchInApp/TouchInApp.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f4c08b6 --- /dev/null +++ b/TouchInApp/TouchInApp.xcodeproj/project.pbxproj @@ -0,0 +1,466 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 120377511F16466E00B02B50 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120377501F16466E00B02B50 /* AppDelegate.swift */; }; + 120377531F16466E00B02B50 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120377521F16466E00B02B50 /* ViewController.swift */; }; + 120377561F16466E00B02B50 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 120377541F16466E00B02B50 /* Main.storyboard */; }; + 120377581F16466E00B02B50 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 120377571F16466E00B02B50 /* Assets.xcassets */; }; + 1203775B1F16466E00B02B50 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 120377591F16466E00B02B50 /* LaunchScreen.storyboard */; }; + 120377691F1646FE00B02B50 /* CallDirectoryHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120377681F1646FE00B02B50 /* CallDirectoryHandler.swift */; }; + 1203776D1F1646FE00B02B50 /* TouchInCallExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 120377661F1646FE00B02B50 /* TouchInCallExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 120377731F16475400B02B50 /* LineReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120377721F16475400B02B50 /* LineReader.swift */; }; + 120377761F16481400B02B50 /* LineReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120377721F16475400B02B50 /* LineReader.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 1203776B1F1646FE00B02B50 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 120377451F16466E00B02B50 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 120377651F1646FE00B02B50; + remoteInfo = TouchInCallExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 120377711F1646FE00B02B50 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 1203776D1F1646FE00B02B50 /* TouchInCallExtension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1203774D1F16466E00B02B50 /* TouchInApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TouchInApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 120377501F16466E00B02B50 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 120377521F16466E00B02B50 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 120377551F16466E00B02B50 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 120377571F16466E00B02B50 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 1203775A1F16466E00B02B50 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 1203775C1F16466E00B02B50 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 120377661F1646FE00B02B50 /* TouchInCallExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = TouchInCallExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 120377681F1646FE00B02B50 /* CallDirectoryHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallDirectoryHandler.swift; sourceTree = ""; }; + 1203776A1F1646FE00B02B50 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 120377721F16475400B02B50 /* LineReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LineReader.swift; sourceTree = ""; }; + 120377741F1647B200B02B50 /* TouchInCallExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TouchInCallExtension.entitlements; sourceTree = ""; }; + 120377751F1647F500B02B50 /* TouchInApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TouchInApp.entitlements; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1203774A1F16466E00B02B50 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 120377631F1646FE00B02B50 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 120377441F16466E00B02B50 = { + isa = PBXGroup; + children = ( + 1203774F1F16466E00B02B50 /* TouchInApp */, + 120377671F1646FE00B02B50 /* TouchInCallExtension */, + 1203774E1F16466E00B02B50 /* Products */, + ); + sourceTree = ""; + }; + 1203774E1F16466E00B02B50 /* Products */ = { + isa = PBXGroup; + children = ( + 1203774D1F16466E00B02B50 /* TouchInApp.app */, + 120377661F1646FE00B02B50 /* TouchInCallExtension.appex */, + ); + name = Products; + sourceTree = ""; + }; + 1203774F1F16466E00B02B50 /* TouchInApp */ = { + isa = PBXGroup; + children = ( + 120377751F1647F500B02B50 /* TouchInApp.entitlements */, + 120377501F16466E00B02B50 /* AppDelegate.swift */, + 120377521F16466E00B02B50 /* ViewController.swift */, + 120377541F16466E00B02B50 /* Main.storyboard */, + 120377571F16466E00B02B50 /* Assets.xcassets */, + 120377591F16466E00B02B50 /* LaunchScreen.storyboard */, + 1203775C1F16466E00B02B50 /* Info.plist */, + 120377721F16475400B02B50 /* LineReader.swift */, + ); + path = TouchInApp; + sourceTree = ""; + }; + 120377671F1646FE00B02B50 /* TouchInCallExtension */ = { + isa = PBXGroup; + children = ( + 120377741F1647B200B02B50 /* TouchInCallExtension.entitlements */, + 120377681F1646FE00B02B50 /* CallDirectoryHandler.swift */, + 1203776A1F1646FE00B02B50 /* Info.plist */, + ); + path = TouchInCallExtension; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1203774C1F16466E00B02B50 /* TouchInApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1203775F1F16466E00B02B50 /* Build configuration list for PBXNativeTarget "TouchInApp" */; + buildPhases = ( + 120377491F16466E00B02B50 /* Sources */, + 1203774A1F16466E00B02B50 /* Frameworks */, + 1203774B1F16466E00B02B50 /* Resources */, + 120377711F1646FE00B02B50 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 1203776C1F1646FE00B02B50 /* PBXTargetDependency */, + ); + name = TouchInApp; + productName = TouchInApp; + productReference = 1203774D1F16466E00B02B50 /* TouchInApp.app */; + productType = "com.apple.product-type.application"; + }; + 120377651F1646FE00B02B50 /* TouchInCallExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1203776E1F1646FE00B02B50 /* Build configuration list for PBXNativeTarget "TouchInCallExtension" */; + buildPhases = ( + 120377621F1646FE00B02B50 /* Sources */, + 120377631F1646FE00B02B50 /* Frameworks */, + 120377641F1646FE00B02B50 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TouchInCallExtension; + productName = TouchInCallExtension; + productReference = 120377661F1646FE00B02B50 /* TouchInCallExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 120377451F16466E00B02B50 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = touchin; + TargetAttributes = { + 1203774C1F16466E00B02B50 = { + CreatedOnToolsVersion = 8.3; + DevelopmentTeam = D4HA43V467; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.ApplicationGroups.iOS = { + enabled = 1; + }; + }; + }; + 120377651F1646FE00B02B50 = { + CreatedOnToolsVersion = 8.3; + DevelopmentTeam = D4HA43V467; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.ApplicationGroups.iOS = { + enabled = 1; + }; + }; + }; + }; + }; + buildConfigurationList = 120377481F16466E00B02B50 /* Build configuration list for PBXProject "TouchInApp" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 120377441F16466E00B02B50; + productRefGroup = 1203774E1F16466E00B02B50 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1203774C1F16466E00B02B50 /* TouchInApp */, + 120377651F1646FE00B02B50 /* TouchInCallExtension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1203774B1F16466E00B02B50 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1203775B1F16466E00B02B50 /* LaunchScreen.storyboard in Resources */, + 120377581F16466E00B02B50 /* Assets.xcassets in Resources */, + 120377561F16466E00B02B50 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 120377641F1646FE00B02B50 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 120377491F16466E00B02B50 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 120377531F16466E00B02B50 /* ViewController.swift in Sources */, + 120377731F16475400B02B50 /* LineReader.swift in Sources */, + 120377511F16466E00B02B50 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 120377621F1646FE00B02B50 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 120377761F16481400B02B50 /* LineReader.swift in Sources */, + 120377691F1646FE00B02B50 /* CallDirectoryHandler.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 1203776C1F1646FE00B02B50 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 120377651F1646FE00B02B50 /* TouchInCallExtension */; + targetProxy = 1203776B1F1646FE00B02B50 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 120377541F16466E00B02B50 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 120377551F16466E00B02B50 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 120377591F16466E00B02B50 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 1203775A1F16466E00B02B50 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 1203775D1F16466E00B02B50 /* 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++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_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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + 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; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 1203775E1F16466E00B02B50 /* 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++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_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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "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 = 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; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 120377601F16466E00B02B50 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = TouchInApp/TouchInApp.entitlements; + DEVELOPMENT_TEAM = D4HA43V467; + INFOPLIST_FILE = TouchInApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ru.touchin.TouchInApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 120377611F16466E00B02B50 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = TouchInApp/TouchInApp.entitlements; + DEVELOPMENT_TEAM = D4HA43V467; + INFOPLIST_FILE = TouchInApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ru.touchin.TouchInApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 1203776F1F1646FE00B02B50 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CODE_SIGN_ENTITLEMENTS = TouchInCallExtension/TouchInCallExtension.entitlements; + DEVELOPMENT_TEAM = D4HA43V467; + INFOPLIST_FILE = TouchInCallExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ru.touchin.TouchInApp.TouchInCallExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 120377701F1646FE00B02B50 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CODE_SIGN_ENTITLEMENTS = TouchInCallExtension/TouchInCallExtension.entitlements; + DEVELOPMENT_TEAM = D4HA43V467; + INFOPLIST_FILE = TouchInCallExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = ru.touchin.TouchInApp.TouchInCallExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 120377481F16466E00B02B50 /* Build configuration list for PBXProject "TouchInApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1203775D1F16466E00B02B50 /* Debug */, + 1203775E1F16466E00B02B50 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1203775F1F16466E00B02B50 /* Build configuration list for PBXNativeTarget "TouchInApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 120377601F16466E00B02B50 /* Debug */, + 120377611F16466E00B02B50 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 1203776E1F1646FE00B02B50 /* Build configuration list for PBXNativeTarget "TouchInCallExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1203776F1F1646FE00B02B50 /* Debug */, + 120377701F1646FE00B02B50 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 120377451F16466E00B02B50 /* Project object */; +} diff --git a/TouchInApp/TouchInApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/TouchInApp/TouchInApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..76c3fa4 --- /dev/null +++ b/TouchInApp/TouchInApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TouchInApp/TouchInApp/AppDelegate.swift b/TouchInApp/TouchInApp/AppDelegate.swift new file mode 100644 index 0000000..eda0128 --- /dev/null +++ b/TouchInApp/TouchInApp/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + return true + } + +} + diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..60a0f49 --- /dev/null +++ b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,56 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..e3020b4 Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..d3565b8 Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..4578f48 Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..9960803 Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..b46256c Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..a5c8786 Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..a5c8786 Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..fead2d6 Binary files /dev/null and b/TouchInApp/TouchInApp/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/TouchInApp/TouchInApp/Base.lproj/LaunchScreen.storyboard b/TouchInApp/TouchInApp/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ b/TouchInApp/TouchInApp/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TouchInApp/TouchInApp/Base.lproj/Main.storyboard b/TouchInApp/TouchInApp/Base.lproj/Main.storyboard new file mode 100644 index 0000000..7d874db --- /dev/null +++ b/TouchInApp/TouchInApp/Base.lproj/Main.storyboard @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TouchInApp/TouchInApp/Info.plist b/TouchInApp/TouchInApp/Info.plist new file mode 100644 index 0000000..11127d1 --- /dev/null +++ b/TouchInApp/TouchInApp/Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + Touch In App + 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 + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/TouchInApp/TouchInApp/LineReader.swift b/TouchInApp/TouchInApp/LineReader.swift new file mode 100644 index 0000000..0dc3b42 --- /dev/null +++ b/TouchInApp/TouchInApp/LineReader.swift @@ -0,0 +1,35 @@ +import Foundation + +class LineReader { + let path: String + + fileprivate let file: UnsafeMutablePointer! + + init?(path: String) { + self.path = path + + file = fopen(path, "r") + + guard file != nil else { return nil } + + } + + var nextLine: String? { + var line:UnsafeMutablePointer? = nil + var linecap:Int = 0 + defer { free(line) } + return getline(&line, &linecap, file) > 0 ? String(cString: line!) : nil + } + + deinit { + fclose(file) + } +} + +extension LineReader: Sequence { + func makeIterator() -> AnyIterator { + return AnyIterator { + return self.nextLine + } + } +} diff --git a/TouchInApp/TouchInApp/TouchInApp.entitlements b/TouchInApp/TouchInApp/TouchInApp.entitlements new file mode 100644 index 0000000..e5ab2fc --- /dev/null +++ b/TouchInApp/TouchInApp/TouchInApp.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.ru.touchin.TouchInApp + + + diff --git a/TouchInApp/TouchInApp/ViewController.swift b/TouchInApp/TouchInApp/ViewController.swift new file mode 100644 index 0000000..0e054c8 --- /dev/null +++ b/TouchInApp/TouchInApp/ViewController.swift @@ -0,0 +1,37 @@ +import UIKit +import CallKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } + + @IBAction func addContacts(_ sender: Any) { + let numbers = ["79214203692", + "79640982354", + "79982434663"] + + let titles = ["Иванов Петр Петрович", + "Сергеев Иван Николаевич", + "Николаев Андрей Михайлович"] + + writeFileForCallDirectory(numbers: numbers, titles: titles) + } + + fileprivate func writeFileForCallDirectory(numbers: [String], titles: [String]) { + guard let fileUrl = FileManager.default + .containerURL(forSecurityApplicationGroupIdentifier: "group.ru.touchin.TouchInApp")? + .appendingPathComponent("contacts") else { return } + + var string = "" + for (number, title) in zip(numbers, titles) { + string += "\(number),\(title)\n" + } + + try? string.write(to: fileUrl, atomically: true, encoding: .utf8) + CXCallDirectoryManager.sharedInstance.reloadExtension(withIdentifier: "ru.touchin.TouchInApp.TouchInCallExtension") + } + +} + diff --git a/TouchInApp/TouchInCallExtension/CallDirectoryHandler.swift b/TouchInApp/TouchInCallExtension/CallDirectoryHandler.swift new file mode 100644 index 0000000..6ddc456 --- /dev/null +++ b/TouchInApp/TouchInCallExtension/CallDirectoryHandler.swift @@ -0,0 +1,79 @@ +import Foundation +import CallKit + +class CallDirectoryHandler: CXCallDirectoryProvider { + + override func beginRequest(with context: CXCallDirectoryExtensionContext) { + context.delegate = self + + do { + try addBlockingPhoneNumbers(to: context) + } catch { + NSLog("Unable to add blocking phone numbers") + let error = NSError(domain: "CallDirectoryHandler", code: 1, userInfo: nil) + context.cancelRequest(withError: error) + return + } + + do { + try addIdentificationPhoneNumbers(to: context) + } catch { + NSLog("Unable to add identification phone numbers") + let error = NSError(domain: "CallDirectoryHandler", code: 2, userInfo: nil) + context.cancelRequest(withError: error) + return + } + + context.completeRequest() + } + + private func addBlockingPhoneNumbers(to context: CXCallDirectoryExtensionContext) throws { + // Retrieve phone numbers to block from data store. For optimal performance and memory usage when there are many phone numbers, + // consider only loading a subset of numbers at a given time and using autorelease pool(s) to release objects allocated during each batch of numbers which are loaded. + // + // Numbers must be provided in numerically ascending order. + let phoneNumbers: [CXCallDirectoryPhoneNumber] = [ 14085555555, 18005555555 ] + + for phoneNumber in phoneNumbers { + context.addBlockingEntry(withNextSequentialPhoneNumber: phoneNumber) + } + } + + private func addIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) throws { + guard let fileUrl = FileManager.default + .containerURL(forSecurityApplicationGroupIdentifier: "group.ru.touchin.TouchInApp")? + .appendingPathComponent("contacts") else { return } + + guard let reader = LineReader(path: fileUrl.path) else { return } + + for line in reader { + autoreleasepool { + // считываем строку и удаляем перевод строки в конце + let line = line.trimmingCharacters(in: .whitespacesAndNewlines) + + // отделяем номер от имени + var components = line.components(separatedBy: ",") + + // приводим номер к Int64 + guard let phone = Int64(components[0]) else { return } + let name = components[1] + + context.addIdentificationEntry(withNextSequentialPhoneNumber: phone, label: name) + } + } + } + +} + +extension CallDirectoryHandler: CXCallDirectoryExtensionContextDelegate { + + func requestFailed(for extensionContext: CXCallDirectoryExtensionContext, withError error: Error) { + // An error occurred while adding blocking or identification entries, check the NSError for details. + // For Call Directory error codes, see the CXErrorCodeCallDirectoryManagerError enum in . + // + // This may be used to store the error details in a location accessible by the extension's containing app, so that the + // app may be notified about errors which occured while loading data even if the request to load data was initiated by + // the user in Settings instead of via the app itself. + } + +} diff --git a/TouchInApp/TouchInCallExtension/Info.plist b/TouchInApp/TouchInCallExtension/Info.plist new file mode 100644 index 0000000..7aeca1c --- /dev/null +++ b/TouchInApp/TouchInCallExtension/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + TouchInCallExtension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionPointIdentifier + com.apple.callkit.call-directory + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).CallDirectoryHandler + + + diff --git a/TouchInApp/TouchInCallExtension/TouchInCallExtension.entitlements b/TouchInApp/TouchInCallExtension/TouchInCallExtension.entitlements new file mode 100644 index 0000000..e5ab2fc --- /dev/null +++ b/TouchInApp/TouchInCallExtension/TouchInCallExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.ru.touchin.TouchInApp + + +