From e8957f7832b7141dcc80e56c2d41c4c29f08cd7a Mon Sep 17 00:00:00 2001 From: Sergey Pugach Date: Sat, 30 May 2020 14:54:15 +0300 Subject: [PATCH] Added sample project and return Keyboard from the KeyboardObservingView --- .DS_Store | Bin 0 -> 8196 bytes Example/Example.xcodeproj/project.pbxproj | 349 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Example/Example/AppDelegate.swift | 37 ++ .../AppIcon.appiconset/Contents.json | 98 +++++ Example/Example/Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ Example/Example/ContentView.swift | 21 ++ Example/Example/Info.plist | 60 +++ .../Preview Assets.xcassets/Contents.json | 6 + Example/Example/SceneDelegate.swift | 64 ++++ Sources/.DS_Store | Bin 0 -> 8196 bytes Sources/KeyboardObserving/.DS_Store | Bin 0 -> 6148 bytes .../KeyboardObservingView.swift | 4 +- Tests/.DS_Store | Bin 0 -> 6148 bytes 16 files changed, 683 insertions(+), 2 deletions(-) create mode 100644 .DS_Store create mode 100644 Example/Example.xcodeproj/project.pbxproj create mode 100644 Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Example/Example/AppDelegate.swift create mode 100644 Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/Example/Assets.xcassets/Contents.json create mode 100644 Example/Example/Base.lproj/LaunchScreen.storyboard create mode 100644 Example/Example/ContentView.swift create mode 100644 Example/Example/Info.plist create mode 100644 Example/Example/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Example/Example/SceneDelegate.swift create mode 100644 Sources/.DS_Store create mode 100644 Sources/KeyboardObserving/.DS_Store create mode 100644 Tests/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9b11cd0ec7efc608bec0b2d3ea610b96ce11ebc5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AMiuVVMz#H+P1s!g7c>&YRWYy^@?q3>Ll4wNhPJE+DdUYopX8$@#=)Zf%xY z!g3+;mRnn;Ba#g4d*fy?TqV(V_K!Ju5tiXHd;p&i_r8Q5;3xP6{v_UsSb}B5x(W>A zHoOa~aSztuKD-B;iGhdkFm_=#9>rtC!Z;4%5RTv|rclQ-IEjYG!3@sg96p2(<0Hhx zC-7N(j@bADvGF1<=Wwql%Q`Oc(rWI_#L|{&TN7kqj4gmTJ4wI|E{Zv3Ygy*;!OL0v z-*xNz|FwL@VC(>a0D*rQ0nG1=b+*$W+20hoYOJfE#`X2j_oq{(CgM?TWtvRQ3l7 literal 0 HcmV?d00001 diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ae5c49e --- /dev/null +++ b/Example/Example.xcodeproj/project.pbxproj @@ -0,0 +1,349 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + BFCF3C6D24827FA300A16E13 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCF3C6C24827FA300A16E13 /* AppDelegate.swift */; }; + BFCF3C6F24827FA300A16E13 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCF3C6E24827FA300A16E13 /* SceneDelegate.swift */; }; + BFCF3C7124827FA300A16E13 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCF3C7024827FA300A16E13 /* ContentView.swift */; }; + BFCF3C7324827FA400A16E13 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BFCF3C7224827FA400A16E13 /* Assets.xcassets */; }; + BFCF3C7624827FA400A16E13 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BFCF3C7524827FA400A16E13 /* Preview Assets.xcassets */; }; + BFCF3C7924827FA400A16E13 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFCF3C7724827FA400A16E13 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + BFCF3C6924827FA300A16E13 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BFCF3C6C24827FA300A16E13 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + BFCF3C6E24827FA300A16E13 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + BFCF3C7024827FA300A16E13 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + BFCF3C7224827FA400A16E13 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + BFCF3C7524827FA400A16E13 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + BFCF3C7824827FA400A16E13 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + BFCF3C7A24827FA400A16E13 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BFCF3C9D2482806300A16E13 /* KeyboardObserving */ = {isa = PBXFileReference; lastKnownFileType = folder; name = KeyboardObserving; path = ..; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + BFCF3C6624827FA300A16E13 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + BFCF3C6024827FA300A16E13 = { + isa = PBXGroup; + children = ( + BFCF3C9D2482806300A16E13 /* KeyboardObserving */, + BFCF3C6B24827FA300A16E13 /* Example */, + BFCF3C6A24827FA300A16E13 /* Products */, + ); + sourceTree = ""; + }; + BFCF3C6A24827FA300A16E13 /* Products */ = { + isa = PBXGroup; + children = ( + BFCF3C6924827FA300A16E13 /* Example.app */, + ); + name = Products; + sourceTree = ""; + }; + BFCF3C6B24827FA300A16E13 /* Example */ = { + isa = PBXGroup; + children = ( + BFCF3C6C24827FA300A16E13 /* AppDelegate.swift */, + BFCF3C6E24827FA300A16E13 /* SceneDelegate.swift */, + BFCF3C7024827FA300A16E13 /* ContentView.swift */, + BFCF3C7224827FA400A16E13 /* Assets.xcassets */, + BFCF3C7724827FA400A16E13 /* LaunchScreen.storyboard */, + BFCF3C7A24827FA400A16E13 /* Info.plist */, + BFCF3C7424827FA400A16E13 /* Preview Content */, + ); + path = Example; + sourceTree = ""; + }; + BFCF3C7424827FA400A16E13 /* Preview Content */ = { + isa = PBXGroup; + children = ( + BFCF3C7524827FA400A16E13 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + BFCF3C6824827FA300A16E13 /* Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = BFCF3C7D24827FA400A16E13 /* Build configuration list for PBXNativeTarget "Example" */; + buildPhases = ( + BFCF3C6524827FA300A16E13 /* Sources */, + BFCF3C6624827FA300A16E13 /* Frameworks */, + BFCF3C6724827FA300A16E13 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Example; + productName = Example; + productReference = BFCF3C6924827FA300A16E13 /* Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BFCF3C6124827FA300A16E13 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1140; + LastUpgradeCheck = 1140; + ORGANIZATIONNAME = "Sergey Pugach"; + TargetAttributes = { + BFCF3C6824827FA300A16E13 = { + CreatedOnToolsVersion = 11.4.1; + }; + }; + }; + buildConfigurationList = BFCF3C6424827FA300A16E13 /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = BFCF3C6024827FA300A16E13; + productRefGroup = BFCF3C6A24827FA300A16E13 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + BFCF3C6824827FA300A16E13 /* Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + BFCF3C6724827FA300A16E13 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BFCF3C7924827FA400A16E13 /* LaunchScreen.storyboard in Resources */, + BFCF3C7624827FA400A16E13 /* Preview Assets.xcassets in Resources */, + BFCF3C7324827FA400A16E13 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + BFCF3C6524827FA300A16E13 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BFCF3C6D24827FA300A16E13 /* AppDelegate.swift in Sources */, + BFCF3C6F24827FA300A16E13 /* SceneDelegate.swift in Sources */, + BFCF3C7124827FA300A16E13 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + BFCF3C7724827FA400A16E13 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BFCF3C7824827FA400A16E13 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + BFCF3C7B24827FA400A16E13 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + 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 = 13.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + BFCF3C7C24827FA400A16E13 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + 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 = 13.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + BFCF3C7E24827FA400A16E13 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; + DEVELOPMENT_TEAM = 955A97TRSL; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.sergey.pugach.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + BFCF3C7F24827FA400A16E13 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; + DEVELOPMENT_TEAM = 955A97TRSL; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.sergey.pugach.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BFCF3C6424827FA300A16E13 /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BFCF3C7B24827FA400A16E13 /* Debug */, + BFCF3C7C24827FA400A16E13 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BFCF3C7D24827FA400A16E13 /* Build configuration list for PBXNativeTarget "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BFCF3C7E24827FA400A16E13 /* Debug */, + BFCF3C7F24827FA400A16E13 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BFCF3C6124827FA300A16E13 /* Project object */; +} diff --git a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6d2a51b --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift new file mode 100644 index 0000000..2f7f259 --- /dev/null +++ b/Example/Example/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// Example +// +// Created by Sergey Pugach on 5/30/20. +// Copyright © 2020 Sergey Pugach. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example/Assets.xcassets/Contents.json b/Example/Example/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/Example/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example/Base.lproj/LaunchScreen.storyboard b/Example/Example/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/Example/Example/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/ContentView.swift b/Example/Example/ContentView.swift new file mode 100644 index 0000000..aa40ad0 --- /dev/null +++ b/Example/Example/ContentView.swift @@ -0,0 +1,21 @@ +// +// ContentView.swift +// Example +// +// Created by Sergey Pugach on 5/30/20. +// Copyright © 2020 Sergey Pugach. All rights reserved. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, World!") + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist new file mode 100644 index 0000000..9742bf0 --- /dev/null +++ b/Example/Example/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/Example/Preview Content/Preview Assets.xcassets/Contents.json b/Example/Example/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/Example/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example/SceneDelegate.swift b/Example/Example/SceneDelegate.swift new file mode 100644 index 0000000..c735a21 --- /dev/null +++ b/Example/Example/SceneDelegate.swift @@ -0,0 +1,64 @@ +// +// SceneDelegate.swift +// Example +// +// Created by Sergey Pugach on 5/30/20. +// Copyright © 2020 Sergey Pugach. All rights reserved. +// + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Create the SwiftUI view that provides the window contents. + let contentView = ContentView() + + // Use a UIHostingController as window root view controller. + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + self.window = window + window.makeKeyAndVisible() + } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/Sources/.DS_Store b/Sources/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..84917f15c9b2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=a{ounyR)l*0I{wGwEzGB literal 0 HcmV?d00001 diff --git a/Sources/KeyboardObserving/.DS_Store b/Sources/KeyboardObserving/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..29cb28e58164b4ad5c09a92beaf8cc26ac44da86 GIT binary patch literal 6148 zcmeHK%SyyR5UkccEa+j69_JVQgJD^}z#kCJ3c^Z2QLj1qU4EL?4}=heT)ap%bk|Hz z*M!s|od#h0x8WMt0oc+V@#$e{e(t`ov&tBe&O4qlV!#s~>Fdn7mw0FW5g#-D5ii5* z!|8q;PwTEyl@yQyQa}nw0V%LT0q?!E?M0%Z6p#W^;70-fJ~X;xFPswN)4>oU0CB@~ z7}qgN5Su56y>LoohGt16Ce>=hu%t8Js;(DKiAjgm@L~02s|m&8>Ab&1IjkotN&zV_ zSKvIiJMaHD^k3%xIY~PyAO-%F0=7Ba9`<~t>aB~H^IqHNcXY4$qPuY&6ozQW#AwId gcsss|qO5Da=6Nri5`)fs(24pPa9w0l;I9?<2JPz>ZU6uP literal 0 HcmV?d00001 diff --git a/Sources/KeyboardObserving/KeyboardObservingView.swift b/Sources/KeyboardObserving/KeyboardObservingView.swift index a9cc8f4..ca3cb06 100644 --- a/Sources/KeyboardObserving/KeyboardObservingView.swift +++ b/Sources/KeyboardObserving/KeyboardObservingView.swift @@ -16,8 +16,8 @@ public struct KeyboardObservingView: View { let content: Content - public init(@ViewBuilder builder: () -> Content) { - self.content = builder() + public init(@ViewBuilder builder: (Keyboard) -> Content) { + self.content = builder(keyboard) } public var body: some View { diff --git a/Tests/.DS_Store b/Tests/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5a0c4b83829bb926c198b9e33fe90899a4d7c0e3 GIT binary patch literal 6148 zcmeHKyGjH>5UkM)4oof*!}$gOU^vdmz(7Ah&lM347j9KB+sxm#`k~yhCuRmx4c)cV z(>23Zu)PhSEML2GU;$uGH^hg9soB2y#Evpkh;*LO;|^PNxWal;eK=vUy>0D`jt;yqxvg uO24Il8Ed_q!CNuWTQL{biqCfHsy%bRC60kkXWr>V{Ro&YGAZyE3VZ?zJQ;xi literal 0 HcmV?d00001