├── VPAutoComplete ├── VPAutoComplete.xcworkspace │ ├── xcuserdata │ │ └── vivekpadaya.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── UserInterfaceState.xcuserstate │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Pods │ ├── Target Support Files │ │ ├── Pods-VPAutoComplete │ │ │ ├── Pods-VPAutoComplete.modulemap │ │ │ ├── Pods-VPAutoComplete-dummy.m │ │ │ ├── Pods-VPAutoComplete-umbrella.h │ │ │ ├── Pods-VPAutoComplete.debug.xcconfig │ │ │ ├── Pods-VPAutoComplete.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-VPAutoComplete-acknowledgements.markdown │ │ │ ├── Pods-VPAutoComplete-acknowledgements.plist │ │ │ ├── Pods-VPAutoComplete-resources.sh │ │ │ └── Pods-VPAutoComplete-frameworks.sh │ │ ├── IQKeyboardManagerSwift │ │ │ ├── IQKeyboardManagerSwift.modulemap │ │ │ ├── IQKeyboardManagerSwift-dummy.m │ │ │ ├── IQKeyboardManagerSwift-prefix.pch │ │ │ ├── IQKeyboardManagerSwift-umbrella.h │ │ │ ├── IQKeyboardManagerSwift.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-VPAutoCompleteTests │ │ │ ├── Pods-VPAutoCompleteTests-acknowledgements.markdown │ │ │ ├── Pods-VPAutoCompleteTests.modulemap │ │ │ ├── Pods-VPAutoCompleteTests-dummy.m │ │ │ ├── Pods-VPAutoCompleteTests-umbrella.h │ │ │ ├── Pods-VPAutoCompleteTests.debug.xcconfig │ │ │ ├── Pods-VPAutoCompleteTests.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-VPAutoCompleteTests-acknowledgements.plist │ │ │ ├── Pods-VPAutoCompleteTests-resources.sh │ │ │ └── Pods-VPAutoCompleteTests-frameworks.sh │ │ └── Pods-VPAutoCompleteUITests │ │ │ ├── Pods-VPAutoCompleteUITests-acknowledgements.markdown │ │ │ ├── Pods-VPAutoCompleteUITests.modulemap │ │ │ ├── Pods-VPAutoCompleteUITests-dummy.m │ │ │ ├── Pods-VPAutoCompleteUITests-umbrella.h │ │ │ ├── Pods-VPAutoCompleteUITests.debug.xcconfig │ │ │ ├── Pods-VPAutoCompleteUITests.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-VPAutoCompleteUITests-acknowledgements.plist │ │ │ ├── Pods-VPAutoCompleteUITests-resources.sh │ │ │ └── Pods-VPAutoCompleteUITests-frameworks.sh │ ├── IQKeyboardManagerSwift │ │ ├── IQKeyboardManagerSwift │ │ │ ├── Resources │ │ │ │ └── IQKeyboardManager.bundle │ │ │ │ │ ├── IQButtonBarArrowDown@2x.png │ │ │ │ │ ├── IQButtonBarArrowDown@3x.png │ │ │ │ │ ├── IQButtonBarArrowLeft@2x.png │ │ │ │ │ ├── IQButtonBarArrowLeft@3x.png │ │ │ │ │ ├── IQButtonBarArrowUp@2x.png │ │ │ │ │ ├── IQButtonBarArrowUp@3x.png │ │ │ │ │ ├── IQButtonBarArrowRight@2x.png │ │ │ │ │ └── IQButtonBarArrowRight@3x.png │ │ │ ├── Constants │ │ │ │ ├── IQKeyboardManagerConstantsInternal.swift │ │ │ │ └── IQKeyboardManagerConstants.swift │ │ │ ├── IQToolbar │ │ │ │ ├── IQPreviousNextView.swift │ │ │ │ ├── IQInvocation.swift │ │ │ │ ├── IQBarButtonItem.swift │ │ │ │ ├── IQTitleBarButtonItem.swift │ │ │ │ └── IQToolbar.swift │ │ │ ├── Categories │ │ │ │ ├── IQUIViewController+Additions.swift │ │ │ │ ├── IQNSArray+Sort.swift │ │ │ │ ├── IQUIScrollView+Additions.swift │ │ │ │ ├── IQUITextFieldView+Additions.swift │ │ │ │ └── IQUIView+Hierarchy.swift │ │ │ └── IQTextView │ │ │ │ └── IQTextView.swift │ │ ├── LICENSE.md │ │ └── README.md │ ├── Manifest.lock │ └── Pods.xcodeproj │ │ └── xcuserdata │ │ └── vivekpadaya.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ ├── IQKeyboardManagerSwift.xcscheme │ │ ├── Pods-VPAutoComplete.xcscheme │ │ ├── Pods-VPAutoCompleteTests.xcscheme │ │ └── Pods-VPAutoCompleteUITests.xcscheme ├── VPAutoComplete.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcuserdata │ │ │ ├── vivek.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── vivekpadaya.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── vivek.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── vivekpadaya.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── Podfile.lock ├── Podfile ├── VPAutoComplete-Source │ ├── VPAutoCompleteViewCell.swift │ ├── VPAutoCompleteViewCell.xib │ └── VPAutoComplete.swift └── VPAutoComplete │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── IQKeyboardManagerSwift │ └── IQToolbar │ │ └── IQInvocation.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── ExampleTableViewController.swift │ ├── AppDelegate.swift │ └── ExampleViewController.swift ├── LICENSE └── README.md /VPAutoComplete/VPAutoComplete.xcworkspace/xcuserdata/vivekpadaya.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_VPAutoComplete { 2 | umbrella header "Pods-VPAutoComplete-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VPAutoComplete : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VPAutoComplete 5 | @end 6 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift.modulemap: -------------------------------------------------------------------------------- 1 | framework module IQKeyboardManagerSwift { 2 | umbrella header "IQKeyboardManagerSwift-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_IQKeyboardManagerSwift : NSObject 3 | @end 4 | @implementation PodsDummy_IQKeyboardManagerSwift 5 | @end 6 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_VPAutoCompleteTests { 2 | umbrella header "Pods-VPAutoCompleteTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VPAutoCompleteTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VPAutoCompleteTests 5 | @end 6 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_VPAutoCompleteUITests { 2 | umbrella header "Pods-VPAutoCompleteUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VPAutoCompleteUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VPAutoCompleteUITests 5 | @end 6 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcworkspace/xcuserdata/vivekpadaya.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/VPAutoComplete.xcworkspace/xcuserdata/vivekpadaya.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcodeproj/project.xcworkspace/xcuserdata/vivek.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/VPAutoComplete.xcodeproj/project.xcworkspace/xcuserdata/vivek.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcodeproj/project.xcworkspace/xcuserdata/vivekpadaya.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/VPAutoComplete.xcodeproj/project.xcworkspace/xcuserdata/vivekpadaya.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@2x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@3x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@2x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@3x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@2x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@3x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@2x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insideApple/VPAutoComplete/HEAD/VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@3x.png -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /VPAutoComplete/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - IQKeyboardManagerSwift (6.2.0) 3 | 4 | DEPENDENCIES: 5 | - IQKeyboardManagerSwift 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - IQKeyboardManagerSwift 10 | 11 | SPEC CHECKSUMS: 12 | IQKeyboardManagerSwift: b07ccf9d8cafe993dcd6cb794eb4ba34611a0c4e 13 | 14 | PODFILE CHECKSUM: 38aa594d22c3303ed81bcabeb74114d61d1834bb 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - IQKeyboardManagerSwift (6.2.0) 3 | 4 | DEPENDENCIES: 5 | - IQKeyboardManagerSwift 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - IQKeyboardManagerSwift 10 | 11 | SPEC CHECKSUMS: 12 | IQKeyboardManagerSwift: b07ccf9d8cafe993dcd6cb794eb4ba34611a0c4e 13 | 14 | PODFILE CHECKSUM: 38aa594d22c3303ed81bcabeb74114d61d1834bb 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_VPAutoCompleteVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_VPAutoCompleteVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcodeproj/xcuserdata/vivek.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | VPAutoComplete.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double IQKeyboardManagerSwiftVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char IQKeyboardManagerSwiftVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_VPAutoCompleteTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_VPAutoCompleteTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_VPAutoCompleteUITestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_VPAutoCompleteUITestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete.xcodeproj/xcuserdata/vivekpadaya.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | VPAutoComplete.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 4 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /VPAutoComplete/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'VPAutoComplete' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for VPAutoComplete 9 | pod 'IQKeyboardManagerSwift' 10 | target 'VPAutoCompleteTests' do 11 | inherit! :search_paths 12 | # Pods for testing 13 | end 14 | 15 | target 'VPAutoCompleteUITests' do 16 | inherit! :search_paths 17 | # Pods for testing 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete-Source/VPAutoCompleteViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VPAutoCompleteViewCell.swift 3 | // VPAutoComplete 4 | // 5 | // Created by Vivek on 25/01/18. 6 | // Copyright © 2018 Vivek. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class VPAutoCompleteViewCell: UITableViewCell { 12 | 13 | @IBOutlet var lblTitle: UILabel! 14 | override func awakeFromNib() { 15 | super.awakeFromNib() 16 | // Initialization code 17 | } 18 | 19 | override func setSelected(_ selected: Bool, animated: Bool) { 20 | super.setSelected(selected, animated: animated) 21 | 22 | // Configure the view for the selected state 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/IQKeyboardManagerSwift/IQKeyboardManagerSwift.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/IQKeyboardManagerSwift 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "IQKeyboardManagerSwift" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "IQKeyboardManagerSwift" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/IQKeyboardManagerSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 6.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Pods.xcodeproj/xcuserdata/vivekpadaya.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | IQKeyboardManagerSwift.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | Pods-VPAutoComplete.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | Pods-VPAutoCompleteTests.xcscheme 22 | 23 | isShown 24 | 25 | orderHint 26 | 2 27 | 28 | Pods-VPAutoCompleteUITests.xcscheme 29 | 30 | isShown 31 | 32 | orderHint 33 | 3 34 | 35 | 36 | SuppressBuildableAutocreation 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Vivek Padaya 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013-2017 Iftekhar Qurashi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## IQKeyboardManagerSwift 5 | 6 | MIT License 7 | 8 | Copyright (c) 2013-2017 Iftekhar Qurashi 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQKeyboardManagerConstantsInternal.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import Foundation 26 | 27 | 28 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQPreviousNextView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQPreviousNextView.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | public class IQPreviousNextView: UIView { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/IQKeyboardManagerSwift/IQToolbar/IQInvocation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQInvocation.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import UIKit 26 | 27 | public class IQInvocation : NSObject { 28 | public weak var target: AnyObject? 29 | public var action: Selector 30 | 31 | @objc public init(_ target: AnyObject, _ action: Selector) { 32 | self.target = target 33 | self.action = action 34 | } 35 | 36 | @objc public func invoke(from: Any) { 37 | if let target = target { 38 | UIApplication.shared.sendAction(action, to: target, from: from, for: UIEvent()) 39 | } 40 | } 41 | 42 | deinit { 43 | target = nil 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQInvocation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQInvocation.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import UIKit 26 | 27 | public class IQInvocation : NSObject { 28 | public weak var target: AnyObject? 29 | public var action: Selector 30 | 31 | @objc public init(_ target: AnyObject, _ action: Selector) { 32 | self.target = target 33 | self.action = action 34 | } 35 | 36 | @objc public func invoke(from: Any) { 37 | if let target = target { 38 | UIApplication.shared.sendAction(action, to: target, from: from, for: UIEvent()) 39 | } 40 | } 41 | 42 | deinit { 43 | target = nil 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/ExampleTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleTableViewController.swift 3 | // VPAutoComplete 4 | // 5 | // Created by Vivek on 25/01/18. 6 | // Copyright © 2018 Vivek. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ExampleTableViewController: UIViewController { 12 | 13 | @IBOutlet var tableView: UITableView! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | // Do any additional setup after loading the view. 19 | self.tableView.dataSource = self 20 | self.tableView.delegate = self 21 | self.tableView.tableFooterView = UIView() 22 | } 23 | 24 | override func didReceiveMemoryWarning() { 25 | super.didReceiveMemoryWarning() 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | } 30 | extension ExampleTableViewController : UITableViewDelegate{ 31 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 32 | return 70 33 | } 34 | } 35 | 36 | extension ExampleTableViewController : UITableViewDataSource{ 37 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 38 | return 5 39 | } 40 | 41 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 42 | let cell = tableView.dequeueReusableCell(withIdentifier: "MyCell") 43 | 44 | let textField = cell?.viewWithTag(101) as! UITextField 45 | textField.placeholder = "Cell \(indexPath.row)" 46 | textField.clearButtonMode = .whileEditing 47 | 48 | let dropDown = VPAutoComplete() 49 | dropDown.dataSource = ["One", "Two", "Three","Foure"] 50 | dropDown.onTextField = textField 51 | dropDown.isSearchBig = false 52 | dropDown.show(onTableView: tableView, atIndexPath: indexPath) { (str, index) in 53 | textField.text = str 54 | } 55 | 56 | 57 | return cell! 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VPAutoComplete 2 | VPAutoComplete is Autocomplete for textField 3 | It is written in swift 4 and support `UITableView` 4 | 5 | ## Demo 6 | 7 | Project containing Example for implemented it in `ViewController` and `UITableView`. 8 | I used `IQKeyBoardManager` for working with scroll as well 9 | 10 | ![](https://i.imgur.com/1eEtDsP.png) 11 | ![](https://i.imgur.com/rKZ6o39.png) 12 | 13 | ### Requirment 14 | 15 | Xcode 9 and iOS 11.0 16 | Code is written in swift 4.2 17 | 18 | 19 | 20 | ### Example 21 | 22 | A step by step series of examples that tell you have to get a development env running 23 | 24 | For `UIViewController` 25 | 26 | ``` 27 | let dropDown = VPAutoComplete() 28 | dropDown.dataSource = ["Data 1", "Data 2", "Data 3"] 29 | dropDown.onTextField = textField // Your TextField 30 | dropDown.onView = self.view // ViewController's View 31 | // dropDownTop.showAlwaysOnTop = true //To show dropdown always on top. 32 | dropDown.show { (str, index) in 33 | print("string : \(str) and Index : \(index)") 34 | self.textField.text = str 35 | } 36 | ``` 37 | 38 | Quick Run 39 | 40 | ``` 41 | _ = VPAutoComplete.init(onTextField: textField, dataSource: ["Data 1", "Data 2", "Data 3"], onView: self.view, completionHandler: { (str, index) in 42 | print("string : \(str) and Index : \(index)") 43 | self.textField.text = str 44 | }) 45 | ``` 46 | For `UITableView` in `cellForRowAt` 47 | 48 | ``` 49 | let dropDown = VPAutoComplete() 50 | dropDown.dataSource = ["One", "Two", "Three","Foure"] 51 | dropDown.onTextField = cell.textField // Your TextField 52 | dropDown.isSearchBig = false // High Light search Text 53 | dropDown.show(onTableView: tableView, atIndexPath: indexPath) { (str, index) in 54 | cell.textField = str 55 | } 56 | 57 | ``` 58 | 59 | 60 | ## Installation 61 | 62 | Copy VPAutoComplete-Source folder in Your project and start using 63 | 64 | 65 | ## Authors 66 | * **Vivek Padaya** 67 | 68 | ## License 69 | 70 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details 71 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2013-2017 Iftekhar Qurashi 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | License 40 | MIT 41 | Title 42 | IQKeyboardManagerSwift 43 | Type 44 | PSGroupSpecifier 45 | 46 | 47 | FooterText 48 | Generated by CocoaPods - https://cocoapods.org 49 | Title 50 | 51 | Type 52 | PSGroupSpecifier 53 | 54 | 55 | StringsTable 56 | Acknowledgements 57 | Title 58 | Acknowledgements 59 | 60 | 61 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Pods.xcodeproj/xcuserdata/vivekpadaya.xcuserdatad/xcschemes/IQKeyboardManagerSwift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // VPAutoComplete 4 | // 5 | // Created by Vivek on 25/01/18. 6 | // Copyright © 2018 Vivek. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | import IQKeyboardManagerSwift 12 | 13 | 14 | @UIApplicationMain 15 | class AppDelegate: UIResponder, UIApplicationDelegate { 16 | 17 | var window: UIWindow? 18 | 19 | 20 | func application(_ application: UIApplication, 21 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool{ 22 | // Override point for customization after application launch. 23 | IQKeyboardManager.shared.enable = true 24 | 25 | return true 26 | } 27 | 28 | func applicationWillResignActive(_ application: UIApplication) { 29 | // 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. 30 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 31 | } 32 | 33 | func applicationDidEnterBackground(_ application: UIApplication) { 34 | // 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. 35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 36 | } 37 | 38 | func applicationWillEnterForeground(_ application: UIApplication) { 39 | // 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. 40 | } 41 | 42 | func applicationDidBecomeActive(_ application: UIApplication) { 43 | // 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. 44 | } 45 | 46 | func applicationWillTerminate(_ application: UIApplication) { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIViewController+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIViewController+Additions.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | 27 | private var kIQLayoutGuideConstraint = "kIQLayoutGuideConstraint" 28 | 29 | 30 | public extension UIViewController { 31 | 32 | /** 33 | To set customized distance from keyboard for textField/textView. Can't be less than zero 34 | 35 | @deprecated Due to change in core-logic of handling distance between textField and keyboard distance, this layout contraint tweak is no longer needed and things will just work out of the box regardless of constraint pinned with safeArea/layoutGuide/superview 36 | */ 37 | @available(*,deprecated, message: "Due to change in core-logic of handling distance between textField and keyboard distance, this layout contraint tweak is no longer needed and things will just work out of the box regardless of constraint pinned with safeArea/layoutGuide/superview.") 38 | @IBOutlet @objc public var IQLayoutGuideConstraint: NSLayoutConstraint? { 39 | get { 40 | 41 | return objc_getAssociatedObject(self, &kIQLayoutGuideConstraint) as? NSLayoutConstraint 42 | } 43 | 44 | set(newValue) { 45 | objc_setAssociatedObject(self, &kIQLayoutGuideConstraint, newValue,objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQNSArray+Sort.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQNSArray+Sort.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | import UIKit 26 | 27 | /** 28 | UIView.subviews sorting category. 29 | */ 30 | internal extension Array { 31 | 32 | ///-------------- 33 | /// MARK: Sorting 34 | ///-------------- 35 | 36 | /** 37 | Returns the array by sorting the UIView's by their tag property. 38 | */ 39 | internal func sortedArrayByTag() -> [Element] { 40 | 41 | return sorted(by: { (obj1 : Element, obj2 : Element) -> Bool in 42 | 43 | let view1 = obj1 as! UIView 44 | let view2 = obj2 as! UIView 45 | 46 | return (view1.tag < view2.tag) 47 | }) 48 | } 49 | 50 | /** 51 | Returns the array by sorting the UIView's by their tag property. 52 | */ 53 | internal func sortedArrayByPosition() -> [Element] { 54 | 55 | return sorted(by: { (obj1 : Element, obj2 : Element) -> Bool in 56 | 57 | let view1 = obj1 as! UIView 58 | let view2 = obj2 as! UIView 59 | 60 | let x1 = view1.frame.minX 61 | let y1 = view1.frame.minY 62 | let x2 = view2.frame.minX 63 | let y2 = view2.frame.minY 64 | 65 | if y1 != y2 { 66 | return y1 < y2 67 | } else { 68 | return x1 < x2 69 | } 70 | }) 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/ExampleViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleViewController.swift 3 | // VPAutoComplete 4 | // 5 | // Created by Vivek on 25/01/18. 6 | // Copyright © 2018 Vivek. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ExampleViewController: UIViewController { 12 | 13 | @IBOutlet var topTextField: UITextField! 14 | @IBOutlet var bottomTextField: UITextField! 15 | @IBOutlet var midTextField: UITextField! 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | // Do any additional setup after loading the view. 21 | self.topTextField.placeholder = "Top-TextField" 22 | self.midTextField.placeholder = "Mid-TextField" 23 | self.bottomTextField.placeholder = "Bottom-TextField" 24 | self.addDropDown() 25 | } 26 | 27 | func addDropDown(){ 28 | 29 | // For Top textField 30 | let dropDownTop = VPAutoComplete() 31 | dropDownTop.dataSource = ["Top-One", "Top-Two", "Top-Three"] 32 | dropDownTop.onTextField = topTextField 33 | dropDownTop.onView = self.view 34 | // dropDownTop.showAlwaysOnTop = true //To show dropdown always on top. 35 | dropDownTop.show { (str, index) in 36 | print("string : \(str) and Index : \(index)") 37 | self.topTextField.text = str 38 | } 39 | 40 | // For Mid textField 41 | let dropDownMid = VPAutoComplete() 42 | dropDownMid.dataSource = ["Mid-One", "Mid-Two", "Mid-Three"] 43 | dropDownMid.onTextField = midTextField 44 | dropDownMid.onView = self.view 45 | dropDownMid.showAlwaysOnTop = true 46 | dropDownMid.show { (str, index) in 47 | print("string : \(str) and Index : \(index)") 48 | self.midTextField.text = str 49 | } 50 | 51 | // For Bottom textField 52 | let dropDownBottom = VPAutoComplete() 53 | dropDownBottom.dataSource = ["Bottom-One", "Bottom-Two", "Bottom-Three"] 54 | dropDownBottom.onTextField = bottomTextField 55 | dropDownBottom.onView = self.view 56 | dropDownBottom.show { (str, index) in 57 | print("string : \(str) and Index : \(index)") 58 | self.bottomTextField.text = str 59 | } 60 | 61 | /******* Simple method to add DropDown 62 | _ = VPDropDown.init(onTextField: bottomTextField, dataSource: ["Bottom-one", "Bottom-two", "Bottom-three"], onView: self.view, completionHandler: { (str, index) in 63 | print("string : \(str) and Index : \(index)") 64 | self.bottomTextField.text = str 65 | }) 66 | *****/ 67 | } 68 | 69 | override func didReceiveMemoryWarning() { 70 | super.didReceiveMemoryWarning() 71 | // Dispose of any resources that can be recreated. 72 | } 73 | 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Pods.xcodeproj/xcuserdata/vivekpadaya.xcuserdatad/xcschemes/Pods-VPAutoComplete.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Pods.xcodeproj/xcuserdata/vivekpadaya.xcuserdatad/xcschemes/Pods-VPAutoCompleteTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Pods.xcodeproj/xcuserdata/vivekpadaya.xcuserdatad/xcschemes/Pods-VPAutoCompleteUITests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIScrollView+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIScrollView+Additions.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | import UIKit 26 | 27 | private var kIQShouldIgnoreScrollingAdjustment = "kIQShouldIgnoreScrollingAdjustment" 28 | private var kIQShouldRestoreScrollViewContentOffset = "kIQShouldRestoreScrollViewContentOffset" 29 | 30 | public extension UIScrollView { 31 | 32 | /** 33 | If YES, then scrollview will ignore scrolling (simply not scroll it) for adjusting textfield position. Default is NO. 34 | */ 35 | @objc public var shouldIgnoreScrollingAdjustment: Bool { 36 | get { 37 | 38 | if let aValue = objc_getAssociatedObject(self, &kIQShouldIgnoreScrollingAdjustment) as? Bool { 39 | return aValue 40 | } else { 41 | return false 42 | } 43 | } 44 | set(newValue) { 45 | objc_setAssociatedObject(self, &kIQShouldIgnoreScrollingAdjustment, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 46 | } 47 | } 48 | 49 | /** 50 | To set customized distance from keyboard for textField/textView. Can't be less than zero 51 | */ 52 | @objc public var shouldRestoreScrollViewContentOffset: Bool { 53 | get { 54 | 55 | if let aValue = objc_getAssociatedObject(self, &kIQShouldRestoreScrollViewContentOffset) as? Bool { 56 | return aValue 57 | } else { 58 | return false 59 | } 60 | } 61 | set(newValue) { 62 | objc_setAssociatedObject(self, &kIQShouldRestoreScrollViewContentOffset, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete-Source/VPAutoCompleteViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | GillSans 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUITextFieldView+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQUITextFieldView+Additions.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | import UIKit 26 | 27 | /** 28 | Uses default keyboard distance for textField. 29 | */ 30 | public let kIQUseDefaultKeyboardDistance = CGFloat.greatestFiniteMagnitude 31 | 32 | private var kIQKeyboardDistanceFromTextField = "kIQKeyboardDistanceFromTextField" 33 | //private var kIQKeyboardEnableMode = "kIQKeyboardEnableMode" 34 | private var kIQKeyboardShouldResignOnTouchOutsideMode = "kIQKeyboardShouldResignOnTouchOutsideMode" 35 | private var kIQIgnoreSwitchingByNextPrevious = "kIQIgnoreSwitchingByNextPrevious" 36 | 37 | /** 38 | UIView category for managing UITextField/UITextView 39 | */ 40 | public extension UIView { 41 | 42 | /** 43 | To set customized distance from keyboard for textField/textView. Can't be less than zero 44 | */ 45 | @objc public var keyboardDistanceFromTextField: CGFloat { 46 | get { 47 | 48 | if let aValue = objc_getAssociatedObject(self, &kIQKeyboardDistanceFromTextField) as? CGFloat { 49 | return aValue 50 | } else { 51 | return kIQUseDefaultKeyboardDistance 52 | } 53 | } 54 | set(newValue) { 55 | objc_setAssociatedObject(self, &kIQKeyboardDistanceFromTextField, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 56 | } 57 | } 58 | 59 | /** 60 | If shouldIgnoreSwitchingByNextPrevious is true then library will ignore this textField/textView while moving to other textField/textView using keyboard toolbar next previous buttons. Default is false 61 | */ 62 | @objc public var ignoreSwitchingByNextPrevious: Bool { 63 | get { 64 | 65 | if let aValue = objc_getAssociatedObject(self, &kIQIgnoreSwitchingByNextPrevious) as? Bool { 66 | return aValue 67 | } else { 68 | return false 69 | } 70 | } 71 | set(newValue) { 72 | objc_setAssociatedObject(self, &kIQIgnoreSwitchingByNextPrevious, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 73 | } 74 | } 75 | 76 | // /** 77 | // Override Enable/disable managing distance between keyboard and textField behaviour for this particular textField. 78 | // */ 79 | // @objc public var enableMode: IQEnableMode { 80 | // get { 81 | // 82 | // if let savedMode = objc_getAssociatedObject(self, &kIQKeyboardEnableMode) as? IQEnableMode { 83 | // return savedMode 84 | // } else { 85 | // return .Default 86 | // } 87 | // } 88 | // set(newValue) { 89 | // objc_setAssociatedObject(self, &kIQKeyboardEnableMode, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 90 | // } 91 | // } 92 | 93 | /** 94 | Override resigns Keyboard on touching outside of UITextField/View behaviour for this particular textField. 95 | */ 96 | @objc public var shouldResignOnTouchOutsideMode: IQEnableMode { 97 | get { 98 | 99 | if let savedMode = objc_getAssociatedObject(self, &kIQKeyboardShouldResignOnTouchOutsideMode) as? IQEnableMode { 100 | return savedMode 101 | } else { 102 | return .Default 103 | } 104 | } 105 | set(newValue) { 106 | objc_setAssociatedObject(self, &kIQKeyboardShouldResignOnTouchOutsideMode, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 107 | } 108 | } 109 | } 110 | 111 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQBarButtonItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQBarButtonItem.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import UIKit 26 | import Foundation 27 | 28 | open class IQBarButtonItem: UIBarButtonItem { 29 | 30 | private static var _classInitialize: Void = classInitialize() 31 | 32 | @objc public override init() { 33 | _ = IQBarButtonItem._classInitialize 34 | super.init() 35 | } 36 | 37 | @objc public required init?(coder aDecoder: NSCoder) { 38 | _ = IQBarButtonItem._classInitialize 39 | super.init(coder: aDecoder) 40 | } 41 | 42 | 43 | private class func classInitialize() { 44 | 45 | let appearanceProxy = self.appearance() 46 | 47 | #if swift(>=4.2) 48 | let states : [UIControl.State] 49 | #else 50 | let states : [UIControlState] 51 | #endif 52 | 53 | states = [.normal,.highlighted,.disabled,.selected,.application,.reserved] 54 | 55 | for state in states { 56 | 57 | appearanceProxy.setBackgroundImage(nil, for: state, barMetrics: .default) 58 | appearanceProxy.setBackgroundImage(nil, for: state, style: .done, barMetrics: .default) 59 | appearanceProxy.setBackgroundImage(nil, for: state, style: .plain, barMetrics: .default) 60 | appearanceProxy.setBackButtonBackgroundImage(nil, for: state, barMetrics: .default) 61 | } 62 | 63 | appearanceProxy.setTitlePositionAdjustment(UIOffset(), for: .default) 64 | appearanceProxy.setBackgroundVerticalPositionAdjustment(0, for: .default) 65 | appearanceProxy.setBackButtonBackgroundVerticalPositionAdjustment(0, for: .default) 66 | } 67 | 68 | @objc override open var tintColor: UIColor? { 69 | didSet { 70 | 71 | #if swift(>=4.2) 72 | var textAttributes = [NSAttributedString.Key : Any]() 73 | let foregroundColorKey = NSAttributedString.Key.foregroundColor 74 | #elseif swift(>=4) 75 | var textAttributes = [NSAttributedStringKey : Any]() 76 | let foregroundColorKey = NSAttributedStringKey.foregroundColor 77 | #else 78 | var textAttributes = [String:Any]() 79 | let foregroundColorKey = NSForegroundColorAttributeName 80 | #endif 81 | 82 | textAttributes[foregroundColorKey] = tintColor 83 | 84 | #if swift(>=4) 85 | 86 | if let attributes = titleTextAttributes(for: .normal) { 87 | 88 | for (key, value) in attributes { 89 | #if swift(>=4.2) 90 | textAttributes[key] = value 91 | #else 92 | textAttributes[NSAttributedStringKey.init(key)] = value 93 | #endif 94 | } 95 | } 96 | 97 | #else 98 | 99 | if let attributes = titleTextAttributes(for: .normal) { 100 | textAttributes = attributes 101 | } 102 | #endif 103 | 104 | setTitleTextAttributes(textAttributes, for: .normal) 105 | } 106 | } 107 | 108 | /** 109 | Boolean to know if it's a system item or custom item, we are having a limitation that we cannot override a designated initializer, so we are manually setting this property once in initialization 110 | */ 111 | @objc internal var isSystemItem = false 112 | 113 | /** 114 | Additional target & action to do get callback action. Note that setting custom target & selector doesn't affect native functionality, this is just an additional target to get a callback. 115 | 116 | @param target Target object. 117 | @param action Target Selector. 118 | */ 119 | @objc open func setTarget(_ target: AnyObject?, action: Selector?) { 120 | if let target = target, let action = action { 121 | invocation = IQInvocation(target, action) 122 | } else { 123 | invocation = nil 124 | } 125 | } 126 | 127 | /** 128 | Customized Invocation to be called when button is pressed. invocation is internally created using setTarget:action: method. 129 | */ 130 | @objc open var invocation : IQInvocation? 131 | 132 | deinit { 133 | target = nil 134 | invocation = nil 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQKeyboardManagerConstants.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import Foundation 26 | 27 | ///----------------------------------- 28 | /// MARK: IQAutoToolbarManageBehaviour 29 | ///----------------------------------- 30 | 31 | /** 32 | `IQAutoToolbarBySubviews` 33 | Creates Toolbar according to subview's hirarchy of Textfield's in view. 34 | 35 | `IQAutoToolbarByTag` 36 | Creates Toolbar according to tag property of TextField's. 37 | 38 | `IQAutoToolbarByPosition` 39 | Creates Toolbar according to the y,x position of textField in it's superview coordinate. 40 | */ 41 | @objc public enum IQAutoToolbarManageBehaviour : Int { 42 | case bySubviews 43 | case byTag 44 | case byPosition 45 | } 46 | 47 | /** 48 | `IQPreviousNextDisplayModeDefault` 49 | Show NextPrevious when there are more than 1 textField otherwise hide. 50 | 51 | `IQPreviousNextDisplayModeAlwaysHide` 52 | Do not show NextPrevious buttons in any case. 53 | 54 | `IQPreviousNextDisplayModeAlwaysShow` 55 | Always show nextPrevious buttons, if there are more than 1 textField then both buttons will be visible but will be shown as disabled. 56 | */ 57 | @objc public enum IQPreviousNextDisplayMode : Int { 58 | case Default 59 | case alwaysHide 60 | case alwaysShow 61 | } 62 | 63 | /** 64 | `IQEnableModeDefault` 65 | Pick default settings. 66 | 67 | `IQEnableModeEnabled` 68 | setting is enabled. 69 | 70 | `IQEnableModeDisabled` 71 | setting is disabled. 72 | */ 73 | @objc public enum IQEnableMode : Int { 74 | case Default 75 | case enabled 76 | case disabled 77 | } 78 | 79 | /* 80 | 81 | /---------------------------------------------------------------------------------------------------\ 82 | \---------------------------------------------------------------------------------------------------/ 83 | | iOS Notification Mechanism | 84 | /---------------------------------------------------------------------------------------------------\ 85 | \---------------------------------------------------------------------------------------------------/ 86 | 87 | 88 | ------------------------------------------------------------ 89 | When UITextField become first responder 90 | ------------------------------------------------------------ 91 | - UITextFieldTextDidBeginEditingNotification (UITextField) 92 | - UIKeyboardWillShowNotification 93 | - UIKeyboardDidShowNotification 94 | 95 | ------------------------------------------------------------ 96 | When UITextView become first responder 97 | ------------------------------------------------------------ 98 | - UIKeyboardWillShowNotification 99 | - UITextViewTextDidBeginEditingNotification (UITextView) 100 | - UIKeyboardDidShowNotification 101 | 102 | ------------------------------------------------------------ 103 | When switching focus from UITextField to another UITextField 104 | ------------------------------------------------------------ 105 | - UITextFieldTextDidEndEditingNotification (UITextField1) 106 | - UITextFieldTextDidBeginEditingNotification (UITextField2) 107 | - UIKeyboardWillShowNotification 108 | - UIKeyboardDidShowNotification 109 | 110 | ------------------------------------------------------------ 111 | When switching focus from UITextView to another UITextView 112 | ------------------------------------------------------------ 113 | - UITextViewTextDidEndEditingNotification : (UITextView1) 114 | - UIKeyboardWillShowNotification 115 | - UITextViewTextDidBeginEditingNotification : (UITextView2) 116 | - UIKeyboardDidShowNotification 117 | 118 | ------------------------------------------------------------ 119 | When switching focus from UITextField to UITextView 120 | ------------------------------------------------------------ 121 | - UITextFieldTextDidEndEditingNotification (UITextField) 122 | - UIKeyboardWillShowNotification 123 | - UITextViewTextDidBeginEditingNotification (UITextView) 124 | - UIKeyboardDidShowNotification 125 | 126 | ------------------------------------------------------------ 127 | When switching focus from UITextView to UITextField 128 | ------------------------------------------------------------ 129 | - UITextViewTextDidEndEditingNotification (UITextView) 130 | - UITextFieldTextDidBeginEditingNotification (UITextField) 131 | - UIKeyboardWillShowNotification 132 | - UIKeyboardDidShowNotification 133 | 134 | ------------------------------------------------------------ 135 | When opening/closing UIKeyboard Predictive bar 136 | ------------------------------------------------------------ 137 | - UIKeyboardWillShowNotification 138 | - UIKeyboardDidShowNotification 139 | 140 | ------------------------------------------------------------ 141 | On orientation change 142 | ------------------------------------------------------------ 143 | - UIApplicationWillChangeStatusBarOrientationNotification 144 | - UIKeyboardWillHideNotification 145 | - UIKeyboardDidHideNotification 146 | - UIApplicationDidChangeStatusBarOrientationNotification 147 | - UIKeyboardWillShowNotification 148 | - UIKeyboardDidShowNotification 149 | - UIKeyboardWillShowNotification 150 | - UIKeyboardDidShowNotification 151 | 152 | */ 153 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteTests/Pods-VPAutoCompleteTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoCompleteUITests/Pods-VPAutoCompleteUITests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/Target Support Files/Pods-VPAutoComplete/Pods-VPAutoComplete-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | 145 | if [[ "$CONFIGURATION" == "Debug" ]]; then 146 | install_framework "${BUILT_PRODUCTS_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework" 147 | fi 148 | if [[ "$CONFIGURATION" == "Release" ]]; then 149 | install_framework "${BUILT_PRODUCTS_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework" 150 | fi 151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 152 | wait 153 | fi 154 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQTextView/IQTextView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQTextView.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import UIKit 26 | 27 | /** @abstract UITextView with placeholder support */ 28 | open class IQTextView : UITextView { 29 | 30 | @objc required public init?(coder aDecoder: NSCoder) { 31 | super.init(coder: aDecoder) 32 | 33 | #if swift(>=4.2) 34 | let UITextViewTextDidChange = UITextView.textDidChangeNotification 35 | #else 36 | let UITextViewTextDidChange = Notification.Name.UITextViewTextDidChange 37 | #endif 38 | 39 | NotificationCenter.default.addObserver(self, selector: #selector(self.refreshPlaceholder), name:UITextViewTextDidChange, object: self) 40 | } 41 | 42 | @objc override public init(frame: CGRect, textContainer: NSTextContainer?) { 43 | super.init(frame: frame, textContainer: textContainer) 44 | 45 | #if swift(>=4.2) 46 | let notificationName = UITextView.textDidChangeNotification 47 | #else 48 | let notificationName = Notification.Name.UITextViewTextDidChange 49 | #endif 50 | 51 | NotificationCenter.default.addObserver(self, selector: #selector(self.refreshPlaceholder), name: notificationName, object: self) 52 | } 53 | 54 | @objc override open func awakeFromNib() { 55 | super.awakeFromNib() 56 | 57 | #if swift(>=4.2) 58 | let UITextViewTextDidChange = UITextView.textDidChangeNotification 59 | #else 60 | let UITextViewTextDidChange = Notification.Name.UITextViewTextDidChange 61 | #endif 62 | 63 | NotificationCenter.default.addObserver(self, selector: #selector(self.refreshPlaceholder), name: UITextViewTextDidChange, object: self) 64 | } 65 | 66 | deinit { 67 | placeholderLabel.removeFromSuperview() 68 | NotificationCenter.default.removeObserver(self) 69 | } 70 | 71 | private var placeholderInsets : UIEdgeInsets { 72 | return UIEdgeInsets(top: self.textContainerInset.top, left: self.textContainerInset.left + self.textContainer.lineFragmentPadding, bottom: self.textContainerInset.bottom, right: self.textContainerInset.right + self.textContainer.lineFragmentPadding) 73 | } 74 | 75 | private var placeholderExpectedFrame : CGRect { 76 | let placeholderInsets = self.placeholderInsets 77 | let maxWidth = self.frame.width-placeholderInsets.left-placeholderInsets.right 78 | let expectedSize = placeholderLabel.sizeThatFits(CGSize(width: maxWidth, height: self.frame.height-placeholderInsets.top-placeholderInsets.bottom)) 79 | 80 | return CGRect(x: placeholderInsets.left, y: placeholderInsets.top, width: maxWidth, height: expectedSize.height) 81 | } 82 | 83 | lazy var placeholderLabel: UILabel = { 84 | let label = UILabel() 85 | 86 | label.autoresizingMask = [.flexibleWidth, .flexibleHeight] 87 | label.lineBreakMode = .byWordWrapping 88 | label.numberOfLines = 0 89 | label.font = self.font 90 | label.textAlignment = self.textAlignment 91 | label.backgroundColor = UIColor.clear 92 | label.textColor = UIColor(white: 0.7, alpha: 1.0) 93 | label.alpha = 0 94 | self.addSubview(label) 95 | 96 | return label 97 | }() 98 | 99 | /** @abstract To set textView's placeholder text color. */ 100 | @IBInspectable open var placeholderTextColor : UIColor? { 101 | 102 | get { 103 | return placeholderLabel.textColor 104 | } 105 | 106 | set { 107 | placeholderLabel.textColor = newValue 108 | } 109 | } 110 | 111 | /** @abstract To set textView's placeholder text. Default is nil. */ 112 | @IBInspectable open var placeholder : String? { 113 | 114 | get { 115 | return placeholderLabel.text 116 | } 117 | 118 | set { 119 | placeholderLabel.text = newValue 120 | refreshPlaceholder() 121 | } 122 | } 123 | 124 | /** @abstract To set textView's placeholder attributed text. Default is nil. */ 125 | open var attributedPlaceholder: NSAttributedString? { 126 | get { 127 | return placeholderLabel.attributedText 128 | } 129 | 130 | set { 131 | placeholderLabel.attributedText = newValue 132 | refreshPlaceholder() 133 | } 134 | } 135 | 136 | @objc override open func layoutSubviews() { 137 | super.layoutSubviews() 138 | 139 | placeholderLabel.frame = placeholderExpectedFrame 140 | } 141 | 142 | @objc internal func refreshPlaceholder() { 143 | 144 | if !text.isEmpty || !attributedText.string.isEmpty { 145 | placeholderLabel.alpha = 0 146 | } else { 147 | placeholderLabel.alpha = 1 148 | } 149 | } 150 | 151 | @objc override open var text: String! { 152 | 153 | didSet { 154 | refreshPlaceholder() 155 | } 156 | } 157 | 158 | open override var attributedText: NSAttributedString! { 159 | 160 | didSet { 161 | refreshPlaceholder() 162 | } 163 | } 164 | 165 | @objc override open var font : UIFont? { 166 | 167 | didSet { 168 | 169 | if let unwrappedFont = font { 170 | placeholderLabel.font = unwrappedFont 171 | } else { 172 | placeholderLabel.font = UIFont.systemFont(ofSize: 12) 173 | } 174 | } 175 | } 176 | 177 | @objc override open var textAlignment: NSTextAlignment 178 | { 179 | didSet { 180 | placeholderLabel.textAlignment = textAlignment 181 | } 182 | } 183 | 184 | @objc override open var delegate : UITextViewDelegate? { 185 | 186 | get { 187 | refreshPlaceholder() 188 | return super.delegate 189 | } 190 | 191 | set { 192 | super.delegate = newValue 193 | } 194 | } 195 | 196 | @objc override open var intrinsicContentSize: CGSize { 197 | guard !hasText else { 198 | return super.intrinsicContentSize 199 | } 200 | 201 | var newSize = super.intrinsicContentSize 202 | let placeholderInsets = self.placeholderInsets 203 | newSize.height = placeholderExpectedFrame.height + placeholderInsets.top + placeholderInsets.bottom 204 | 205 | return newSize 206 | } 207 | } 208 | 209 | 210 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQTitleBarButtonItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQTitleBarButtonItem.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import Foundation 26 | import UIKit 27 | 28 | open class IQTitleBarButtonItem: IQBarButtonItem { 29 | 30 | @objc open var titleFont : UIFont? { 31 | 32 | didSet { 33 | if let unwrappedFont = titleFont { 34 | titleButton?.titleLabel?.font = unwrappedFont 35 | } else { 36 | titleButton?.titleLabel?.font = UIFont.systemFont(ofSize: 13) 37 | } 38 | } 39 | } 40 | 41 | @objc override open var title: String? { 42 | didSet { 43 | titleButton?.setTitle(title, for: .normal) 44 | } 45 | } 46 | 47 | /** 48 | titleColor to be used for displaying button text when displaying title (disabled state). 49 | */ 50 | @objc open var titleColor : UIColor? { 51 | 52 | didSet { 53 | 54 | if let color = titleColor { 55 | titleButton?.setTitleColor(color, for:.disabled) 56 | } else { 57 | titleButton?.setTitleColor(UIColor.lightGray, for:.disabled) 58 | } 59 | } 60 | } 61 | 62 | /** 63 | selectableTitleColor to be used for displaying button text when button is enabled. 64 | */ 65 | @objc open var selectableTitleColor : UIColor? { 66 | 67 | didSet { 68 | 69 | if let color = selectableTitleColor { 70 | titleButton?.setTitleColor(color, for:.normal) 71 | } else { 72 | titleButton?.setTitleColor(UIColor.init(red: 0.0, green: 0.5, blue: 1.0, alpha: 1), for:.normal) 73 | } 74 | } 75 | } 76 | 77 | /** 78 | Customized Invocation to be called on title button action. titleInvocation is internally created using setTitleTarget:action: method. 79 | */ 80 | @objc override open var invocation : IQInvocation? { 81 | 82 | didSet { 83 | 84 | if let target = invocation?.target, let action = invocation?.action { 85 | self.isEnabled = true 86 | titleButton?.isEnabled = true 87 | titleButton?.addTarget(target, action: action, for: .touchUpInside) 88 | } else { 89 | self.isEnabled = false 90 | titleButton?.isEnabled = false 91 | titleButton?.removeTarget(nil, action: nil, for: .touchUpInside) 92 | } 93 | } 94 | } 95 | 96 | internal var titleButton : UIButton? 97 | private var _titleView : UIView? 98 | 99 | override init() { 100 | super.init() 101 | } 102 | 103 | @objc public convenience init(title : String?) { 104 | 105 | self.init(title: nil, style: .plain, target: nil, action: nil) 106 | 107 | _titleView = UIView() 108 | _titleView?.backgroundColor = UIColor.clear 109 | 110 | titleButton = UIButton(type: .system) 111 | titleButton?.isEnabled = false 112 | titleButton?.titleLabel?.numberOfLines = 3 113 | titleButton?.setTitleColor(UIColor.lightGray, for:.disabled) 114 | titleButton?.setTitleColor(UIColor.init(red: 0.0, green: 0.5, blue: 1.0, alpha: 1), for:.normal) 115 | titleButton?.backgroundColor = UIColor.clear 116 | titleButton?.titleLabel?.textAlignment = .center 117 | titleButton?.setTitle(title, for: .normal) 118 | titleFont = UIFont.systemFont(ofSize: 13.0) 119 | titleButton?.titleLabel?.font = self.titleFont 120 | _titleView?.addSubview(titleButton!) 121 | 122 | #if swift(>=3.2) 123 | if #available(iOS 11, *) { 124 | 125 | var layoutDefaultLowPriority : UILayoutPriority 126 | var layoutDefaultHighPriority : UILayoutPriority 127 | 128 | #if swift(>=4.0) 129 | let layoutPriorityLowValue = UILayoutPriority.defaultLow.rawValue-1 130 | let layoutPriorityHighValue = UILayoutPriority.defaultHigh.rawValue-1 131 | layoutDefaultLowPriority = UILayoutPriority(rawValue: layoutPriorityLowValue) 132 | layoutDefaultHighPriority = UILayoutPriority(rawValue: layoutPriorityHighValue) 133 | #else 134 | layoutDefaultLowPriority = UILayoutPriorityDefaultLow-1 135 | layoutDefaultHighPriority = UILayoutPriorityDefaultHigh-1 136 | #endif 137 | 138 | _titleView?.translatesAutoresizingMaskIntoConstraints = false 139 | _titleView?.setContentHuggingPriority(layoutDefaultLowPriority, for: .vertical) 140 | _titleView?.setContentHuggingPriority(layoutDefaultLowPriority, for: .horizontal) 141 | _titleView?.setContentCompressionResistancePriority(layoutDefaultHighPriority, for: .vertical) 142 | _titleView?.setContentCompressionResistancePriority(layoutDefaultHighPriority, for: .horizontal) 143 | 144 | titleButton?.translatesAutoresizingMaskIntoConstraints = false 145 | titleButton?.setContentHuggingPriority(layoutDefaultLowPriority, for: .vertical) 146 | titleButton?.setContentHuggingPriority(layoutDefaultLowPriority, for: .horizontal) 147 | titleButton?.setContentCompressionResistancePriority(layoutDefaultHighPriority, for: .vertical) 148 | titleButton?.setContentCompressionResistancePriority(layoutDefaultHighPriority, for: .horizontal) 149 | 150 | let top = NSLayoutConstraint.init(item: titleButton!, attribute: .top, relatedBy: .equal, toItem: _titleView, attribute: .top, multiplier: 1, constant: 0) 151 | let bottom = NSLayoutConstraint.init(item: titleButton!, attribute: .bottom, relatedBy: .equal, toItem: _titleView, attribute: .bottom, multiplier: 1, constant: 0) 152 | let leading = NSLayoutConstraint.init(item: titleButton!, attribute: .leading, relatedBy: .equal, toItem: _titleView, attribute: .leading, multiplier: 1, constant: 0) 153 | let trailing = NSLayoutConstraint.init(item: titleButton!, attribute: .trailing, relatedBy: .equal, toItem: _titleView, attribute: .trailing, multiplier: 1, constant: 0) 154 | 155 | _titleView?.addConstraints([top,bottom,leading,trailing]) 156 | } else { 157 | _titleView?.autoresizingMask = [.flexibleWidth,.flexibleHeight] 158 | titleButton?.autoresizingMask = [.flexibleWidth,.flexibleHeight] 159 | } 160 | #else 161 | _titleView?.autoresizingMask = [.flexibleWidth,.flexibleHeight] 162 | titleButton?.autoresizingMask = [.flexibleWidth,.flexibleHeight] 163 | #endif 164 | 165 | customView = _titleView 166 | } 167 | 168 | @objc required public init?(coder aDecoder: NSCoder) { 169 | super.init(coder: aDecoder) 170 | } 171 | 172 | deinit { 173 | customView = nil 174 | titleButton?.removeTarget(nil, action: nil, for: .touchUpInside) 175 | _titleView = nil 176 | titleButton = nil 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/README.md: -------------------------------------------------------------------------------- 1 |

2 | Icon 3 |

4 |

IQKeyboardManager

5 |

6 | GitHub license 8 | 9 | 10 | [![Build Status](https://travis-ci.org/hackiftekhar/IQKeyboardManager.svg)](https://travis-ci.org/hackiftekhar/IQKeyboardManager) 11 | 12 | 13 | Often while developing an app, We ran into an issues where the iPhone keyboard slide up and cover the `UITextField/UITextView`. `IQKeyboardManager` allows you to prevent issues of the keyboard sliding up and cover `UITextField/UITextView` without needing you to enter any code and no additional setup required. To use `IQKeyboardManager` you simply need to add source files to your project. 14 | 15 | 16 | #### Key Features 17 | 18 | 1) `**CODELESS**, Zero Lines Of Code` 19 | 20 | 2) `Works Automatically` 21 | 22 | 3) `No More UIScrollView` 23 | 24 | 4) `No More Subclasses` 25 | 26 | 5) `No More Manual Work` 27 | 28 | 6) `No More #imports` 29 | 30 | `IQKeyboardManager` works on all orientations, and with the toolbar. There are also nice optional features allowing you to customize the distance from the text field, add the next/previous done button as a keyboard UIToolbar, play sounds when the user navigations through the form and more. 31 | 32 | 33 | ## Screenshot 34 | [![IQKeyboardManager](https://raw.githubusercontent.com/hackiftekhar/IQKeyboardManager/v3.3.0/Screenshot/IQKeyboardManagerScreenshot.png)](http://youtu.be/6nhLw6hju2A) 35 | [![Settings](https://raw.githubusercontent.com/hackiftekhar/IQKeyboardManager/v3.3.0/Screenshot/IQKeyboardManagerSettings.png)](http://youtu.be/6nhLw6hju2A) 36 | 37 | ## GIF animation 38 | [![IQKeyboardManager](https://raw.githubusercontent.com/hackiftekhar/IQKeyboardManager/v3.3.0/Screenshot/IQKeyboardManager.gif)](http://youtu.be/6nhLw6hju2A) 39 | 40 | ## Video 41 | 42 | IQKeyboardManager Demo Video 44 | 45 | ## Tutorial video by @rebeloper ([#1135](https://github.com/hackiftekhar/IQKeyboardManager/issues/1135)) 46 | 47 | @rebeloper demonstrated two videos on how to implement **IQKeyboardManager** at it's core: 48 | 49 | Youtube Tutorial Playlist 51 | 52 | https://www.youtube.com/playlist?list=PL_csAAO9PQ8aTL87XnueOXi3RpWE2m_8v 53 | 54 | ## Warning 55 | 56 | - **If you're planning to build SDK/library/framework and wants to handle UITextField/UITextView with IQKeyboardManager then you're totally going on wrong way.** I would never suggest to add **IQKeyboardManager** as **dependency/adding/shipping** with any third-party library, instead of adding **IQKeyboardManager** you should implement your own solution to achieve same kind of results. **IQKeyboardManager** is totally designed for projects to help developers for their convenience, it's not designed for **adding/dependency/shipping** with any **third-party library**, because **doing this could block adoption by other developers for their projects as well(who are not using IQKeyboardManager and implemented their custom solution to handle UITextField/UITextView thought the project).** 57 | - If **IQKeyboardManager** conflicts with other **third-party library**, then it's **developer responsibility** to **enable/disable IQKeyboardManager** when **presenting/dismissing** third-party library UI. Third-party libraries are not responsible to handle IQKeyboardManager. 58 | 59 | ## Requirements 60 | [![Platform iOS](https://img.shields.io/badge/Platform-iOS-blue.svg?style=fla)]() 61 | 62 | | | Language | Minimum iOS Target | Minimum Xcode Version | 63 | |------------------------|----------|--------------------|-----------------------| 64 | | IQKeyboardManager | Obj-C | iOS 8.0 | Xcode 8.2.1 | 65 | | IQKeyboardManagerSwift | Swift | iOS 8.0 | Xcode 8.2.1 | 66 | | Demo Project | | | Xcode 9.3 | 67 | 68 | **Note** 69 | - 3.3.7 is the last iOS 7 supported version. 70 | 71 | #### Swift versions support 72 | 73 | | Swift | Xcode | IQKeyboardManagerSwift | 74 | |-------------------|-------|------------------------| 75 | | 4.2, 4.0, 3.2, 3.0| 10.0 | >= 6.0.4 | 76 | | 4.0, 3.2, 3.0 | 9.0 | 5.0.0 | 77 | | 3.1 | 8.3 | 4.0.10 | 78 | | 3.0 (3.0.2) | 8.2 | 4.0.8 | 79 | | 2.2 or 2.3 | 7.3 | 4.0.5 | 80 | | 2.1.1 | 7.2 | 4.0.0 | 81 | | 2.1 | 7.2 | 3.3.7 | 82 | | 2.0 | 7.0 | 3.3.3.1 | 83 | | 1.2 | 6.3 | 3.3.1 | 84 | | 1.0 | 6.0 | 3.3.2 | 85 | 86 | Installation 87 | ========================== 88 | 89 | #### Installation with CocoaPods 90 | 91 | [![CocoaPods](https://img.shields.io/cocoapods/v/IQKeyboardManager.svg)](http://cocoadocs.org/docsets/IQKeyboardManager) 92 | 93 | ***IQKeyboardManager (Objective-C):*** IQKeyboardManager is available through [CocoaPods](http://cocoapods.org), to install 94 | it simply add the following line to your Podfile: ([#9](https://github.com/hackiftekhar/IQKeyboardManager/issues/9)) 95 | 96 | ```ruby 97 | pod 'IQKeyboardManager' #iOS8 and later 98 | 99 | pod 'IQKeyboardManager', '3.3.7' #iOS7 100 | ``` 101 | 102 | ***IQKeyboardManager (Swift):*** IQKeyboardManagerSwift is available through [CocoaPods](http://cocoapods.org), to install 103 | it simply add the following line to your Podfile: ([#236](https://github.com/hackiftekhar/IQKeyboardManager/issues/236)) 104 | 105 | *Swift 4.2, 4.0, 3.2, 3.0 (Xcode 9)* 106 | 107 | ```ruby 108 | pod 'IQKeyboardManagerSwift' 109 | ``` 110 | 111 | *Or you can choose version you need based on Swift support table from [Requirements](README.md#requirements)* 112 | 113 | ```ruby 114 | pod 'IQKeyboardManagerSwift', '5.0.0' 115 | ``` 116 | 117 | In AppDelegate.swift, just import IQKeyboardManagerSwift framework and enable IQKeyboardManager. 118 | 119 | ```swift 120 | import IQKeyboardManagerSwift 121 | 122 | @UIApplicationMain 123 | class AppDelegate: UIResponder, UIApplicationDelegate { 124 | 125 | var window: UIWindow? 126 | 127 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 128 | 129 | IQKeyboardManager.shared.enable = true 130 | 131 | return true 132 | } 133 | } 134 | ``` 135 | 136 | #### Installation with Carthage 137 | 138 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. 139 | 140 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command: 141 | 142 | ```bash 143 | $ brew update 144 | $ brew install carthage 145 | ``` 146 | 147 | To integrate `IQKeyboardManger` or `IQKeyboardManagerSwift` into your Xcode project using Carthage, specify it in your `Cartfile`: 148 | 149 | ```ogdl 150 | github "hackiftekhar/IQKeyboardManager" 151 | ``` 152 | 153 | Run `carthage` to build the frameworks and drag the appropriate framework (`IQKeyboardManager.framework` or `IQKeyboardManagerSwift.framework`) into your Xcode project according to your need. Make sure to add only one framework and not both. 154 | 155 | 156 | #### Installation with Source Code 157 | 158 | [![Github tag](https://img.shields.io/github/tag/hackiftekhar/iqkeyboardmanager.svg)]() 159 | 160 | 161 | 162 | ***IQKeyboardManager (Objective-C):*** Just ***drag and drop*** `IQKeyboardManager` directory from demo project to your project. That's it. 163 | 164 | ***IQKeyboardManager (Swift):*** ***Drag and drop*** `IQKeyboardManagerSwift` directory from demo project to your project 165 | 166 | In AppDelegate.swift, just enable IQKeyboardManager. 167 | 168 | ```swift 169 | @UIApplicationMain 170 | class AppDelegate: UIResponder, UIApplicationDelegate { 171 | 172 | var window: UIWindow? 173 | 174 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 175 | 176 | IQKeyboardManager.shared.enable = true 177 | 178 | return true 179 | } 180 | } 181 | ``` 182 | 183 | Migration Guide 184 | ========================== 185 | - [IQKeyboardManager 6.0.0 Migration Guide](https://github.com/hackiftekhar/IQKeyboardManager/wiki/IQKeyboardManager-6.0.0-Migration-Guide) 186 | 187 | Other Links 188 | ========================== 189 | 190 | - [Known Issues](https://github.com/hackiftekhar/IQKeyboardManager/wiki/Known-Issues) 191 | - [Manual Management Tweaks](https://github.com/hackiftekhar/IQKeyboardManager/wiki/Manual-Management) 192 | - [Properties and functions usage](https://github.com/hackiftekhar/IQKeyboardManager/wiki/Properties-&-Functions) 193 | 194 | ## Flow Diagram 195 | [![IQKeyboardManager CFD](https://raw.githubusercontent.com/hackiftekhar/IQKeyboardManager/master/Screenshot/IQKeyboardManagerFlowDiagram.jpg)](https://raw.githubusercontent.com/hackiftekhar/IQKeyboardManager/master/Screenshot/IQKeyboardManagerFlowDiagram.jpg) 196 | 197 | If you would like to see detailed Flow diagram then see [Detailed Flow Diagram](https://raw.githubusercontent.com/hackiftekhar/IQKeyboardManager/v3.3.0/Screenshot/IQKeyboardManagerCFD.jpg). 198 | 199 | 200 | LICENSE 201 | --- 202 | Distributed under the MIT License. 203 | 204 | Contributions 205 | --- 206 | Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub. 207 | 208 | Author 209 | --- 210 | If you wish to contact me, email at: hack.iftekhar@gmail.com 211 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/Categories/IQUIView+Hierarchy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIView+Hierarchy.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import UIKit 26 | 27 | /** 28 | UIView hierarchy category. 29 | */ 30 | public extension UIView { 31 | 32 | ///---------------------- 33 | /// MARK: viewControllers 34 | ///---------------------- 35 | 36 | /** 37 | Returns the UIViewController object that manages the receiver. 38 | */ 39 | @objc public func viewContainingController()->UIViewController? { 40 | 41 | var nextResponder: UIResponder? = self 42 | 43 | repeat { 44 | nextResponder = nextResponder?.next 45 | 46 | if let viewController = nextResponder as? UIViewController { 47 | return viewController 48 | } 49 | 50 | } while nextResponder != nil 51 | 52 | return nil 53 | } 54 | 55 | /** 56 | Returns the topMost UIViewController object in hierarchy. 57 | */ 58 | @objc public func topMostController()->UIViewController? { 59 | 60 | var controllersHierarchy = [UIViewController]() 61 | 62 | if var topController = window?.rootViewController { 63 | controllersHierarchy.append(topController) 64 | 65 | while let presented = topController.presentedViewController { 66 | 67 | topController = presented 68 | 69 | controllersHierarchy.append(presented) 70 | } 71 | 72 | var matchController :UIResponder? = viewContainingController() 73 | 74 | while matchController != nil && controllersHierarchy.contains(matchController as! UIViewController) == false { 75 | 76 | repeat { 77 | matchController = matchController?.next 78 | 79 | } while matchController != nil && matchController is UIViewController == false 80 | } 81 | 82 | return matchController as? UIViewController 83 | 84 | } else { 85 | return viewContainingController() 86 | } 87 | } 88 | 89 | /** 90 | Returns the UIViewController object that is actually the parent of this object. Most of the time it's the viewController object which actually contains it, but result may be different if it's viewController is added as childViewController of another viewController. 91 | */ 92 | @objc public func parentContainerViewController()->UIViewController? { 93 | 94 | var matchController = viewContainingController() 95 | var parentContainerViewController : UIViewController? 96 | 97 | if var navController = matchController?.navigationController { 98 | 99 | while let parentNav = navController.navigationController { 100 | navController = parentNav 101 | } 102 | 103 | var parentController : UIViewController = navController 104 | 105 | while let parent = parentController.parent, 106 | (parent.isKind(of: UINavigationController.self) == false && 107 | parent.isKind(of: UITabBarController.self) == false && 108 | parent.isKind(of: UISplitViewController.self) == false) { 109 | 110 | parentController = parent 111 | } 112 | 113 | if navController == parentController { 114 | parentContainerViewController = navController.topViewController 115 | } else { 116 | parentContainerViewController = parentController 117 | } 118 | } 119 | else if let tabController = matchController?.tabBarController { 120 | 121 | if let navController = tabController.selectedViewController as? UINavigationController { 122 | parentContainerViewController = navController.topViewController 123 | } else { 124 | parentContainerViewController = tabController.selectedViewController 125 | } 126 | } else { 127 | while let parentController = matchController?.parent, 128 | (parentController.isKind(of: UINavigationController.self) == false && 129 | parentController.isKind(of: UITabBarController.self) == false && 130 | parentController.isKind(of: UISplitViewController.self) == false) { 131 | 132 | matchController = parentController 133 | } 134 | 135 | parentContainerViewController = matchController 136 | } 137 | 138 | let finalController = parentContainerViewController?.parentIQContainerViewController() ?? parentContainerViewController 139 | 140 | return finalController 141 | 142 | } 143 | 144 | ///----------------------------------- 145 | /// MARK: Superviews/Subviews/Siglings 146 | ///----------------------------------- 147 | 148 | /** 149 | Returns the superView of provided class type. 150 | */ 151 | @objc public func superviewOfClassType(_ classType:UIView.Type)->UIView? { 152 | 153 | var superView = superview 154 | 155 | while let unwrappedSuperView = superView { 156 | 157 | if unwrappedSuperView.isKind(of: classType) { 158 | 159 | //If it's UIScrollView, then validating for special cases 160 | if unwrappedSuperView.isKind(of: UIScrollView.self) { 161 | 162 | let classNameString = NSStringFromClass(type(of:unwrappedSuperView.self)) 163 | 164 | // If it's not UITableViewWrapperView class, this is internal class which is actually manage in UITableview. The speciality of this class is that it's superview is UITableView. 165 | // If it's not UITableViewCellScrollView class, this is internal class which is actually manage in UITableviewCell. The speciality of this class is that it's superview is UITableViewCell. 166 | //If it's not _UIQueuingScrollView class, actually we validate for _ prefix which usually used by Apple internal classes 167 | if unwrappedSuperView.superview?.isKind(of: UITableView.self) == false && 168 | unwrappedSuperView.superview?.isKind(of: UITableViewCell.self) == false && 169 | classNameString.hasPrefix("_") == false { 170 | return superView 171 | } 172 | } 173 | else { 174 | return superView 175 | } 176 | } 177 | 178 | superView = unwrappedSuperView.superview 179 | } 180 | 181 | return nil 182 | } 183 | 184 | /** 185 | Returns all siblings of the receiver which canBecomeFirstResponder. 186 | */ 187 | internal func responderSiblings()->[UIView] { 188 | 189 | //Array of (UITextField/UITextView's). 190 | var tempTextFields = [UIView]() 191 | 192 | // Getting all siblings 193 | if let siblings = superview?.subviews { 194 | 195 | for textField in siblings { 196 | 197 | if (textField == self || textField.ignoreSwitchingByNextPrevious == false) && textField._IQcanBecomeFirstResponder() == true { 198 | tempTextFields.append(textField) 199 | } 200 | } 201 | } 202 | 203 | return tempTextFields 204 | } 205 | 206 | /** 207 | Returns all deep subViews of the receiver which canBecomeFirstResponder. 208 | */ 209 | internal func deepResponderViews()->[UIView] { 210 | 211 | //Array of (UITextField/UITextView's). 212 | var textfields = [UIView]() 213 | 214 | for textField in subviews { 215 | 216 | if (textField == self || textField.ignoreSwitchingByNextPrevious == false) && textField._IQcanBecomeFirstResponder() == true { 217 | textfields.append(textField) 218 | } 219 | 220 | //Sometimes there are hidden or disabled views and textField inside them still recorded, so we added some more validations here (Bug ID: #458) 221 | //Uncommented else (Bug ID: #625) 222 | if textField.subviews.count != 0 && isUserInteractionEnabled == true && isHidden == false && alpha != 0.0 { 223 | for deepView in textField.deepResponderViews() { 224 | textfields.append(deepView) 225 | } 226 | } 227 | } 228 | 229 | //subviews are returning in opposite order. Sorting according the frames 'y'. 230 | return textfields.sorted(by: { (view1 : UIView, view2 : UIView) -> Bool in 231 | 232 | let frame1 = view1.convert(view1.bounds, to: self) 233 | let frame2 = view2.convert(view2.bounds, to: self) 234 | 235 | let x1 = frame1.minX 236 | let y1 = frame1.minY 237 | let x2 = frame2.minX 238 | let y2 = frame2.minY 239 | 240 | if y1 != y2 { 241 | return y1 < y2 242 | } else { 243 | return x1 < x2 244 | } 245 | }) 246 | } 247 | 248 | private func _IQcanBecomeFirstResponder() -> Bool { 249 | 250 | var _IQcanBecomeFirstResponder = false 251 | 252 | // Setting toolbar to keyboard. 253 | if let textField = self as? UITextField { 254 | _IQcanBecomeFirstResponder = textField.isEnabled 255 | } else if let textView = self as? UITextView { 256 | _IQcanBecomeFirstResponder = textView.isEditable 257 | } 258 | 259 | if _IQcanBecomeFirstResponder == true { 260 | _IQcanBecomeFirstResponder = isUserInteractionEnabled == true && isHidden == false && alpha != 0.0 && isAlertViewTextField() == false && textFieldSearchBar() == nil 261 | } 262 | 263 | return _IQcanBecomeFirstResponder 264 | } 265 | 266 | ///------------------------- 267 | /// MARK: Special TextFields 268 | ///------------------------- 269 | 270 | /** 271 | Returns searchBar if receiver object is UISearchBarTextField, otherwise return nil. 272 | */ 273 | internal func textFieldSearchBar()-> UISearchBar? { 274 | 275 | var responder : UIResponder? = self.next 276 | 277 | while let bar = responder { 278 | 279 | if let searchBar = bar as? UISearchBar { 280 | return searchBar 281 | } else if bar is UIViewController { 282 | break 283 | } 284 | 285 | responder = bar.next 286 | } 287 | 288 | return nil 289 | } 290 | 291 | /** 292 | Returns YES if the receiver object is UIAlertSheetTextField, otherwise return NO. 293 | */ 294 | internal func isAlertViewTextField()->Bool { 295 | 296 | var alertViewController : UIResponder? = viewContainingController() 297 | 298 | var isAlertViewTextField = false 299 | 300 | while let controller = alertViewController, isAlertViewTextField == false { 301 | 302 | if controller.isKind(of: UIAlertController.self) { 303 | isAlertViewTextField = true 304 | break 305 | } 306 | 307 | alertViewController = controller.next 308 | } 309 | 310 | return isAlertViewTextField 311 | } 312 | 313 | private func depth()->Int { 314 | var depth : Int = 0 315 | 316 | if let superView = superview { 317 | depth = superView.depth()+1 318 | } 319 | 320 | return depth 321 | } 322 | 323 | } 324 | 325 | public extension UIViewController { 326 | 327 | func parentIQContainerViewController() -> UIViewController? { 328 | return self 329 | } 330 | } 331 | 332 | extension NSObject { 333 | 334 | internal func _IQDescription() -> String { 335 | return "<\(self) \(Unmanaged.passUnretained(self).toOpaque())>" 336 | } 337 | } 338 | 339 | 340 | 341 | -------------------------------------------------------------------------------- /VPAutoComplete/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQToolbar/IQToolbar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IQToolbar.swift 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import UIKit 26 | 27 | /** @abstract IQToolbar for IQKeyboardManager. */ 28 | open class IQToolbar: UIToolbar , UIInputViewAudioFeedback { 29 | 30 | private static var _classInitialize: Void = classInitialize() 31 | 32 | private class func classInitialize() { 33 | 34 | let appearanceProxy = self.appearance() 35 | 36 | appearanceProxy.barTintColor = nil 37 | 38 | let positions : [UIBarPosition] = [.any,.bottom,.top,.topAttached] 39 | 40 | for position in positions { 41 | 42 | appearanceProxy.setBackgroundImage(nil, forToolbarPosition: position, barMetrics: .default) 43 | appearanceProxy.setShadowImage(nil, forToolbarPosition: .any) 44 | } 45 | 46 | //Background color 47 | appearanceProxy.backgroundColor = nil 48 | } 49 | 50 | /** 51 | Previous bar button of toolbar. 52 | */ 53 | private var privatePreviousBarButton: IQBarButtonItem? 54 | @objc open var previousBarButton : IQBarButtonItem { 55 | get { 56 | if privatePreviousBarButton == nil { 57 | privatePreviousBarButton = IQBarButtonItem(image: nil, style: .plain, target: nil, action: nil) 58 | privatePreviousBarButton?.accessibilityLabel = "Toolbar Previous Button" 59 | } 60 | return privatePreviousBarButton! 61 | } 62 | 63 | set (newValue) { 64 | privatePreviousBarButton = newValue 65 | } 66 | } 67 | 68 | /** 69 | Next bar button of toolbar. 70 | */ 71 | private var privateNextBarButton: IQBarButtonItem? 72 | @objc open var nextBarButton : IQBarButtonItem { 73 | get { 74 | if privateNextBarButton == nil { 75 | privateNextBarButton = IQBarButtonItem(image: nil, style: .plain, target: nil, action: nil) 76 | privateNextBarButton?.accessibilityLabel = "Toolbar Next Button" 77 | } 78 | return privateNextBarButton! 79 | } 80 | 81 | set (newValue) { 82 | privateNextBarButton = newValue 83 | } 84 | } 85 | 86 | /** 87 | Title bar button of toolbar. 88 | */ 89 | private var privateTitleBarButton: IQTitleBarButtonItem? 90 | @objc open var titleBarButton : IQTitleBarButtonItem { 91 | get { 92 | if privateTitleBarButton == nil { 93 | privateTitleBarButton = IQTitleBarButtonItem(title: nil) 94 | privateTitleBarButton?.accessibilityLabel = "Toolbar Title Button" 95 | } 96 | return privateTitleBarButton! 97 | } 98 | 99 | set (newValue) { 100 | privateTitleBarButton = newValue 101 | } 102 | } 103 | 104 | /** 105 | Done bar button of toolbar. 106 | */ 107 | private var privateDoneBarButton: IQBarButtonItem? 108 | @objc open var doneBarButton : IQBarButtonItem { 109 | get { 110 | if privateDoneBarButton == nil { 111 | privateDoneBarButton = IQBarButtonItem(title: nil, style: .done, target: nil, action: nil) 112 | privateDoneBarButton?.accessibilityLabel = "Toolbar Done Button" 113 | } 114 | return privateDoneBarButton! 115 | } 116 | 117 | set (newValue) { 118 | privateDoneBarButton = newValue 119 | } 120 | } 121 | 122 | /** 123 | Fixed space bar button of toolbar. 124 | */ 125 | private var privateFixedSpaceBarButton: IQBarButtonItem? 126 | @objc open var fixedSpaceBarButton : IQBarButtonItem { 127 | get { 128 | if privateFixedSpaceBarButton == nil { 129 | privateFixedSpaceBarButton = IQBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil) 130 | } 131 | privateFixedSpaceBarButton!.isSystemItem = true 132 | 133 | if #available(iOS 10, *) { 134 | privateFixedSpaceBarButton!.width = 6 135 | } else { 136 | privateFixedSpaceBarButton!.width = 20 137 | } 138 | 139 | return privateFixedSpaceBarButton! 140 | } 141 | 142 | set (newValue) { 143 | privateFixedSpaceBarButton = newValue 144 | } 145 | } 146 | 147 | override init(frame: CGRect) { 148 | _ = IQToolbar._classInitialize 149 | super.init(frame: frame) 150 | 151 | sizeToFit() 152 | 153 | autoresizingMask = .flexibleWidth 154 | self.isTranslucent = true 155 | } 156 | 157 | @objc required public init?(coder aDecoder: NSCoder) { 158 | _ = IQToolbar._classInitialize 159 | super.init(coder: aDecoder) 160 | 161 | sizeToFit() 162 | 163 | autoresizingMask = .flexibleWidth 164 | self.isTranslucent = true 165 | } 166 | 167 | @objc override open func sizeThatFits(_ size: CGSize) -> CGSize { 168 | var sizeThatFit = super.sizeThatFits(size) 169 | sizeThatFit.height = 44 170 | return sizeThatFit 171 | } 172 | 173 | @objc override open var tintColor: UIColor! { 174 | 175 | didSet { 176 | if let unwrappedItems = items { 177 | for item in unwrappedItems { 178 | item.tintColor = tintColor 179 | } 180 | } 181 | } 182 | } 183 | 184 | @objc override open var barStyle: UIBarStyle { 185 | didSet { 186 | 187 | if titleBarButton.selectableTitleColor == nil { 188 | if barStyle == .default { 189 | titleBarButton.titleButton?.setTitleColor(UIColor.init(red: 0.0, green: 0.5, blue: 1.0, alpha: 1), for: .normal) 190 | } else { 191 | titleBarButton.titleButton?.setTitleColor(UIColor.yellow, for: .normal) 192 | } 193 | } 194 | } 195 | } 196 | 197 | @objc override open func layoutSubviews() { 198 | 199 | super.layoutSubviews() 200 | 201 | //If running on Xcode9 (iOS11) only then we'll validate for iOS version, otherwise for older versions of Xcode (iOS10 and below) we'll just execute the tweak 202 | #if swift(>=3.2) 203 | 204 | if #available(iOS 11, *) { 205 | return 206 | } else if let customTitleView = titleBarButton.customView { 207 | var leftRect = CGRect.null 208 | var rightRect = CGRect.null 209 | var isTitleBarButtonFound = false 210 | 211 | let sortedSubviews = self.subviews.sorted(by: { (view1 : UIView, view2 : UIView) -> Bool in 212 | 213 | let x1 = view1.frame.minX 214 | let y1 = view1.frame.minY 215 | let x2 = view2.frame.minX 216 | let y2 = view2.frame.minY 217 | 218 | if x1 != x2 { 219 | return x1 < x2 220 | } else { 221 | return y1 < y2 222 | } 223 | }) 224 | 225 | for barButtonItemView in sortedSubviews { 226 | 227 | if isTitleBarButtonFound == true { 228 | rightRect = barButtonItemView.frame 229 | break 230 | } else if barButtonItemView === customTitleView { 231 | isTitleBarButtonFound = true 232 | //If it's UIToolbarButton or UIToolbarTextButton (which actually UIBarButtonItem) 233 | } else if barButtonItemView.isKind(of: UIControl.self) == true { 234 | leftRect = barButtonItemView.frame 235 | } 236 | } 237 | 238 | let titleMargin : CGFloat = 16 239 | 240 | let maxWidth : CGFloat = self.frame.width - titleMargin*2 - (leftRect.isNull ? 0 : leftRect.maxX) - (rightRect.isNull ? 0 : self.frame.width - rightRect.minX) 241 | let maxHeight = self.frame.height 242 | 243 | let sizeThatFits = customTitleView.sizeThatFits(CGSize(width: maxWidth, height: maxHeight)) 244 | 245 | var titleRect : CGRect 246 | 247 | if sizeThatFits.width > 0 && sizeThatFits.height > 0 { 248 | let width = min(sizeThatFits.width, maxWidth) 249 | let height = min(sizeThatFits.height, maxHeight) 250 | 251 | var x : CGFloat 252 | 253 | if (leftRect.isNull == false) { 254 | x = titleMargin + leftRect.maxX + ((maxWidth - width)/2) 255 | } else { 256 | x = titleMargin 257 | } 258 | 259 | let y = (maxHeight - height)/2 260 | 261 | titleRect = CGRect(x: x, y: y, width: width, height: height) 262 | } else { 263 | 264 | var x : CGFloat 265 | 266 | if (leftRect.isNull == false) { 267 | x = titleMargin + leftRect.maxX 268 | } else { 269 | x = titleMargin 270 | } 271 | 272 | let width : CGFloat = self.frame.width - titleMargin*2 - (leftRect.isNull ? 0 : leftRect.maxX) - (rightRect.isNull ? 0 : self.frame.width - rightRect.minX) 273 | 274 | titleRect = CGRect(x: x, y: 0, width: width, height: maxHeight) 275 | } 276 | 277 | customTitleView.frame = titleRect 278 | } 279 | 280 | #else 281 | if let customTitleView = titleBarButton.customView { 282 | var leftRect = CGRect.null 283 | var rightRect = CGRect.null 284 | var isTitleBarButtonFound = false 285 | 286 | let sortedSubviews = self.subviews.sorted(by: { (view1 : UIView, view2 : UIView) -> Bool in 287 | 288 | let x1 = view1.frame.minX 289 | let y1 = view1.frame.minY 290 | let x2 = view2.frame.minX 291 | let y2 = view2.frame.minY 292 | 293 | if x1 != x2 { 294 | return x1 < x2 295 | } else { 296 | return y1 < y2 297 | } 298 | }) 299 | 300 | for barButtonItemView in sortedSubviews { 301 | 302 | if isTitleBarButtonFound == true { 303 | rightRect = barButtonItemView.frame 304 | break 305 | } else if barButtonItemView === titleBarButton.customView { 306 | isTitleBarButtonFound = true 307 | //If it's UIToolbarButton or UIToolbarTextButton (which actually UIBarButtonItem) 308 | } else if barButtonItemView.isKind(of: UIControl.self) == true { 309 | leftRect = barButtonItemView.frame 310 | } 311 | } 312 | 313 | let titleMargin : CGFloat = 16 314 | let maxWidth : CGFloat = self.frame.width - titleMargin*2 - (leftRect.isNull ? 0 : leftRect.maxX) - (rightRect.isNull ? 0 : self.frame.width - rightRect.minX) 315 | let maxHeight = self.frame.height 316 | 317 | let sizeThatFits = customTitleView.sizeThatFits(CGSize(width: maxWidth, height: maxHeight)) 318 | 319 | var titleRect : CGRect 320 | 321 | if sizeThatFits.width > 0 && sizeThatFits.height > 0 { 322 | let width = min(sizeThatFits.width, maxWidth) 323 | let height = min(sizeThatFits.height, maxHeight) 324 | 325 | var x : CGFloat 326 | 327 | if (leftRect.isNull == false) { 328 | x = titleMargin + leftRect.maxX + ((maxWidth - width)/2) 329 | } else { 330 | x = titleMargin 331 | } 332 | 333 | let y = (maxHeight - height)/2 334 | 335 | titleRect = CGRect(x: x, y: y, width: width, height: height) 336 | } else { 337 | 338 | var x : CGFloat 339 | 340 | if (leftRect.isNull == false) { 341 | x = titleMargin + leftRect.maxX 342 | } else { 343 | x = titleMargin 344 | } 345 | 346 | let width : CGFloat = self.frame.width - titleMargin*2 - (leftRect.isNull ? 0 : leftRect.maxX) - (rightRect.isNull ? 0 : self.frame.width - rightRect.minX) 347 | 348 | titleRect = CGRect(x: x, y: 0, width: width, height: maxHeight) 349 | } 350 | 351 | customTitleView.frame = titleRect 352 | } 353 | #endif 354 | } 355 | 356 | @objc open var enableInputClicksWhenVisible: Bool { 357 | return true 358 | } 359 | 360 | deinit { 361 | 362 | items = nil 363 | privatePreviousBarButton = nil 364 | privateNextBarButton = nil 365 | privateTitleBarButton = nil 366 | privateDoneBarButton = nil 367 | privateFixedSpaceBarButton = nil 368 | } 369 | } 370 | -------------------------------------------------------------------------------- /VPAutoComplete/VPAutoComplete-Source/VPAutoComplete.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VPAutoComplete.swift 3 | // VPAutoComplete 4 | // 5 | // Created by Vivek on 25/01/18. 6 | // Copyright © 2018 Vivek. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class VPAutoComplete: UIView { 12 | 13 | // Data source for show DropDown. 14 | public var dataSource : [String] = [String]() 15 | // Textfield for DropDown to show. 16 | public var onTextField : UITextField! 17 | // Completion Block For Selection in DropDown. 18 | public var completionHandler: CompletionHandler? 19 | // TableView For DropDown. 20 | var tableView : UITableView? 21 | public var dropDownHeight : CGFloat? 22 | // Parents View for Show DropDown. 23 | public var onView : UIView? 24 | // Filter data when writing on textfield. 25 | var filterDataSource : [String] = [String]() 26 | public var indexPath : IndexPath? 27 | // MultiLine for DropDown List (For Now dosent added properly and tested) 28 | private var isMultiLine = false 29 | // Cell Height for DropDown 30 | public var cellHeight : CGFloat! 31 | // Make Searched Text Bold Or Not. 32 | public var isSearchBig = true 33 | 34 | public var showAlwaysOnTop = false 35 | 36 | 37 | var is_filter = false 38 | private var isOnTop = false 39 | 40 | // Arrow Indicator For DropDown. 41 | fileprivate lazy var arrowIndication: UIImageView = { 42 | UIGraphicsBeginImageContextWithOptions(CGSize(width: 20, height: 10), false, 0) 43 | let path = UIBezierPath() 44 | path.move(to: CGPoint(x: 0, y: 10)) 45 | path.addLine(to: CGPoint(x: 20, y: 10)) 46 | path.addLine(to: CGPoint(x: 10, y: 0)) 47 | path.addLine(to: CGPoint(x: 0, y: 10)) 48 | UIColor.black.setFill() 49 | path.fill() 50 | let img = UIGraphicsGetImageFromCurrentImageContext() 51 | UIGraphicsEndImageContext() 52 | let tintImg = img?.withRenderingMode(.alwaysTemplate) 53 | let imgv = UIImageView(image: tintImg) 54 | imgv.frame = CGRect(x: 0, y: -10, width: 15, height: 10) 55 | return imgv 56 | }() 57 | 58 | // Completion BLock. 59 | typealias CompletionHandler = (_ text: String , _ index : Int) -> Void 60 | 61 | // Remove observer 62 | deinit{ 63 | self.deregisterFromKeyboardNotifications() 64 | } 65 | 66 | // Override Init 67 | override init(frame: CGRect) { 68 | super.init(frame: frame) 69 | // SetUp View 70 | self.setUp() 71 | } 72 | 73 | public convenience init() { 74 | self.init(frame: .zero) 75 | } 76 | 77 | required init(coder aDecoder: NSCoder) { 78 | fatalError("init(coder:) has not been implemented") 79 | } 80 | 81 | public convenience init(onTextField: UITextField , dataSource : [String], onView: UIView, completionHandler: @escaping CompletionHandler){ 82 | self.init() 83 | self.dataSource = dataSource 84 | self.onTextField = onTextField 85 | self.onView = onView 86 | self.tableView?.frame = CGRect(x: 0, y: 0, width: onTextField.frame.width, height: 150) 87 | self.frame = CGRect(x: onTextField.frame.minX, y: onTextField.frame.maxY, width: onTextField.frame.width, height: 150) 88 | 89 | self.addSubview(tableView!) 90 | onView.addSubview(self) 91 | self.tableView?.reloadData() 92 | 93 | self.onTextField.addTarget(self, action: #selector(didBeganText(textField:)), for: .editingDidBegin) 94 | self.onTextField.addTarget(self, action: #selector(didChangeText(textField:)), for: .editingChanged) 95 | self.onTextField.addTarget(self, action: #selector(didEndText(textField:)), for: .editingDidEnd) 96 | 97 | self.isShowView(is_show: false) 98 | self.completionHandler = completionHandler 99 | } 100 | 101 | // MARK: - Show DropDown.(Add DropDown) 102 | /********** For Show DropDown for View And get selection in 103 | completion block.***********/ 104 | public func show(completionHandler: @escaping CompletionHandler){ 105 | 106 | self.tableView?.frame = CGRect(x: 0, y: 0, width: onTextField.frame.width, height: 150) 107 | self.frame = CGRect(x: onTextField.frame.minX, y: onTextField.frame.maxY, width: onTextField.frame.width, height: 150) 108 | 109 | onTextField.addTarget(self, action: #selector(didBeganText(textField:)), for: .editingDidBegin) 110 | onTextField.addTarget(self, action: #selector(didChangeText(textField:)), for: .editingChanged) 111 | onTextField.addTarget(self, action: #selector(didEndText(textField:)), for: .editingDidEnd) 112 | 113 | self.addSubview(tableView!) 114 | self.onView?.addSubview(self) 115 | 116 | self.alpha = 0 117 | self.isHidden = true 118 | 119 | self.tableView?.alpha = 0 120 | self.tableView?.isHidden = true 121 | 122 | self.completionHandler = completionHandler 123 | } 124 | 125 | /********** For Show DropDown for TableView And get selection in 126 | completion block.***********/ 127 | public func show(onTableView : UITableView, atIndexPath: IndexPath, completionHandler: @escaping CompletionHandler){ 128 | 129 | self.tableView?.frame = CGRect(x: 0, y: 0, width: onTextField.frame.width, height: cellHeight * 3) 130 | 131 | let cellRectInTable: CGRect = onTableView.rectForRow(at: atIndexPath) 132 | let cellInSuperview: CGRect = onTableView.convert(cellRectInTable, to: onTableView) 133 | self.frame = CGRect(x: onTextField.frame.minX, y: cellInSuperview.minY + onTextField.frame.maxY, width: onTextField.frame.width, height: cellHeight * 3) 134 | 135 | self.onView = onTableView 136 | 137 | onTextField.addTarget(self, action: #selector(didBeganText(textField:)), for: .editingDidBegin) 138 | onTextField.addTarget(self, action: #selector(didChangeText(textField:)), for: .editingChanged) 139 | onTextField.addTarget(self, action: #selector(didEndText(textField:)), for: .editingDidEnd) 140 | 141 | self.addSubview(tableView!) 142 | onTableView.addSubview(self) 143 | 144 | self.alpha = 0 145 | self.isHidden = true 146 | 147 | self.tableView?.alpha = 0 148 | self.tableView?.isHidden = true 149 | 150 | self.completionHandler = completionHandler 151 | } 152 | 153 | static func hide(){ 154 | 155 | } 156 | 157 | // MARK: - SetUp View 158 | 159 | private func setUp(){ 160 | self.tableView = UITableView() 161 | self.tableView?.register(UINib(nibName: "VPAutoCompleteViewCell", bundle: nil), forCellReuseIdentifier: "VPAutoCompleteViewCell") 162 | self.tableView?.delegate = self 163 | self.tableView?.dataSource = self 164 | self.tableView?.tableFooterView = UIView() 165 | 166 | self.tableView?.layer.cornerRadius = 10 167 | self.tableView?.clipsToBounds = true 168 | 169 | self.layer.cornerRadius = 10 170 | self.clipsToBounds = true 171 | 172 | self.cellHeight = 50 173 | 174 | self.addShadow(customView: self) 175 | self.registerForKeyboardNotifications() 176 | } 177 | 178 | // Shadow for DropDown 179 | public func addShadow(customView: UIView){ 180 | 181 | customView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.25).cgColor 182 | customView.layer.shadowOffset = CGSize(width: 0, height: 1) 183 | customView.layer.shadowOpacity = 1.0 184 | customView.layer.shadowRadius = 2.0 185 | customView.layer.masksToBounds = false 186 | } 187 | 188 | 189 | 190 | @objc func didChangeText(textField: UITextField) { 191 | if let textInField = onTextField.text { 192 | if textInField.count == 0{ 193 | is_filter = false 194 | self.tableView?.reloadData() 195 | }else{ 196 | is_filter = true 197 | let tempData = dataSource.filter { $0.localizedCaseInsensitiveContains(textInField) } 198 | filterDataSource = tempData 199 | self.isShowView(is_show: true) 200 | self.tableView?.reloadData() 201 | } 202 | } 203 | } 204 | 205 | @objc func didBeganText(textField: UITextField) { 206 | self.isShowView(is_show: true); 207 | } 208 | 209 | @objc func didEndText(textField: UITextField) { 210 | is_filter = false 211 | self.isShowView(is_show: false) 212 | self.tableView?.reloadData() 213 | } 214 | 215 | func isShowView(is_show : Bool){ 216 | 217 | if !self.isHidden && is_show{ 218 | return 219 | } 220 | 221 | if is_show { 222 | self.alpha = 0 223 | self.isHidden = false 224 | 225 | self.tableView?.alpha = 0 226 | self.tableView?.isHidden = false 227 | 228 | UIView.animate(withDuration: 0.3) { 229 | self.alpha = 1 230 | self.tableView?.alpha = 1 231 | } 232 | 233 | }else{ 234 | UIView.animate(withDuration: 0.3, animations: { 235 | self.tableView?.alpha = 0 236 | self.alpha = 0 237 | }) { (finished) in 238 | self.tableView?.isHidden = finished 239 | self.isHidden = finished 240 | } 241 | } 242 | 243 | } 244 | 245 | func changeHeightForCount(count: Int){ 246 | if cellHeight == nil { 247 | return 248 | } 249 | var newFrame = self.frame 250 | newFrame.size.height = cellHeight * CGFloat(count) 251 | if isOnTop { 252 | newFrame.origin.y = self.frame.maxY - newFrame.size.height 253 | } 254 | self.frame = newFrame 255 | self.tableView?.frame = CGRect(x: 0, y: 0, width: newFrame.width, height: newFrame.height) 256 | print("self frame :\(self.frame)") 257 | self.setNeedsLayout() 258 | } 259 | 260 | func attributedText(withString string: String, boldString: String, font: UIFont) -> NSAttributedString { 261 | let attributedString = NSMutableAttributedString(string: string, 262 | attributes: [NSAttributedString.Key.font: font]) 263 | let boldFontAttribute: [NSAttributedString.Key: Any] = [NSAttributedString.Key.font: font.withSize(font.pointSize + 3)] 264 | let range = (string as NSString).range(of: boldString, options: .caseInsensitive) 265 | attributedString.addAttributes(boldFontAttribute, range: range) 266 | return attributedString 267 | } 268 | 269 | 270 | } 271 | 272 | 273 | // MARK: - TableView Delegate. 274 | 275 | extension VPAutoComplete : UITableViewDelegate{ 276 | 277 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 278 | 279 | if !isMultiLine { 280 | return cellHeight 281 | } 282 | 283 | if is_filter{ 284 | let selectedStr = filterDataSource[indexPath.row] 285 | return selectedStr.height(constraintedWidth: self.onTextField.frame.width, font: self.onTextField.font!) 286 | } 287 | let selectedStr = dataSource[indexPath.row] 288 | return selectedStr.height(constraintedWidth: self.onTextField.frame.width, font: self.onTextField.font!) 289 | } 290 | 291 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 292 | if is_filter{ 293 | let selectedStr = filterDataSource[indexPath.row] 294 | let selectedIndex = dataSource.index(of: selectedStr) 295 | self.isShowView(is_show: false) 296 | self.completionHandler!(selectedStr, selectedIndex!) 297 | return 298 | } 299 | let selectedStr = dataSource[indexPath.row] 300 | let selectedIndex = indexPath.row 301 | self.isShowView(is_show: false) 302 | self.completionHandler!(selectedStr, selectedIndex) 303 | } 304 | 305 | 306 | } 307 | 308 | // MARK: - TableView DataSource. 309 | 310 | extension VPAutoComplete : UITableViewDataSource{ 311 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 312 | if is_filter{ 313 | self.changeHeightForCount(count: self.filterDataSource.count < 4 ? self.filterDataSource.count : 3) 314 | return self.filterDataSource.count 315 | } 316 | self.changeHeightForCount(count: self.dataSource.count < 4 ? self.dataSource.count : 3) 317 | return self.dataSource.count 318 | } 319 | 320 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 321 | let cell = tableView.dequeueReusableCell(withIdentifier: "VPAutoCompleteViewCell") as! VPAutoCompleteViewCell 322 | if is_filter { 323 | cell.lblTitle.text = filterDataSource[indexPath.row] 324 | }else{ 325 | cell.lblTitle.text = dataSource[indexPath.row] 326 | } 327 | if isSearchBig { 328 | let formattedString = self.attributedText(withString: cell.lblTitle.text!, boldString: onTextField.text!, font: onTextField.font!) 329 | cell.lblTitle.attributedText = formattedString 330 | } 331 | return cell 332 | } 333 | } 334 | 335 | extension VPAutoComplete { 336 | 337 | func heightForLabel(text:String) -> CGFloat{ 338 | let label:UILabel = UILabel(frame: CGRect(x:0, y:0, width: self.onTextField.frame.width, height: CGFloat.greatestFiniteMagnitude)) 339 | label.numberOfLines = 0 340 | label.lineBreakMode = NSLineBreakMode.byWordWrapping 341 | label.font = self.onTextField.font 342 | label.text = text 343 | 344 | label.sizeToFit() 345 | return label.frame.height + 20 346 | } 347 | 348 | func addIndicator(color: UIColor, onRight: Bool, forView: UIView){ 349 | 350 | self.arrowIndication.frame = CGRect(x: 10, y: onRight ? forView.frame.width - 20 : 20, width: 10 , height: 10) 351 | self.arrowIndication.tintColor = color 352 | forView.addSubview(self.arrowIndication) 353 | } 354 | 355 | func registerForKeyboardNotifications(){ 356 | //Adding notifies on keyboard appearing 357 | NotificationCenter.default.addObserver(self, selector: #selector(keyboarDidShown(notification:)), name: UIResponder.keyboardDidShowNotification, object: nil) 358 | } 359 | 360 | func deregisterFromKeyboardNotifications(){ 361 | //Removing notifies on keyboard appearing 362 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardDidShowNotification, object: nil) 363 | } 364 | 365 | @objc func keyboarDidShown(notification: NSNotification){ 366 | //Need to calculate keyboard exact size due to Apple suggestions 367 | var info = notification.userInfo! 368 | let keyboardSize = (info[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.size 369 | 370 | var aRect : CGRect = (self.onView?.frame)! 371 | aRect.size.height -= keyboardSize!.height 372 | if (self.onTextField) != nil { 373 | print("self frame : \(self.frame.origin)") 374 | 375 | if showAlwaysOnTop { 376 | self.frame = CGRect(x: onTextField.frame.minX, y: self.frame.origin.y - self.frame.height - self.onTextField.frame.height, width: onTextField.frame.width, height: self.frame.height) 377 | isOnTop = true 378 | self.setNeedsDisplay() 379 | }else{ 380 | if aRect.height < (self.frame.origin.y + self.frame .height) { 381 | if !isOnTop { 382 | self.frame = CGRect(x: onTextField.frame.minX, y: self.frame.origin.y - self.frame.height - self.onTextField.frame.height, width: onTextField.frame.width, height: self.frame.height) 383 | isOnTop = true 384 | self.setNeedsDisplay() 385 | } 386 | } 387 | } 388 | 389 | } 390 | } 391 | 392 | } 393 | 394 | 395 | // MARK: - Height for text. 396 | extension String { 397 | func height(constraintedWidth width: CGFloat, font: UIFont) -> CGFloat { 398 | let label = UILabel(frame: CGRect(x: 0, y: 0, width: width, height: .greatestFiniteMagnitude)) 399 | label.numberOfLines = 0 400 | label.lineBreakMode = NSLineBreakMode.byWordWrapping 401 | label.text = self 402 | label.font = font 403 | label.sizeToFit() 404 | 405 | return label.frame.height + 30 406 | } 407 | } 408 | 409 | --------------------------------------------------------------------------------