diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c5ecad3 Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index 69de732..bce853a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ SZTextViewPlaceholder ===================== + +Instantiated like any other UITextView the SZTextViewPlaceholder allows you to have a placeholder. + +Examples exist in the Xcode project. + +You can easily set placeholder text, color and font. \ No newline at end of file diff --git a/SZTextViewPlaceholder.xcodeproj/project.pbxproj b/SZTextViewPlaceholder.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ffe16d7 --- /dev/null +++ b/SZTextViewPlaceholder.xcodeproj/project.pbxproj @@ -0,0 +1,456 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + AA28DF0317ADBC2B00E45ABE /* SZTextViewPlaceHolderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AA28DF0217ADBC2B00E45ABE /* SZTextViewPlaceHolderTests.m */; }; + AA7FC47217ADB2D70039C4F0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7FC46517ADB2D70039C4F0 /* AppDelegate.m */; }; + AA7FC47317ADB2D70039C4F0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA7FC46617ADB2D70039C4F0 /* Main.storyboard */; }; + AA7FC47417ADB2D70039C4F0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AA7FC46817ADB2D70039C4F0 /* InfoPlist.strings */; }; + AA7FC47517ADB2D70039C4F0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AA7FC46A17ADB2D70039C4F0 /* Images.xcassets */; }; + AA7FC47617ADB2D70039C4F0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7FC46B17ADB2D70039C4F0 /* main.m */; }; + AA7FC47717ADB2D70039C4F0 /* SZTextViewPlaceholder-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AA7FC46C17ADB2D70039C4F0 /* SZTextViewPlaceholder-Info.plist */; }; + AA7FC47817ADB2D70039C4F0 /* SZTextViewPlaceholder.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7FC46F17ADB2D70039C4F0 /* SZTextViewPlaceholder.m */; }; + AA7FC47917ADB2D70039C4F0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7FC47117ADB2D70039C4F0 /* ViewController.m */; }; + AA7FC47F17ADB2E30039C4F0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AA7FC47B17ADB2E30039C4F0 /* InfoPlist.strings */; }; + AA7FC48017ADB2E30039C4F0 /* SZTextViewPlaceholderTests-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AA7FC47D17ADB2E30039C4F0 /* SZTextViewPlaceholderTests-Info.plist */; }; + AAF7609317ACBC1000BA76D4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF7609217ACBC1000BA76D4 /* Foundation.framework */; }; + AAF7609517ACBC1000BA76D4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF7609417ACBC1000BA76D4 /* CoreGraphics.framework */; }; + AAF7609717ACBC1000BA76D4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF7609617ACBC1000BA76D4 /* UIKit.framework */; }; + AAF760B217ACBC1000BA76D4 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF760B117ACBC1000BA76D4 /* XCTest.framework */; }; + AAF760B317ACBC1000BA76D4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF7609217ACBC1000BA76D4 /* Foundation.framework */; }; + AAF760B417ACBC1000BA76D4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF7609617ACBC1000BA76D4 /* UIKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + AAF760B517ACBC1000BA76D4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AAF7608717ACBC1000BA76D4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = AAF7608E17ACBC1000BA76D4; + remoteInfo = TextViewPlaceHolder; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + AA28DF0217ADBC2B00E45ABE /* SZTextViewPlaceHolderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SZTextViewPlaceHolderTests.m; sourceTree = ""; }; + AA7FC46417ADB2D70039C4F0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + AA7FC46517ADB2D70039C4F0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + AA7FC46717ADB2D70039C4F0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + AA7FC46917ADB2D70039C4F0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + AA7FC46A17ADB2D70039C4F0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + AA7FC46B17ADB2D70039C4F0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + AA7FC46C17ADB2D70039C4F0 /* SZTextViewPlaceholder-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SZTextViewPlaceholder-Info.plist"; sourceTree = ""; }; + AA7FC46D17ADB2D70039C4F0 /* SZTextViewPlaceholder-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SZTextViewPlaceholder-Prefix.pch"; sourceTree = ""; }; + AA7FC46E17ADB2D70039C4F0 /* SZTextViewPlaceholder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SZTextViewPlaceholder.h; sourceTree = ""; }; + AA7FC46F17ADB2D70039C4F0 /* SZTextViewPlaceholder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SZTextViewPlaceholder.m; sourceTree = ""; }; + AA7FC47017ADB2D70039C4F0 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + AA7FC47117ADB2D70039C4F0 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + AA7FC47C17ADB2E30039C4F0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + AA7FC47D17ADB2E30039C4F0 /* SZTextViewPlaceholderTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SZTextViewPlaceholderTests-Info.plist"; sourceTree = ""; }; + AAF7608F17ACBC1000BA76D4 /* SZTextViewPlaceholder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SZTextViewPlaceholder.app; sourceTree = BUILT_PRODUCTS_DIR; }; + AAF7609217ACBC1000BA76D4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + AAF7609417ACBC1000BA76D4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + AAF7609617ACBC1000BA76D4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + AAF760B017ACBC1000BA76D4 /* SZTextViewPlaceholderTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SZTextViewPlaceholderTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + AAF760B117ACBC1000BA76D4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + AAF7608C17ACBC1000BA76D4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AAF7609517ACBC1000BA76D4 /* CoreGraphics.framework in Frameworks */, + AAF7609717ACBC1000BA76D4 /* UIKit.framework in Frameworks */, + AAF7609317ACBC1000BA76D4 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAF760AD17ACBC1000BA76D4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AAF760B217ACBC1000BA76D4 /* XCTest.framework in Frameworks */, + AAF760B417ACBC1000BA76D4 /* UIKit.framework in Frameworks */, + AAF760B317ACBC1000BA76D4 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + AA7FC46317ADB2D70039C4F0 /* SZTextViewPlaceholder */ = { + isa = PBXGroup; + children = ( + AA7FC46417ADB2D70039C4F0 /* AppDelegate.h */, + AA7FC46517ADB2D70039C4F0 /* AppDelegate.m */, + AA7FC46617ADB2D70039C4F0 /* Main.storyboard */, + AA7FC46817ADB2D70039C4F0 /* InfoPlist.strings */, + AA7FC46A17ADB2D70039C4F0 /* Images.xcassets */, + AA7FC46B17ADB2D70039C4F0 /* main.m */, + AA7FC46C17ADB2D70039C4F0 /* SZTextViewPlaceholder-Info.plist */, + AA7FC46D17ADB2D70039C4F0 /* SZTextViewPlaceholder-Prefix.pch */, + AA7FC46E17ADB2D70039C4F0 /* SZTextViewPlaceholder.h */, + AA7FC46F17ADB2D70039C4F0 /* SZTextViewPlaceholder.m */, + AA7FC47017ADB2D70039C4F0 /* ViewController.h */, + AA7FC47117ADB2D70039C4F0 /* ViewController.m */, + ); + path = SZTextViewPlaceholder; + sourceTree = ""; + }; + AA7FC47A17ADB2E30039C4F0 /* SZTextViewPlaceholderTests */ = { + isa = PBXGroup; + children = ( + AA7FC47B17ADB2E30039C4F0 /* InfoPlist.strings */, + AA7FC47D17ADB2E30039C4F0 /* SZTextViewPlaceholderTests-Info.plist */, + AA28DF0217ADBC2B00E45ABE /* SZTextViewPlaceHolderTests.m */, + ); + path = SZTextViewPlaceholderTests; + sourceTree = ""; + }; + AAF7608617ACBC1000BA76D4 = { + isa = PBXGroup; + children = ( + AA7FC46317ADB2D70039C4F0 /* SZTextViewPlaceholder */, + AA7FC47A17ADB2E30039C4F0 /* SZTextViewPlaceholderTests */, + AAF7609117ACBC1000BA76D4 /* Frameworks */, + AAF7609017ACBC1000BA76D4 /* Products */, + ); + sourceTree = ""; + }; + AAF7609017ACBC1000BA76D4 /* Products */ = { + isa = PBXGroup; + children = ( + AAF7608F17ACBC1000BA76D4 /* SZTextViewPlaceholder.app */, + AAF760B017ACBC1000BA76D4 /* SZTextViewPlaceholderTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + AAF7609117ACBC1000BA76D4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + AAF7609217ACBC1000BA76D4 /* Foundation.framework */, + AAF7609417ACBC1000BA76D4 /* CoreGraphics.framework */, + AAF7609617ACBC1000BA76D4 /* UIKit.framework */, + AAF760B117ACBC1000BA76D4 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + AAF7608E17ACBC1000BA76D4 /* SZTextViewPlaceholder */ = { + isa = PBXNativeTarget; + buildConfigurationList = AAF760C117ACBC1100BA76D4 /* Build configuration list for PBXNativeTarget "SZTextViewPlaceholder" */; + buildPhases = ( + AAF7608B17ACBC1000BA76D4 /* Sources */, + AAF7608C17ACBC1000BA76D4 /* Frameworks */, + AAF7608D17ACBC1000BA76D4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SZTextViewPlaceholder; + productName = TextViewPlaceHolder; + productReference = AAF7608F17ACBC1000BA76D4 /* SZTextViewPlaceholder.app */; + productType = "com.apple.product-type.application"; + }; + AAF760AF17ACBC1000BA76D4 /* SZTextViewPlaceholderTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = AAF760C417ACBC1100BA76D4 /* Build configuration list for PBXNativeTarget "SZTextViewPlaceholderTests" */; + buildPhases = ( + AAF760AC17ACBC1000BA76D4 /* Sources */, + AAF760AD17ACBC1000BA76D4 /* Frameworks */, + AAF760AE17ACBC1000BA76D4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + AAF760B617ACBC1000BA76D4 /* PBXTargetDependency */, + ); + name = SZTextViewPlaceholderTests; + productName = TextViewPlaceHolderTests; + productReference = AAF760B017ACBC1000BA76D4 /* SZTextViewPlaceholderTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + AAF7608717ACBC1000BA76D4 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Steven Zweier"; + }; + buildConfigurationList = AAF7608A17ACBC1000BA76D4 /* Build configuration list for PBXProject "SZTextViewPlaceholder" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = AAF7608617ACBC1000BA76D4; + productRefGroup = AAF7609017ACBC1000BA76D4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + AAF7608E17ACBC1000BA76D4 /* SZTextViewPlaceholder */, + AAF760AF17ACBC1000BA76D4 /* SZTextViewPlaceholderTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + AAF7608D17ACBC1000BA76D4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AA7FC47517ADB2D70039C4F0 /* Images.xcassets in Resources */, + AA7FC48017ADB2E30039C4F0 /* SZTextViewPlaceholderTests-Info.plist in Resources */, + AA7FC47317ADB2D70039C4F0 /* Main.storyboard in Resources */, + AA7FC47717ADB2D70039C4F0 /* SZTextViewPlaceholder-Info.plist in Resources */, + AA7FC47417ADB2D70039C4F0 /* InfoPlist.strings in Resources */, + AA7FC47F17ADB2E30039C4F0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAF760AE17ACBC1000BA76D4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + AAF7608B17ACBC1000BA76D4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AA7FC47617ADB2D70039C4F0 /* main.m in Sources */, + AA7FC47817ADB2D70039C4F0 /* SZTextViewPlaceholder.m in Sources */, + AA7FC47917ADB2D70039C4F0 /* ViewController.m in Sources */, + AA7FC47217ADB2D70039C4F0 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAF760AC17ACBC1000BA76D4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AA28DF0317ADBC2B00E45ABE /* SZTextViewPlaceHolderTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + AAF760B617ACBC1000BA76D4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = AAF7608E17ACBC1000BA76D4 /* SZTextViewPlaceholder */; + targetProxy = AAF760B517ACBC1000BA76D4 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + AA7FC46617ADB2D70039C4F0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + AA7FC46717ADB2D70039C4F0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + AA7FC46817ADB2D70039C4F0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + AA7FC46917ADB2D70039C4F0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + AA7FC47B17ADB2E30039C4F0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + AA7FC47C17ADB2E30039C4F0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + AAF760BF17ACBC1100BA76D4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + AAF760C017ACBC1100BA76D4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + AAF760C217ACBC1100BA76D4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SZTextViewPlaceHolder/SZTextViewPlaceholder-Prefix.pch"; + INFOPLIST_FILE = "SZTextViewPlaceHolder/SZTextViewPlaceholder-Info.plist"; + PRODUCT_NAME = SZTextViewPlaceholder; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + AAF760C317ACBC1100BA76D4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SZTextViewPlaceHolder/SZTextViewPlaceholder-Prefix.pch"; + INFOPLIST_FILE = "SZTextViewPlaceHolder/SZTextViewPlaceholder-Info.plist"; + PRODUCT_NAME = SZTextViewPlaceholder; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + AAF760C517ACBC1100BA76D4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TextViewPlaceHolder/TextViewPlaceHolder-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "SZTextViewPlaceHolderTests/SZTextViewPlaceholderTests-Info.plist"; + PRODUCT_NAME = SZTextViewPlaceholderTests; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + AAF760C617ACBC1100BA76D4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TextViewPlaceHolder/TextViewPlaceHolder-Prefix.pch"; + INFOPLIST_FILE = "SZTextViewPlaceHolderTests/SZTextViewPlaceholderTests-Info.plist"; + PRODUCT_NAME = SZTextViewPlaceholderTests; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + AAF7608A17ACBC1000BA76D4 /* Build configuration list for PBXProject "SZTextViewPlaceholder" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AAF760BF17ACBC1100BA76D4 /* Debug */, + AAF760C017ACBC1100BA76D4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AAF760C117ACBC1100BA76D4 /* Build configuration list for PBXNativeTarget "SZTextViewPlaceholder" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AAF760C217ACBC1100BA76D4 /* Debug */, + AAF760C317ACBC1100BA76D4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AAF760C417ACBC1100BA76D4 /* Build configuration list for PBXNativeTarget "SZTextViewPlaceholderTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AAF760C517ACBC1100BA76D4 /* Debug */, + AAF760C617ACBC1100BA76D4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = AAF7608717ACBC1000BA76D4 /* Project object */; +} diff --git a/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c9f0a96 --- /dev/null +++ b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcshareddata/SZTextViewPlaceholder.xccheckout b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcshareddata/SZTextViewPlaceholder.xccheckout new file mode 100644 index 0000000..4e15885 --- /dev/null +++ b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcshareddata/SZTextViewPlaceholder.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 85789B93-96DD-4C4E-862D-C6AE0EA856C8 + IDESourceControlProjectName + SZTextViewPlaceholder + IDESourceControlProjectOriginsDictionary + + B762894C-A119-4BD1-BDC5-15EB3C3A8D2C + ssh://github.com/SteveZz/SZTextViewPlaceholder.git + + IDESourceControlProjectPath + SZTextViewPlaceholder.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + B762894C-A119-4BD1-BDC5-15EB3C3A8D2C + ../.. + + IDESourceControlProjectURL + ssh://github.com/SteveZz/SZTextViewPlaceholder.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + B762894C-A119-4BD1-BDC5-15EB3C3A8D2C + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + B762894C-A119-4BD1-BDC5-15EB3C3A8D2C + IDESourceControlWCCName + SZTextViewPlaceholder + + + + diff --git a/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcuserdata/Steve.xcuserdatad/UserInterfaceState.xcuserstate b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcuserdata/Steve.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..594c054 Binary files /dev/null and b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcuserdata/Steve.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcuserdata/Steve.xcuserdatad/WorkspaceSettings.xcsettings b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcuserdata/Steve.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..bfffcfe --- /dev/null +++ b/SZTextViewPlaceholder.xcodeproj/project.xcworkspace/xcuserdata/Steve.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcschemes/SZTextViewPlaceHolder.xcscheme b/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcschemes/SZTextViewPlaceHolder.xcscheme new file mode 100644 index 0000000..5c99e75 --- /dev/null +++ b/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcschemes/SZTextViewPlaceHolder.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcschemes/xcschememanagement.plist b/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..81e6810 --- /dev/null +++ b/SZTextViewPlaceholder.xcodeproj/xcuserdata/Steve.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + SZTextViewPlaceHolder.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + AAF7608E17ACBC1000BA76D4 + + primary + + + AAF760AF17ACBC1000BA76D4 + + primary + + + + + diff --git a/SZTextViewPlaceholder/AppDelegate.h b/SZTextViewPlaceholder/AppDelegate.h new file mode 100644 index 0000000..5f108d8 --- /dev/null +++ b/SZTextViewPlaceholder/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// TextViewPlaceHolder +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/SZTextViewPlaceholder/AppDelegate.m b/SZTextViewPlaceholder/AppDelegate.m new file mode 100644 index 0000000..834f71b --- /dev/null +++ b/SZTextViewPlaceholder/AppDelegate.m @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// TextViewPlaceHolder +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // 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. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/SZTextViewPlaceholder/Base.lproj/Main.storyboard b/SZTextViewPlaceholder/Base.lproj/Main.storyboard new file mode 100644 index 0000000..28a955d --- /dev/null +++ b/SZTextViewPlaceholder/Base.lproj/Main.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SZTextViewPlaceholder/Images.xcassets/AppIcon.appiconset/Contents.json b/SZTextViewPlaceholder/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/SZTextViewPlaceholder/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SZTextViewPlaceholder/Images.xcassets/LaunchImage.launchimage/Contents.json b/SZTextViewPlaceholder/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/SZTextViewPlaceholder/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SZTextViewPlaceholder/SZTextViewPlaceholder-Info.plist b/SZTextViewPlaceholder/SZTextViewPlaceholder-Info.plist new file mode 100644 index 0000000..ff8ca03 --- /dev/null +++ b/SZTextViewPlaceholder/SZTextViewPlaceholder-Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + Example + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.StevenZweier.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/SZTextViewPlaceholder/SZTextViewPlaceholder-Prefix.pch b/SZTextViewPlaceholder/SZTextViewPlaceholder-Prefix.pch new file mode 100644 index 0000000..9f4c510 --- /dev/null +++ b/SZTextViewPlaceholder/SZTextViewPlaceholder-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/SZTextViewPlaceholder/SZTextViewPlaceholder.h b/SZTextViewPlaceholder/SZTextViewPlaceholder.h new file mode 100644 index 0000000..0c29271 --- /dev/null +++ b/SZTextViewPlaceholder/SZTextViewPlaceholder.h @@ -0,0 +1,31 @@ +// +// SZTextViewPlaceholder.h +// SZTextViewPlaceHolder +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import + +/** + This is a textview with a placeholder. + */ +@interface SZTextViewPlaceholder : UITextView + +/** + This text you would like to appear as the placeholder. + */ +@property (nonatomic, retain) NSString *placeholder; + +/** + The color of the placeholder. + */ +@property (nonatomic, retain) UIColor *placeholderColor; + +/** + The font of the placeholder + */ +@property (nonatomic, retain) UIFont *placeholderFont; + +@end diff --git a/SZTextViewPlaceholder/SZTextViewPlaceholder.m b/SZTextViewPlaceholder/SZTextViewPlaceholder.m new file mode 100644 index 0000000..43b6ebe --- /dev/null +++ b/SZTextViewPlaceholder/SZTextViewPlaceholder.m @@ -0,0 +1,225 @@ +// +// SZTextViewPlaceholder.m +// SZTextViewPlaceHolder +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import "SZTextViewPlaceholder.h" + +#define kPlaceHolderTag 777 + +@interface SZTextViewPlaceholder () + +@property (nonatomic, strong) UITextView *placeHolderTextView; + +@end + +@implementation SZTextViewPlaceholder + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + /** + Initialize the view + */ + [self initializeView]; +} + +- (id)initWithFrame:(CGRect)frame +{ + if( (self = [super initWithFrame:frame]) ) + { + /** + Initiliaze the view + */ + [self initializeView]; + + } + return self; +} + +- (void)initializeView{ + /** + Set the default placeholder color to light gray + */ + [self setPlaceholderColor:[UIColor lightGrayColor]]; + + /** + Register for notifications when the textview changed + */ + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textViewDidChange:) name:UITextViewTextDidChangeNotification object:nil]; +} + +/** + Called when the placeholder color is set + */ +- (void)setPlaceholderColor:(UIColor *)placeholderColor{ + /** + Store the placeholder color + */ + _placeholderColor = placeholderColor; + + if(!_placeHolderTextView){ + /** + Placeholder doesn't exist, create it. + */ + [self createPlaceholder]; + }else{ + /** + Placeholder does exist, update it. + */ + [_placeHolderTextView setTextColor:self.placeholderColor]; + [_placeHolderTextView setText:self.placeholder]; + } +} + +/** + Called when placeholder is set + */ +- (void)setPlaceholder:(NSString *)placeholder{ + /** + Store the placeholder + */ + _placeholder = placeholder; + + if(!_placeHolderTextView){ + /** + Placeholder doesn't exist, create it. + */ + [self createPlaceholder]; + }else{ + /** + Placeholder does exist, update it. + */ + [_placeHolderTextView setTextColor:self.placeholderColor]; + [_placeHolderTextView setText:self.placeholder]; + } +} + +- (void)setPlaceholderFont:(UIFont *)placeholderFont{ + _placeholderFont = placeholderFont; + [_placeHolderTextView setFont:[self placeholderFont]]; +} + +/** + Create the placeholder + */ +- (void)createPlaceholder{ + if([[self placeholder] length] > 0) + { + /** + If we have a placeholder check if we made the placeholder text view. + */ + if (!_placeHolderTextView) + { + /** + The placeholder textview doesn't exist + We need to create it and add it to the textview + */ + _placeHolderTextView = [[UITextView alloc] initWithFrame:self.bounds]; + [_placeHolderTextView setTag:kPlaceHolderTag]; + [_placeHolderTextView setBackgroundColor:[UIColor clearColor]]; + [_placeHolderTextView setTextColor:self.placeholderColor]; + [_placeHolderTextView setFont:self.font]; + [self insertSubview:_placeHolderTextView atIndex:0]; + [_placeHolderTextView setHidden:NO]; + [_placeHolderTextView setUserInteractionEnabled:NO]; + } + /** + Set the text to the placeholder text + */ + _placeHolderTextView.text = self.placeholder; + } +} + +/** + This method is called when the textview did change + */ +- (void)textViewDidChange:(NSNotification *)notification +{ + if([[notification object] isEqual:self]){ + if([[self placeholder] length] == 0) + { + /** + The placeholder wasn't set so forget it + */ + return; + } + + if([[self text] length] == 0 && [[self viewWithTag:kPlaceHolderTag] isHidden]) + { + /** + The textview has no text (empty) and the placeholder is hidden, show the placeholder + */ + [[self viewWithTag:kPlaceHolderTag] setHidden:NO]; + } + else if([[self text] length] != 0 && ![[self viewWithTag:kPlaceHolderTag] isHidden]) + { + /** + The text view has text and the placeholder is not hidden, hide the placeholder + */ + [[self viewWithTag:kPlaceHolderTag] setHidden:YES]; + } + } +} + +/** + This sets the text of the textview. + + When this happens we call textviewdidchange to adjust the placeholder accordingly + */ +- (void)setText:(NSString *)text { + [super setText:text]; + [self textViewDidChange:nil]; +} + +/** + This sets the font for the textview. + + When this happens we want the placeholder to be the same font so we adjust the placeholderes + */ +- (void)setFont:(UIFont *)font{ + [super setFont:font]; + [self adjustPlaceholderFont]; +} + +/** + We want the font of the placeholder to match that of the textview + */ +- (void)adjustPlaceholderFont{ + if(_placeHolderTextView && ![self placeholderFont]){ + /** + Set the placeholder font to match the our textviews new font if a different font hasn't been set + */ + [_placeHolderTextView setFont:self.font]; + } +} + +/** + If a new frame is set for the textview the placeholder should match it as well + */ +- (void)setFrame:(CGRect)frame{ + [_placeHolderTextView setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)]; + [super setFrame:frame]; +} + +/** + Deallocates the project and removes the current observers. + + We also release necessary objects if this is being used without arc. + */ +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +#if !__has_feature(objc_arc) + [_placeHolderTextView release]; _placeHolderTextView = nil; + [_placeholderColor release]; _placeholderColor = nil; + [_placeholder release]; _placeholder = nil; + [super dealloc]; +#endif +} + +@end diff --git a/SZTextViewPlaceholder/ViewController.h b/SZTextViewPlaceholder/ViewController.h new file mode 100644 index 0000000..90bf16a --- /dev/null +++ b/SZTextViewPlaceholder/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// TextViewPlaceHolder +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/SZTextViewPlaceholder/ViewController.m b/SZTextViewPlaceholder/ViewController.m new file mode 100644 index 0000000..1324cf6 --- /dev/null +++ b/SZTextViewPlaceholder/ViewController.m @@ -0,0 +1,46 @@ +// +// ViewController.m +// TextViewPlaceHolder +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import "ViewController.h" +#import "SZTextViewPlaceholder.h" + +@interface ViewController () +{ + SZTextViewPlaceholder *szTextView2; +} + +@property (weak, nonatomic) IBOutlet SZTextViewPlaceholder *szTextView; + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + /** + Example of SZTextViewPlaceholder created in the Main.storyboard + */ + [self.szTextView setPlaceholder:@"Placeholder"]; + [self.szTextView setPlaceholderColor:[UIColor lightGrayColor]]; + [self.szTextView setTextColor:[UIColor blackColor]]; + + /** + Example of SZTableViewPlaceholder initialization in code + */ + szTextView2 = [[SZTextViewPlaceholder alloc] init]; + [szTextView2 setFrame:CGRectMake(0, self.szTextView.frame.origin.y+self.szTextView.frame.size.height+10, 320, 100)]; + [szTextView2 setPlaceholder:@"Placeholder text to show the capability of the textview to show a multi-line placeholder."]; + [szTextView2 setPlaceholderColor:[UIColor lightGrayColor]]; + [szTextView2 setTextColor:[UIColor blackColor]]; + [szTextView2 setPlaceholderFont:[UIFont fontWithName:@"Arial-ItalicMT" size:10]]; + [self.view addSubview:szTextView2]; +} + +@end diff --git a/SZTextViewPlaceholder/en.lproj/InfoPlist.strings b/SZTextViewPlaceholder/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/SZTextViewPlaceholder/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/SZTextViewPlaceholder/main.m b/SZTextViewPlaceholder/main.m new file mode 100644 index 0000000..d01b9a4 --- /dev/null +++ b/SZTextViewPlaceholder/main.m @@ -0,0 +1,18 @@ +// +// main.m +// TextViewPlaceHolder +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/SZTextViewPlaceholderTests/SZTextViewPlaceHolderTests.m b/SZTextViewPlaceholderTests/SZTextViewPlaceHolderTests.m new file mode 100644 index 0000000..3467f41 --- /dev/null +++ b/SZTextViewPlaceholderTests/SZTextViewPlaceHolderTests.m @@ -0,0 +1,33 @@ +// +// SZTextViewPlaceHolderTests.m +// SZTextViewPlaceHolderTests +// +// Created by Steve Zweier on 8/3/13. +// Copyright (c) 2013 Steven Zweier. All rights reserved. +// + +#import + +@interface SZTextViewPlaceHolderTests : XCTestCase + +@end + +@implementation SZTextViewPlaceHolderTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ +} + +@end diff --git a/SZTextViewPlaceholderTests/SZTextViewPlaceholderTests-Info.plist b/SZTextViewPlaceholderTests/SZTextViewPlaceholderTests-Info.plist new file mode 100644 index 0000000..7c11ebe --- /dev/null +++ b/SZTextViewPlaceholderTests/SZTextViewPlaceholderTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.StevenZweier.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + CFBundleSignature + ???? + + diff --git a/SZTextViewPlaceholderTests/en.lproj/InfoPlist.strings b/SZTextViewPlaceholderTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/SZTextViewPlaceholderTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ +