├── Making MVC Greate Again.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── omar.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── omar.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── Making MVC Greate Again.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── omar.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── Making MVC Greate Again ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ └── LaunchScreen.storyboard ├── Base │ ├── Classes │ │ ├── View.swift │ │ └── ViewController.swift │ └── Protocols │ │ ├── KeyboardControllable.swift │ │ └── KeyboardObserving.swift ├── Common │ └── Extensions.swift ├── Info.plist ├── LoginView.swift └── LoginViewController.swift ├── Podfile ├── Podfile.lock ├── Pods ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── omar.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-Making MVC Greate Again.xcscheme │ │ ├── SnapKit.xcscheme │ │ └── xcschememanagement.plist ├── SnapKit │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── Constraint.swift │ │ ├── ConstraintAttributes.swift │ │ ├── ConstraintConfig.swift │ │ ├── ConstraintConstantTarget.swift │ │ ├── ConstraintDSL.swift │ │ ├── ConstraintDescription.swift │ │ ├── ConstraintInsetTarget.swift │ │ ├── ConstraintInsets.swift │ │ ├── ConstraintItem.swift │ │ ├── ConstraintLayoutGuide+Extensions.swift │ │ ├── ConstraintLayoutGuide.swift │ │ ├── ConstraintLayoutGuideDSL.swift │ │ ├── ConstraintLayoutSupport.swift │ │ ├── ConstraintLayoutSupportDSL.swift │ │ ├── ConstraintMaker.swift │ │ ├── ConstraintMakerEditable.swift │ │ ├── ConstraintMakerExtendable.swift │ │ ├── ConstraintMakerFinalizable.swift │ │ ├── ConstraintMakerPriortizable.swift │ │ ├── ConstraintMakerRelatable.swift │ │ ├── ConstraintMultiplierTarget.swift │ │ ├── ConstraintOffsetTarget.swift │ │ ├── ConstraintPriority.swift │ │ ├── ConstraintPriorityTarget.swift │ │ ├── ConstraintRelatableTarget.swift │ │ ├── ConstraintRelation.swift │ │ ├── ConstraintView+Extensions.swift │ │ ├── ConstraintView.swift │ │ ├── ConstraintViewDSL.swift │ │ ├── Debugging.swift │ │ ├── LayoutConstraint.swift │ │ ├── LayoutConstraintItem.swift │ │ ├── Typealiases.swift │ │ └── UILayoutSupport+Extensions.swift └── Target Support Files │ ├── Pods-Making MVC Greate Again │ ├── Info.plist │ ├── Pods-Making MVC Greate Again-acknowledgements.markdown │ ├── Pods-Making MVC Greate Again-acknowledgements.plist │ ├── Pods-Making MVC Greate Again-dummy.m │ ├── Pods-Making MVC Greate Again-frameworks.sh │ ├── Pods-Making MVC Greate Again-resources.sh │ ├── Pods-Making MVC Greate Again-umbrella.h │ ├── Pods-Making MVC Greate Again.debug.xcconfig │ ├── Pods-Making MVC Greate Again.modulemap │ └── Pods-Making MVC Greate Again.release.xcconfig │ └── SnapKit │ ├── Info.plist │ ├── SnapKit-dummy.m │ ├── SnapKit-prefix.pch │ ├── SnapKit-umbrella.h │ ├── SnapKit.modulemap │ └── SnapKit.xcconfig └── README.md /Making MVC Greate Again.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 070B068120795EFB008880C8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 070B068020795EFB008880C8 /* AppDelegate.swift */; }; 11 | 070B068320795EFB008880C8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 070B068220795EFB008880C8 /* ViewController.swift */; }; 12 | 070B068820795EFC008880C8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 070B068720795EFC008880C8 /* Assets.xcassets */; }; 13 | 070B068B20795EFC008880C8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 070B068920795EFC008880C8 /* LaunchScreen.storyboard */; }; 14 | 070B069320795F43008880C8 /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 070B069220795F43008880C8 /* View.swift */; }; 15 | 070B069520795F83008880C8 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 070B069420795F83008880C8 /* Extensions.swift */; }; 16 | 070B069820795FA6008880C8 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 070B069720795FA6008880C8 /* LoginView.swift */; }; 17 | 070B069A20795FB8008880C8 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 070B069920795FB8008880C8 /* LoginViewController.swift */; }; 18 | 07A36233208C93630098740B /* KeyboardControllable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07A36232208C93630098740B /* KeyboardControllable.swift */; }; 19 | 07A36235208C941F0098740B /* KeyboardObserving.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07A36234208C941F0098740B /* KeyboardObserving.swift */; }; 20 | F68C32C1FE498C51EBAB03DB /* Pods_Making_MVC_Greate_Again.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A39600B52F21EE4FA731C044 /* Pods_Making_MVC_Greate_Again.framework */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 070B067D20795EFB008880C8 /* Making MVC Greate Again.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Making MVC Greate Again.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 070B068020795EFB008880C8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 26 | 070B068220795EFB008880C8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 27 | 070B068720795EFC008880C8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 070B068A20795EFC008880C8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 070B068C20795EFC008880C8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 070B069220795F43008880C8 /* View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.swift; sourceTree = ""; }; 31 | 070B069420795F83008880C8 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 32 | 070B069720795FA6008880C8 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; 33 | 070B069920795FB8008880C8 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; 34 | 07A36232208C93630098740B /* KeyboardControllable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardControllable.swift; sourceTree = ""; }; 35 | 07A36234208C941F0098740B /* KeyboardObserving.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardObserving.swift; sourceTree = ""; }; 36 | 40AF08278A0FF2C3BB89B1E8 /* Pods-Making MVC Greate Again.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Making MVC Greate Again.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again.debug.xcconfig"; sourceTree = ""; }; 37 | A39600B52F21EE4FA731C044 /* Pods_Making_MVC_Greate_Again.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Making_MVC_Greate_Again.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | EA1EDEA9BB224469044F6188 /* Pods-Making MVC Greate Again.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Making MVC Greate Again.release.xcconfig"; path = "Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again.release.xcconfig"; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 070B067A20795EFB008880C8 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | F68C32C1FE498C51EBAB03DB /* Pods_Making_MVC_Greate_Again.framework in Frameworks */, 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXFrameworksBuildPhase section */ 51 | 52 | /* Begin PBXGroup section */ 53 | 070B067420795EFB008880C8 = { 54 | isa = PBXGroup; 55 | children = ( 56 | 070B067F20795EFB008880C8 /* Making MVC Greate Again */, 57 | 070B067E20795EFB008880C8 /* Products */, 58 | C123AC50ADCD2265B1AE0C5F /* Pods */, 59 | 6FC006ECCAF45E61DE0DABAE /* Frameworks */, 60 | ); 61 | sourceTree = ""; 62 | }; 63 | 070B067E20795EFB008880C8 /* Products */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | 070B067D20795EFB008880C8 /* Making MVC Greate Again.app */, 67 | ); 68 | name = Products; 69 | sourceTree = ""; 70 | }; 71 | 070B067F20795EFB008880C8 /* Making MVC Greate Again */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 070B068020795EFB008880C8 /* AppDelegate.swift */, 75 | 070B069620795F98008880C8 /* Base */, 76 | 070B069B20796003008880C8 /* Common */, 77 | 070B069720795FA6008880C8 /* LoginView.swift */, 78 | 070B069920795FB8008880C8 /* LoginViewController.swift */, 79 | 070B068720795EFC008880C8 /* Assets.xcassets */, 80 | 070B068920795EFC008880C8 /* LaunchScreen.storyboard */, 81 | 070B068C20795EFC008880C8 /* Info.plist */, 82 | ); 83 | path = "Making MVC Greate Again"; 84 | sourceTree = ""; 85 | }; 86 | 070B069620795F98008880C8 /* Base */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 07A36236208C95C40098740B /* Protocols */, 90 | 07A36237208C95D60098740B /* Classes */, 91 | ); 92 | path = Base; 93 | sourceTree = ""; 94 | }; 95 | 070B069B20796003008880C8 /* Common */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 070B069420795F83008880C8 /* Extensions.swift */, 99 | ); 100 | path = Common; 101 | sourceTree = ""; 102 | }; 103 | 07A36236208C95C40098740B /* Protocols */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 07A36232208C93630098740B /* KeyboardControllable.swift */, 107 | 07A36234208C941F0098740B /* KeyboardObserving.swift */, 108 | ); 109 | path = Protocols; 110 | sourceTree = ""; 111 | }; 112 | 07A36237208C95D60098740B /* Classes */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 070B069220795F43008880C8 /* View.swift */, 116 | 070B068220795EFB008880C8 /* ViewController.swift */, 117 | ); 118 | path = Classes; 119 | sourceTree = ""; 120 | }; 121 | 6FC006ECCAF45E61DE0DABAE /* Frameworks */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | A39600B52F21EE4FA731C044 /* Pods_Making_MVC_Greate_Again.framework */, 125 | ); 126 | name = Frameworks; 127 | sourceTree = ""; 128 | }; 129 | C123AC50ADCD2265B1AE0C5F /* Pods */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 40AF08278A0FF2C3BB89B1E8 /* Pods-Making MVC Greate Again.debug.xcconfig */, 133 | EA1EDEA9BB224469044F6188 /* Pods-Making MVC Greate Again.release.xcconfig */, 134 | ); 135 | name = Pods; 136 | sourceTree = ""; 137 | }; 138 | /* End PBXGroup section */ 139 | 140 | /* Begin PBXNativeTarget section */ 141 | 070B067C20795EFB008880C8 /* Making MVC Greate Again */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = 070B068F20795EFC008880C8 /* Build configuration list for PBXNativeTarget "Making MVC Greate Again" */; 144 | buildPhases = ( 145 | 2BB599086434748092B4F4A7 /* [CP] Check Pods Manifest.lock */, 146 | 070B067920795EFB008880C8 /* Sources */, 147 | 070B067A20795EFB008880C8 /* Frameworks */, 148 | 070B067B20795EFB008880C8 /* Resources */, 149 | 37C81694A47EFCA522326380 /* [CP] Embed Pods Frameworks */, 150 | E0C9C8E7ABD0168F185E809A /* [CP] Copy Pods Resources */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = "Making MVC Greate Again"; 157 | productName = "Making MVC Greate Again"; 158 | productReference = 070B067D20795EFB008880C8 /* Making MVC Greate Again.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | 070B067520795EFB008880C8 /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastSwiftUpdateCheck = 0930; 168 | LastUpgradeCheck = 0930; 169 | ORGANIZATIONNAME = "Omar Albeik"; 170 | TargetAttributes = { 171 | 070B067C20795EFB008880C8 = { 172 | CreatedOnToolsVersion = 9.3; 173 | }; 174 | }; 175 | }; 176 | buildConfigurationList = 070B067820795EFB008880C8 /* Build configuration list for PBXProject "Making MVC Greate Again" */; 177 | compatibilityVersion = "Xcode 9.3"; 178 | developmentRegion = en; 179 | hasScannedForEncodings = 0; 180 | knownRegions = ( 181 | en, 182 | Base, 183 | ); 184 | mainGroup = 070B067420795EFB008880C8; 185 | productRefGroup = 070B067E20795EFB008880C8 /* Products */; 186 | projectDirPath = ""; 187 | projectRoot = ""; 188 | targets = ( 189 | 070B067C20795EFB008880C8 /* Making MVC Greate Again */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | 070B067B20795EFB008880C8 /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | 070B068B20795EFC008880C8 /* LaunchScreen.storyboard in Resources */, 200 | 070B068820795EFC008880C8 /* Assets.xcassets in Resources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | /* End PBXResourcesBuildPhase section */ 205 | 206 | /* Begin PBXShellScriptBuildPhase section */ 207 | 2BB599086434748092B4F4A7 /* [CP] Check Pods Manifest.lock */ = { 208 | isa = PBXShellScriptBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | ); 212 | inputPaths = ( 213 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 214 | "${PODS_ROOT}/Manifest.lock", 215 | ); 216 | name = "[CP] Check Pods Manifest.lock"; 217 | outputPaths = ( 218 | "$(DERIVED_FILE_DIR)/Pods-Making MVC Greate Again-checkManifestLockResult.txt", 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | shellPath = /bin/sh; 222 | 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"; 223 | showEnvVarsInLog = 0; 224 | }; 225 | 37C81694A47EFCA522326380 /* [CP] Embed Pods Frameworks */ = { 226 | isa = PBXShellScriptBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | inputPaths = ( 231 | "${SRCROOT}/Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-frameworks.sh", 232 | "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework", 233 | ); 234 | name = "[CP] Embed Pods Frameworks"; 235 | outputPaths = ( 236 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework", 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | shellPath = /bin/sh; 240 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-frameworks.sh\"\n"; 241 | showEnvVarsInLog = 0; 242 | }; 243 | E0C9C8E7ABD0168F185E809A /* [CP] Copy Pods Resources */ = { 244 | isa = PBXShellScriptBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ); 248 | inputPaths = ( 249 | ); 250 | name = "[CP] Copy Pods Resources"; 251 | outputPaths = ( 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | shellPath = /bin/sh; 255 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-resources.sh\"\n"; 256 | showEnvVarsInLog = 0; 257 | }; 258 | /* End PBXShellScriptBuildPhase section */ 259 | 260 | /* Begin PBXSourcesBuildPhase section */ 261 | 070B067920795EFB008880C8 /* Sources */ = { 262 | isa = PBXSourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | 070B069A20795FB8008880C8 /* LoginViewController.swift in Sources */, 266 | 070B068320795EFB008880C8 /* ViewController.swift in Sources */, 267 | 07A36235208C941F0098740B /* KeyboardObserving.swift in Sources */, 268 | 070B068120795EFB008880C8 /* AppDelegate.swift in Sources */, 269 | 070B069320795F43008880C8 /* View.swift in Sources */, 270 | 070B069820795FA6008880C8 /* LoginView.swift in Sources */, 271 | 07A36233208C93630098740B /* KeyboardControllable.swift in Sources */, 272 | 070B069520795F83008880C8 /* Extensions.swift in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXSourcesBuildPhase section */ 277 | 278 | /* Begin PBXVariantGroup section */ 279 | 070B068920795EFC008880C8 /* LaunchScreen.storyboard */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | 070B068A20795EFC008880C8 /* Base */, 283 | ); 284 | name = LaunchScreen.storyboard; 285 | sourceTree = ""; 286 | }; 287 | /* End PBXVariantGroup section */ 288 | 289 | /* Begin XCBuildConfiguration section */ 290 | 070B068D20795EFC008880C8 /* Debug */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | ALWAYS_SEARCH_USER_PATHS = NO; 294 | CLANG_ANALYZER_NONNULL = YES; 295 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 296 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 297 | CLANG_CXX_LIBRARY = "libc++"; 298 | CLANG_ENABLE_MODULES = YES; 299 | CLANG_ENABLE_OBJC_ARC = YES; 300 | CLANG_ENABLE_OBJC_WEAK = YES; 301 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 302 | CLANG_WARN_BOOL_CONVERSION = YES; 303 | CLANG_WARN_COMMA = YES; 304 | CLANG_WARN_CONSTANT_CONVERSION = YES; 305 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 307 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 308 | CLANG_WARN_EMPTY_BODY = YES; 309 | CLANG_WARN_ENUM_CONVERSION = YES; 310 | CLANG_WARN_INFINITE_RECURSION = YES; 311 | CLANG_WARN_INT_CONVERSION = YES; 312 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 313 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 314 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 315 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 316 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 317 | CLANG_WARN_STRICT_PROTOTYPES = YES; 318 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 319 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 320 | CLANG_WARN_UNREACHABLE_CODE = YES; 321 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 322 | CODE_SIGN_IDENTITY = "iPhone Developer"; 323 | COPY_PHASE_STRIP = NO; 324 | DEBUG_INFORMATION_FORMAT = dwarf; 325 | ENABLE_STRICT_OBJC_MSGSEND = YES; 326 | ENABLE_TESTABILITY = YES; 327 | GCC_C_LANGUAGE_STANDARD = gnu11; 328 | GCC_DYNAMIC_NO_PIC = NO; 329 | GCC_NO_COMMON_BLOCKS = YES; 330 | GCC_OPTIMIZATION_LEVEL = 0; 331 | GCC_PREPROCESSOR_DEFINITIONS = ( 332 | "DEBUG=1", 333 | "$(inherited)", 334 | ); 335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 337 | GCC_WARN_UNDECLARED_SELECTOR = YES; 338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 339 | GCC_WARN_UNUSED_FUNCTION = YES; 340 | GCC_WARN_UNUSED_VARIABLE = YES; 341 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 342 | MTL_ENABLE_DEBUG_INFO = YES; 343 | ONLY_ACTIVE_ARCH = YES; 344 | SDKROOT = iphoneos; 345 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 346 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 347 | }; 348 | name = Debug; 349 | }; 350 | 070B068E20795EFC008880C8 /* Release */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ALWAYS_SEARCH_USER_PATHS = NO; 354 | CLANG_ANALYZER_NONNULL = YES; 355 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 356 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 357 | CLANG_CXX_LIBRARY = "libc++"; 358 | CLANG_ENABLE_MODULES = YES; 359 | CLANG_ENABLE_OBJC_ARC = YES; 360 | CLANG_ENABLE_OBJC_WEAK = YES; 361 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 362 | CLANG_WARN_BOOL_CONVERSION = YES; 363 | CLANG_WARN_COMMA = YES; 364 | CLANG_WARN_CONSTANT_CONVERSION = YES; 365 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 366 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 367 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 368 | CLANG_WARN_EMPTY_BODY = YES; 369 | CLANG_WARN_ENUM_CONVERSION = YES; 370 | CLANG_WARN_INFINITE_RECURSION = YES; 371 | CLANG_WARN_INT_CONVERSION = YES; 372 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 373 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 374 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 377 | CLANG_WARN_STRICT_PROTOTYPES = YES; 378 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 379 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 380 | CLANG_WARN_UNREACHABLE_CODE = YES; 381 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 382 | CODE_SIGN_IDENTITY = "iPhone Developer"; 383 | COPY_PHASE_STRIP = NO; 384 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 385 | ENABLE_NS_ASSERTIONS = NO; 386 | ENABLE_STRICT_OBJC_MSGSEND = YES; 387 | GCC_C_LANGUAGE_STANDARD = gnu11; 388 | GCC_NO_COMMON_BLOCKS = YES; 389 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 390 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 391 | GCC_WARN_UNDECLARED_SELECTOR = YES; 392 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 393 | GCC_WARN_UNUSED_FUNCTION = YES; 394 | GCC_WARN_UNUSED_VARIABLE = YES; 395 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 396 | MTL_ENABLE_DEBUG_INFO = NO; 397 | SDKROOT = iphoneos; 398 | SWIFT_COMPILATION_MODE = wholemodule; 399 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 400 | VALIDATE_PRODUCT = YES; 401 | }; 402 | name = Release; 403 | }; 404 | 070B069020795EFC008880C8 /* Debug */ = { 405 | isa = XCBuildConfiguration; 406 | baseConfigurationReference = 40AF08278A0FF2C3BB89B1E8 /* Pods-Making MVC Greate Again.debug.xcconfig */; 407 | buildSettings = { 408 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 409 | CODE_SIGN_STYLE = Automatic; 410 | DEVELOPMENT_TEAM = C3VKVFB3SA; 411 | INFOPLIST_FILE = "Making MVC Greate Again/Info.plist"; 412 | LD_RUNPATH_SEARCH_PATHS = ( 413 | "$(inherited)", 414 | "@executable_path/Frameworks", 415 | ); 416 | PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.Making-MVC-Greate-Again"; 417 | PRODUCT_NAME = "$(TARGET_NAME)"; 418 | SWIFT_VERSION = 4.0; 419 | TARGETED_DEVICE_FAMILY = "1,2"; 420 | }; 421 | name = Debug; 422 | }; 423 | 070B069120795EFC008880C8 /* Release */ = { 424 | isa = XCBuildConfiguration; 425 | baseConfigurationReference = EA1EDEA9BB224469044F6188 /* Pods-Making MVC Greate Again.release.xcconfig */; 426 | buildSettings = { 427 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 428 | CODE_SIGN_STYLE = Automatic; 429 | DEVELOPMENT_TEAM = C3VKVFB3SA; 430 | INFOPLIST_FILE = "Making MVC Greate Again/Info.plist"; 431 | LD_RUNPATH_SEARCH_PATHS = ( 432 | "$(inherited)", 433 | "@executable_path/Frameworks", 434 | ); 435 | PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.Making-MVC-Greate-Again"; 436 | PRODUCT_NAME = "$(TARGET_NAME)"; 437 | SWIFT_VERSION = 4.0; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | }; 440 | name = Release; 441 | }; 442 | /* End XCBuildConfiguration section */ 443 | 444 | /* Begin XCConfigurationList section */ 445 | 070B067820795EFB008880C8 /* Build configuration list for PBXProject "Making MVC Greate Again" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 070B068D20795EFC008880C8 /* Debug */, 449 | 070B068E20795EFC008880C8 /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | 070B068F20795EFC008880C8 /* Build configuration list for PBXNativeTarget "Making MVC Greate Again" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 070B069020795EFC008880C8 /* Debug */, 458 | 070B069120795EFC008880C8 /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | defaultConfigurationName = Release; 462 | }; 463 | /* End XCConfigurationList section */ 464 | }; 465 | rootObject = 070B067520795EFB008880C8 /* Project object */; 466 | } 467 | -------------------------------------------------------------------------------- /Making MVC Greate Again.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Making MVC Greate Again.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Making MVC Greate Again.xcodeproj/project.xcworkspace/xcuserdata/omar.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omaralbeik/making-mvc-great-again/817861404b079fa049714eb3e7515a7fab54f13c/Making MVC Greate Again.xcodeproj/project.xcworkspace/xcuserdata/omar.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Making MVC Greate Again.xcodeproj/xcuserdata/omar.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Making MVC Greate Again.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Making MVC Greate Again.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Making MVC Greate Again.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Making MVC Greate Again.xcworkspace/xcuserdata/omar.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omaralbeik/making-mvc-great-again/817861404b079fa049714eb3e7515a7fab54f13c/Making MVC Greate Again.xcworkspace/xcuserdata/omar.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Making MVC Greate Again/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/7/18. 6 | // Copyright © 2018 Omar Albeik. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 17 | 18 | window = UIWindow() 19 | window?.rootViewController = LoginViewController() 20 | window?.makeKeyAndVisible() 21 | 22 | return true 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Making MVC Greate Again/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Making MVC Greate Again/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Making MVC Greate Again/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Making MVC Greate Again/Base/Classes/View.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/7/18. 6 | // Copyright © 2018 Omar Albeik. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class View: UIView { 12 | 13 | override init(frame: CGRect) { 14 | super.init(frame: frame) 15 | 16 | setViews() 17 | layoutViews() 18 | } 19 | 20 | required init?(coder aDecoder: NSCoder) { 21 | super.init(coder: aDecoder) 22 | 23 | setViews() 24 | layoutViews() 25 | } 26 | 27 | /// Set your view and its subviews here. 28 | func setViews() { 29 | backgroundColor = .white 30 | } 31 | 32 | /// Layout your subviews here. 33 | func layoutViews() {} 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Making MVC Greate Again/Base/Classes/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/7/18. 6 | // Copyright © 2018 Omar Albeik. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func loadView() { 14 | view = V() 15 | } 16 | 17 | var customView: V { 18 | return view as! V 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Making MVC Greate Again/Base/Protocols/KeyboardControllable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardControllable.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/22/18. 6 | // Copyright © 2018 Omar Albeik. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | /// Conform to `KeyboardObserving` protocol in a view controller to observe UIKeyboard events. 11 | protocol KeyboardObserving: class { 12 | 13 | /// Called when .UIKeyboardWillShow notification is prodcasted by system. 14 | /// 15 | /// - Parameter notification: .UIKeyboardWillShow notification. 16 | func keyboardWillShow(_ notification: Notification) 17 | 18 | /// Called when .UIKeyboardDidShow notification is prodcasted by system. 19 | /// 20 | /// - Parameter notification: .UIKeyboardDidShow notification. 21 | func keyboardDidShow(_ notification: Notification) 22 | 23 | /// Called when .UIKeyboardWillHide notification is prodcasted by system. 24 | /// 25 | /// - Parameter notification: .UIKeyboardWillHide notification. 26 | func keyboardWillHide(_ notification: Notification) 27 | 28 | /// Called when .UIKeyboardDidHide notification is prodcasted by system. 29 | /// 30 | /// - Parameter notification: .UIKeyboardDidHide notification. 31 | func keyboardDidHide(_ notification: Notification) 32 | 33 | /// Called when .UIKeyboardWillChangeFrame notification is prodcasted by system. 34 | /// 35 | /// - Parameter notification: .UIKeyboardWillChangeFrame notification. 36 | func keyboardWillChangeFrame(_ notification: Notification) 37 | 38 | /// Called when .UIKeyboardDidChangeFrame notification is prodcasted by system. 39 | /// 40 | /// - Parameter notification: .UIKeyboardDidChangeFrame notification. 41 | func keyboardDidChangeFrame(_ notification: Notification) 42 | 43 | /// Register for UIKeyboard notifications. 44 | func registerForKeyboardEvents() 45 | 46 | /// Unregister from UIKeyboard notifications. 47 | func unregisterFromKeyboardEvents() 48 | 49 | } 50 | 51 | extension KeyboardObserving where Self: UIViewController { 52 | 53 | /// Called when .UIKeyboardWillShow notification is prodcasted by system. 54 | /// 55 | /// - Parameter notification: .UIKeyboardWillShow notification. 56 | func keyboardWillShow(_ notification: Notification) {} 57 | 58 | /// Called when .UIKeyboardDidShow notification is prodcasted by system. 59 | /// 60 | /// - Parameter notification: .UIKeyboardDidShow notification. 61 | func keyboardDidShow(_ notification: Notification) {} 62 | 63 | /// Called when .UIKeyboardWillHide notification is prodcasted by system. 64 | /// 65 | /// - Parameter notification: .UIKeyboardWillHide notification. 66 | func keyboardWillHide(_ notification: Notification) {} 67 | 68 | /// Called when .UIKeyboardDidHide notification is prodcasted by system. 69 | /// 70 | /// - Parameter notification: .UIKeyboardDidHide notification. 71 | func keyboardDidHide(_ notification: Notification) {} 72 | 73 | /// Called when .UIKeyboardWillChangeFrame notification is prodcasted by system. 74 | /// 75 | /// - Parameter notification: .UIKeyboardWillChangeFrame notification. 76 | func keyboardWillChangeFrame(_ notification: Notification) {} 77 | 78 | /// Called when .UIKeyboardDidChangeFrame notification is prodcasted by system. 79 | /// 80 | /// - Parameter notification: .UIKeyboardDidChangeFrame notification. 81 | func keyboardDidChangeFrame(_ notification: Notification) {} 82 | 83 | /// Register for UIKeyboard notifications. 84 | func registerForKeyboardEvents() { 85 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: nil) { [weak self] (notification) in 86 | self?.keyboardWillShow(notification) 87 | } 88 | 89 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: nil) { [weak self] (notification) in 90 | self?.keyboardDidShow(notification) 91 | } 92 | 93 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: nil) { [weak self] (notification) in 94 | self?.keyboardWillHide(notification) 95 | } 96 | 97 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidHideNotification, object: nil, queue: nil) { [weak self] (notification) in 98 | self?.keyboardDidHide(notification) 99 | } 100 | 101 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillChangeFrameNotification, object: nil, queue: nil) { [weak self] (notification) in 102 | self?.keyboardWillChangeFrame(notification) 103 | } 104 | 105 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidChangeFrameNotification, object: nil, queue: nil) { [weak self] (notification) in 106 | self?.keyboardDidChangeFrame(notification) 107 | } 108 | } 109 | 110 | /// Unregister from UIKeyboard notifications. 111 | func unregisterFromKeyboardEvents() { 112 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil) 113 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardDidShowNotification, object: nil) 114 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil) 115 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardDidHideNotification, object: nil) 116 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillChangeFrameNotification, object: nil) 117 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardDidChangeFrameNotification, object: nil) 118 | } 119 | 120 | } 121 | 122 | 123 | /// Conform to KeyboardControllable protocol in a view to handle UIKeyboard events. 124 | protocol KeyboardControllable: class { 125 | 126 | /// Call this method from view contoller to handle KeyboardWillShow notification. 127 | /// 128 | /// - Parameter notification: keyboard notificaton sent from system. 129 | func handleKeyboardWillShow(_ notification: Notification) 130 | 131 | /// Call this method from view contoller to handle handleKeyboardDidShow notification. 132 | /// 133 | /// - Parameter notification: keyboard notificaton sent from system. 134 | func handleKeyboardDidShow(_ notification: Notification) 135 | 136 | /// Call this method from view contoller to handle handleKeyboardWillHide notification. 137 | /// 138 | /// - Parameter notification: keyboard notificaton sent from system. 139 | func handleKeyboardWillHide(_ notification: Notification) 140 | 141 | /// Call this method from view contoller to handle handleKeyboardDidHide notification. 142 | /// 143 | /// - Parameter notification: keyboard notificaton sent from system. 144 | func handleKeyboardDidHide(_ notification: Notification) 145 | 146 | /// Call this method from view contoller to handle handleKeyboardWillChangeFrame notification. 147 | /// 148 | /// - Parameter notification: keyboard notificaton sent from system. 149 | func handleKeyboardWillChangeFrame(_ notification: Notification) 150 | 151 | /// Call this method from view contoller to handle handleKeyboardDidChangeFrame notification. 152 | /// 153 | /// - Parameter notification: keyboard notificaton sent from system. 154 | func handleKeyboardDidChangeFrame(_ notification: Notification) 155 | 156 | } 157 | 158 | extension KeyboardControllable where Self: UIView { 159 | 160 | func handleKeyboardWillShow(_ notification: Notification) {} 161 | 162 | func handleKeyboardDidShow(_ notification: Notification) {} 163 | 164 | func handleKeyboardWillHide(_ notification: Notification) {} 165 | 166 | func handleKeyboardDidHide(_ notification: Notification) {} 167 | 168 | func handleKeyboardWillChangeFrame(_ notification: Notification) {} 169 | 170 | func handleKeyboardDidChangeFrame(_ notification: Notification) {} 171 | 172 | } 173 | -------------------------------------------------------------------------------- /Making MVC Greate Again/Base/Protocols/KeyboardObserving.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardObserving.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/22/18. 6 | // Updated by Philip Ives on 1/24/19 7 | // Copyright © 2018 Omar Albeik. All rights reserved. 8 | // 9 | 10 | import UIKit 11 | import Foundation 12 | 13 | /// Conform to `KeyboardObserving` protocol in a view controller to observe UIKeyboard events. 14 | protocol KeyboardObserving: class { 15 | 16 | /// Called when .UIKeyboardWillShow notification is prodcasted by system. 17 | /// 18 | /// - Parameter notification: .UIKeyboardWillShow notification. 19 | func keyboardWillShow(_ notification: Notification) 20 | 21 | /// Called when .UIKeyboardDidShow notification is prodcasted by system. 22 | /// 23 | /// - Parameter notification: .UIKeyboardDidShow notification. 24 | func keyboardDidShow(_ notification: Notification) 25 | 26 | /// Called when .UIKeyboardWillHide notification is prodcasted by system. 27 | /// 28 | /// - Parameter notification: .UIKeyboardWillHide notification. 29 | func keyboardWillHide(_ notification: Notification) 30 | 31 | /// Called when .UIKeyboardDidHide notification is prodcasted by system. 32 | /// 33 | /// - Parameter notification: .UIKeyboardDidHide notification. 34 | func keyboardDidHide(_ notification: Notification) 35 | 36 | /// Called when .UIKeyboardWillChangeFrame notification is prodcasted by system. 37 | /// 38 | /// - Parameter notification: .UIKeyboardWillChangeFrame notification. 39 | func keyboardWillChangeFrame(_ notification: Notification) 40 | 41 | /// Called when .UIKeyboardDidChangeFrame notification is prodcasted by system. 42 | /// 43 | /// - Parameter notification: .UIKeyboardDidChangeFrame notification. 44 | func keyboardDidChangeFrame(_ notification: Notification) 45 | 46 | /// Register for UIKeyboard notifications. 47 | func registerForKeyboardEvents() 48 | 49 | /// Unregister from UIKeyboard notifications. 50 | func unregisterFromKeyboardEvents() 51 | 52 | } 53 | 54 | extension KeyboardObserving where Self: UIViewController { 55 | 56 | /// Called when .UIKeyboardWillShow notification is prodcasted by system. 57 | /// 58 | /// - Parameter notification: .UIKeyboardWillShow notification. 59 | func keyboardWillShow(_ notification: Notification) {} 60 | 61 | /// Called when .UIKeyboardDidShow notification is prodcasted by system. 62 | /// 63 | /// - Parameter notification: .UIKeyboardDidShow notification. 64 | func keyboardDidShow(_ notification: Notification) {} 65 | 66 | /// Called when .UIKeyboardWillHide notification is prodcasted by system. 67 | /// 68 | /// - Parameter notification: .UIKeyboardWillHide notification. 69 | func keyboardWillHide(_ notification: Notification) {} 70 | 71 | /// Called when .UIKeyboardDidHide notification is prodcasted by system. 72 | /// 73 | /// - Parameter notification: .UIKeyboardDidHide notification. 74 | func keyboardDidHide(_ notification: Notification) {} 75 | 76 | /// Called when .UIKeyboardWillChangeFrame notification is prodcasted by system. 77 | /// 78 | /// - Parameter notification: .UIKeyboardWillChangeFrame notification. 79 | func keyboardWillChangeFrame(_ notification: Notification) {} 80 | 81 | /// Called when .UIKeyboardDidChangeFrame notification is prodcasted by system. 82 | /// 83 | /// - Parameter notification: .UIKeyboardDidChangeFrame notification. 84 | func keyboardDidChangeFrame(_ notification: Notification) {} 85 | 86 | /// Register for UIKeyboard notifications. 87 | func registerForKeyboardEvents() { 88 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: nil) { [weak self] (notification) in 89 | self?.keyboardWillShow(notification) 90 | } 91 | 92 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: nil) { [weak self] (notification) in 93 | self?.keyboardDidShow(notification) 94 | } 95 | 96 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: nil) { [weak self] (notification) in 97 | self?.keyboardWillHide(notification) 98 | } 99 | 100 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidHideNotification, object: nil, queue: nil) { [weak self] (notification) in 101 | self?.keyboardDidHide(notification) 102 | } 103 | 104 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillChangeFrameNotification, object: nil, queue: nil) { [weak self] (notification) in 105 | self?.keyboardWillChangeFrame(notification) 106 | } 107 | 108 | _ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidChangeFrameNotification, object: nil, queue: nil) { [weak self] (notification) in 109 | self?.keyboardDidChangeFrame(notification) 110 | } 111 | } 112 | 113 | /// Unregister from UIKeyboard notifications. 114 | func unregisterFromKeyboardEvents() { 115 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil) 116 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardDidShowNotification, object: nil) 117 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHide, object: nil) 118 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardDidHide, object: nil) 119 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillChangeFrame, object: nil) 120 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardDidChangeFrame, object: nil) 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /Making MVC Greate Again/Common/Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Extensions.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/7/18. 6 | // Copyright © 2018 Omar Albeik. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UITextField { 12 | 13 | convenience init( 14 | placeholder: String, 15 | keyboardType: UIKeyboardType = .default, 16 | textAlignment: NSTextAlignment = .center, 17 | isSecureTextEntry: Bool = false) { 18 | 19 | self.init() 20 | 21 | self.placeholder = placeholder 22 | self.keyboardType = keyboardType 23 | self.textAlignment = textAlignment 24 | self.isSecureTextEntry = isSecureTextEntry 25 | } 26 | 27 | } 28 | 29 | extension UIButton { 30 | 31 | convenience init( 32 | type: UIButtonType = .system, 33 | title: String?, 34 | image: UIImage?) { 35 | 36 | self.init(type: type) 37 | 38 | self.setTitle(title, for: .normal) 39 | self.setImage(image, for: .normal) 40 | } 41 | 42 | } 43 | 44 | extension Notification { 45 | var keyboardSize: CGSize? { 46 | return (userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.size 47 | } 48 | var keyboardAnimationDuration: Double? { 49 | return userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Making MVC Greate Again/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Making MVC Greate Again/LoginView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginView.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/7/18. 6 | // Copyright © 2018 Omar Albeik. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | 12 | protocol LoginViewDelegate: class { 13 | func loginView(_ view: LoginView, didTapLoginButton button: UIButton) 14 | } 15 | 16 | class LoginView: View, KeyboardControllable { 17 | 18 | weak var delegate: LoginViewDelegate? 19 | 20 | var emailAddress: String { 21 | return emailTextField.text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "" 22 | } 23 | 24 | var password: String { 25 | return passwordTextField.text ?? "" 26 | } 27 | 28 | private lazy var emailTextField: UITextField = { 29 | return UITextField(placeholder: "Email Address", keyboardType: .emailAddress) 30 | }() 31 | 32 | private lazy var passwordTextField: UITextField = { 33 | return UITextField(placeholder: "Password", isSecureTextEntry: true) 34 | }() 35 | 36 | private lazy var loginButton: UIButton = { 37 | return UIButton(title: "Login", image: nil) 38 | }() 39 | 40 | private lazy var resetButton: UIButton = { 41 | return UIButton(title: "Reset", image: nil) 42 | }() 43 | 44 | private lazy var stackView: UIStackView = { 45 | let view = UIStackView(arrangedSubviews: [emailTextField, passwordTextField, loginButton, resetButton]) 46 | view.axis = .vertical 47 | view.alignment = .fill 48 | view.distribution = .fillEqually 49 | view.spacing = 10 50 | return view 51 | }() 52 | 53 | override func setViews() { 54 | super.setViews() 55 | 56 | loginButton.addTarget(self, action: #selector(didTapLoginButton(_:)), for: .touchUpInside) 57 | resetButton.addTarget(self, action: #selector(didTapResetButton(_:)), for: .touchUpInside) 58 | addSubview(stackView) 59 | 60 | let tap = UITapGestureRecognizer(target: self, action: #selector(didTap)) 61 | addGestureRecognizer(tap) 62 | } 63 | 64 | override func layoutViews() { 65 | stackView.snp.makeConstraints { make in 66 | make.leading.equalToSuperview().inset(20) 67 | make.trailing.equalToSuperview().inset(20) 68 | make.bottom.equalToSuperview().inset(40) 69 | } 70 | } 71 | 72 | func handleKeyboardWillShow(_ notification: Notification) { 73 | let keyboardHeight = notification.keyboardSize?.height ?? 250 74 | stackView.snp.updateConstraints { make in 75 | make.bottom.equalToSuperview().inset(40 + keyboardHeight) 76 | } 77 | layoutIfNeeded() 78 | } 79 | 80 | func handleKeyboardWillHide(_ notification: Notification) { 81 | stackView.snp.updateConstraints { make in 82 | make.bottom.equalToSuperview().inset(40) 83 | } 84 | layoutIfNeeded() 85 | } 86 | 87 | } 88 | 89 | // MARK: - Actions 90 | private extension LoginView { 91 | 92 | @objc func didTapLoginButton(_ button: UIButton) { 93 | delegate?.loginView(self, didTapLoginButton: button) 94 | } 95 | 96 | @objc func didTapResetButton(_ button: UIButton) { 97 | endEditing(false) 98 | emailTextField.text = "" 99 | passwordTextField.text = "" 100 | } 101 | 102 | @objc func didTap() { 103 | endEditing(true) 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /Making MVC Greate Again/LoginViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.swift 3 | // Making MVC Greate Again 4 | // 5 | // Created by Omar Albeik on 4/7/18. 6 | // Copyright © 2018 Omar Albeik. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LoginViewController: ViewController, KeyboardObserving { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | customView.delegate = self 17 | registerForKeyboardEvents() 18 | } 19 | 20 | func keyboardWillShow(_ notification: Notification) { 21 | customView.handleKeyboardWillShow(notification) 22 | } 23 | 24 | func keyboardWillHide(_ notification: Notification) { 25 | customView.handleKeyboardWillHide(notification) 26 | } 27 | 28 | deinit { 29 | unregisterFromKeyboardEvents() 30 | } 31 | } 32 | 33 | // MARK: - LoginViewDelegate 34 | extension LoginViewController: LoginViewDelegate { 35 | 36 | func loginView(_ view: LoginView, didTapLoginButton button: UIButton) { 37 | print("Email Address: \(customView.emailAddress)") 38 | print("Password: \(customView.password)") 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | 3 | target 'Making MVC Greate Again' do 4 | use_frameworks! 5 | pod 'SnapKit' 6 | 7 | end 8 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SnapKit (4.0.0) 3 | 4 | DEPENDENCIES: 5 | - SnapKit 6 | 7 | SPEC CHECKSUMS: 8 | SnapKit: a42d492c16e80209130a3379f73596c3454b7694 9 | 10 | PODFILE CHECKSUM: 8e9018a1d1c70c9f7d7d9f71f87a4d8d0da5a59e 11 | 12 | COCOAPODS: 1.4.0 13 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SnapKit (4.0.0) 3 | 4 | DEPENDENCIES: 5 | - SnapKit 6 | 7 | SPEC CHECKSUMS: 8 | SnapKit: a42d492c16e80209130a3379f73596c3454b7694 9 | 10 | PODFILE CHECKSUM: 8e9018a1d1c70c9f7d7d9f71f87a4d8d0da5a59e 11 | 12 | COCOAPODS: 1.4.0 13 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/omar.xcuserdatad/xcschemes/Pods-Making MVC Greate Again.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/omar.xcuserdatad/xcschemes/SnapKit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/omar.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-Making MVC Greate Again.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | SnapKit.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | 22 | SuppressBuildableAutocreation 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Pods/SnapKit/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/SnapKit/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | SnapKit is a DSL to make Auto Layout easy on both iOS and OS X. 4 | 5 | [![Build Status](https://travis-ci.org/SnapKit/SnapKit.svg)](https://travis-ci.org/SnapKit/SnapKit) 6 | [![Platform](https://img.shields.io/cocoapods/p/SnapKit.svg?style=flat)](https://github.com/SnapKit/SnapKit) 7 | [![Cocoapods Compatible](https://img.shields.io/cocoapods/v/SnapKit.svg)](https://cocoapods.org/pods/SnapKit) 8 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 9 | 10 | #### ⚠️ **To use with Swift 3.x please ensure you are using >= 3.0.0** ⚠️ 11 | #### ⚠️ **To use with Swift 4.x please ensure you are using >= 4.0.0** ⚠️ 12 | 13 | ## Contents 14 | 15 | - [Requirements](#requirements) 16 | - [Migration Guides](#migration-guides) 17 | - [Communication](#communication) 18 | - [Installation](#installation) 19 | - [Usage](#usage) 20 | - [Credits](#credits) 21 | - [License](#license) 22 | 23 | ## Requirements 24 | 25 | - iOS 8.0+ / Mac OS X 10.11+ / tvOS 9.0+ 26 | - Xcode 9.0+ 27 | - Swift 3.0+ 28 | 29 | ## Communication 30 | 31 | - If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit). (Tag 'snapkit') 32 | - If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit). 33 | - If you **found a bug**, open an issue. 34 | - If you **have a feature request**, open an issue. 35 | - If you **want to contribute**, submit a pull request. 36 | 37 | 38 | ## Installation 39 | 40 | ### CocoaPods 41 | 42 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: 43 | 44 | ```bash 45 | $ gem install cocoapods 46 | ``` 47 | 48 | > CocoaPods 1.1.0+ is required to build SnapKit 4.0.0+. 49 | 50 | To integrate SnapKit into your Xcode project using CocoaPods, specify it in your `Podfile`: 51 | 52 | ```ruby 53 | source 'https://github.com/CocoaPods/Specs.git' 54 | platform :ios, '10.0' 55 | use_frameworks! 56 | 57 | target '' do 58 | pod 'SnapKit', '~> 4.0.0' 59 | end 60 | ``` 61 | 62 | Then, run the following command: 63 | 64 | ```bash 65 | $ pod install 66 | ``` 67 | 68 | ### Carthage 69 | 70 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. 71 | 72 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command: 73 | 74 | ```bash 75 | $ brew update 76 | $ brew install carthage 77 | ``` 78 | 79 | To integrate SnapKit into your Xcode project using Carthage, specify it in your `Cartfile`: 80 | 81 | ```ogdl 82 | github "SnapKit/SnapKit" ~> 4.0.0 83 | ``` 84 | 85 | Run `carthage update` to build the framework and drag the built `SnapKit.framework` into your Xcode project. 86 | 87 | ### Manually 88 | 89 | If you prefer not to use either of the aforementioned dependency managers, you can integrate SnapKit into your project manually. 90 | 91 | --- 92 | 93 | ## Usage 94 | 95 | ### Quick Start 96 | 97 | ```swift 98 | import SnapKit 99 | 100 | class MyViewController: UIViewController { 101 | 102 | lazy var box = UIView() 103 | 104 | override func viewDidLoad() { 105 | super.viewDidLoad() 106 | 107 | self.view.addSubview(box) 108 | box.snp.makeConstraints { (make) -> Void in 109 | make.width.height.equalTo(50) 110 | make.center.equalTo(self.view) 111 | } 112 | } 113 | 114 | } 115 | ``` 116 | 117 | ### Resources 118 | 119 | - [Documentation](http://snapkit.io/docs/) 120 | - [F.A.Q.](http://snapkit.io/faq/) 121 | 122 | ## Credits 123 | 124 | - Robert Payne ([@robertjpayne](https://twitter.com/robertjpayne)) 125 | - Many other contributors 126 | 127 | ## License 128 | 129 | SnapKit is released under the MIT license. See LICENSE for details. 130 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/Constraint.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | public final class Constraint { 31 | 32 | internal let sourceLocation: (String, UInt) 33 | internal let label: String? 34 | 35 | private let from: ConstraintItem 36 | private let to: ConstraintItem 37 | private let relation: ConstraintRelation 38 | private let multiplier: ConstraintMultiplierTarget 39 | private var constant: ConstraintConstantTarget { 40 | didSet { 41 | self.updateConstantAndPriorityIfNeeded() 42 | } 43 | } 44 | private var priority: ConstraintPriorityTarget { 45 | didSet { 46 | self.updateConstantAndPriorityIfNeeded() 47 | } 48 | } 49 | public var layoutConstraints: [LayoutConstraint] 50 | 51 | public var isActive: Bool { 52 | for layoutConstraint in self.layoutConstraints { 53 | if layoutConstraint.isActive { 54 | return true 55 | } 56 | } 57 | return false 58 | } 59 | 60 | // MARK: Initialization 61 | 62 | internal init(from: ConstraintItem, 63 | to: ConstraintItem, 64 | relation: ConstraintRelation, 65 | sourceLocation: (String, UInt), 66 | label: String?, 67 | multiplier: ConstraintMultiplierTarget, 68 | constant: ConstraintConstantTarget, 69 | priority: ConstraintPriorityTarget) { 70 | self.from = from 71 | self.to = to 72 | self.relation = relation 73 | self.sourceLocation = sourceLocation 74 | self.label = label 75 | self.multiplier = multiplier 76 | self.constant = constant 77 | self.priority = priority 78 | self.layoutConstraints = [] 79 | 80 | // get attributes 81 | let layoutFromAttributes = self.from.attributes.layoutAttributes 82 | let layoutToAttributes = self.to.attributes.layoutAttributes 83 | 84 | // get layout from 85 | let layoutFrom = self.from.layoutConstraintItem! 86 | 87 | // get relation 88 | let layoutRelation = self.relation.layoutRelation 89 | 90 | for layoutFromAttribute in layoutFromAttributes { 91 | // get layout to attribute 92 | let layoutToAttribute: LayoutAttribute 93 | #if os(iOS) || os(tvOS) 94 | if layoutToAttributes.count > 0 { 95 | if self.from.attributes == .edges && self.to.attributes == .margins { 96 | switch layoutFromAttribute { 97 | case .left: 98 | layoutToAttribute = .leftMargin 99 | case .right: 100 | layoutToAttribute = .rightMargin 101 | case .top: 102 | layoutToAttribute = .topMargin 103 | case .bottom: 104 | layoutToAttribute = .bottomMargin 105 | default: 106 | fatalError() 107 | } 108 | } else if self.from.attributes == .margins && self.to.attributes == .edges { 109 | switch layoutFromAttribute { 110 | case .leftMargin: 111 | layoutToAttribute = .left 112 | case .rightMargin: 113 | layoutToAttribute = .right 114 | case .topMargin: 115 | layoutToAttribute = .top 116 | case .bottomMargin: 117 | layoutToAttribute = .bottom 118 | default: 119 | fatalError() 120 | } 121 | } else if self.from.attributes == self.to.attributes { 122 | layoutToAttribute = layoutFromAttribute 123 | } else { 124 | layoutToAttribute = layoutToAttributes[0] 125 | } 126 | } else { 127 | if self.to.target == nil && (layoutFromAttribute == .centerX || layoutFromAttribute == .centerY) { 128 | layoutToAttribute = layoutFromAttribute == .centerX ? .left : .top 129 | } else { 130 | layoutToAttribute = layoutFromAttribute 131 | } 132 | } 133 | #else 134 | if self.from.attributes == self.to.attributes { 135 | layoutToAttribute = layoutFromAttribute 136 | } else if layoutToAttributes.count > 0 { 137 | layoutToAttribute = layoutToAttributes[0] 138 | } else { 139 | layoutToAttribute = layoutFromAttribute 140 | } 141 | #endif 142 | 143 | // get layout constant 144 | let layoutConstant: CGFloat = self.constant.constraintConstantTargetValueFor(layoutAttribute: layoutToAttribute) 145 | 146 | // get layout to 147 | var layoutTo: AnyObject? = self.to.target 148 | 149 | // use superview if possible 150 | if layoutTo == nil && layoutToAttribute != .width && layoutToAttribute != .height { 151 | layoutTo = layoutFrom.superview 152 | } 153 | 154 | // create layout constraint 155 | let layoutConstraint = LayoutConstraint( 156 | item: layoutFrom, 157 | attribute: layoutFromAttribute, 158 | relatedBy: layoutRelation, 159 | toItem: layoutTo, 160 | attribute: layoutToAttribute, 161 | multiplier: self.multiplier.constraintMultiplierTargetValue, 162 | constant: layoutConstant 163 | ) 164 | 165 | // set label 166 | layoutConstraint.label = self.label 167 | 168 | // set priority 169 | layoutConstraint.priority = LayoutPriority(rawValue: self.priority.constraintPriorityTargetValue) 170 | 171 | // set constraint 172 | layoutConstraint.constraint = self 173 | 174 | // append 175 | self.layoutConstraints.append(layoutConstraint) 176 | } 177 | } 178 | 179 | // MARK: Public 180 | 181 | @available(*, deprecated:3.0, message:"Use activate().") 182 | public func install() { 183 | self.activate() 184 | } 185 | 186 | @available(*, deprecated:3.0, message:"Use deactivate().") 187 | public func uninstall() { 188 | self.deactivate() 189 | } 190 | 191 | public func activate() { 192 | self.activateIfNeeded() 193 | } 194 | 195 | public func deactivate() { 196 | self.deactivateIfNeeded() 197 | } 198 | 199 | @discardableResult 200 | public func update(offset: ConstraintOffsetTarget) -> Constraint { 201 | self.constant = offset.constraintOffsetTargetValue 202 | return self 203 | } 204 | 205 | @discardableResult 206 | public func update(inset: ConstraintInsetTarget) -> Constraint { 207 | self.constant = inset.constraintInsetTargetValue 208 | return self 209 | } 210 | 211 | @discardableResult 212 | public func update(priority: ConstraintPriorityTarget) -> Constraint { 213 | self.priority = priority.constraintPriorityTargetValue 214 | return self 215 | } 216 | 217 | @available(*, deprecated:3.0, message:"Use update(offset: ConstraintOffsetTarget) instead.") 218 | public func updateOffset(amount: ConstraintOffsetTarget) -> Void { self.update(offset: amount) } 219 | 220 | @available(*, deprecated:3.0, message:"Use update(inset: ConstraintInsetTarget) instead.") 221 | public func updateInsets(amount: ConstraintInsetTarget) -> Void { self.update(inset: amount) } 222 | 223 | @available(*, deprecated:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") 224 | public func updatePriority(amount: ConstraintPriorityTarget) -> Void { self.update(priority: amount) } 225 | 226 | @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") 227 | public func updatePriorityRequired() -> Void {} 228 | 229 | @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") 230 | public func updatePriorityHigh() -> Void { fatalError("Must be implemented by Concrete subclass.") } 231 | 232 | @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") 233 | public func updatePriorityMedium() -> Void { fatalError("Must be implemented by Concrete subclass.") } 234 | 235 | @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") 236 | public func updatePriorityLow() -> Void { fatalError("Must be implemented by Concrete subclass.") } 237 | 238 | // MARK: Internal 239 | 240 | internal func updateConstantAndPriorityIfNeeded() { 241 | for layoutConstraint in self.layoutConstraints { 242 | let attribute = (layoutConstraint.secondAttribute == .notAnAttribute) ? layoutConstraint.firstAttribute : layoutConstraint.secondAttribute 243 | layoutConstraint.constant = self.constant.constraintConstantTargetValueFor(layoutAttribute: attribute) 244 | 245 | let requiredPriority = ConstraintPriority.required.value 246 | if (layoutConstraint.priority.rawValue < requiredPriority), (self.priority.constraintPriorityTargetValue != requiredPriority) { 247 | layoutConstraint.priority = LayoutPriority(rawValue: self.priority.constraintPriorityTargetValue) 248 | } 249 | } 250 | } 251 | 252 | internal func activateIfNeeded(updatingExisting: Bool = false) { 253 | guard let item = self.from.layoutConstraintItem else { 254 | print("WARNING: SnapKit failed to get from item from constraint. Activate will be a no-op.") 255 | return 256 | } 257 | let layoutConstraints = self.layoutConstraints 258 | 259 | if updatingExisting { 260 | var existingLayoutConstraints: [LayoutConstraint] = [] 261 | for constraint in item.constraints { 262 | existingLayoutConstraints += constraint.layoutConstraints 263 | } 264 | 265 | for layoutConstraint in layoutConstraints { 266 | let existingLayoutConstraint = existingLayoutConstraints.first { $0 == layoutConstraint } 267 | guard let updateLayoutConstraint = existingLayoutConstraint else { 268 | fatalError("Updated constraint could not find existing matching constraint to update: \(layoutConstraint)") 269 | } 270 | 271 | let updateLayoutAttribute = (updateLayoutConstraint.secondAttribute == .notAnAttribute) ? updateLayoutConstraint.firstAttribute : updateLayoutConstraint.secondAttribute 272 | updateLayoutConstraint.constant = self.constant.constraintConstantTargetValueFor(layoutAttribute: updateLayoutAttribute) 273 | } 274 | } else { 275 | NSLayoutConstraint.activate(layoutConstraints) 276 | item.add(constraints: [self]) 277 | } 278 | } 279 | 280 | internal func deactivateIfNeeded() { 281 | guard let item = self.from.layoutConstraintItem else { 282 | print("WARNING: SnapKit failed to get from item from constraint. Deactivate will be a no-op.") 283 | return 284 | } 285 | let layoutConstraints = self.layoutConstraints 286 | NSLayoutConstraint.deactivate(layoutConstraints) 287 | item.remove(constraints: [self]) 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintAttributes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | internal struct ConstraintAttributes : OptionSet { 32 | 33 | internal init(rawValue: UInt) { 34 | self.rawValue = rawValue 35 | } 36 | internal init(_ rawValue: UInt) { 37 | self.init(rawValue: rawValue) 38 | } 39 | internal init(nilLiteral: ()) { 40 | self.rawValue = 0 41 | } 42 | 43 | internal private(set) var rawValue: UInt 44 | internal static var allZeros: ConstraintAttributes { return self.init(0) } 45 | internal static func convertFromNilLiteral() -> ConstraintAttributes { return self.init(0) } 46 | internal var boolValue: Bool { return self.rawValue != 0 } 47 | 48 | internal func toRaw() -> UInt { return self.rawValue } 49 | internal static func fromRaw(_ raw: UInt) -> ConstraintAttributes? { return self.init(raw) } 50 | internal static func fromMask(_ raw: UInt) -> ConstraintAttributes { return self.init(raw) } 51 | 52 | // normal 53 | 54 | internal static var none: ConstraintAttributes { return self.init(0) } 55 | internal static var left: ConstraintAttributes { return self.init(1) } 56 | internal static var top: ConstraintAttributes { return self.init(2) } 57 | internal static var right: ConstraintAttributes { return self.init(4) } 58 | internal static var bottom: ConstraintAttributes { return self.init(8) } 59 | internal static var leading: ConstraintAttributes { return self.init(16) } 60 | internal static var trailing: ConstraintAttributes { return self.init(32) } 61 | internal static var width: ConstraintAttributes { return self.init(64) } 62 | internal static var height: ConstraintAttributes { return self.init(128) } 63 | internal static var centerX: ConstraintAttributes { return self.init(256) } 64 | internal static var centerY: ConstraintAttributes { return self.init(512) } 65 | internal static var lastBaseline: ConstraintAttributes { return self.init(1024) } 66 | 67 | @available(iOS 8.0, OSX 10.11, *) 68 | internal static var firstBaseline: ConstraintAttributes { return self.init(2048) } 69 | 70 | @available(iOS 8.0, *) 71 | internal static var leftMargin: ConstraintAttributes { return self.init(4096) } 72 | 73 | @available(iOS 8.0, *) 74 | internal static var rightMargin: ConstraintAttributes { return self.init(8192) } 75 | 76 | @available(iOS 8.0, *) 77 | internal static var topMargin: ConstraintAttributes { return self.init(16384) } 78 | 79 | @available(iOS 8.0, *) 80 | internal static var bottomMargin: ConstraintAttributes { return self.init(32768) } 81 | 82 | @available(iOS 8.0, *) 83 | internal static var leadingMargin: ConstraintAttributes { return self.init(65536) } 84 | 85 | @available(iOS 8.0, *) 86 | internal static var trailingMargin: ConstraintAttributes { return self.init(131072) } 87 | 88 | @available(iOS 8.0, *) 89 | internal static var centerXWithinMargins: ConstraintAttributes { return self.init(262144) } 90 | 91 | @available(iOS 8.0, *) 92 | internal static var centerYWithinMargins: ConstraintAttributes { return self.init(524288) } 93 | 94 | // aggregates 95 | 96 | internal static var edges: ConstraintAttributes { return self.init(15) } 97 | internal static var size: ConstraintAttributes { return self.init(192) } 98 | internal static var center: ConstraintAttributes { return self.init(768) } 99 | 100 | @available(iOS 8.0, *) 101 | internal static var margins: ConstraintAttributes { return self.init(61440) } 102 | 103 | @available(iOS 8.0, *) 104 | internal static var centerWithinMargins: ConstraintAttributes { return self.init(786432) } 105 | 106 | internal var layoutAttributes:[LayoutAttribute] { 107 | var attrs = [LayoutAttribute]() 108 | if (self.contains(ConstraintAttributes.left)) { 109 | attrs.append(.left) 110 | } 111 | if (self.contains(ConstraintAttributes.top)) { 112 | attrs.append(.top) 113 | } 114 | if (self.contains(ConstraintAttributes.right)) { 115 | attrs.append(.right) 116 | } 117 | if (self.contains(ConstraintAttributes.bottom)) { 118 | attrs.append(.bottom) 119 | } 120 | if (self.contains(ConstraintAttributes.leading)) { 121 | attrs.append(.leading) 122 | } 123 | if (self.contains(ConstraintAttributes.trailing)) { 124 | attrs.append(.trailing) 125 | } 126 | if (self.contains(ConstraintAttributes.width)) { 127 | attrs.append(.width) 128 | } 129 | if (self.contains(ConstraintAttributes.height)) { 130 | attrs.append(.height) 131 | } 132 | if (self.contains(ConstraintAttributes.centerX)) { 133 | attrs.append(.centerX) 134 | } 135 | if (self.contains(ConstraintAttributes.centerY)) { 136 | attrs.append(.centerY) 137 | } 138 | if (self.contains(ConstraintAttributes.lastBaseline)) { 139 | attrs.append(.lastBaseline) 140 | } 141 | 142 | #if os(iOS) || os(tvOS) 143 | if (self.contains(ConstraintAttributes.firstBaseline)) { 144 | attrs.append(.firstBaseline) 145 | } 146 | if (self.contains(ConstraintAttributes.leftMargin)) { 147 | attrs.append(.leftMargin) 148 | } 149 | if (self.contains(ConstraintAttributes.rightMargin)) { 150 | attrs.append(.rightMargin) 151 | } 152 | if (self.contains(ConstraintAttributes.topMargin)) { 153 | attrs.append(.topMargin) 154 | } 155 | if (self.contains(ConstraintAttributes.bottomMargin)) { 156 | attrs.append(.bottomMargin) 157 | } 158 | if (self.contains(ConstraintAttributes.leadingMargin)) { 159 | attrs.append(.leadingMargin) 160 | } 161 | if (self.contains(ConstraintAttributes.trailingMargin)) { 162 | attrs.append(.trailingMargin) 163 | } 164 | if (self.contains(ConstraintAttributes.centerXWithinMargins)) { 165 | attrs.append(.centerXWithinMargins) 166 | } 167 | if (self.contains(ConstraintAttributes.centerYWithinMargins)) { 168 | attrs.append(.centerYWithinMargins) 169 | } 170 | #endif 171 | 172 | return attrs 173 | } 174 | } 175 | 176 | internal func + (left: ConstraintAttributes, right: ConstraintAttributes) -> ConstraintAttributes { 177 | return left.union(right) 178 | } 179 | 180 | internal func +=(left: inout ConstraintAttributes, right: ConstraintAttributes) { 181 | left.formUnion(right) 182 | } 183 | 184 | internal func -=(left: inout ConstraintAttributes, right: ConstraintAttributes) { 185 | left.subtract(right) 186 | } 187 | 188 | internal func ==(left: ConstraintAttributes, right: ConstraintAttributes) -> Bool { 189 | return left.rawValue == right.rawValue 190 | } 191 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintConfig.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | public typealias ConstraintInterfaceLayoutDirection = UIUserInterfaceLayoutDirection 27 | #else 28 | import AppKit 29 | public typealias ConstraintInterfaceLayoutDirection = NSUserInterfaceLayoutDirection 30 | #endif 31 | 32 | 33 | public struct ConstraintConfig { 34 | 35 | public static var interfaceLayoutDirection: ConstraintInterfaceLayoutDirection = .leftToRight 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintConstantTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintConstantTarget { 32 | } 33 | 34 | extension CGPoint: ConstraintConstantTarget { 35 | } 36 | 37 | extension CGSize: ConstraintConstantTarget { 38 | } 39 | 40 | extension ConstraintInsets: ConstraintConstantTarget { 41 | } 42 | 43 | extension ConstraintConstantTarget { 44 | 45 | internal func constraintConstantTargetValueFor(layoutAttribute: LayoutAttribute) -> CGFloat { 46 | if let value = self as? CGFloat { 47 | return value 48 | } 49 | 50 | if let value = self as? Float { 51 | return CGFloat(value) 52 | } 53 | 54 | if let value = self as? Double { 55 | return CGFloat(value) 56 | } 57 | 58 | if let value = self as? Int { 59 | return CGFloat(value) 60 | } 61 | 62 | if let value = self as? UInt { 63 | return CGFloat(value) 64 | } 65 | 66 | if let value = self as? CGSize { 67 | if layoutAttribute == .width { 68 | return value.width 69 | } else if layoutAttribute == .height { 70 | return value.height 71 | } else { 72 | return 0.0 73 | } 74 | } 75 | 76 | if let value = self as? CGPoint { 77 | #if os(iOS) || os(tvOS) 78 | switch layoutAttribute { 79 | case .left, .right, .leading, .trailing, .centerX, .leftMargin, .rightMargin, .leadingMargin, .trailingMargin, .centerXWithinMargins: 80 | return value.x 81 | case .top, .bottom, .centerY, .topMargin, .bottomMargin, .centerYWithinMargins, .lastBaseline, .firstBaseline: 82 | return value.y 83 | case .width, .height, .notAnAttribute: 84 | return 0.0 85 | } 86 | #else 87 | switch layoutAttribute { 88 | case .left, .right, .leading, .trailing, .centerX: 89 | return value.x 90 | case .top, .bottom, .centerY, .lastBaseline, .firstBaseline: 91 | return value.y 92 | case .width, .height, .notAnAttribute: 93 | return 0.0 94 | } 95 | #endif 96 | } 97 | 98 | if let value = self as? ConstraintInsets { 99 | #if os(iOS) || os(tvOS) 100 | switch layoutAttribute { 101 | case .left, .leftMargin, .centerX, .centerXWithinMargins: 102 | return value.left 103 | case .top, .topMargin, .centerY, .centerYWithinMargins, .lastBaseline, .firstBaseline: 104 | return value.top 105 | case .right, .rightMargin: 106 | return -value.right 107 | case .bottom, .bottomMargin: 108 | return -value.bottom 109 | case .leading, .leadingMargin: 110 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right 111 | case .trailing, .trailingMargin: 112 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left 113 | case .width: 114 | return -(value.left + value.right) 115 | case .height: 116 | return -(value.top + value.bottom) 117 | case .notAnAttribute: 118 | return 0.0 119 | } 120 | #else 121 | switch layoutAttribute { 122 | case .left, .centerX: 123 | return value.left 124 | case .top, .centerY, .lastBaseline, .firstBaseline: 125 | return value.top 126 | case .right: 127 | return -value.right 128 | case .bottom: 129 | return -value.bottom 130 | case .leading: 131 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right 132 | case .trailing: 133 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left 134 | case .width: 135 | return -(value.left + value.right) 136 | case .height: 137 | return -(value.top + value.bottom) 138 | case .notAnAttribute: 139 | return 0.0 140 | } 141 | #endif 142 | } 143 | 144 | return 0.0 145 | } 146 | 147 | } 148 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintDSL { 32 | 33 | var target: AnyObject? { get } 34 | 35 | func setLabel(_ value: String?) 36 | func label() -> String? 37 | 38 | } 39 | extension ConstraintDSL { 40 | 41 | public func setLabel(_ value: String?) { 42 | objc_setAssociatedObject(self.target as Any, &labelKey, value, .OBJC_ASSOCIATION_COPY_NONATOMIC) 43 | } 44 | public func label() -> String? { 45 | return objc_getAssociatedObject(self.target as Any, &labelKey) as? String 46 | } 47 | 48 | } 49 | private var labelKey: UInt8 = 0 50 | 51 | 52 | public protocol ConstraintBasicAttributesDSL : ConstraintDSL { 53 | } 54 | extension ConstraintBasicAttributesDSL { 55 | 56 | // MARK: Basics 57 | 58 | public var left: ConstraintItem { 59 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.left) 60 | } 61 | 62 | public var top: ConstraintItem { 63 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top) 64 | } 65 | 66 | public var right: ConstraintItem { 67 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.right) 68 | } 69 | 70 | public var bottom: ConstraintItem { 71 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom) 72 | } 73 | 74 | public var leading: ConstraintItem { 75 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leading) 76 | } 77 | 78 | public var trailing: ConstraintItem { 79 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.trailing) 80 | } 81 | 82 | public var width: ConstraintItem { 83 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.width) 84 | } 85 | 86 | public var height: ConstraintItem { 87 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height) 88 | } 89 | 90 | public var centerX: ConstraintItem { 91 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerX) 92 | } 93 | 94 | public var centerY: ConstraintItem { 95 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerY) 96 | } 97 | 98 | public var edges: ConstraintItem { 99 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.edges) 100 | } 101 | 102 | public var size: ConstraintItem { 103 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.size) 104 | } 105 | 106 | public var center: ConstraintItem { 107 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.center) 108 | } 109 | 110 | } 111 | 112 | public protocol ConstraintAttributesDSL : ConstraintBasicAttributesDSL { 113 | } 114 | extension ConstraintAttributesDSL { 115 | 116 | // MARK: Baselines 117 | 118 | @available(*, deprecated:3.0, message:"Use .lastBaseline instead") 119 | public var baseline: ConstraintItem { 120 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.lastBaseline) 121 | } 122 | 123 | @available(iOS 8.0, OSX 10.11, *) 124 | public var lastBaseline: ConstraintItem { 125 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.lastBaseline) 126 | } 127 | 128 | @available(iOS 8.0, OSX 10.11, *) 129 | public var firstBaseline: ConstraintItem { 130 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.firstBaseline) 131 | } 132 | 133 | // MARK: Margins 134 | 135 | @available(iOS 8.0, *) 136 | public var leftMargin: ConstraintItem { 137 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leftMargin) 138 | } 139 | 140 | @available(iOS 8.0, *) 141 | public var topMargin: ConstraintItem { 142 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.topMargin) 143 | } 144 | 145 | @available(iOS 8.0, *) 146 | public var rightMargin: ConstraintItem { 147 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.rightMargin) 148 | } 149 | 150 | @available(iOS 8.0, *) 151 | public var bottomMargin: ConstraintItem { 152 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottomMargin) 153 | } 154 | 155 | @available(iOS 8.0, *) 156 | public var leadingMargin: ConstraintItem { 157 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leadingMargin) 158 | } 159 | 160 | @available(iOS 8.0, *) 161 | public var trailingMargin: ConstraintItem { 162 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.trailingMargin) 163 | } 164 | 165 | @available(iOS 8.0, *) 166 | public var centerXWithinMargins: ConstraintItem { 167 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerXWithinMargins) 168 | } 169 | 170 | @available(iOS 8.0, *) 171 | public var centerYWithinMargins: ConstraintItem { 172 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerYWithinMargins) 173 | } 174 | 175 | @available(iOS 8.0, *) 176 | public var margins: ConstraintItem { 177 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.margins) 178 | } 179 | 180 | @available(iOS 8.0, *) 181 | public var centerWithinMargins: ConstraintItem { 182 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerWithinMargins) 183 | } 184 | 185 | } 186 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintDescription.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintDescription { 32 | 33 | internal let item: LayoutConstraintItem 34 | internal var attributes: ConstraintAttributes 35 | internal var relation: ConstraintRelation? = nil 36 | internal var sourceLocation: (String, UInt)? = nil 37 | internal var label: String? = nil 38 | internal var related: ConstraintItem? = nil 39 | internal var multiplier: ConstraintMultiplierTarget = 1.0 40 | internal var constant: ConstraintConstantTarget = 0.0 41 | internal var priority: ConstraintPriorityTarget = 1000.0 42 | internal lazy var constraint: Constraint? = { 43 | guard let relation = self.relation, 44 | let related = self.related, 45 | let sourceLocation = self.sourceLocation else { 46 | return nil 47 | } 48 | let from = ConstraintItem(target: self.item, attributes: self.attributes) 49 | 50 | return Constraint( 51 | from: from, 52 | to: related, 53 | relation: relation, 54 | sourceLocation: sourceLocation, 55 | label: self.label, 56 | multiplier: self.multiplier, 57 | constant: self.constant, 58 | priority: self.priority 59 | ) 60 | }() 61 | 62 | // MARK: Initialization 63 | 64 | internal init(item: LayoutConstraintItem, attributes: ConstraintAttributes) { 65 | self.item = item 66 | self.attributes = attributes 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintInsetTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintInsetTarget: ConstraintConstantTarget { 32 | } 33 | 34 | extension Int: ConstraintInsetTarget { 35 | } 36 | 37 | extension UInt: ConstraintInsetTarget { 38 | } 39 | 40 | extension Float: ConstraintInsetTarget { 41 | } 42 | 43 | extension Double: ConstraintInsetTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintInsetTarget { 47 | } 48 | 49 | extension ConstraintInsets: ConstraintInsetTarget { 50 | } 51 | 52 | extension ConstraintInsetTarget { 53 | 54 | internal var constraintInsetTargetValue: ConstraintInsets { 55 | if let amount = self as? ConstraintInsets { 56 | return amount 57 | } else if let amount = self as? Float { 58 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 59 | } else if let amount = self as? Double { 60 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 61 | } else if let amount = self as? CGFloat { 62 | return ConstraintInsets(top: amount, left: amount, bottom: amount, right: amount) 63 | } else if let amount = self as? Int { 64 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 65 | } else if let amount = self as? UInt { 66 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 67 | } else { 68 | return ConstraintInsets(top: 0, left: 0, bottom: 0, right: 0) 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintInsets.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | public typealias ConstraintInsets = UIEdgeInsets 33 | #else 34 | public typealias ConstraintInsets = NSEdgeInsets 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public final class ConstraintItem { 32 | 33 | internal weak var target: AnyObject? 34 | internal let attributes: ConstraintAttributes 35 | 36 | internal init(target: AnyObject?, attributes: ConstraintAttributes) { 37 | self.target = target 38 | self.attributes = attributes 39 | } 40 | 41 | internal var layoutConstraintItem: LayoutConstraintItem? { 42 | return self.target as? LayoutConstraintItem 43 | } 44 | 45 | } 46 | 47 | public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool { 48 | // pointer equality 49 | guard lhs !== rhs else { 50 | return true 51 | } 52 | 53 | // must both have valid targets and identical attributes 54 | guard let target1 = lhs.target, 55 | let target2 = rhs.target, 56 | target1 === target2 && lhs.attributes == rhs.attributes else { 57 | return false 58 | } 59 | 60 | return true 61 | } 62 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #endif 27 | 28 | 29 | @available(iOS 9.0, OSX 10.11, *) 30 | public extension ConstraintLayoutGuide { 31 | 32 | public var snp: ConstraintLayoutGuideDSL { 33 | return ConstraintLayoutGuideDSL(guide: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintLayoutGuide.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | @available(iOS 9.0, *) 33 | public typealias ConstraintLayoutGuide = UILayoutGuide 34 | #else 35 | @available(OSX 10.11, *) 36 | public typealias ConstraintLayoutGuide = NSLayoutGuide 37 | #endif 38 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | @available(iOS 9.0, OSX 10.11, *) 32 | public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL { 33 | 34 | @discardableResult 35 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { 36 | return ConstraintMaker.prepareConstraints(item: self.guide, closure: closure) 37 | } 38 | 39 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 40 | ConstraintMaker.makeConstraints(item: self.guide, closure: closure) 41 | } 42 | 43 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 44 | ConstraintMaker.remakeConstraints(item: self.guide, closure: closure) 45 | } 46 | 47 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 48 | ConstraintMaker.updateConstraints(item: self.guide, closure: closure) 49 | } 50 | 51 | public func removeConstraints() { 52 | ConstraintMaker.removeConstraints(item: self.guide) 53 | } 54 | 55 | public var target: AnyObject? { 56 | return self.guide 57 | } 58 | 59 | internal let guide: ConstraintLayoutGuide 60 | 61 | internal init(guide: ConstraintLayoutGuide) { 62 | self.guide = guide 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintLayoutSupport.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | @available(iOS 8.0, *) 33 | public typealias ConstraintLayoutSupport = UILayoutSupport 34 | #else 35 | public class ConstraintLayoutSupport {} 36 | #endif 37 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | @available(iOS 8.0, *) 32 | public struct ConstraintLayoutSupportDSL: ConstraintDSL { 33 | 34 | public var target: AnyObject? { 35 | return self.support 36 | } 37 | 38 | internal let support: ConstraintLayoutSupport 39 | 40 | internal init(support: ConstraintLayoutSupport) { 41 | self.support = support 42 | 43 | } 44 | 45 | public var top: ConstraintItem { 46 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top) 47 | } 48 | 49 | public var bottom: ConstraintItem { 50 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom) 51 | } 52 | 53 | public var height: ConstraintItem { 54 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMaker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | public class ConstraintMaker { 31 | 32 | public var left: ConstraintMakerExtendable { 33 | return self.makeExtendableWithAttributes(.left) 34 | } 35 | 36 | public var top: ConstraintMakerExtendable { 37 | return self.makeExtendableWithAttributes(.top) 38 | } 39 | 40 | public var bottom: ConstraintMakerExtendable { 41 | return self.makeExtendableWithAttributes(.bottom) 42 | } 43 | 44 | public var right: ConstraintMakerExtendable { 45 | return self.makeExtendableWithAttributes(.right) 46 | } 47 | 48 | public var leading: ConstraintMakerExtendable { 49 | return self.makeExtendableWithAttributes(.leading) 50 | } 51 | 52 | public var trailing: ConstraintMakerExtendable { 53 | return self.makeExtendableWithAttributes(.trailing) 54 | } 55 | 56 | public var width: ConstraintMakerExtendable { 57 | return self.makeExtendableWithAttributes(.width) 58 | } 59 | 60 | public var height: ConstraintMakerExtendable { 61 | return self.makeExtendableWithAttributes(.height) 62 | } 63 | 64 | public var centerX: ConstraintMakerExtendable { 65 | return self.makeExtendableWithAttributes(.centerX) 66 | } 67 | 68 | public var centerY: ConstraintMakerExtendable { 69 | return self.makeExtendableWithAttributes(.centerY) 70 | } 71 | 72 | @available(*, deprecated:3.0, message:"Use lastBaseline instead") 73 | public var baseline: ConstraintMakerExtendable { 74 | return self.makeExtendableWithAttributes(.lastBaseline) 75 | } 76 | 77 | public var lastBaseline: ConstraintMakerExtendable { 78 | return self.makeExtendableWithAttributes(.lastBaseline) 79 | } 80 | 81 | @available(iOS 8.0, OSX 10.11, *) 82 | public var firstBaseline: ConstraintMakerExtendable { 83 | return self.makeExtendableWithAttributes(.firstBaseline) 84 | } 85 | 86 | @available(iOS 8.0, *) 87 | public var leftMargin: ConstraintMakerExtendable { 88 | return self.makeExtendableWithAttributes(.leftMargin) 89 | } 90 | 91 | @available(iOS 8.0, *) 92 | public var rightMargin: ConstraintMakerExtendable { 93 | return self.makeExtendableWithAttributes(.rightMargin) 94 | } 95 | 96 | @available(iOS 8.0, *) 97 | public var topMargin: ConstraintMakerExtendable { 98 | return self.makeExtendableWithAttributes(.topMargin) 99 | } 100 | 101 | @available(iOS 8.0, *) 102 | public var bottomMargin: ConstraintMakerExtendable { 103 | return self.makeExtendableWithAttributes(.bottomMargin) 104 | } 105 | 106 | @available(iOS 8.0, *) 107 | public var leadingMargin: ConstraintMakerExtendable { 108 | return self.makeExtendableWithAttributes(.leadingMargin) 109 | } 110 | 111 | @available(iOS 8.0, *) 112 | public var trailingMargin: ConstraintMakerExtendable { 113 | return self.makeExtendableWithAttributes(.trailingMargin) 114 | } 115 | 116 | @available(iOS 8.0, *) 117 | public var centerXWithinMargins: ConstraintMakerExtendable { 118 | return self.makeExtendableWithAttributes(.centerXWithinMargins) 119 | } 120 | 121 | @available(iOS 8.0, *) 122 | public var centerYWithinMargins: ConstraintMakerExtendable { 123 | return self.makeExtendableWithAttributes(.centerYWithinMargins) 124 | } 125 | 126 | public var edges: ConstraintMakerExtendable { 127 | return self.makeExtendableWithAttributes(.edges) 128 | } 129 | public var size: ConstraintMakerExtendable { 130 | return self.makeExtendableWithAttributes(.size) 131 | } 132 | public var center: ConstraintMakerExtendable { 133 | return self.makeExtendableWithAttributes(.center) 134 | } 135 | 136 | @available(iOS 8.0, *) 137 | public var margins: ConstraintMakerExtendable { 138 | return self.makeExtendableWithAttributes(.margins) 139 | } 140 | 141 | @available(iOS 8.0, *) 142 | public var centerWithinMargins: ConstraintMakerExtendable { 143 | return self.makeExtendableWithAttributes(.centerWithinMargins) 144 | } 145 | 146 | private let item: LayoutConstraintItem 147 | private var descriptions = [ConstraintDescription]() 148 | 149 | internal init(item: LayoutConstraintItem) { 150 | self.item = item 151 | self.item.prepare() 152 | } 153 | 154 | internal func makeExtendableWithAttributes(_ attributes: ConstraintAttributes) -> ConstraintMakerExtendable { 155 | let description = ConstraintDescription(item: self.item, attributes: attributes) 156 | self.descriptions.append(description) 157 | return ConstraintMakerExtendable(description) 158 | } 159 | 160 | internal static func prepareConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { 161 | let maker = ConstraintMaker(item: item) 162 | closure(maker) 163 | var constraints: [Constraint] = [] 164 | for description in maker.descriptions { 165 | guard let constraint = description.constraint else { 166 | continue 167 | } 168 | constraints.append(constraint) 169 | } 170 | return constraints 171 | } 172 | 173 | internal static func makeConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) { 174 | let maker = ConstraintMaker(item: item) 175 | closure(maker) 176 | var constraints: [Constraint] = [] 177 | for description in maker.descriptions { 178 | guard let constraint = description.constraint else { 179 | continue 180 | } 181 | constraints.append(constraint) 182 | } 183 | for constraint in constraints { 184 | constraint.activateIfNeeded(updatingExisting: false) 185 | } 186 | } 187 | 188 | internal static func remakeConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) { 189 | self.removeConstraints(item: item) 190 | self.makeConstraints(item: item, closure: closure) 191 | } 192 | 193 | internal static func updateConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) { 194 | guard item.constraints.count > 0 else { 195 | self.makeConstraints(item: item, closure: closure) 196 | return 197 | } 198 | 199 | let maker = ConstraintMaker(item: item) 200 | closure(maker) 201 | var constraints: [Constraint] = [] 202 | for description in maker.descriptions { 203 | guard let constraint = description.constraint else { 204 | continue 205 | } 206 | constraints.append(constraint) 207 | } 208 | for constraint in constraints { 209 | constraint.activateIfNeeded(updatingExisting: true) 210 | } 211 | } 212 | 213 | internal static func removeConstraints(item: LayoutConstraintItem) { 214 | let constraints = item.constraints 215 | for constraint in constraints { 216 | constraint.deactivateIfNeeded() 217 | } 218 | } 219 | 220 | } 221 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMakerEditable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerEditable: ConstraintMakerPriortizable { 32 | 33 | @discardableResult 34 | public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { 35 | self.description.multiplier = amount 36 | return self 37 | } 38 | 39 | @discardableResult 40 | public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { 41 | return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue) 42 | } 43 | 44 | @discardableResult 45 | public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable { 46 | self.description.constant = amount.constraintOffsetTargetValue 47 | return self 48 | } 49 | 50 | @discardableResult 51 | public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable { 52 | self.description.constant = amount.constraintInsetTargetValue 53 | return self 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMakerExtendable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerExtendable: ConstraintMakerRelatable { 32 | 33 | public var left: ConstraintMakerExtendable { 34 | self.description.attributes += .left 35 | return self 36 | } 37 | 38 | public var top: ConstraintMakerExtendable { 39 | self.description.attributes += .top 40 | return self 41 | } 42 | 43 | public var bottom: ConstraintMakerExtendable { 44 | self.description.attributes += .bottom 45 | return self 46 | } 47 | 48 | public var right: ConstraintMakerExtendable { 49 | self.description.attributes += .right 50 | return self 51 | } 52 | 53 | public var leading: ConstraintMakerExtendable { 54 | self.description.attributes += .leading 55 | return self 56 | } 57 | 58 | public var trailing: ConstraintMakerExtendable { 59 | self.description.attributes += .trailing 60 | return self 61 | } 62 | 63 | public var width: ConstraintMakerExtendable { 64 | self.description.attributes += .width 65 | return self 66 | } 67 | 68 | public var height: ConstraintMakerExtendable { 69 | self.description.attributes += .height 70 | return self 71 | } 72 | 73 | public var centerX: ConstraintMakerExtendable { 74 | self.description.attributes += .centerX 75 | return self 76 | } 77 | 78 | public var centerY: ConstraintMakerExtendable { 79 | self.description.attributes += .centerY 80 | return self 81 | } 82 | 83 | @available(*, deprecated:3.0, message:"Use lastBaseline instead") 84 | public var baseline: ConstraintMakerExtendable { 85 | self.description.attributes += .lastBaseline 86 | return self 87 | } 88 | 89 | public var lastBaseline: ConstraintMakerExtendable { 90 | self.description.attributes += .lastBaseline 91 | return self 92 | } 93 | 94 | @available(iOS 8.0, OSX 10.11, *) 95 | public var firstBaseline: ConstraintMakerExtendable { 96 | self.description.attributes += .firstBaseline 97 | return self 98 | } 99 | 100 | @available(iOS 8.0, *) 101 | public var leftMargin: ConstraintMakerExtendable { 102 | self.description.attributes += .leftMargin 103 | return self 104 | } 105 | 106 | @available(iOS 8.0, *) 107 | public var rightMargin: ConstraintMakerExtendable { 108 | self.description.attributes += .rightMargin 109 | return self 110 | } 111 | 112 | @available(iOS 8.0, *) 113 | public var topMargin: ConstraintMakerExtendable { 114 | self.description.attributes += .topMargin 115 | return self 116 | } 117 | 118 | @available(iOS 8.0, *) 119 | public var bottomMargin: ConstraintMakerExtendable { 120 | self.description.attributes += .bottomMargin 121 | return self 122 | } 123 | 124 | @available(iOS 8.0, *) 125 | public var leadingMargin: ConstraintMakerExtendable { 126 | self.description.attributes += .leadingMargin 127 | return self 128 | } 129 | 130 | @available(iOS 8.0, *) 131 | public var trailingMargin: ConstraintMakerExtendable { 132 | self.description.attributes += .trailingMargin 133 | return self 134 | } 135 | 136 | @available(iOS 8.0, *) 137 | public var centerXWithinMargins: ConstraintMakerExtendable { 138 | self.description.attributes += .centerXWithinMargins 139 | return self 140 | } 141 | 142 | @available(iOS 8.0, *) 143 | public var centerYWithinMargins: ConstraintMakerExtendable { 144 | self.description.attributes += .centerYWithinMargins 145 | return self 146 | } 147 | 148 | public var edges: ConstraintMakerExtendable { 149 | self.description.attributes += .edges 150 | return self 151 | } 152 | public var size: ConstraintMakerExtendable { 153 | self.description.attributes += .size 154 | return self 155 | } 156 | 157 | @available(iOS 8.0, *) 158 | public var margins: ConstraintMakerExtendable { 159 | self.description.attributes += .margins 160 | return self 161 | } 162 | 163 | @available(iOS 8.0, *) 164 | public var centerWithinMargins: ConstraintMakerExtendable { 165 | self.description.attributes += .centerWithinMargins 166 | return self 167 | } 168 | 169 | } 170 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMakerFinalizable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerFinalizable { 32 | 33 | internal let description: ConstraintDescription 34 | 35 | internal init(_ description: ConstraintDescription) { 36 | self.description = description 37 | } 38 | 39 | @discardableResult 40 | public func labeled(_ label: String) -> ConstraintMakerFinalizable { 41 | self.description.label = label 42 | return self 43 | } 44 | 45 | public var constraint: Constraint { 46 | return self.description.constraint! 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMakerPriortizable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerPriortizable: ConstraintMakerFinalizable { 32 | 33 | @discardableResult 34 | public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable { 35 | self.description.priority = amount.value 36 | return self 37 | } 38 | 39 | @discardableResult 40 | public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable { 41 | self.description.priority = amount 42 | return self 43 | } 44 | 45 | @available(*, deprecated:3.0, message:"Use priority(.required) instead.") 46 | @discardableResult 47 | public func priorityRequired() -> ConstraintMakerFinalizable { 48 | return self.priority(.required) 49 | } 50 | 51 | @available(*, deprecated:3.0, message:"Use priority(.high) instead.") 52 | @discardableResult 53 | public func priorityHigh() -> ConstraintMakerFinalizable { 54 | return self.priority(.high) 55 | } 56 | 57 | @available(*, deprecated:3.0, message:"Use priority(.medium) instead.") 58 | @discardableResult 59 | public func priorityMedium() -> ConstraintMakerFinalizable { 60 | return self.priority(.medium) 61 | } 62 | 63 | @available(*, deprecated:3.0, message:"Use priority(.low) instead.") 64 | @discardableResult 65 | public func priorityLow() -> ConstraintMakerFinalizable { 66 | return self.priority(.low) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMakerRelatable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerRelatable { 32 | 33 | internal let description: ConstraintDescription 34 | 35 | internal init(_ description: ConstraintDescription) { 36 | self.description = description 37 | } 38 | 39 | internal func relatedTo(_ other: ConstraintRelatableTarget, relation: ConstraintRelation, file: String, line: UInt) -> ConstraintMakerEditable { 40 | let related: ConstraintItem 41 | let constant: ConstraintConstantTarget 42 | 43 | if let other = other as? ConstraintItem { 44 | guard other.attributes == ConstraintAttributes.none || 45 | other.attributes.layoutAttributes.count <= 1 || 46 | other.attributes.layoutAttributes == self.description.attributes.layoutAttributes || 47 | other.attributes == .edges && self.description.attributes == .margins || 48 | other.attributes == .margins && self.description.attributes == .edges else { 49 | fatalError("Cannot constraint to multiple non identical attributes. (\(file), \(line))"); 50 | } 51 | 52 | related = other 53 | constant = 0.0 54 | } else if let other = other as? ConstraintView { 55 | related = ConstraintItem(target: other, attributes: ConstraintAttributes.none) 56 | constant = 0.0 57 | } else if let other = other as? ConstraintConstantTarget { 58 | related = ConstraintItem(target: nil, attributes: ConstraintAttributes.none) 59 | constant = other 60 | } else if #available(iOS 9.0, OSX 10.11, *), let other = other as? ConstraintLayoutGuide { 61 | related = ConstraintItem(target: other, attributes: ConstraintAttributes.none) 62 | constant = 0.0 63 | } else { 64 | fatalError("Invalid constraint. (\(file), \(line))") 65 | } 66 | 67 | let editable = ConstraintMakerEditable(self.description) 68 | editable.description.sourceLocation = (file, line) 69 | editable.description.relation = relation 70 | editable.description.related = related 71 | editable.description.constant = constant 72 | return editable 73 | } 74 | 75 | @discardableResult 76 | public func equalTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { 77 | return self.relatedTo(other, relation: .equal, file: file, line: line) 78 | } 79 | 80 | @discardableResult 81 | public func equalToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { 82 | guard let other = self.description.item.superview else { 83 | fatalError("Expected superview but found nil when attempting make constraint `equalToSuperview`.") 84 | } 85 | return self.relatedTo(other, relation: .equal, file: file, line: line) 86 | } 87 | 88 | @discardableResult 89 | public func lessThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { 90 | return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line) 91 | } 92 | 93 | @discardableResult 94 | public func lessThanOrEqualToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { 95 | guard let other = self.description.item.superview else { 96 | fatalError("Expected superview but found nil when attempting make constraint `lessThanOrEqualToSuperview`.") 97 | } 98 | return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line) 99 | } 100 | 101 | @discardableResult 102 | public func greaterThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable { 103 | return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line) 104 | } 105 | 106 | @discardableResult 107 | public func greaterThanOrEqualToSuperview(_ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable { 108 | guard let other = self.description.item.superview else { 109 | fatalError("Expected superview but found nil when attempting make constraint `greaterThanOrEqualToSuperview`.") 110 | } 111 | return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line) 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMultiplierTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintMultiplierTarget { 32 | 33 | var constraintMultiplierTargetValue: CGFloat { get } 34 | 35 | } 36 | 37 | extension Int: ConstraintMultiplierTarget { 38 | 39 | public var constraintMultiplierTargetValue: CGFloat { 40 | return CGFloat(self) 41 | } 42 | 43 | } 44 | 45 | extension UInt: ConstraintMultiplierTarget { 46 | 47 | public var constraintMultiplierTargetValue: CGFloat { 48 | return CGFloat(self) 49 | } 50 | 51 | } 52 | 53 | extension Float: ConstraintMultiplierTarget { 54 | 55 | public var constraintMultiplierTargetValue: CGFloat { 56 | return CGFloat(self) 57 | } 58 | 59 | } 60 | 61 | extension Double: ConstraintMultiplierTarget { 62 | 63 | public var constraintMultiplierTargetValue: CGFloat { 64 | return CGFloat(self) 65 | } 66 | 67 | } 68 | 69 | extension CGFloat: ConstraintMultiplierTarget { 70 | 71 | public var constraintMultiplierTargetValue: CGFloat { 72 | return self 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintOffsetTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintOffsetTarget: ConstraintConstantTarget { 32 | } 33 | 34 | extension Int: ConstraintOffsetTarget { 35 | } 36 | 37 | extension UInt: ConstraintOffsetTarget { 38 | } 39 | 40 | extension Float: ConstraintOffsetTarget { 41 | } 42 | 43 | extension Double: ConstraintOffsetTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintOffsetTarget { 47 | } 48 | 49 | extension ConstraintOffsetTarget { 50 | 51 | internal var constraintOffsetTargetValue: CGFloat { 52 | let offset: CGFloat 53 | if let amount = self as? Float { 54 | offset = CGFloat(amount) 55 | } else if let amount = self as? Double { 56 | offset = CGFloat(amount) 57 | } else if let amount = self as? CGFloat { 58 | offset = CGFloat(amount) 59 | } else if let amount = self as? Int { 60 | offset = CGFloat(amount) 61 | } else if let amount = self as? UInt { 62 | offset = CGFloat(amount) 63 | } else { 64 | offset = 0.0 65 | } 66 | return offset 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintPriority.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable, Strideable { 31 | public typealias FloatLiteralType = Float 32 | 33 | public let value: Float 34 | 35 | public init(floatLiteral value: Float) { 36 | self.value = value 37 | } 38 | 39 | public init(_ value: Float) { 40 | self.value = value 41 | } 42 | 43 | public static var required: ConstraintPriority { 44 | return 1000.0 45 | } 46 | 47 | public static var high: ConstraintPriority { 48 | return 750.0 49 | } 50 | 51 | public static var medium: ConstraintPriority { 52 | #if os(OSX) 53 | return 501.0 54 | #else 55 | return 500.0 56 | #endif 57 | 58 | } 59 | 60 | public static var low: ConstraintPriority { 61 | return 250.0 62 | } 63 | 64 | public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool { 65 | return lhs.value == rhs.value 66 | } 67 | 68 | // MARK: Strideable 69 | 70 | public func advanced(by n: FloatLiteralType) -> ConstraintPriority { 71 | return ConstraintPriority(floatLiteral: value + n) 72 | } 73 | 74 | public func distance(to other: ConstraintPriority) -> FloatLiteralType { 75 | return other.value - value 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintPriorityTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintPriorityTarget { 32 | 33 | var constraintPriorityTargetValue: Float { get } 34 | 35 | } 36 | 37 | extension Int: ConstraintPriorityTarget { 38 | 39 | public var constraintPriorityTargetValue: Float { 40 | return Float(self) 41 | } 42 | 43 | } 44 | 45 | extension UInt: ConstraintPriorityTarget { 46 | 47 | public var constraintPriorityTargetValue: Float { 48 | return Float(self) 49 | } 50 | 51 | } 52 | 53 | extension Float: ConstraintPriorityTarget { 54 | 55 | public var constraintPriorityTargetValue: Float { 56 | return self 57 | } 58 | 59 | } 60 | 61 | extension Double: ConstraintPriorityTarget { 62 | 63 | public var constraintPriorityTargetValue: Float { 64 | return Float(self) 65 | } 66 | 67 | } 68 | 69 | extension CGFloat: ConstraintPriorityTarget { 70 | 71 | public var constraintPriorityTargetValue: Float { 72 | return Float(self) 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintRelatableTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintRelatableTarget { 32 | } 33 | 34 | extension Int: ConstraintRelatableTarget { 35 | } 36 | 37 | extension UInt: ConstraintRelatableTarget { 38 | } 39 | 40 | extension Float: ConstraintRelatableTarget { 41 | } 42 | 43 | extension Double: ConstraintRelatableTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintRelatableTarget { 47 | } 48 | 49 | extension CGSize: ConstraintRelatableTarget { 50 | } 51 | 52 | extension CGPoint: ConstraintRelatableTarget { 53 | } 54 | 55 | extension ConstraintInsets: ConstraintRelatableTarget { 56 | } 57 | 58 | extension ConstraintItem: ConstraintRelatableTarget { 59 | } 60 | 61 | extension ConstraintView: ConstraintRelatableTarget { 62 | } 63 | 64 | @available(iOS 9.0, OSX 10.11, *) 65 | extension ConstraintLayoutGuide: ConstraintRelatableTarget { 66 | } 67 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintRelation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | internal enum ConstraintRelation : Int { 32 | case equal = 1 33 | case lessThanOrEqual 34 | case greaterThanOrEqual 35 | 36 | internal var layoutRelation: LayoutRelation { 37 | get { 38 | switch(self) { 39 | case .equal: 40 | return .equal 41 | case .lessThanOrEqual: 42 | return .lessThanOrEqual 43 | case .greaterThanOrEqual: 44 | return .greaterThanOrEqual 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintView+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public extension ConstraintView { 32 | 33 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 34 | public var snp_left: ConstraintItem { return self.snp.left } 35 | 36 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 37 | public var snp_top: ConstraintItem { return self.snp.top } 38 | 39 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 40 | public var snp_right: ConstraintItem { return self.snp.right } 41 | 42 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 43 | public var snp_bottom: ConstraintItem { return self.snp.bottom } 44 | 45 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 46 | public var snp_leading: ConstraintItem { return self.snp.leading } 47 | 48 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 49 | public var snp_trailing: ConstraintItem { return self.snp.trailing } 50 | 51 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 52 | public var snp_width: ConstraintItem { return self.snp.width } 53 | 54 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 55 | public var snp_height: ConstraintItem { return self.snp.height } 56 | 57 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 58 | public var snp_centerX: ConstraintItem { return self.snp.centerX } 59 | 60 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 61 | public var snp_centerY: ConstraintItem { return self.snp.centerY } 62 | 63 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 64 | public var snp_baseline: ConstraintItem { return self.snp.baseline } 65 | 66 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 67 | @available(iOS 8.0, OSX 10.11, *) 68 | public var snp_lastBaseline: ConstraintItem { return self.snp.lastBaseline } 69 | 70 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 71 | @available(iOS 8.0, OSX 10.11, *) 72 | public var snp_firstBaseline: ConstraintItem { return self.snp.firstBaseline } 73 | 74 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 75 | @available(iOS 8.0, *) 76 | public var snp_leftMargin: ConstraintItem { return self.snp.leftMargin } 77 | 78 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 79 | @available(iOS 8.0, *) 80 | public var snp_topMargin: ConstraintItem { return self.snp.topMargin } 81 | 82 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 83 | @available(iOS 8.0, *) 84 | public var snp_rightMargin: ConstraintItem { return self.snp.rightMargin } 85 | 86 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 87 | @available(iOS 8.0, *) 88 | public var snp_bottomMargin: ConstraintItem { return self.snp.bottomMargin } 89 | 90 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 91 | @available(iOS 8.0, *) 92 | public var snp_leadingMargin: ConstraintItem { return self.snp.leadingMargin } 93 | 94 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 95 | @available(iOS 8.0, *) 96 | public var snp_trailingMargin: ConstraintItem { return self.snp.trailingMargin } 97 | 98 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 99 | @available(iOS 8.0, *) 100 | public var snp_centerXWithinMargins: ConstraintItem { return self.snp.centerXWithinMargins } 101 | 102 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 103 | @available(iOS 8.0, *) 104 | public var snp_centerYWithinMargins: ConstraintItem { return self.snp.centerYWithinMargins } 105 | 106 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 107 | public var snp_edges: ConstraintItem { return self.snp.edges } 108 | 109 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 110 | public var snp_size: ConstraintItem { return self.snp.size } 111 | 112 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 113 | public var snp_center: ConstraintItem { return self.snp.center } 114 | 115 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 116 | @available(iOS 8.0, *) 117 | public var snp_margins: ConstraintItem { return self.snp.margins } 118 | 119 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") 120 | @available(iOS 8.0, *) 121 | public var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins } 122 | 123 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 124 | public func snp_prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { 125 | return self.snp.prepareConstraints(closure) 126 | } 127 | 128 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 129 | public func snp_makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 130 | self.snp.makeConstraints(closure) 131 | } 132 | 133 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 134 | public func snp_remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 135 | self.snp.remakeConstraints(closure) 136 | } 137 | 138 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 139 | public func snp_updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 140 | self.snp.updateConstraints(closure) 141 | } 142 | 143 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") 144 | public func snp_removeConstraints() { 145 | self.snp.removeConstraints() 146 | } 147 | 148 | public var snp: ConstraintViewDSL { 149 | return ConstraintViewDSL(view: self) 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | public typealias ConstraintView = UIView 33 | #else 34 | public typealias ConstraintView = NSView 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintViewDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public struct ConstraintViewDSL: ConstraintAttributesDSL { 32 | 33 | @discardableResult 34 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { 35 | return ConstraintMaker.prepareConstraints(item: self.view, closure: closure) 36 | } 37 | 38 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 39 | ConstraintMaker.makeConstraints(item: self.view, closure: closure) 40 | } 41 | 42 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 43 | ConstraintMaker.remakeConstraints(item: self.view, closure: closure) 44 | } 45 | 46 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 47 | ConstraintMaker.updateConstraints(item: self.view, closure: closure) 48 | } 49 | 50 | public func removeConstraints() { 51 | ConstraintMaker.removeConstraints(item: self.view) 52 | } 53 | 54 | public var contentHuggingHorizontalPriority: Float { 55 | get { 56 | return self.view.contentHuggingPriority(for: .horizontal).rawValue 57 | } 58 | set { 59 | self.view.setContentHuggingPriority(LayoutPriority(rawValue: newValue), for: .horizontal) 60 | } 61 | } 62 | 63 | public var contentHuggingVerticalPriority: Float { 64 | get { 65 | return self.view.contentHuggingPriority(for: .vertical).rawValue 66 | } 67 | set { 68 | self.view.setContentHuggingPriority(LayoutPriority(rawValue: newValue), for: .vertical) 69 | } 70 | } 71 | 72 | public var contentCompressionResistanceHorizontalPriority: Float { 73 | get { 74 | return self.view.contentCompressionResistancePriority(for: .horizontal).rawValue 75 | } 76 | set { 77 | self.view.setContentCompressionResistancePriority(LayoutPriority(rawValue: newValue), for: .horizontal) 78 | } 79 | } 80 | 81 | public var contentCompressionResistanceVerticalPriority: Float { 82 | get { 83 | return self.view.contentCompressionResistancePriority(for: .vertical).rawValue 84 | } 85 | set { 86 | self.view.setContentCompressionResistancePriority(LayoutPriority(rawValue: newValue), for: .vertical) 87 | } 88 | } 89 | 90 | public var target: AnyObject? { 91 | return self.view 92 | } 93 | 94 | internal let view: ConstraintView 95 | 96 | internal init(view: ConstraintView) { 97 | self.view = view 98 | 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/Debugging.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | public extension LayoutConstraint { 31 | 32 | override public var description: String { 33 | var description = "<" 34 | 35 | description += descriptionForObject(self) 36 | 37 | if let firstItem = conditionalOptional(from: self.firstItem) { 38 | description += " \(descriptionForObject(firstItem))" 39 | } 40 | 41 | if self.firstAttribute != .notAnAttribute { 42 | description += ".\(descriptionForAttribute(self.firstAttribute))" 43 | } 44 | 45 | description += " \(descriptionForRelation(self.relation))" 46 | 47 | if let secondItem = self.secondItem { 48 | description += " \(descriptionForObject(secondItem))" 49 | } 50 | 51 | if self.secondAttribute != .notAnAttribute { 52 | description += ".\(descriptionForAttribute(self.secondAttribute))" 53 | } 54 | 55 | if self.multiplier != 1.0 { 56 | description += " * \(self.multiplier)" 57 | } 58 | 59 | if self.secondAttribute == .notAnAttribute { 60 | description += " \(self.constant)" 61 | } else { 62 | if self.constant > 0.0 { 63 | description += " + \(self.constant)" 64 | } else if self.constant < 0.0 { 65 | description += " - \(abs(self.constant))" 66 | } 67 | } 68 | 69 | if self.priority.rawValue != 1000.0 { 70 | description += " ^\(self.priority)" 71 | } 72 | 73 | description += ">" 74 | 75 | return description 76 | } 77 | 78 | } 79 | 80 | private func descriptionForRelation(_ relation: LayoutRelation) -> String { 81 | switch relation { 82 | case .equal: return "==" 83 | case .greaterThanOrEqual: return ">=" 84 | case .lessThanOrEqual: return "<=" 85 | } 86 | } 87 | 88 | private func descriptionForAttribute(_ attribute: LayoutAttribute) -> String { 89 | #if os(iOS) || os(tvOS) 90 | switch attribute { 91 | case .notAnAttribute: return "notAnAttribute" 92 | case .top: return "top" 93 | case .left: return "left" 94 | case .bottom: return "bottom" 95 | case .right: return "right" 96 | case .leading: return "leading" 97 | case .trailing: return "trailing" 98 | case .width: return "width" 99 | case .height: return "height" 100 | case .centerX: return "centerX" 101 | case .centerY: return "centerY" 102 | case .lastBaseline: return "lastBaseline" 103 | case .firstBaseline: return "firstBaseline" 104 | case .topMargin: return "topMargin" 105 | case .leftMargin: return "leftMargin" 106 | case .bottomMargin: return "bottomMargin" 107 | case .rightMargin: return "rightMargin" 108 | case .leadingMargin: return "leadingMargin" 109 | case .trailingMargin: return "trailingMargin" 110 | case .centerXWithinMargins: return "centerXWithinMargins" 111 | case .centerYWithinMargins: return "centerYWithinMargins" 112 | } 113 | #else 114 | switch attribute { 115 | case .notAnAttribute: return "notAnAttribute" 116 | case .top: return "top" 117 | case .left: return "left" 118 | case .bottom: return "bottom" 119 | case .right: return "right" 120 | case .leading: return "leading" 121 | case .trailing: return "trailing" 122 | case .width: return "width" 123 | case .height: return "height" 124 | case .centerX: return "centerX" 125 | case .centerY: return "centerY" 126 | case .lastBaseline: return "lastBaseline" 127 | case .firstBaseline: return "firstBaseline" 128 | } 129 | #endif 130 | } 131 | 132 | private func conditionalOptional(from object: Optional) -> Optional { 133 | return object 134 | } 135 | 136 | private func conditionalOptional(from object: T) -> Optional { 137 | return Optional.some(object) 138 | } 139 | 140 | private func descriptionForObject(_ object: AnyObject) -> String { 141 | let pointerDescription = String(format: "%p", UInt(bitPattern: ObjectIdentifier(object))) 142 | var desc = "" 143 | 144 | desc += type(of: object).description() 145 | 146 | if let object = object as? ConstraintView { 147 | desc += ":\(object.snp.label() ?? pointerDescription)" 148 | } else if let object = object as? LayoutConstraint { 149 | desc += ":\(object.label ?? pointerDescription)" 150 | } else { 151 | desc += ":\(pointerDescription)" 152 | } 153 | 154 | if let object = object as? LayoutConstraint, let file = object.constraint?.sourceLocation.0, let line = object.constraint?.sourceLocation.1 { 155 | desc += "@\((file as NSString).lastPathComponent)#\(line)" 156 | } 157 | 158 | desc += "" 159 | return desc 160 | } 161 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/LayoutConstraint.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class LayoutConstraint : NSLayoutConstraint { 32 | 33 | public var label: String? { 34 | get { 35 | return self.identifier 36 | } 37 | set { 38 | self.identifier = newValue 39 | } 40 | } 41 | 42 | internal weak var constraint: Constraint? = nil 43 | 44 | } 45 | 46 | internal func ==(lhs: LayoutConstraint, rhs: LayoutConstraint) -> Bool { 47 | guard lhs.firstItem === rhs.firstItem && 48 | lhs.secondItem === rhs.secondItem && 49 | lhs.firstAttribute == rhs.firstAttribute && 50 | lhs.secondAttribute == rhs.secondAttribute && 51 | lhs.relation == rhs.relation && 52 | lhs.priority == rhs.priority && 53 | lhs.multiplier == rhs.multiplier else { 54 | return false 55 | } 56 | return true 57 | } 58 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/LayoutConstraintItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol LayoutConstraintItem: class { 32 | } 33 | 34 | @available(iOS 9.0, OSX 10.11, *) 35 | extension ConstraintLayoutGuide : LayoutConstraintItem { 36 | } 37 | 38 | extension ConstraintView : LayoutConstraintItem { 39 | } 40 | 41 | 42 | extension LayoutConstraintItem { 43 | 44 | internal func prepare() { 45 | if let view = self as? ConstraintView { 46 | view.translatesAutoresizingMaskIntoConstraints = false 47 | } 48 | } 49 | 50 | internal var superview: ConstraintView? { 51 | if let view = self as? ConstraintView { 52 | return view.superview 53 | } 54 | 55 | if #available(iOS 9.0, OSX 10.11, *), let guide = self as? ConstraintLayoutGuide { 56 | return guide.owningView 57 | } 58 | 59 | return nil 60 | } 61 | internal var constraints: [Constraint] { 62 | return self.constraintsSet.allObjects as! [Constraint] 63 | } 64 | 65 | internal func add(constraints: [Constraint]) { 66 | let constraintsSet = self.constraintsSet 67 | for constraint in constraints { 68 | constraintsSet.add(constraint) 69 | } 70 | } 71 | 72 | internal func remove(constraints: [Constraint]) { 73 | let constraintsSet = self.constraintsSet 74 | for constraint in constraints { 75 | constraintsSet.remove(constraint) 76 | } 77 | } 78 | 79 | private var constraintsSet: NSMutableSet { 80 | let constraintsSet: NSMutableSet 81 | 82 | if let existing = objc_getAssociatedObject(self, &constraintsKey) as? NSMutableSet { 83 | constraintsSet = existing 84 | } else { 85 | constraintsSet = NSMutableSet() 86 | objc_setAssociatedObject(self, &constraintsKey, constraintsSet, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 87 | } 88 | return constraintsSet 89 | 90 | } 91 | 92 | } 93 | private var constraintsKey: UInt8 = 0 94 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/Typealiases.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | 26 | #if os(iOS) || os(tvOS) 27 | import UIKit 28 | typealias LayoutRelation = NSLayoutRelation 29 | typealias LayoutAttribute = NSLayoutAttribute 30 | typealias LayoutPriority = UILayoutPriority 31 | #else 32 | import AppKit 33 | typealias LayoutRelation = NSLayoutConstraint.Relation 34 | typealias LayoutAttribute = NSLayoutConstraint.Attribute 35 | typealias LayoutPriority = NSLayoutConstraint.Priority 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/UILayoutSupport+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #endif 27 | 28 | 29 | @available(iOS 8.0, *) 30 | public extension ConstraintLayoutSupport { 31 | 32 | public var snp: ConstraintLayoutSupportDSL { 33 | return ConstraintLayoutSupportDSL(support: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SnapKit 5 | 6 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | SnapKit 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Making_MVC_Greate_Again : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Making_MVC_Greate_Again 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # Used as a return value for each invocation of `strip_invalid_archs` function. 10 | STRIP_BINARY_RETVAL=0 11 | 12 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 13 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 14 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 15 | 16 | # Copies and strips a vendored framework 17 | install_framework() 18 | { 19 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 20 | local source="${BUILT_PRODUCTS_DIR}/$1" 21 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 22 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 23 | elif [ -r "$1" ]; then 24 | local source="$1" 25 | fi 26 | 27 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 28 | 29 | if [ -L "${source}" ]; then 30 | echo "Symlinked..." 31 | source="$(readlink "${source}")" 32 | fi 33 | 34 | # Use filter instead of exclude so missing patterns don't throw errors. 35 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 36 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 37 | 38 | local basename 39 | basename="$(basename -s .framework "$1")" 40 | binary="${destination}/${basename}.framework/${basename}" 41 | if ! [ -r "$binary" ]; then 42 | binary="${destination}/${basename}" 43 | fi 44 | 45 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 46 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 47 | strip_invalid_archs "$binary" 48 | fi 49 | 50 | # Resign the code if required by the build settings to avoid unstable apps 51 | code_sign_if_enabled "${destination}/$(basename "$1")" 52 | 53 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 54 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 55 | local swift_runtime_libs 56 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 57 | for lib in $swift_runtime_libs; do 58 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 59 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 60 | code_sign_if_enabled "${destination}/${lib}" 61 | done 62 | fi 63 | } 64 | 65 | # Copies and strips a vendored dSYM 66 | install_dsym() { 67 | local source="$1" 68 | if [ -r "$source" ]; then 69 | # Copy the dSYM into a the targets temp dir. 70 | 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}\"" 71 | 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}" 72 | 73 | local basename 74 | basename="$(basename -s .framework.dSYM "$source")" 75 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 76 | 77 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 78 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 79 | strip_invalid_archs "$binary" 80 | fi 81 | 82 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 83 | # Move the stripped file into its final destination. 84 | 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}\"" 85 | 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}" 86 | else 87 | # 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. 88 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 89 | fi 90 | fi 91 | } 92 | 93 | # Signs a framework with the provided identity 94 | code_sign_if_enabled() { 95 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 96 | # Use the current code_sign_identitiy 97 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 98 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 99 | 100 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 101 | code_sign_cmd="$code_sign_cmd &" 102 | fi 103 | echo "$code_sign_cmd" 104 | eval "$code_sign_cmd" 105 | fi 106 | } 107 | 108 | # Strip invalid architectures 109 | strip_invalid_archs() { 110 | binary="$1" 111 | # Get architectures for current target binary 112 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 113 | # Intersect them with the architectures we are building for 114 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 115 | # If there are no archs supported by this binary then warn the user 116 | if [[ -z "$intersected_archs" ]]; then 117 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 118 | STRIP_BINARY_RETVAL=0 119 | return 120 | fi 121 | stripped="" 122 | for arch in $binary_archs; do 123 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 124 | # Strip non-valid architectures in-place 125 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 126 | stripped="$stripped $arch" 127 | fi 128 | done 129 | if [[ "$stripped" ]]; then 130 | echo "Stripped $binary of architectures:$stripped" 131 | fi 132 | STRIP_BINARY_RETVAL=1 133 | } 134 | 135 | 136 | if [[ "$CONFIGURATION" == "Debug" ]]; then 137 | install_framework "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework" 138 | fi 139 | if [[ "$CONFIGURATION" == "Release" ]]; then 140 | install_framework "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework" 141 | fi 142 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 143 | wait 144 | fi 145 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | 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 52 | 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} 53 | ;; 54 | *.xib) 55 | 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 56 | 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} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | 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}" 106 | fi 107 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_Making_MVC_Greate_AgainVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_Making_MVC_Greate_AgainVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "SnapKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Making_MVC_Greate_Again { 2 | umbrella header "Pods-Making MVC Greate Again-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Making MVC Greate Again/Pods-Making MVC Greate Again.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "SnapKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SnapKit : NSObject 3 | @end 4 | @implementation PodsDummy_SnapKit 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double SnapKitVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module SnapKit { 2 | umbrella header "SnapKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SnapKit 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Making MVC Great Again! 2 | Use generics, protocols, and extensions to get rid of massive view controllers 3 | 4 | ### Read the blog post: 5 | [https://omaralbeik.com/blog/make_mvc_great_again_1](https://omaralbeik.com/blog/make_mvc_great_again_1) 6 | --------------------------------------------------------------------------------