├── .DS_Store ├── ImageTextField.podspec ├── ImageTextField.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── ImageTextField.xcscmblueprint │ └── xcuserdata │ │ └── sahil.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── sahil.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── ImageTextField.xcscheme │ └── xcschememanagement.plist ├── ImageTextField ├── .DS_Store ├── 1.0.0 │ └── ImageTextField.podspec ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── icon.imageset │ │ ├── Contents.json │ │ ├── add_large-1.png │ │ └── add_large-2.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── ImageTextFieldTests ├── ImageTextFieldTests.swift └── Info.plist ├── ImageTextFieldUITests ├── ImageTextFieldUITests.swift └── Info.plist ├── LICENSE ├── README.md └── Source └── ImageTextField.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sahilberi/ImageTextField/34e71ca6129a7b51bb03cbdcf4ecb7d1a0b4d5a7/.DS_Store -------------------------------------------------------------------------------- /ImageTextField.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = "ImageTextField" 4 | s.version = "1.0.0" 5 | s.summary = "A Designable Textfield For adding textfield leftview and rightview images in storyboard for swift 3.0" 6 | s.homepage = "https://github.com/Sahilberi/ImageTextField/tree/master/ImageTextField" 7 | s.screenshots = "https://cloud.githubusercontent.com/assets/7422405/23651176/b1db6c48-034a-11e7-90c0-571da6a150f3.png" 8 | s.license = "MIT" 9 | s.author = { "Sahil" => "Sahilberi97@gmail.com" } 10 | s.platform = :ios 11 | s.ios.deployment_target = "8.0" 12 | s.source = { :git => "https://github.com/Sahilberi/ImageTextField.git", :tag => s.version } 13 | s.source_files = "Source/**/*.{swift,h}" 14 | end 15 | -------------------------------------------------------------------------------- /ImageTextField.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BAB836E51E5D757200FF6C2E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB836E41E5D757200FF6C2E /* AppDelegate.swift */; }; 11 | BAB836E71E5D757200FF6C2E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB836E61E5D757200FF6C2E /* ViewController.swift */; }; 12 | BAB836EA1E5D757200FF6C2E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BAB836E81E5D757200FF6C2E /* Main.storyboard */; }; 13 | BAB836EC1E5D757200FF6C2E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BAB836EB1E5D757200FF6C2E /* Assets.xcassets */; }; 14 | BAB836EF1E5D757200FF6C2E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BAB836ED1E5D757200FF6C2E /* LaunchScreen.storyboard */; }; 15 | BAB836FA1E5D757200FF6C2E /* ImageTextFieldTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB836F91E5D757200FF6C2E /* ImageTextFieldTests.swift */; }; 16 | BAB837051E5D757200FF6C2E /* ImageTextFieldUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB837041E5D757200FF6C2E /* ImageTextFieldUITests.swift */; }; 17 | BAB837131E5D759300FF6C2E /* ImageTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB837121E5D759300FF6C2E /* ImageTextField.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | BAB836F61E5D757200FF6C2E /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = BAB836D91E5D757200FF6C2E /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = BAB836E01E5D757200FF6C2E; 26 | remoteInfo = ImageTextField; 27 | }; 28 | BAB837011E5D757200FF6C2E /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = BAB836D91E5D757200FF6C2E /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = BAB836E01E5D757200FF6C2E; 33 | remoteInfo = ImageTextField; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | BAB836E11E5D757200FF6C2E /* ImageTextField.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageTextField.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | BAB836E41E5D757200FF6C2E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | BAB836E61E5D757200FF6C2E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | BAB836E91E5D757200FF6C2E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | BAB836EB1E5D757200FF6C2E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | BAB836EE1E5D757200FF6C2E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | BAB836F01E5D757200FF6C2E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | BAB836F51E5D757200FF6C2E /* ImageTextFieldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageTextFieldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | BAB836F91E5D757200FF6C2E /* ImageTextFieldTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageTextFieldTests.swift; sourceTree = ""; }; 47 | BAB836FB1E5D757200FF6C2E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | BAB837001E5D757200FF6C2E /* ImageTextFieldUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageTextFieldUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | BAB837041E5D757200FF6C2E /* ImageTextFieldUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageTextFieldUITests.swift; sourceTree = ""; }; 50 | BAB837061E5D757200FF6C2E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | BAB837121E5D759300FF6C2E /* ImageTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageTextField.swift; path = ../ImageTextField/ImageTextField.swift; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | BAB836DE1E5D757200FF6C2E /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | BAB836F21E5D757200FF6C2E /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | BAB836FD1E5D757200FF6C2E /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | BA98B6E41EAF0B9200204CD6 /* Source */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | BAB837121E5D759300FF6C2E /* ImageTextField.swift */, 83 | ); 84 | path = Source; 85 | sourceTree = ""; 86 | }; 87 | BAB836D81E5D757200FF6C2E = { 88 | isa = PBXGroup; 89 | children = ( 90 | BA98B6E41EAF0B9200204CD6 /* Source */, 91 | BAB836E31E5D757200FF6C2E /* ImageTextField */, 92 | BAB836F81E5D757200FF6C2E /* ImageTextFieldTests */, 93 | BAB837031E5D757200FF6C2E /* ImageTextFieldUITests */, 94 | BAB836E21E5D757200FF6C2E /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | BAB836E21E5D757200FF6C2E /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | BAB836E11E5D757200FF6C2E /* ImageTextField.app */, 102 | BAB836F51E5D757200FF6C2E /* ImageTextFieldTests.xctest */, 103 | BAB837001E5D757200FF6C2E /* ImageTextFieldUITests.xctest */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | BAB836E31E5D757200FF6C2E /* ImageTextField */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | BAB836E41E5D757200FF6C2E /* AppDelegate.swift */, 112 | BAB836E61E5D757200FF6C2E /* ViewController.swift */, 113 | BAB836E81E5D757200FF6C2E /* Main.storyboard */, 114 | BAB836EB1E5D757200FF6C2E /* Assets.xcassets */, 115 | BAB836ED1E5D757200FF6C2E /* LaunchScreen.storyboard */, 116 | BAB836F01E5D757200FF6C2E /* Info.plist */, 117 | ); 118 | path = ImageTextField; 119 | sourceTree = ""; 120 | }; 121 | BAB836F81E5D757200FF6C2E /* ImageTextFieldTests */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | BAB836F91E5D757200FF6C2E /* ImageTextFieldTests.swift */, 125 | BAB836FB1E5D757200FF6C2E /* Info.plist */, 126 | ); 127 | path = ImageTextFieldTests; 128 | sourceTree = ""; 129 | }; 130 | BAB837031E5D757200FF6C2E /* ImageTextFieldUITests */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | BAB837041E5D757200FF6C2E /* ImageTextFieldUITests.swift */, 134 | BAB837061E5D757200FF6C2E /* Info.plist */, 135 | ); 136 | path = ImageTextFieldUITests; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | BAB836E01E5D757200FF6C2E /* ImageTextField */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = BAB837091E5D757200FF6C2E /* Build configuration list for PBXNativeTarget "ImageTextField" */; 145 | buildPhases = ( 146 | BAB836DD1E5D757200FF6C2E /* Sources */, 147 | BAB836DE1E5D757200FF6C2E /* Frameworks */, 148 | BAB836DF1E5D757200FF6C2E /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = ImageTextField; 155 | productName = ImageTextField; 156 | productReference = BAB836E11E5D757200FF6C2E /* ImageTextField.app */; 157 | productType = "com.apple.product-type.application"; 158 | }; 159 | BAB836F41E5D757200FF6C2E /* ImageTextFieldTests */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = BAB8370C1E5D757200FF6C2E /* Build configuration list for PBXNativeTarget "ImageTextFieldTests" */; 162 | buildPhases = ( 163 | BAB836F11E5D757200FF6C2E /* Sources */, 164 | BAB836F21E5D757200FF6C2E /* Frameworks */, 165 | BAB836F31E5D757200FF6C2E /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | BAB836F71E5D757200FF6C2E /* PBXTargetDependency */, 171 | ); 172 | name = ImageTextFieldTests; 173 | productName = ImageTextFieldTests; 174 | productReference = BAB836F51E5D757200FF6C2E /* ImageTextFieldTests.xctest */; 175 | productType = "com.apple.product-type.bundle.unit-test"; 176 | }; 177 | BAB836FF1E5D757200FF6C2E /* ImageTextFieldUITests */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = BAB8370F1E5D757200FF6C2E /* Build configuration list for PBXNativeTarget "ImageTextFieldUITests" */; 180 | buildPhases = ( 181 | BAB836FC1E5D757200FF6C2E /* Sources */, 182 | BAB836FD1E5D757200FF6C2E /* Frameworks */, 183 | BAB836FE1E5D757200FF6C2E /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | BAB837021E5D757200FF6C2E /* PBXTargetDependency */, 189 | ); 190 | name = ImageTextFieldUITests; 191 | productName = ImageTextFieldUITests; 192 | productReference = BAB837001E5D757200FF6C2E /* ImageTextFieldUITests.xctest */; 193 | productType = "com.apple.product-type.bundle.ui-testing"; 194 | }; 195 | /* End PBXNativeTarget section */ 196 | 197 | /* Begin PBXProject section */ 198 | BAB836D91E5D757200FF6C2E /* Project object */ = { 199 | isa = PBXProject; 200 | attributes = { 201 | LastSwiftUpdateCheck = 0820; 202 | LastUpgradeCheck = 0820; 203 | ORGANIZATIONNAME = SahilBeri; 204 | TargetAttributes = { 205 | BAB836E01E5D757200FF6C2E = { 206 | CreatedOnToolsVersion = 8.2; 207 | ProvisioningStyle = Automatic; 208 | }; 209 | BAB836F41E5D757200FF6C2E = { 210 | CreatedOnToolsVersion = 8.2; 211 | ProvisioningStyle = Automatic; 212 | TestTargetID = BAB836E01E5D757200FF6C2E; 213 | }; 214 | BAB836FF1E5D757200FF6C2E = { 215 | CreatedOnToolsVersion = 8.2; 216 | ProvisioningStyle = Automatic; 217 | TestTargetID = BAB836E01E5D757200FF6C2E; 218 | }; 219 | }; 220 | }; 221 | buildConfigurationList = BAB836DC1E5D757200FF6C2E /* Build configuration list for PBXProject "ImageTextField" */; 222 | compatibilityVersion = "Xcode 3.2"; 223 | developmentRegion = English; 224 | hasScannedForEncodings = 0; 225 | knownRegions = ( 226 | en, 227 | Base, 228 | ); 229 | mainGroup = BAB836D81E5D757200FF6C2E; 230 | productRefGroup = BAB836E21E5D757200FF6C2E /* Products */; 231 | projectDirPath = ""; 232 | projectRoot = ""; 233 | targets = ( 234 | BAB836E01E5D757200FF6C2E /* ImageTextField */, 235 | BAB836F41E5D757200FF6C2E /* ImageTextFieldTests */, 236 | BAB836FF1E5D757200FF6C2E /* ImageTextFieldUITests */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | BAB836DF1E5D757200FF6C2E /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | BAB836EF1E5D757200FF6C2E /* LaunchScreen.storyboard in Resources */, 247 | BAB836EC1E5D757200FF6C2E /* Assets.xcassets in Resources */, 248 | BAB836EA1E5D757200FF6C2E /* Main.storyboard in Resources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | BAB836F31E5D757200FF6C2E /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | BAB836FE1E5D757200FF6C2E /* Resources */ = { 260 | isa = PBXResourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXResourcesBuildPhase section */ 267 | 268 | /* Begin PBXSourcesBuildPhase section */ 269 | BAB836DD1E5D757200FF6C2E /* Sources */ = { 270 | isa = PBXSourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | BAB836E71E5D757200FF6C2E /* ViewController.swift in Sources */, 274 | BAB837131E5D759300FF6C2E /* ImageTextField.swift in Sources */, 275 | BAB836E51E5D757200FF6C2E /* AppDelegate.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | BAB836F11E5D757200FF6C2E /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | BAB836FA1E5D757200FF6C2E /* ImageTextFieldTests.swift in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | BAB836FC1E5D757200FF6C2E /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | BAB837051E5D757200FF6C2E /* ImageTextFieldUITests.swift in Sources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | /* End PBXSourcesBuildPhase section */ 296 | 297 | /* Begin PBXTargetDependency section */ 298 | BAB836F71E5D757200FF6C2E /* PBXTargetDependency */ = { 299 | isa = PBXTargetDependency; 300 | target = BAB836E01E5D757200FF6C2E /* ImageTextField */; 301 | targetProxy = BAB836F61E5D757200FF6C2E /* PBXContainerItemProxy */; 302 | }; 303 | BAB837021E5D757200FF6C2E /* PBXTargetDependency */ = { 304 | isa = PBXTargetDependency; 305 | target = BAB836E01E5D757200FF6C2E /* ImageTextField */; 306 | targetProxy = BAB837011E5D757200FF6C2E /* PBXContainerItemProxy */; 307 | }; 308 | /* End PBXTargetDependency section */ 309 | 310 | /* Begin PBXVariantGroup section */ 311 | BAB836E81E5D757200FF6C2E /* Main.storyboard */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | BAB836E91E5D757200FF6C2E /* Base */, 315 | ); 316 | name = Main.storyboard; 317 | sourceTree = ""; 318 | }; 319 | BAB836ED1E5D757200FF6C2E /* LaunchScreen.storyboard */ = { 320 | isa = PBXVariantGroup; 321 | children = ( 322 | BAB836EE1E5D757200FF6C2E /* Base */, 323 | ); 324 | name = LaunchScreen.storyboard; 325 | sourceTree = ""; 326 | }; 327 | /* End PBXVariantGroup section */ 328 | 329 | /* Begin XCBuildConfiguration section */ 330 | BAB837071E5D757200FF6C2E /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_ANALYZER_NONNULL = YES; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN_BOOL_CONVERSION = YES; 340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 342 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 343 | CLANG_WARN_EMPTY_BODY = YES; 344 | CLANG_WARN_ENUM_CONVERSION = YES; 345 | CLANG_WARN_INFINITE_RECURSION = YES; 346 | CLANG_WARN_INT_CONVERSION = YES; 347 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 348 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 349 | CLANG_WARN_UNREACHABLE_CODE = YES; 350 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 351 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 352 | COPY_PHASE_STRIP = NO; 353 | DEBUG_INFORMATION_FORMAT = dwarf; 354 | ENABLE_STRICT_OBJC_MSGSEND = YES; 355 | ENABLE_TESTABILITY = YES; 356 | GCC_C_LANGUAGE_STANDARD = gnu99; 357 | GCC_DYNAMIC_NO_PIC = NO; 358 | GCC_NO_COMMON_BLOCKS = YES; 359 | GCC_OPTIMIZATION_LEVEL = 0; 360 | GCC_PREPROCESSOR_DEFINITIONS = ( 361 | "DEBUG=1", 362 | "$(inherited)", 363 | ); 364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 365 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 366 | GCC_WARN_UNDECLARED_SELECTOR = YES; 367 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 368 | GCC_WARN_UNUSED_FUNCTION = YES; 369 | GCC_WARN_UNUSED_VARIABLE = YES; 370 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 371 | MTL_ENABLE_DEBUG_INFO = YES; 372 | ONLY_ACTIVE_ARCH = YES; 373 | SDKROOT = iphoneos; 374 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 375 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 376 | TARGETED_DEVICE_FAMILY = "1,2"; 377 | }; 378 | name = Debug; 379 | }; 380 | BAB837081E5D757200FF6C2E /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ALWAYS_SEARCH_USER_PATHS = NO; 384 | CLANG_ANALYZER_NONNULL = YES; 385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 386 | CLANG_CXX_LIBRARY = "libc++"; 387 | CLANG_ENABLE_MODULES = YES; 388 | CLANG_ENABLE_OBJC_ARC = YES; 389 | CLANG_WARN_BOOL_CONVERSION = YES; 390 | CLANG_WARN_CONSTANT_CONVERSION = YES; 391 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 392 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 393 | CLANG_WARN_EMPTY_BODY = YES; 394 | CLANG_WARN_ENUM_CONVERSION = YES; 395 | CLANG_WARN_INFINITE_RECURSION = YES; 396 | CLANG_WARN_INT_CONVERSION = YES; 397 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 398 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 399 | CLANG_WARN_UNREACHABLE_CODE = YES; 400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 402 | COPY_PHASE_STRIP = NO; 403 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 404 | ENABLE_NS_ASSERTIONS = NO; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | GCC_C_LANGUAGE_STANDARD = gnu99; 407 | GCC_NO_COMMON_BLOCKS = YES; 408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 410 | GCC_WARN_UNDECLARED_SELECTOR = YES; 411 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 412 | GCC_WARN_UNUSED_FUNCTION = YES; 413 | GCC_WARN_UNUSED_VARIABLE = YES; 414 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 415 | MTL_ENABLE_DEBUG_INFO = NO; 416 | SDKROOT = iphoneos; 417 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 418 | TARGETED_DEVICE_FAMILY = "1,2"; 419 | VALIDATE_PRODUCT = YES; 420 | }; 421 | name = Release; 422 | }; 423 | BAB8370A1E5D757200FF6C2E /* Debug */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 427 | INFOPLIST_FILE = ImageTextField/Info.plist; 428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 429 | PRODUCT_BUNDLE_IDENTIFIER = sahil.ImageTextField; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | SWIFT_VERSION = 3.0; 432 | }; 433 | name = Debug; 434 | }; 435 | BAB8370B1E5D757200FF6C2E /* Release */ = { 436 | isa = XCBuildConfiguration; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | INFOPLIST_FILE = ImageTextField/Info.plist; 440 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 441 | PRODUCT_BUNDLE_IDENTIFIER = sahil.ImageTextField; 442 | PRODUCT_NAME = "$(TARGET_NAME)"; 443 | SWIFT_VERSION = 3.0; 444 | }; 445 | name = Release; 446 | }; 447 | BAB8370D1E5D757200FF6C2E /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 451 | BUNDLE_LOADER = "$(TEST_HOST)"; 452 | INFOPLIST_FILE = ImageTextFieldTests/Info.plist; 453 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 454 | PRODUCT_BUNDLE_IDENTIFIER = sahil.ImageTextFieldTests; 455 | PRODUCT_NAME = "$(TARGET_NAME)"; 456 | SWIFT_VERSION = 3.0; 457 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageTextField.app/ImageTextField"; 458 | }; 459 | name = Debug; 460 | }; 461 | BAB8370E1E5D757200FF6C2E /* Release */ = { 462 | isa = XCBuildConfiguration; 463 | buildSettings = { 464 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 465 | BUNDLE_LOADER = "$(TEST_HOST)"; 466 | INFOPLIST_FILE = ImageTextFieldTests/Info.plist; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 468 | PRODUCT_BUNDLE_IDENTIFIER = sahil.ImageTextFieldTests; 469 | PRODUCT_NAME = "$(TARGET_NAME)"; 470 | SWIFT_VERSION = 3.0; 471 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageTextField.app/ImageTextField"; 472 | }; 473 | name = Release; 474 | }; 475 | BAB837101E5D757200FF6C2E /* Debug */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 479 | INFOPLIST_FILE = ImageTextFieldUITests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = sahil.ImageTextFieldUITests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | SWIFT_VERSION = 3.0; 484 | TEST_TARGET_NAME = ImageTextField; 485 | }; 486 | name = Debug; 487 | }; 488 | BAB837111E5D757200FF6C2E /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 492 | INFOPLIST_FILE = ImageTextFieldUITests/Info.plist; 493 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 494 | PRODUCT_BUNDLE_IDENTIFIER = sahil.ImageTextFieldUITests; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | SWIFT_VERSION = 3.0; 497 | TEST_TARGET_NAME = ImageTextField; 498 | }; 499 | name = Release; 500 | }; 501 | /* End XCBuildConfiguration section */ 502 | 503 | /* Begin XCConfigurationList section */ 504 | BAB836DC1E5D757200FF6C2E /* Build configuration list for PBXProject "ImageTextField" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | BAB837071E5D757200FF6C2E /* Debug */, 508 | BAB837081E5D757200FF6C2E /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | BAB837091E5D757200FF6C2E /* Build configuration list for PBXNativeTarget "ImageTextField" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | BAB8370A1E5D757200FF6C2E /* Debug */, 517 | BAB8370B1E5D757200FF6C2E /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | BAB8370C1E5D757200FF6C2E /* Build configuration list for PBXNativeTarget "ImageTextFieldTests" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | BAB8370D1E5D757200FF6C2E /* Debug */, 526 | BAB8370E1E5D757200FF6C2E /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | BAB8370F1E5D757200FF6C2E /* Build configuration list for PBXNativeTarget "ImageTextFieldUITests" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | BAB837101E5D757200FF6C2E /* Debug */, 535 | BAB837111E5D757200FF6C2E /* Release */, 536 | ); 537 | defaultConfigurationIsVisible = 0; 538 | defaultConfigurationName = Release; 539 | }; 540 | /* End XCConfigurationList section */ 541 | }; 542 | rootObject = BAB836D91E5D757200FF6C2E /* Project object */; 543 | } 544 | -------------------------------------------------------------------------------- /ImageTextField.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ImageTextField.xcodeproj/project.xcworkspace/xcshareddata/ImageTextField.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "EDEFB4BA40DA3D0FDBB5D7F0D9514B74B28E7DC7", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "AD0AF67AFAF37D8FA43849A5B6029DF239573BD2" : 9223372036854775807, 8 | "EDEFB4BA40DA3D0FDBB5D7F0D9514B74B28E7DC7" : 9223372036854775807 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "52279A05-0C4F-4777-9853-8745B8074E9F", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "AD0AF67AFAF37D8FA43849A5B6029DF239573BD2" : "", 13 | "EDEFB4BA40DA3D0FDBB5D7F0D9514B74B28E7DC7" : "ImageTextField\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "ImageTextField", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "ImageTextField.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:Sahilberi\/SahilRepo.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "AD0AF67AFAF37D8FA43849A5B6029DF239573BD2" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Sahilberi\/ImageTextField.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "EDEFB4BA40DA3D0FDBB5D7F0D9514B74B28E7DC7" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /ImageTextField.xcodeproj/project.xcworkspace/xcuserdata/sahil.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sahilberi/ImageTextField/34e71ca6129a7b51bb03cbdcf4ecb7d1a0b4d5a7/ImageTextField.xcodeproj/project.xcworkspace/xcuserdata/sahil.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ImageTextField.xcodeproj/xcuserdata/sahil.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ImageTextField.xcodeproj/xcuserdata/sahil.xcuserdatad/xcschemes/ImageTextField.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /ImageTextField.xcodeproj/xcuserdata/sahil.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ImageTextField.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | BAB836E01E5D757200FF6C2E 16 | 17 | primary 18 | 19 | 20 | BAB836F41E5D757200FF6C2E 21 | 22 | primary 23 | 24 | 25 | BAB836FF1E5D757200FF6C2E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ImageTextField/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sahilberi/ImageTextField/34e71ca6129a7b51bb03cbdcf4ecb7d1a0b4d5a7/ImageTextField/.DS_Store -------------------------------------------------------------------------------- /ImageTextField/1.0.0/ImageTextField.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = "ImageTextField" 4 | s.version = "1.0.0" 5 | s.summary = "A Designable Textfield For adding textfield leftview and rightview images in storyboard for swift 3.0" 6 | s.homepage = "https://github.com/Sahilberi/ImageTextField/tree/master/ImageTextField" 7 | s.screenshots = "https://cloud.githubusercontent.com/assets/7422405/23651176/b1db6c48-034a-11e7-90c0-571da6a150f3.png" 8 | s.license = "MIT" 9 | s.author = { "Sahil" => "Sahilberi97@gmail.com" } 10 | s.platform = :ios 11 | s.ios.deployment_target = "8.0" 12 | s.source = { :git => "https://github.com/Sahilberi/ImageTextField.git", :tag => s.version } 13 | s.source_files = "Source/**/*.{swift,h}" 14 | end 15 | -------------------------------------------------------------------------------- /ImageTextField/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ImageTextField 4 | // 5 | // Created by Sahil on 22/02/17. 6 | // Copyright © 2017 SahilBeri. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /ImageTextField/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /ImageTextField/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ImageTextField/Assets.xcassets/icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "add_large-1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "add_large-2.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ImageTextField/Assets.xcassets/icon.imageset/add_large-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sahilberi/ImageTextField/34e71ca6129a7b51bb03cbdcf4ecb7d1a0b4d5a7/ImageTextField/Assets.xcassets/icon.imageset/add_large-1.png -------------------------------------------------------------------------------- /ImageTextField/Assets.xcassets/icon.imageset/add_large-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sahilberi/ImageTextField/34e71ca6129a7b51bb03cbdcf4ecb7d1a0b4d5a7/ImageTextField/Assets.xcassets/icon.imageset/add_large-2.png -------------------------------------------------------------------------------- /ImageTextField/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 | 27 | 28 | -------------------------------------------------------------------------------- /ImageTextField/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /ImageTextField/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ImageTextField/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ImageTextField 4 | // 5 | // Created by Sahil on 22/02/17. 6 | // Copyright © 2017 SahilBeri. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ImageTextFieldTests/ImageTextFieldTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageTextFieldTests.swift 3 | // ImageTextFieldTests 4 | // 5 | // Created by Sahil on 22/02/17. 6 | // Copyright © 2017 SahilBeri. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import ImageTextField 11 | 12 | class ImageTextFieldTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ImageTextFieldTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ImageTextFieldUITests/ImageTextFieldUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageTextFieldUITests.swift 3 | // ImageTextFieldUITests 4 | // 5 | // Created by Sahil on 22/02/17. 6 | // Copyright © 2017 SahilBeri. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class ImageTextFieldUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ImageTextFieldUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Sahil 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ImageTextField 2 | 3 | A Designable Textfield For adding textfield leftview and rightview images in storyboard for swift 3.0 . 4 | 5 | Using ImageTextField you can set left and right imageview in storyboard with padding. At a single time image is either show on left side or right side. Also you can add Layer to TextField. If you add any color to Bottom Color it will add a layer in 6 | bottom layer and it's borderStyle will change. if you set it clear color it will change to .roundedRect borderStyle. 7 | 8 | 9 | 10 | 11 | # NOTE 12 | if you want to add image on right side you have to select the Force Right-to-Left option in semantic in interface builder. 13 | 14 | 15 | # Installation 16 | 17 | Manually 18 | 19 | Clone or Download this Repo. Then simply drag the class ImageTextField.swift to your Xcode project. 20 | 21 | # CocoaPods 22 | 23 | CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command: 24 | 25 | $ gem install cocoapods 26 | To integrate ImageTextField into your Xcode project using CocoaPods, specify it in your Podfile: 27 | 28 | ```source 'https://github.com/CocoaPods/Specs.git' 29 | platform :ios, '8.0' 30 | use_frameworks! 31 | 32 | target '' do 33 | pod 'ImageTextField','~> 1.0.0' 34 | end 35 | ``` 36 | 37 | Then, run the following command: 38 | 39 | $ pod install 40 | 41 | # Requirements 42 | 43 | Swift 3.0 44 | 45 | iOS 8.0 or later 46 | 47 | 48 | # Contributions 49 | 50 | Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub. 51 | 52 | -------------------------------------------------------------------------------- /Source/ImageTextField.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageTextField.swift 3 | // ImageTextField 4 | // 5 | // Created by Sahil on 22/02/17. 6 | // Copyright © 2017 SahilBeri. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @IBDesignable 12 | class ImageTextField: UITextField { 13 | 14 | var textFieldBorderStyle: UITextBorderStyle = .roundedRect 15 | 16 | // Provides left padding for image 17 | override func leftViewRect(forBounds bounds: CGRect) -> CGRect { 18 | var textRect = super.leftViewRect(forBounds: bounds) 19 | textRect.origin.x += padding 20 | return textRect 21 | } 22 | 23 | // Provides right padding for image 24 | override func rightViewRect(forBounds bounds: CGRect) -> CGRect { 25 | var textRect = super.rightViewRect(forBounds: bounds) 26 | textRect.origin.x -= padding 27 | return textRect 28 | } 29 | 30 | @IBInspectable var fieldImage: UIImage? = nil { 31 | didSet { 32 | updateView() 33 | } 34 | } 35 | 36 | @IBInspectable var padding: CGFloat = 0 37 | @IBInspectable var color: UIColor = UIColor.gray { 38 | didSet { 39 | updateView() 40 | } 41 | } 42 | @IBInspectable var bottomColor: UIColor = UIColor.clear { 43 | didSet { 44 | if bottomColor == UIColor.clear { 45 | self.borderStyle = .roundedRect 46 | } else { 47 | self.borderStyle = .bezel 48 | } 49 | self.setNeedsDisplay() 50 | } 51 | } 52 | 53 | func updateView() { 54 | 55 | if let image = fieldImage { 56 | leftViewMode = UITextFieldViewMode.always 57 | let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) 58 | imageView.image = image 59 | // Note: In order for your image to use the tint color, you have to select the image in the Assets.xcassets and change the "Render As" property to "Template Image". 60 | imageView.tintColor = color 61 | leftView = imageView 62 | } else { 63 | leftViewMode = UITextFieldViewMode.never 64 | leftView = nil 65 | } 66 | // Placeholder text color 67 | attributedPlaceholder = NSAttributedString(string: placeholder != nil ? placeholder! : "", attributes:[NSForegroundColorAttributeName: color]) 68 | } 69 | 70 | override func draw(_ rect: CGRect) { 71 | 72 | let path = UIBezierPath() 73 | path.move(to: CGPoint(x: self.bounds.origin.x, y: self.bounds.height 74 | - 0.5)) 75 | path.addLine(to: CGPoint(x: self.bounds.size.width, y: self.bounds.height 76 | - 0.5)) 77 | path.lineWidth = 0.5 78 | self.bottomColor.setStroke() 79 | path.stroke() 80 | } 81 | } 82 | --------------------------------------------------------------------------------