diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a51fc53 --- /dev/null +++ b/.gitignore @@ -0,0 +1,84 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## OSX +.DS_Store + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +node_modules + +# Jekyll +_site/ +.sass-cache/ +.jekyll-metadata + +# secrets +Resources/*.xcconfig +*Secrets.swift* + + +# FBSnapshotTestCase Failure Diffs +FailureDiffs/ diff --git a/ContextMenu.podspec b/ContextMenu.podspec new file mode 100644 index 0000000..7e86a0b --- /dev/null +++ b/ContextMenu.podspec @@ -0,0 +1,10 @@ +Pod::Spec.new do |spec| + spec.name = 'ContextMenu' + spec.version = '0.1.0' + spec.license = { :type => 'MIT' } + spec.homepage = 'https://github.com/GitHawkApp/ContextMenu' + spec.authors = { 'Ryan Nystrom' => 'rnystrom@whoisryannystrom.com' } + spec.summary = 'Context menu inspired by Things 3.' + spec.source = { :git => 'https://github.com/GitHawkApp/ContextMenu.git', :tag => '#{s.version}' } + spec.source_files = 'ContextMenu/*.swift' +end \ No newline at end of file diff --git a/ContextMenu.xcodeproj/project.pbxproj b/ContextMenu.xcodeproj/project.pbxproj new file mode 100644 index 0000000..611e429 --- /dev/null +++ b/ContextMenu.xcodeproj/project.pbxproj @@ -0,0 +1,379 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 2971CE772054539900342296 /* ContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 2971CE752054539900342296 /* ContextMenu.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2971CE8B205453D900342296 /* ContextMenuPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE7D205453D800342296 /* ContextMenuPresentationController.swift */; }; + 2971CE8C205453D900342296 /* ContextMenu+Options.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE7E205453D800342296 /* ContextMenu+Options.swift */; }; + 2971CE8D205453D900342296 /* ContextMenu+UIViewControllerTransitioningDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE7F205453D800342296 /* ContextMenu+UIViewControllerTransitioningDelegate.swift */; }; + 2971CE8E205453D900342296 /* ContextMenu+ContainerStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE80205453D800342296 /* ContextMenu+ContainerStyle.swift */; }; + 2971CE8F205453D900342296 /* ContextMenu+Item.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE81205453D900342296 /* ContextMenu+Item.swift */; }; + 2971CE90205453D900342296 /* ContextMenuDismissing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE82205453D900342296 /* ContextMenuDismissing.swift */; }; + 2971CE91205453D900342296 /* ContextMenu+Animations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE83205453D900342296 /* ContextMenu+Animations.swift */; }; + 2971CE92205453D900342296 /* ContextMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE84205453D900342296 /* ContextMenu.swift */; }; + 2971CE93205453D900342296 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE85205453D900342296 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift */; }; + 2971CE94205453D900342296 /* ContextMenu+MenuStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE86205453D900342296 /* ContextMenu+MenuStyle.swift */; }; + 2971CE95205453D900342296 /* ClippedContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE87205453D900342296 /* ClippedContainerViewController.swift */; }; + 2971CE96205453D900342296 /* SourceViewCorner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE88205453D900342296 /* SourceViewCorner.swift */; }; + 2971CE97205453D900342296 /* ContextMenuPresenting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE89205453D900342296 /* ContextMenuPresenting.swift */; }; + 2971CE98205453D900342296 /* CGRect+Area.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CE8A205453D900342296 /* CGRect+Area.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2971CE722054539900342296 /* ContextMenu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ContextMenu.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2971CE752054539900342296 /* ContextMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContextMenu.h; sourceTree = ""; }; + 2971CE762054539900342296 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2971CE7D205453D800342296 /* ContextMenuPresentationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContextMenuPresentationController.swift; sourceTree = ""; }; + 2971CE7E205453D800342296 /* ContextMenu+Options.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+Options.swift"; sourceTree = ""; }; + 2971CE7F205453D800342296 /* ContextMenu+UIViewControllerTransitioningDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+UIViewControllerTransitioningDelegate.swift"; sourceTree = ""; }; + 2971CE80205453D800342296 /* ContextMenu+ContainerStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+ContainerStyle.swift"; sourceTree = ""; }; + 2971CE81205453D900342296 /* ContextMenu+Item.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+Item.swift"; sourceTree = ""; }; + 2971CE82205453D900342296 /* ContextMenuDismissing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContextMenuDismissing.swift; sourceTree = ""; }; + 2971CE83205453D900342296 /* ContextMenu+Animations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+Animations.swift"; sourceTree = ""; }; + 2971CE84205453D900342296 /* ContextMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContextMenu.swift; sourceTree = ""; }; + 2971CE85205453D900342296 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+ContextMenuPresentationControllerDelegate.swift"; sourceTree = ""; }; + 2971CE86205453D900342296 /* ContextMenu+MenuStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextMenu+MenuStyle.swift"; sourceTree = ""; }; + 2971CE87205453D900342296 /* ClippedContainerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClippedContainerViewController.swift; sourceTree = ""; }; + 2971CE88205453D900342296 /* SourceViewCorner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SourceViewCorner.swift; sourceTree = ""; }; + 2971CE89205453D900342296 /* ContextMenuPresenting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContextMenuPresenting.swift; sourceTree = ""; }; + 2971CE8A205453D900342296 /* CGRect+Area.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CGRect+Area.swift"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2971CE6E2054539900342296 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2971CE682054539900342296 = { + isa = PBXGroup; + children = ( + 2971CE742054539900342296 /* ContextMenu */, + 2971CE732054539900342296 /* Products */, + ); + sourceTree = ""; + }; + 2971CE732054539900342296 /* Products */ = { + isa = PBXGroup; + children = ( + 2971CE722054539900342296 /* ContextMenu.framework */, + ); + name = Products; + sourceTree = ""; + }; + 2971CE742054539900342296 /* ContextMenu */ = { + isa = PBXGroup; + children = ( + 2971CE8A205453D900342296 /* CGRect+Area.swift */, + 2971CE87205453D900342296 /* ClippedContainerViewController.swift */, + 2971CE752054539900342296 /* ContextMenu.h */, + 2971CE84205453D900342296 /* ContextMenu.swift */, + 2971CE83205453D900342296 /* ContextMenu+Animations.swift */, + 2971CE80205453D800342296 /* ContextMenu+ContainerStyle.swift */, + 2971CE85205453D900342296 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift */, + 2971CE81205453D900342296 /* ContextMenu+Item.swift */, + 2971CE86205453D900342296 /* ContextMenu+MenuStyle.swift */, + 2971CE7E205453D800342296 /* ContextMenu+Options.swift */, + 2971CE7F205453D800342296 /* ContextMenu+UIViewControllerTransitioningDelegate.swift */, + 2971CE82205453D900342296 /* ContextMenuDismissing.swift */, + 2971CE7D205453D800342296 /* ContextMenuPresentationController.swift */, + 2971CE89205453D900342296 /* ContextMenuPresenting.swift */, + 2971CE762054539900342296 /* Info.plist */, + 2971CE88205453D900342296 /* SourceViewCorner.swift */, + ); + path = ContextMenu; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2971CE6F2054539900342296 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 2971CE772054539900342296 /* ContextMenu.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2971CE712054539900342296 /* ContextMenu */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2971CE7A2054539900342296 /* Build configuration list for PBXNativeTarget "ContextMenu" */; + buildPhases = ( + 2971CE6D2054539900342296 /* Sources */, + 2971CE6E2054539900342296 /* Frameworks */, + 2971CE6F2054539900342296 /* Headers */, + 2971CE702054539900342296 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ContextMenu; + productName = ContextMenu; + productReference = 2971CE722054539900342296 /* ContextMenu.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2971CE692054539900342296 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Ryan Nystrom"; + TargetAttributes = { + 2971CE712054539900342296 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 2971CE6C2054539900342296 /* Build configuration list for PBXProject "ContextMenu" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2971CE682054539900342296; + productRefGroup = 2971CE732054539900342296 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2971CE712054539900342296 /* ContextMenu */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2971CE702054539900342296 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2971CE6D2054539900342296 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2971CE98205453D900342296 /* CGRect+Area.swift in Sources */, + 2971CE93205453D900342296 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift in Sources */, + 2971CE91205453D900342296 /* ContextMenu+Animations.swift in Sources */, + 2971CE97205453D900342296 /* ContextMenuPresenting.swift in Sources */, + 2971CE90205453D900342296 /* ContextMenuDismissing.swift in Sources */, + 2971CE94205453D900342296 /* ContextMenu+MenuStyle.swift in Sources */, + 2971CE8E205453D900342296 /* ContextMenu+ContainerStyle.swift in Sources */, + 2971CE95205453D900342296 /* ClippedContainerViewController.swift in Sources */, + 2971CE96205453D900342296 /* SourceViewCorner.swift in Sources */, + 2971CE8F205453D900342296 /* ContextMenu+Item.swift in Sources */, + 2971CE8B205453D900342296 /* ContextMenuPresentationController.swift in Sources */, + 2971CE8C205453D900342296 /* ContextMenu+Options.swift in Sources */, + 2971CE92205453D900342296 /* ContextMenu.swift in Sources */, + 2971CE8D205453D900342296 /* ContextMenu+UIViewControllerTransitioningDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2971CE782054539900342296 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 2971CE792054539900342296 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 2971CE7B2054539900342296 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 523C4DWBTH; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ContextMenu/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.whoisryannystrom.ContextMenu; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 2971CE7C2054539900342296 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 523C4DWBTH; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ContextMenu/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.whoisryannystrom.ContextMenu; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2971CE6C2054539900342296 /* Build configuration list for PBXProject "ContextMenu" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2971CE782054539900342296 /* Debug */, + 2971CE792054539900342296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2971CE7A2054539900342296 /* Build configuration list for PBXNativeTarget "ContextMenu" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2971CE7B2054539900342296 /* Debug */, + 2971CE7C2054539900342296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2971CE692054539900342296 /* Project object */; +} diff --git a/ContextMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ContextMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f309b7a --- /dev/null +++ b/ContextMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ContextMenu/CGRect+Area.swift b/ContextMenu/CGRect+Area.swift new file mode 100644 index 0000000..b443f4b --- /dev/null +++ b/ContextMenu/CGRect+Area.swift @@ -0,0 +1,35 @@ +// +// CGRect+Area.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension CGRect { + + internal func rect(point: CGPoint, xRemainder: Bool, yRemainder: Bool) -> CGRect { + let xDiv = divided(atDistance: point.x, from: .minXEdge) + let x = xRemainder ? xDiv.remainder : xDiv.slice + let yDiv = x.divided(atDistance: point.y, from: .minYEdge) + return yRemainder ? yDiv.remainder : yDiv.slice + } + + internal func area(corner: SourceViewCorner) -> CGFloat { + let frame: CGRect + switch corner.position { + case .topLeft: + frame = rect(point: corner.point, xRemainder: false, yRemainder: false) + case .topRight: + frame = rect(point: corner.point, xRemainder: true, yRemainder: false) + case .bottomLeft: + frame = rect(point: corner.point, xRemainder: false, yRemainder: true) + case .bottomRight: + frame = rect(point: corner.point, xRemainder: true, yRemainder: true) + } + return frame.width * frame.height + } + +} diff --git a/ContextMenu/ClippedContainerViewController.swift b/ContextMenu/ClippedContainerViewController.swift new file mode 100644 index 0000000..b7c2e2d --- /dev/null +++ b/ContextMenu/ClippedContainerViewController.swift @@ -0,0 +1,67 @@ +// +// ClippedContainerViewController.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +internal class ClippedContainerViewController: UIViewController { + + private let options: ContextMenu.Options + private let containedViewController: UINavigationController + + init(options: ContextMenu.Options, viewController: UIViewController) { + self.options = options + self.containedViewController = UINavigationController(rootViewController: viewController) + super.init(nibName: nil, bundle: nil) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + view.layer.cornerRadius = options.containerStyle.cornerRadius + view.layer.shadowRadius = options.containerStyle.shadowRadius + view.layer.shadowColor = UIColor.black.cgColor + view.layer.shadowOpacity = 0.2 + + containedViewController.view.layer.cornerRadius = view.layer.cornerRadius + containedViewController.view.clipsToBounds = true + containedViewController.setNavigationBarHidden(options.menuStyle == .minimal, animated: false) + + let size = CGSize(width: 1, height: 1) + UIGraphicsBeginImageContext(size) + defer { UIGraphicsEndImageContext() } + + options.containerStyle.backgroundColor.setFill() + UIBezierPath(rect: CGRect(origin: .zero, size: size)).fill() + + let image = UIGraphicsGetImageFromCurrentImageContext() + let navigationBar = containedViewController.navigationBar + navigationBar.isTranslucent = false + navigationBar.setBackgroundImage(image, for: .any, barMetrics: .default) + navigationBar.shadowImage = image + + addChildViewController(containedViewController) + view.addSubview(containedViewController.view) + containedViewController.didMove(toParentViewController: self) + + preferredContentSize = containedViewController.preferredContentSize + } + + override func viewWillLayoutSubviews() { + super.viewWillLayoutSubviews() + containedViewController.view.frame = view.bounds + } + + override func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) { + super.preferredContentSizeDidChange(forChildContentContainer: container) + preferredContentSize = container.preferredContentSize + } + +} diff --git a/ContextMenu/ContextMenu+Animations.swift b/ContextMenu/ContextMenu+Animations.swift new file mode 100644 index 0000000..aa7b93d --- /dev/null +++ b/ContextMenu/ContextMenu+Animations.swift @@ -0,0 +1,39 @@ +// +// ContextMenu+Animations.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension ContextMenu { + + public struct AnimationDurations { + + public let present: TimeInterval + public let springPresent: TimeInterval + public let springDamping: CGFloat + public let springVelocity: CGFloat + public let dismiss: TimeInterval + public let resize: TimeInterval + + public init( + present: TimeInterval = 0.3, + springPresent: TimeInterval = 0.5, + springDamping: CGFloat = 0.8, + springVelocity: CGFloat = 0.5, + dismiss: TimeInterval = 0.15, + resize: TimeInterval = 0.3 + ) { + self.present = present + self.springPresent = springPresent + self.springDamping = springDamping + self.springVelocity = springVelocity + self.dismiss = dismiss + self.resize = resize + } + } + +} diff --git a/ContextMenu/ContextMenu+ContainerStyle.swift b/ContextMenu/ContextMenu+ContainerStyle.swift new file mode 100644 index 0000000..27216f3 --- /dev/null +++ b/ContextMenu/ContextMenu+ContainerStyle.swift @@ -0,0 +1,43 @@ +// +// ContextMenu+ContainerStyle.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension ContextMenu { + + public struct ContainerStyle { + + public let cornerRadius: CGFloat + public let shadowRadius: CGFloat + public let xPadding: CGFloat + public let yPadding: CGFloat + public let edgePadding: CGFloat + public let backgroundColor: UIColor + public let overlayColor: UIColor + + public init( + cornerRadius: CGFloat = 8, + shadowRadius: CGFloat = 15, + xPadding: CGFloat = 8, + yPadding: CGFloat = 8, + edgePadding: CGFloat = 15, + backgroundColor: UIColor = .white, + overlayColor: UIColor = UIColor(white: 0, alpha: 0.3) + ) { + self.cornerRadius = cornerRadius + self.shadowRadius = shadowRadius + self.xPadding = xPadding + self.yPadding = yPadding + self.edgePadding = edgePadding + self.backgroundColor = backgroundColor + self.overlayColor = overlayColor + } + + } + +} diff --git a/ContextMenu/ContextMenu+ContextMenuPresentationControllerDelegate.swift b/ContextMenu/ContextMenu+ContextMenuPresentationControllerDelegate.swift new file mode 100644 index 0000000..05a53a0 --- /dev/null +++ b/ContextMenu/ContextMenu+ContextMenuPresentationControllerDelegate.swift @@ -0,0 +1,18 @@ +// +// ContextMenu+ContextMenuPresentationControllerDelegate.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension ContextMenu: ContextMenuPresentationControllerDelegate { + + internal func willDismiss(presentationController: ContextMenuPresentationController) { + guard item?.viewController === presentationController.presentedViewController else { return } + item = nil + } + +} diff --git a/ContextMenu/ContextMenu+Item.swift b/ContextMenu/ContextMenu+Item.swift new file mode 100644 index 0000000..b3f1a2e --- /dev/null +++ b/ContextMenu/ContextMenu+Item.swift @@ -0,0 +1,31 @@ +// +// File.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension ContextMenu { + + internal class Item { + + let options: Options + let viewController: ClippedContainerViewController + + weak var sourceView: UIView? + + init( + viewController: UIViewController, + options: Options, + sourceView: UIView? + ) { + self.viewController = ClippedContainerViewController(options: options, viewController: viewController) + self.options = options + self.sourceView = sourceView + } + } + +} diff --git a/ContextMenu/ContextMenu+MenuStyle.swift b/ContextMenu/ContextMenu+MenuStyle.swift new file mode 100644 index 0000000..088990d --- /dev/null +++ b/ContextMenu/ContextMenu+MenuStyle.swift @@ -0,0 +1,18 @@ +// +// ContextMenu+Style.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension ContextMenu { + + public enum MenuStyle: Int { + case `default` + case minimal + } + +} diff --git a/ContextMenu/ContextMenu+Options.swift b/ContextMenu/ContextMenu+Options.swift new file mode 100644 index 0000000..e2c9658 --- /dev/null +++ b/ContextMenu/ContextMenu+Options.swift @@ -0,0 +1,30 @@ +// +// ContextMenuOptions.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension ContextMenu { + + public struct Options { + + let durations: AnimationDurations + let containerStyle: ContainerStyle + let menuStyle: MenuStyle + + public init( + durations: AnimationDurations = AnimationDurations(), + containerStyle: ContainerStyle = ContainerStyle(), + menuStyle: MenuStyle = .default + ) { + self.durations = durations + self.containerStyle = containerStyle + self.menuStyle = menuStyle + } + } + +} diff --git a/ContextMenu/ContextMenu+UIViewControllerTransitioningDelegate.swift b/ContextMenu/ContextMenu+UIViewControllerTransitioningDelegate.swift new file mode 100644 index 0000000..d7da64b --- /dev/null +++ b/ContextMenu/ContextMenu+UIViewControllerTransitioningDelegate.swift @@ -0,0 +1,30 @@ +// +// ContextMenu+UIViewControllerTransitioningDelegate.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +extension ContextMenu: UIViewControllerTransitioningDelegate { + + public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { + guard let item = self.item else { return nil } + return ContextMenuDismissing(item: item) + } + + public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { + guard let item = self.item else { return nil } + return ContextMenuPresenting(item: item) + } + + public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { + guard let item = self.item else { return nil } + let controller = ContextMenuPresentationController(presentedViewController: presented, presenting: presenting, item: item) + controller.contextDelegate = self + return controller + } + +} diff --git a/ContextMenu/ContextMenu.h b/ContextMenu/ContextMenu.h new file mode 100644 index 0000000..c00dfcd --- /dev/null +++ b/ContextMenu/ContextMenu.h @@ -0,0 +1,19 @@ +// +// ContextMenu.h +// ContextMenu +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +#import + +//! Project version number for ContextMenu. +FOUNDATION_EXPORT double ContextMenuVersionNumber; + +//! Project version string for ContextMenu. +FOUNDATION_EXPORT const unsigned char ContextMenuVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/ContextMenu/ContextMenu.swift b/ContextMenu/ContextMenu.swift new file mode 100644 index 0000000..41bfedf --- /dev/null +++ b/ContextMenu/ContextMenu.swift @@ -0,0 +1,35 @@ +// +// ContextMenu.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/7/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +public class ContextMenu: NSObject { + + public static let shared = ContextMenu() + + internal var item: Item? + + public func show( + sourceViewController: UIViewController, + viewController: UIViewController, + options: Options = Options(), + sourceView: UIView? = nil + ) { + let item = Item( + viewController: viewController, + options: options, + sourceView: sourceView + ) + self.item = item + + item.viewController.transitioningDelegate = self + item.viewController.modalPresentationStyle = .custom + sourceViewController.present(item.viewController, animated: true) + } + +} diff --git a/ContextMenu/ContextMenuDismissing.swift b/ContextMenu/ContextMenuDismissing.swift new file mode 100644 index 0000000..4e19e14 --- /dev/null +++ b/ContextMenu/ContextMenuDismissing.swift @@ -0,0 +1,33 @@ +// +// ContextMenuDismissing.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +internal class ContextMenuDismissing: NSObject, UIViewControllerAnimatedTransitioning { + + private let item: ContextMenu.Item + + init(item: ContextMenu.Item) { + self.item = item + } + + public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { + guard let fromViewController = transitionContext.viewController(forKey: .from) else { return } + + UIView.animate(withDuration: transitionDuration(using: transitionContext), animations: { + fromViewController.view.alpha = 0 + }) { _ in + transitionContext.completeTransition(true) + } + } + + public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { + return item.options.durations.dismiss + } + +} diff --git a/ContextMenu/ContextMenuPresentationController.swift b/ContextMenu/ContextMenuPresentationController.swift new file mode 100644 index 0000000..81faa9a --- /dev/null +++ b/ContextMenu/ContextMenuPresentationController.swift @@ -0,0 +1,162 @@ +// +// ContextMenuPresentationController.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +internal protocol ContextMenuPresentationControllerDelegate: class { + func willDismiss(presentationController: ContextMenuPresentationController) +} + +internal class ContextMenuPresentationController: UIPresentationController { + + weak var contextDelegate: ContextMenuPresentationControllerDelegate? + let item: ContextMenu.Item + + init(presentedViewController: UIViewController, presenting presentingViewController: UIViewController?, item: ContextMenu.Item) { + self.item = item + super.init(presentedViewController: presentedViewController, presenting: presentingViewController) + } + + lazy var overlayView: UIView = { + let view = UIView() + view.backgroundColor = item.options.containerStyle.overlayColor + return view + }() + + var preferredSourceViewCorner: SourceViewCorner? { + guard let sourceViewFrame = item.sourceView?.frame, + let containerView = self.containerView, + let frame = item.sourceView?.superview?.convert(sourceViewFrame, to: containerView) + else { return nil} + + let corners: [SourceViewCorner] = [ + SourceViewCorner(point: CGPoint(x: frame.minX, y: frame.minY), position: .topLeft), + SourceViewCorner(point: CGPoint(x: frame.maxX, y: frame.minY), position: .topRight), + SourceViewCorner(point: CGPoint(x: frame.minX, y: frame.maxY), position: .bottomLeft), + SourceViewCorner(point: CGPoint(x: frame.maxX, y: frame.maxY), position: .bottomRight), + ] + + var maxArea: CGFloat = 0 + var maxCorner: SourceViewCorner? = nil + for corner in corners { + let area = containerView.bounds.area(corner: corner) + if area > maxArea { + maxArea = area + maxCorner = corner + } + } + return maxCorner + } + + override var frameOfPresentedViewInContainerView: CGRect { + guard let containerBounds = containerView?.bounds else { return .zero } + let size = presentedViewController.preferredContentSize + if let corner = preferredSourceViewCorner { + let minPadding = item.options.containerStyle.edgePadding + let x = corner.point.x + + corner.position.xSizeModifier * size.width + + corner.position.xModifier * item.options.containerStyle.xPadding + let y = corner.point.y + + corner.position.ySizeModifier * size.height + + corner.position.yModifier * item.options.containerStyle.yPadding + return CGRect( + x: max(minPadding, min(containerBounds.width - size.width - minPadding, x)), + y: max(minPadding, min(containerBounds.height - size.height - minPadding, y)), + width: size.width, + height: size.height + ) + } else { + return CGRect( + x: (containerBounds.width - size.width)/2, + y: (containerBounds.height - size.height)/2, + width: size.width, + height: size.height + ) + } + } + + override func containerViewWillLayoutSubviews() { + guard let containerView = self.containerView else { return } + let frame = frameOfPresentedViewInContainerView + if frame != .zero { + presentedView?.frame = frame + } + overlayView.frame = containerView.bounds + } + + var presentedViewTransform: CATransform3D { + let translate: CATransform3D + if let corner = preferredSourceViewCorner { + let frame = frameOfPresentedViewInContainerView + let center = CGPoint(x: frame.minX + frame.width / 2, y: frame.minY + frame.height / 2) + translate = CATransform3DMakeTranslation(corner.point.x - center.x, corner.point.y - center.y, 0) + } else { + translate = CATransform3DIdentity + } + let scale: CGFloat = item.sourceView == nil ? 0.8 : 0.2 + return CATransform3DScale(translate, scale, scale, 1) + } + + override func presentationTransitionWillBegin() { + super.presentationTransitionWillBegin() + guard let containerView = self.containerView, + let coordinator = presentedViewController.transitionCoordinator + else { return } + + containerView.insertSubview(overlayView, at: 0) + + let tap = UITapGestureRecognizer(target: self, action: #selector(onTap(recognizer:))) + tap.cancelsTouchesInView = false + containerView.addGestureRecognizer(tap) + + overlayView.alpha = 0 + coordinator.animate(alongsideTransition: { _ in + self.overlayView.alpha = 1 + }) + + presentedView?.layer.transform = presentedViewTransform + + UIView.animate( + withDuration: item.options.durations.springPresent, + delay: 0, + usingSpringWithDamping: item.options.durations.springDamping, + initialSpringVelocity: item.options.durations.springVelocity, + options: [], + animations: { + self.presentedView?.layer.transform = CATransform3DIdentity + }) + } + + override func dismissalTransitionWillBegin() { + super.dismissalTransitionWillBegin() + contextDelegate?.willDismiss(presentationController: self) + guard let coordinator = presentedViewController.transitionCoordinator else { return } + coordinator.animate(alongsideTransition: { _ in + self.presentedView?.layer.transform = self.presentedViewTransform + self.overlayView.alpha = 0 + }) + } + + @objc func onTap(recognizer: UITapGestureRecognizer) { + guard recognizer.state == .ended, + let containerView = self.containerView, + presentedView?.frame.contains(recognizer.location(in: containerView)) == false + else { return } + presentingViewController.dismiss(animated: true) + } + + override func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) { + super.preferredContentSizeDidChange(forChildContentContainer: container) + guard let containerView = self.containerView else { return } + UIView.animate(withDuration: item.options.durations.resize) { + containerView.setNeedsLayout() + containerView.layoutIfNeeded() + } + } + +} diff --git a/ContextMenu/ContextMenuPresenting.swift b/ContextMenu/ContextMenuPresenting.swift new file mode 100644 index 0000000..b41c553 --- /dev/null +++ b/ContextMenu/ContextMenuPresenting.swift @@ -0,0 +1,38 @@ +// +// ContextMenuPresenting.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +internal class ContextMenuPresenting: NSObject, UIViewControllerAnimatedTransitioning { + + private let item: ContextMenu.Item + + init(item: ContextMenu.Item) { + self.item = item + } + + public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { + guard let toViewController = transitionContext.viewController(forKey: .to) else { return } + + let containerView = transitionContext.containerView + + containerView.addSubview(toViewController.view) + + toViewController.view.alpha = 0 + UIView.animate(withDuration: transitionDuration(using: transitionContext), animations: { + toViewController.view.alpha = 1 + }) { _ in + transitionContext.completeTransition(true) + } + } + + public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { + return item.options.durations.present + } + +} diff --git a/ContextMenu/Info.plist b/ContextMenu/Info.plist new file mode 100644 index 0000000..1007fd9 --- /dev/null +++ b/ContextMenu/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/ContextMenu/SourceViewCorner.swift b/ContextMenu/SourceViewCorner.swift new file mode 100644 index 0000000..3e10c4d --- /dev/null +++ b/ContextMenu/SourceViewCorner.swift @@ -0,0 +1,52 @@ +// +// SourceViewCorner.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +internal struct SourceViewCorner { + + enum Position { + case topLeft + case topRight + case bottomLeft + case bottomRight + + var xModifier: CGFloat { + switch self { + case .topLeft, .bottomLeft: return -1 + case .topRight, .bottomRight: return 1 + } + } + + var yModifier: CGFloat { + switch self { + case .topLeft, .topRight: return -1 + case .bottomLeft, .bottomRight: return 1 + } + } + + var xSizeModifier: CGFloat { + switch self { + case .topLeft, .bottomLeft: return -1 + case .topRight, .bottomRight: return 0 + } + } + + var ySizeModifier: CGFloat { + switch self { + case .topLeft, .topRight: return -1 + case .bottomLeft, .bottomRight: return 0 + } + } + + } + + let point: CGPoint + let position: Position + +} diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..144b3d7 --- /dev/null +++ b/Example/Example.xcodeproj/project.pbxproj @@ -0,0 +1,414 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 2971CEA6205454BD00342296 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CEA5205454BD00342296 /* AppDelegate.swift */; }; + 2971CEA8205454BD00342296 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CEA7205454BD00342296 /* ViewController.swift */; }; + 2971CEAB205454BD00342296 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2971CEA9205454BD00342296 /* Main.storyboard */; }; + 2971CEAD205454BD00342296 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2971CEAC205454BD00342296 /* Assets.xcassets */; }; + 2971CEB0205454BD00342296 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2971CEAE205454BD00342296 /* LaunchScreen.storyboard */; }; + 2971CEB82054553400342296 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2971CEB72054553400342296 /* MenuViewController.swift */; }; + 5D9BB1BB05FE1C79E1E43B74 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67EA137013E06182CC4BE858 /* Pods_Example.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2971CEA2205454BD00342296 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2971CEA5205454BD00342296 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 2971CEA7205454BD00342296 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 2971CEAA205454BD00342296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 2971CEAC205454BD00342296 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 2971CEAF205454BD00342296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 2971CEB1205454BD00342296 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2971CEB72054553400342296 /* MenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = ""; }; + 445EDEAD1EC427ACF9B0E27F /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; + 67EA137013E06182CC4BE858 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A8435E3320DB10C18B762D4A /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2971CE9F205454BD00342296 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D9BB1BB05FE1C79E1E43B74 /* Pods_Example.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2971CE99205454BD00342296 = { + isa = PBXGroup; + children = ( + 2971CEA4205454BD00342296 /* Example */, + 2971CEA3205454BD00342296 /* Products */, + CF96DC47D978551C58AC0BF1 /* Pods */, + AB4AF995992E81B8A37FF524 /* Frameworks */, + ); + sourceTree = ""; + }; + 2971CEA3205454BD00342296 /* Products */ = { + isa = PBXGroup; + children = ( + 2971CEA2205454BD00342296 /* Example.app */, + ); + name = Products; + sourceTree = ""; + }; + 2971CEA4205454BD00342296 /* Example */ = { + isa = PBXGroup; + children = ( + 2971CEB72054553400342296 /* MenuViewController.swift */, + 2971CEA5205454BD00342296 /* AppDelegate.swift */, + 2971CEA7205454BD00342296 /* ViewController.swift */, + 2971CEA9205454BD00342296 /* Main.storyboard */, + 2971CEAC205454BD00342296 /* Assets.xcassets */, + 2971CEAE205454BD00342296 /* LaunchScreen.storyboard */, + 2971CEB1205454BD00342296 /* Info.plist */, + ); + path = Example; + sourceTree = ""; + }; + AB4AF995992E81B8A37FF524 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 67EA137013E06182CC4BE858 /* Pods_Example.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CF96DC47D978551C58AC0BF1 /* Pods */ = { + isa = PBXGroup; + children = ( + 445EDEAD1EC427ACF9B0E27F /* Pods-Example.debug.xcconfig */, + A8435E3320DB10C18B762D4A /* Pods-Example.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 2971CEA1205454BD00342296 /* Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2971CEB4205454BD00342296 /* Build configuration list for PBXNativeTarget "Example" */; + buildPhases = ( + 682E2D89CC189B785A9F12E8 /* [CP] Check Pods Manifest.lock */, + 2971CE9E205454BD00342296 /* Sources */, + 2971CE9F205454BD00342296 /* Frameworks */, + 2971CEA0205454BD00342296 /* Resources */, + 27C1DE8FF747B6D110FAA1D7 /* [CP] Embed Pods Frameworks */, + 823E736755195F61FFC5DDE6 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Example; + productName = Example; + productReference = 2971CEA2205454BD00342296 /* Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2971CE9A205454BD00342296 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Ryan Nystrom"; + TargetAttributes = { + 2971CEA1205454BD00342296 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 2971CE9D205454BD00342296 /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 2971CE99205454BD00342296; + productRefGroup = 2971CEA3205454BD00342296 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2971CEA1205454BD00342296 /* Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2971CEA0205454BD00342296 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2971CEB0205454BD00342296 /* LaunchScreen.storyboard in Resources */, + 2971CEAD205454BD00342296 /* Assets.xcassets in Resources */, + 2971CEAB205454BD00342296 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 27C1DE8FF747B6D110FAA1D7 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/ContextMenu/ContextMenu.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ContextMenu.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 682E2D89CC189B785A9F12E8 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 823E736755195F61FFC5DDE6 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2971CE9E205454BD00342296 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2971CEA8205454BD00342296 /* ViewController.swift in Sources */, + 2971CEB82054553400342296 /* MenuViewController.swift in Sources */, + 2971CEA6205454BD00342296 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 2971CEA9205454BD00342296 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 2971CEAA205454BD00342296 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 2971CEAE205454BD00342296 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 2971CEAF205454BD00342296 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 2971CEB2205454BD00342296 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 2971CEB3205454BD00342296 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 2971CEB5205454BD00342296 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 445EDEAD1EC427ACF9B0E27F /* Pods-Example.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 523C4DWBTH; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.whoisryannystrom.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 2971CEB6205454BD00342296 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A8435E3320DB10C18B762D4A /* Pods-Example.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 523C4DWBTH; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.whoisryannystrom.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2971CE9D205454BD00342296 /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2971CEB2205454BD00342296 /* Debug */, + 2971CEB3205454BD00342296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2971CEB4205454BD00342296 /* Build configuration list for PBXNativeTarget "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2971CEB5205454BD00342296 /* Debug */, + 2971CEB6205454BD00342296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2971CE9A205454BD00342296 /* Project object */; +} diff --git a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6d2a51b --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/Example.xcworkspace/contents.xcworkspacedata b/Example/Example.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a37cf19 --- /dev/null +++ b/Example/Example.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift new file mode 100644 index 0000000..cdef497 --- /dev/null +++ b/Example/Example/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Example +// +// Created by Ryan Nystrom on 3/10/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Base.lproj/LaunchScreen.storyboard b/Example/Example/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/Example/Example/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Base.lproj/Main.storyboard b/Example/Example/Base.lproj/Main.storyboard new file mode 100644 index 0000000..594e945 --- /dev/null +++ b/Example/Example/Base.lproj/Main.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/Example/Example/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/Example/MenuViewController.swift b/Example/Example/MenuViewController.swift new file mode 100644 index 0000000..df107aa --- /dev/null +++ b/Example/Example/MenuViewController.swift @@ -0,0 +1,41 @@ +// +// MenuViewController.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/8/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit + +class MenuViewController: UITableViewController { + + let rows = arc4random_uniform(4) + 2 + + override func viewDidLoad() { + super.viewDidLoad() + title = "Demo" + tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") + tableView.reloadData() + tableView.layoutIfNeeded() + preferredContentSize = CGSize(width: 200, height: tableView.contentSize.height) + navigationItem.backBarButtonItem = UIBarButtonItem(title: " ", style: .plain, target: nil, action: nil) + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return Int(rows) + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) + cell.textLabel?.text = "Cell \(indexPath.row)" + cell.accessoryType = .disclosureIndicator + return cell + } + + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + navigationController?.pushViewController(MenuViewController(), animated: true) + } + +} diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift new file mode 100644 index 0000000..a80d756 --- /dev/null +++ b/Example/Example/ViewController.swift @@ -0,0 +1,35 @@ +// +// ViewController.swift +// ThingsUI +// +// Created by Ryan Nystrom on 3/7/18. +// Copyright © 2018 Ryan Nystrom. All rights reserved. +// + +import UIKit +import ContextMenu + +class ViewController: UIViewController { + + @IBOutlet weak var button: UIButton! + + override func viewDidLoad() { + super.viewDidLoad() + button.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(onPan(gesture:)))) + } + + @objc func onPan(gesture: UIPanGestureRecognizer) { + guard gesture.state == .changed else { return } + button.center = gesture.location(in: view) + } + + @IBAction func onButton(_ sender: Any) { + ContextMenu.shared.show( + sourceViewController: self, + viewController: MenuViewController(), + sourceView: nil + ) + } + +} + diff --git a/Example/Podfile b/Example/Podfile new file mode 100644 index 0000000..3b09939 --- /dev/null +++ b/Example/Podfile @@ -0,0 +1,4 @@ +target 'Example' do + use_frameworks! + pod 'ContextMenu', :path => '../ContextMenu.podspec' +end diff --git a/Example/Podfile.lock b/Example/Podfile.lock new file mode 100644 index 0000000..7df98c5 --- /dev/null +++ b/Example/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - ContextMenu (0.1.0) + +DEPENDENCIES: + - ContextMenu (from `../ContextMenu.podspec`) + +EXTERNAL SOURCES: + ContextMenu: + :path: ../ContextMenu.podspec + +SPEC CHECKSUMS: + ContextMenu: 74f68e96197cdbfb1b5d91c703cc0906bc914cfc + +PODFILE CHECKSUM: aa060c7f3a10a9cb8b2633f1297c22bb65e4f54d + +COCOAPODS: 1.4.0 diff --git a/Example/Pods/Local Podspecs/ContextMenu.podspec.json b/Example/Pods/Local Podspecs/ContextMenu.podspec.json new file mode 100644 index 0000000..658721c --- /dev/null +++ b/Example/Pods/Local Podspecs/ContextMenu.podspec.json @@ -0,0 +1,23 @@ +{ + "name": "ContextMenu", + "version": "0.1.0", + "license": { + "type": "MIT" + }, + "homepage": "https://github.com/GitHawkApp/ContextMenu", + "authors": { + "Ryan Nystrom": "rnystrom@whoisryannystrom.com" + }, + "summary": "Context menu inspired by Things 3.", + "source": { + "git": "https://github.com/GitHawkApp/ContextMenu.git", + "tag": "#{s.version}" + }, + "source_files": "ContextMenu/*.swift", + "platforms": { + "osx": null, + "ios": null, + "tvos": null, + "watchos": null + } +} diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock new file mode 100644 index 0000000..7df98c5 --- /dev/null +++ b/Example/Pods/Manifest.lock @@ -0,0 +1,16 @@ +PODS: + - ContextMenu (0.1.0) + +DEPENDENCIES: + - ContextMenu (from `../ContextMenu.podspec`) + +EXTERNAL SOURCES: + ContextMenu: + :path: ../ContextMenu.podspec + +SPEC CHECKSUMS: + ContextMenu: 74f68e96197cdbfb1b5d91c703cc0906bc914cfc + +PODFILE CHECKSUM: aa060c7f3a10a9cb8b2633f1297c22bb65e4f54d + +COCOAPODS: 1.4.0 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fe07302 --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,634 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 076F001444726AABF19EDF3AE0030DE6 /* ContextMenu+Item.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71DDD555C4F32B86F69F2CCE692E87C1 /* ContextMenu+Item.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 124D99BD9430F3AB4A6DF8E255DCA46A /* ContextMenu+Animations.swift in Sources */ = {isa = PBXBuildFile; fileRef = A99C513A5107C353567935F9D81AA652 /* ContextMenu+Animations.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 1B66E33B588115713F5B90C812A0139C /* ContextMenu-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F35176CEE9BAAD80281A0DF595B0D25 /* ContextMenu-dummy.m */; }; + 1EF18353721727430EEB0909C7305CFE /* SourceViewCorner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 333B6A8DDD5E59721593B55968D63FAB /* SourceViewCorner.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 21EC9664F21956FADCEF9134F909B74A /* CGRect+Area.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E5199A0158EA7B553B582999281E75 /* CGRect+Area.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 2A9FDD9927F1A610C304492868BDC5D0 /* ContextMenuPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4372D257F4D95B7947C8B75C44589837 /* ContextMenuPresentationController.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 32BD703743B0B8B75A5832596BBDD912 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; + 40F454BB711499A3B137B3CD6180DCD4 /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD65E35A3233FBE6F2EFDEB3D43D114 /* Pods-Example-dummy.m */; }; + 5781C6CCB5DE969BD2B288E1C5324350 /* ContextMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083F96FBD20FBEB55E326904926AB872 /* ContextMenu.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 60DB52EBDF12A3EB0DFB1DBACF33A21C /* ClippedContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A3903BCCBC56DE7698C23F1B9D7025 /* ClippedContainerViewController.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 6E2F766F9F48371E7CA5E0F47F1A6EEC /* ContextMenuPresenting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 248C9B4FF0D3F81A06280C402C567D88 /* ContextMenuPresenting.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 71B3B8136D9A8DACBBD76C3B1272FE02 /* Pods-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 15D3FE98E9F2D34863BD3F3597A0485A /* Pods-Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 787A1CED76E70C77A3DD9B9B7752812C /* ContextMenu+Options.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474D16CA3C348A373EFF57AD26B722F2 /* ContextMenu+Options.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 815B8988E0BCCDEF999236F4D8559306 /* ContextMenu+MenuStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62168363D7BF0CE18A35DC197FA28EE2 /* ContextMenu+MenuStyle.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + B249B66E738181ADC06D5F535E15ACB4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; + C0BD94C6FD169D88161473F1C6250C0A /* ContextMenuDismissing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4458DFE4EB0642A02F5AFCD928B409F7 /* ContextMenuDismissing.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + C688343B3B6107C07545D1AB5A931DF3 /* ContextMenu-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C3EAB79C04F9B0D923F8793CFDA2DD07 /* ContextMenu-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CC1D347FD60D409088D72BEB33249564 /* ContextMenu+UIViewControllerTransitioningDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DBAFC09AB1344CE2E45DEE323F5406 /* ContextMenu+UIViewControllerTransitioningDelegate.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + D50CEA488C152C5FE3F547F038B7BCC0 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9625EE0940E5B6D28DE87B9A9AA394 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + ED8938E64121FD9659C3469F672F1B50 /* ContextMenu+ContainerStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F09346CD57031C9F4615B373489CCB0 /* ContextMenu+ContainerStyle.swift */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 1BF88884B950C5385334221468581CB7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 94E34967574FD8A9203CFB4086EA7849; + remoteInfo = ContextMenu; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 044AA3E23F71470C9B5F50D44720EA0D /* Pods-Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-resources.sh"; sourceTree = ""; }; + 083F96FBD20FBEB55E326904926AB872 /* ContextMenu.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ContextMenu.swift; path = ContextMenu/ContextMenu.swift; sourceTree = ""; }; + 11434BC759D12F57876FBB74A4775E74 /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = ""; }; + 15D3FE98E9F2D34863BD3F3597A0485A /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = ""; }; + 15DBAFC09AB1344CE2E45DEE323F5406 /* ContextMenu+UIViewControllerTransitioningDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ContextMenu+UIViewControllerTransitioningDelegate.swift"; path = "ContextMenu/ContextMenu+UIViewControllerTransitioningDelegate.swift"; sourceTree = ""; }; + 1AD65E35A3233FBE6F2EFDEB3D43D114 /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = ""; }; + 248C9B4FF0D3F81A06280C402C567D88 /* ContextMenuPresenting.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ContextMenuPresenting.swift; path = ContextMenu/ContextMenuPresenting.swift; sourceTree = ""; }; + 25A37D4D536CC5988A439441117C41F4 /* Pods-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-Example.modulemap"; sourceTree = ""; }; + 2E9625EE0940E5B6D28DE87B9A9AA394 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ContextMenu+ContextMenuPresentationControllerDelegate.swift"; path = "ContextMenu/ContextMenu+ContextMenuPresentationControllerDelegate.swift"; sourceTree = ""; }; + 333B6A8DDD5E59721593B55968D63FAB /* SourceViewCorner.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SourceViewCorner.swift; path = ContextMenu/SourceViewCorner.swift; sourceTree = ""; }; + 3ADE9E5655579DB0F79DC9C80758673C /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = ""; }; + 3F3EFEBDE6702DEFDFFF9D5C6DBC3773 /* Pods-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-frameworks.sh"; sourceTree = ""; }; + 4372D257F4D95B7947C8B75C44589837 /* ContextMenuPresentationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ContextMenuPresentationController.swift; path = ContextMenu/ContextMenuPresentationController.swift; sourceTree = ""; }; + 4458DFE4EB0642A02F5AFCD928B409F7 /* ContextMenuDismissing.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ContextMenuDismissing.swift; path = ContextMenu/ContextMenuDismissing.swift; sourceTree = ""; }; + 474D16CA3C348A373EFF57AD26B722F2 /* ContextMenu+Options.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ContextMenu+Options.swift"; path = "ContextMenu/ContextMenu+Options.swift"; sourceTree = ""; }; + 4AA4306EDD56FD63FFE70487653C25C7 /* ContextMenu.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = ContextMenu.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 5A5ED5343F3693436571E370FA1D9B25 /* ContextMenu.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ContextMenu.xcconfig; sourceTree = ""; }; + 5B81C04F8E84EAE60AE15C8695031A5F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 62168363D7BF0CE18A35DC197FA28EE2 /* ContextMenu+MenuStyle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ContextMenu+MenuStyle.swift"; path = "ContextMenu/ContextMenu+MenuStyle.swift"; sourceTree = ""; }; + 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 6F09346CD57031C9F4615B373489CCB0 /* ContextMenu+ContainerStyle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ContextMenu+ContainerStyle.swift"; path = "ContextMenu/ContextMenu+ContainerStyle.swift"; sourceTree = ""; }; + 71DDD555C4F32B86F69F2CCE692E87C1 /* ContextMenu+Item.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ContextMenu+Item.swift"; path = "ContextMenu/ContextMenu+Item.swift"; sourceTree = ""; }; + 7F35176CEE9BAAD80281A0DF595B0D25 /* ContextMenu-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ContextMenu-dummy.m"; sourceTree = ""; }; + 8CA4BC8B1FC7FBDA052E28D7230EEC13 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Example.framework; path = "Pods-Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + A79AC23D5A157FED70D9C53D844B2319 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = ""; }; + A99C513A5107C353567935F9D81AA652 /* ContextMenu+Animations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ContextMenu+Animations.swift"; path = "ContextMenu/ContextMenu+Animations.swift"; sourceTree = ""; }; + BA36393F87FB036B5B9B0106BEC81095 /* ContextMenu-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ContextMenu-prefix.pch"; sourceTree = ""; }; + C3EAB79C04F9B0D923F8793CFDA2DD07 /* ContextMenu-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ContextMenu-umbrella.h"; sourceTree = ""; }; + C9792695121A60254E7D649C440E8697 /* ContextMenu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = ContextMenu.framework; path = ContextMenu.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D177D476D63313B2ADC339EC0713F6D5 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + D1B6FD6EAA05656387548B6C68F1CB27 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E7A3903BCCBC56DE7698C23F1B9D7025 /* ClippedContainerViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ClippedContainerViewController.swift; path = ContextMenu/ClippedContainerViewController.swift; sourceTree = ""; }; + E9E5199A0158EA7B553B582999281E75 /* CGRect+Area.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CGRect+Area.swift"; path = "ContextMenu/CGRect+Area.swift"; sourceTree = ""; }; + EE1CBCB45C857CA71181AC45E10D9857 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + EFC5B2E05B58CD826FD55659BF1D7E39 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = ""; }; + F3AC6FE060B4AE166C90F65E0E2BD194 /* ContextMenu.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = ContextMenu.modulemap; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 11A115FAF4DA547D1E09F39B8EBE85F1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B249B66E738181ADC06D5F535E15ACB4 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 81D8A176D77C945E39050D896E977827 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 32BD703743B0B8B75A5832596BBDD912 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1B5ECB992A56AE0C70DC72D88BB90B05 /* Pods-Example */ = { + isa = PBXGroup; + children = ( + 5B81C04F8E84EAE60AE15C8695031A5F /* Info.plist */, + 25A37D4D536CC5988A439441117C41F4 /* Pods-Example.modulemap */, + 3ADE9E5655579DB0F79DC9C80758673C /* Pods-Example-acknowledgements.markdown */, + 11434BC759D12F57876FBB74A4775E74 /* Pods-Example-acknowledgements.plist */, + 1AD65E35A3233FBE6F2EFDEB3D43D114 /* Pods-Example-dummy.m */, + 3F3EFEBDE6702DEFDFFF9D5C6DBC3773 /* Pods-Example-frameworks.sh */, + 044AA3E23F71470C9B5F50D44720EA0D /* Pods-Example-resources.sh */, + 15D3FE98E9F2D34863BD3F3597A0485A /* Pods-Example-umbrella.h */, + EFC5B2E05B58CD826FD55659BF1D7E39 /* Pods-Example.debug.xcconfig */, + A79AC23D5A157FED70D9C53D844B2319 /* Pods-Example.release.xcconfig */, + ); + name = "Pods-Example"; + path = "Target Support Files/Pods-Example"; + sourceTree = ""; + }; + 20940AA8C4D3863E207848977EBEF11C /* Support Files */ = { + isa = PBXGroup; + children = ( + F3AC6FE060B4AE166C90F65E0E2BD194 /* ContextMenu.modulemap */, + 5A5ED5343F3693436571E370FA1D9B25 /* ContextMenu.xcconfig */, + 7F35176CEE9BAAD80281A0DF595B0D25 /* ContextMenu-dummy.m */, + BA36393F87FB036B5B9B0106BEC81095 /* ContextMenu-prefix.pch */, + C3EAB79C04F9B0D923F8793CFDA2DD07 /* ContextMenu-umbrella.h */, + D1B6FD6EAA05656387548B6C68F1CB27 /* Info.plist */, + ); + name = "Support Files"; + path = "Example/Pods/Target Support Files/ContextMenu"; + sourceTree = ""; + }; + 3F0A5F1EF3DA411863AE72B94A1D0EA6 /* Development Pods */ = { + isa = PBXGroup; + children = ( + B3C1B7C3B8F55E46C293A5ACA2938450 /* ContextMenu */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 6A4F6A14E3FB951290E4531728B7A461 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 1B5ECB992A56AE0C70DC72D88BB90B05 /* Pods-Example */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 3F0A5F1EF3DA411863AE72B94A1D0EA6 /* Development Pods */, + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, + C65033CE272052BFBDCB15610D69AE2B /* Products */, + 6A4F6A14E3FB951290E4531728B7A461 /* Targets Support Files */, + ); + sourceTree = ""; + }; + B3C1B7C3B8F55E46C293A5ACA2938450 /* ContextMenu */ = { + isa = PBXGroup; + children = ( + E9E5199A0158EA7B553B582999281E75 /* CGRect+Area.swift */, + E7A3903BCCBC56DE7698C23F1B9D7025 /* ClippedContainerViewController.swift */, + 083F96FBD20FBEB55E326904926AB872 /* ContextMenu.swift */, + A99C513A5107C353567935F9D81AA652 /* ContextMenu+Animations.swift */, + 6F09346CD57031C9F4615B373489CCB0 /* ContextMenu+ContainerStyle.swift */, + 2E9625EE0940E5B6D28DE87B9A9AA394 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift */, + 71DDD555C4F32B86F69F2CCE692E87C1 /* ContextMenu+Item.swift */, + 62168363D7BF0CE18A35DC197FA28EE2 /* ContextMenu+MenuStyle.swift */, + 474D16CA3C348A373EFF57AD26B722F2 /* ContextMenu+Options.swift */, + 15DBAFC09AB1344CE2E45DEE323F5406 /* ContextMenu+UIViewControllerTransitioningDelegate.swift */, + 4458DFE4EB0642A02F5AFCD928B409F7 /* ContextMenuDismissing.swift */, + 4372D257F4D95B7947C8B75C44589837 /* ContextMenuPresentationController.swift */, + 248C9B4FF0D3F81A06280C402C567D88 /* ContextMenuPresenting.swift */, + 333B6A8DDD5E59721593B55968D63FAB /* SourceViewCorner.swift */, + DE363DB3821939CF89BB2CC8B8B39B2B /* Pod */, + 20940AA8C4D3863E207848977EBEF11C /* Support Files */, + ); + name = ContextMenu; + path = ../..; + sourceTree = ""; + }; + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { + isa = PBXGroup; + children = ( + D35AF013A5F0BAD4F32504907A52519E /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + C65033CE272052BFBDCB15610D69AE2B /* Products */ = { + isa = PBXGroup; + children = ( + C9792695121A60254E7D649C440E8697 /* ContextMenu.framework */, + 8CA4BC8B1FC7FBDA052E28D7230EEC13 /* Pods_Example.framework */, + ); + name = Products; + sourceTree = ""; + }; + D35AF013A5F0BAD4F32504907A52519E /* iOS */ = { + isa = PBXGroup; + children = ( + 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; + DE363DB3821939CF89BB2CC8B8B39B2B /* Pod */ = { + isa = PBXGroup; + children = ( + 4AA4306EDD56FD63FFE70487653C25C7 /* ContextMenu.podspec */, + EE1CBCB45C857CA71181AC45E10D9857 /* LICENSE */, + D177D476D63313B2ADC339EC0713F6D5 /* README.md */, + ); + name = Pod; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 56AA5040B4EFC9CA80BD7B049F73739F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 71B3B8136D9A8DACBBD76C3B1272FE02 /* Pods-Example-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AF762F200BA5827FC8DC4B06A78DC0F9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C688343B3B6107C07545D1AB5A931DF3 /* ContextMenu-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 4FFAA6E4EBC948A31BAEED42653BB8D7 /* Pods-Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = D3CB2AA0C5C3FD87BE88AEE41588DA13 /* Build configuration list for PBXNativeTarget "Pods-Example" */; + buildPhases = ( + 84E87A2BE9D1D93F66EBFD49006C04D4 /* Sources */, + 81D8A176D77C945E39050D896E977827 /* Frameworks */, + 56AA5040B4EFC9CA80BD7B049F73739F /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + B0033F7548FA4B72E658467AF36BE6F9 /* PBXTargetDependency */, + ); + name = "Pods-Example"; + productName = "Pods-Example"; + productReference = 8CA4BC8B1FC7FBDA052E28D7230EEC13 /* Pods_Example.framework */; + productType = "com.apple.product-type.framework"; + }; + 94E34967574FD8A9203CFB4086EA7849 /* ContextMenu */ = { + isa = PBXNativeTarget; + buildConfigurationList = 11FA8D253AF9022C08CF03380C0FABE1 /* Build configuration list for PBXNativeTarget "ContextMenu" */; + buildPhases = ( + 5C41E0B82C7A128B2905EE8DE18BB314 /* Sources */, + 11A115FAF4DA547D1E09F39B8EBE85F1 /* Frameworks */, + AF762F200BA5827FC8DC4B06A78DC0F9 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ContextMenu; + productName = ContextMenu; + productReference = C9792695121A60254E7D649C440E8697 /* ContextMenu.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = C65033CE272052BFBDCB15610D69AE2B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 94E34967574FD8A9203CFB4086EA7849 /* ContextMenu */, + 4FFAA6E4EBC948A31BAEED42653BB8D7 /* Pods-Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 5C41E0B82C7A128B2905EE8DE18BB314 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 21EC9664F21956FADCEF9134F909B74A /* CGRect+Area.swift in Sources */, + 60DB52EBDF12A3EB0DFB1DBACF33A21C /* ClippedContainerViewController.swift in Sources */, + 124D99BD9430F3AB4A6DF8E255DCA46A /* ContextMenu+Animations.swift in Sources */, + ED8938E64121FD9659C3469F672F1B50 /* ContextMenu+ContainerStyle.swift in Sources */, + D50CEA488C152C5FE3F547F038B7BCC0 /* ContextMenu+ContextMenuPresentationControllerDelegate.swift in Sources */, + 076F001444726AABF19EDF3AE0030DE6 /* ContextMenu+Item.swift in Sources */, + 815B8988E0BCCDEF999236F4D8559306 /* ContextMenu+MenuStyle.swift in Sources */, + 787A1CED76E70C77A3DD9B9B7752812C /* ContextMenu+Options.swift in Sources */, + CC1D347FD60D409088D72BEB33249564 /* ContextMenu+UIViewControllerTransitioningDelegate.swift in Sources */, + 1B66E33B588115713F5B90C812A0139C /* ContextMenu-dummy.m in Sources */, + 5781C6CCB5DE969BD2B288E1C5324350 /* ContextMenu.swift in Sources */, + C0BD94C6FD169D88161473F1C6250C0A /* ContextMenuDismissing.swift in Sources */, + 2A9FDD9927F1A610C304492868BDC5D0 /* ContextMenuPresentationController.swift in Sources */, + 6E2F766F9F48371E7CA5E0F47F1A6EEC /* ContextMenuPresenting.swift in Sources */, + 1EF18353721727430EEB0909C7305CFE /* SourceViewCorner.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 84E87A2BE9D1D93F66EBFD49006C04D4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 40F454BB711499A3B137B3CD6180DCD4 /* Pods-Example-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + B0033F7548FA4B72E658467AF36BE6F9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = ContextMenu; + target = 94E34967574FD8A9203CFB4086EA7849 /* ContextMenu */; + targetProxy = 1BF88884B950C5385334221468581CB7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 306B871BA67093DD446E506D7EEE972C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EFC5B2E05B58CD826FD55659BF1D7E39 /* Pods-Example.debug.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_Example; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 323A24856F1A4871A780301AF5C02A2A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 88C55FD0D32E908EE2717AA95BF9185A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5A5ED5343F3693436571E370FA1D9B25 /* ContextMenu.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/ContextMenu/ContextMenu-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/ContextMenu/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/ContextMenu/ContextMenu.modulemap"; + PRODUCT_NAME = ContextMenu; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 9AE385182761F2A5528F32131331D1CB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5A5ED5343F3693436571E370FA1D9B25 /* ContextMenu.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/ContextMenu/ContextMenu-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/ContextMenu/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/ContextMenu/ContextMenu.modulemap"; + PRODUCT_NAME = ContextMenu; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C72736E31C25E34B154DFAA69EFB6E7F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A79AC23D5A157FED70D9C53D844B2319 /* Pods-Example.release.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_Example; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + CA33F186435244FD0FD5B7325332656C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 11FA8D253AF9022C08CF03380C0FABE1 /* Build configuration list for PBXNativeTarget "ContextMenu" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9AE385182761F2A5528F32131331D1CB /* Debug */, + 88C55FD0D32E908EE2717AA95BF9185A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 323A24856F1A4871A780301AF5C02A2A /* Debug */, + CA33F186435244FD0FD5B7325332656C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D3CB2AA0C5C3FD87BE88AEE41588DA13 /* Build configuration list for PBXNativeTarget "Pods-Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 306B871BA67093DD446E506D7EEE972C /* Debug */, + C72736E31C25E34B154DFAA69EFB6E7F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/Example/Pods/Target Support Files/ContextMenu/ContextMenu-dummy.m b/Example/Pods/Target Support Files/ContextMenu/ContextMenu-dummy.m new file mode 100644 index 0000000..5a9861f --- /dev/null +++ b/Example/Pods/Target Support Files/ContextMenu/ContextMenu-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_ContextMenu : NSObject +@end +@implementation PodsDummy_ContextMenu +@end diff --git a/Example/Pods/Target Support Files/ContextMenu/ContextMenu-prefix.pch b/Example/Pods/Target Support Files/ContextMenu/ContextMenu-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/Example/Pods/Target Support Files/ContextMenu/ContextMenu-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/Example/Pods/Target Support Files/ContextMenu/ContextMenu-umbrella.h b/Example/Pods/Target Support Files/ContextMenu/ContextMenu-umbrella.h new file mode 100644 index 0000000..7cbea20 --- /dev/null +++ b/Example/Pods/Target Support Files/ContextMenu/ContextMenu-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double ContextMenuVersionNumber; +FOUNDATION_EXPORT const unsigned char ContextMenuVersionString[]; + diff --git a/Example/Pods/Target Support Files/ContextMenu/ContextMenu.modulemap b/Example/Pods/Target Support Files/ContextMenu/ContextMenu.modulemap new file mode 100644 index 0000000..c394daa --- /dev/null +++ b/Example/Pods/Target Support Files/ContextMenu/ContextMenu.modulemap @@ -0,0 +1,6 @@ +framework module ContextMenu { + umbrella header "ContextMenu-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/ContextMenu/ContextMenu.xcconfig b/Example/Pods/Target Support Files/ContextMenu/ContextMenu.xcconfig new file mode 100644 index 0000000..adbeb21 --- /dev/null +++ b/Example/Pods/Target Support Files/ContextMenu/ContextMenu.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ContextMenu +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/ContextMenu/Info.plist b/Example/Pods/Target Support Files/ContextMenu/Info.plist new file mode 100644 index 0000000..161a9d3 --- /dev/null +++ b/Example/Pods/Target Support Files/ContextMenu/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-Example/Info.plist b/Example/Pods/Target Support Files/Pods-Example/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown new file mode 100644 index 0000000..bceafdd --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown @@ -0,0 +1,28 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## ContextMenu + +The MIT License + +Copyright (c) 2017 Ryan Nystrom http://whoisryannystrom.com/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist new file mode 100644 index 0000000..1790d57 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist @@ -0,0 +1,60 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + The MIT License + +Copyright (c) 2017 Ryan Nystrom http://whoisryannystrom.com/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + ContextMenu + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m new file mode 100644 index 0000000..6ee3f90 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_Example : NSObject +@end +@implementation PodsDummy_Pods_Example +@end diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh new file mode 100755 index 0000000..0b943ea --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh @@ -0,0 +1,144 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/ContextMenu/ContextMenu.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/ContextMenu/ContextMenu.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh new file mode 100755 index 0000000..a7df440 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh @@ -0,0 +1,106 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + 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 + 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} + ;; + *.xib) + 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 + 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} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + 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}" +fi diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h new file mode 100644 index 0000000..ecf498e --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_ExampleVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_ExampleVersionString[]; + diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig new file mode 100644 index 0000000..b7f1db6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ContextMenu" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/ContextMenu/ContextMenu.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "ContextMenu" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap new file mode 100644 index 0000000..4b5189f --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap @@ -0,0 +1,6 @@ +framework module Pods_Example { + umbrella header "Pods-Example-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig new file mode 100644 index 0000000..b7f1db6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ContextMenu" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/ContextMenu/ContextMenu.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "ContextMenu" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2cb9e38 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2017 Ryan Nystrom http://whoisryannystrom.com/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed7829a --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +COMING SOON \ No newline at end of file