验证码输入框

帮朋友封装的验证码输入
This commit is contained in:
MengLiMing
2016-05-18 16:26:09 +08:00
commit 1cacf83c07
22 changed files with 1381 additions and 0 deletions

View File

@@ -0,0 +1,541 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0F1D1DD01CEC5D3E008FC24B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F1D1DCF1CEC5D3E008FC24B /* main.m */; };
0F1D1DD31CEC5D3E008FC24B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F1D1DD21CEC5D3E008FC24B /* AppDelegate.m */; };
0F1D1DD61CEC5D3E008FC24B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F1D1DD51CEC5D3E008FC24B /* ViewController.m */; };
0F1D1DD91CEC5D3E008FC24B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0F1D1DD71CEC5D3E008FC24B /* Main.storyboard */; };
0F1D1DDB1CEC5D3E008FC24B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0F1D1DDA1CEC5D3E008FC24B /* Assets.xcassets */; };
0F1D1DDE1CEC5D3E008FC24B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0F1D1DDC1CEC5D3E008FC24B /* LaunchScreen.storyboard */; };
0F1D1DE91CEC5D3E008FC24B /* CodeViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F1D1DE81CEC5D3E008FC24B /* CodeViewTests.m */; };
0F1D1DF41CEC5D3E008FC24B /* CodeViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F1D1DF31CEC5D3E008FC24B /* CodeViewUITests.m */; };
0F1D1E041CEC5D71008FC24B /* CodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F1D1E031CEC5D71008FC24B /* CodeView.m */; };
0F1D1E071CEC5DD9008FC24B /* UIView+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F1D1E061CEC5DD9008FC24B /* UIView+Category.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
0F1D1DE51CEC5D3E008FC24B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0F1D1DC31CEC5D3E008FC24B /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0F1D1DCA1CEC5D3E008FC24B;
remoteInfo = CodeView;
};
0F1D1DF01CEC5D3E008FC24B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0F1D1DC31CEC5D3E008FC24B /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0F1D1DCA1CEC5D3E008FC24B;
remoteInfo = CodeView;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
0F1D1DCB1CEC5D3E008FC24B /* CodeView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CodeView.app; sourceTree = BUILT_PRODUCTS_DIR; };
0F1D1DCF1CEC5D3E008FC24B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
0F1D1DD11CEC5D3E008FC24B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
0F1D1DD21CEC5D3E008FC24B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
0F1D1DD41CEC5D3E008FC24B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
0F1D1DD51CEC5D3E008FC24B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
0F1D1DD81CEC5D3E008FC24B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
0F1D1DDA1CEC5D3E008FC24B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
0F1D1DDD1CEC5D3E008FC24B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
0F1D1DDF1CEC5D3E008FC24B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0F1D1DE41CEC5D3E008FC24B /* CodeViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CodeViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
0F1D1DE81CEC5D3E008FC24B /* CodeViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CodeViewTests.m; sourceTree = "<group>"; };
0F1D1DEA1CEC5D3E008FC24B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0F1D1DEF1CEC5D3E008FC24B /* CodeViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CodeViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
0F1D1DF31CEC5D3E008FC24B /* CodeViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CodeViewUITests.m; sourceTree = "<group>"; };
0F1D1DF51CEC5D3E008FC24B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0F1D1E021CEC5D71008FC24B /* CodeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeView.h; sourceTree = "<group>"; };
0F1D1E031CEC5D71008FC24B /* CodeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CodeView.m; sourceTree = "<group>"; };
0F1D1E051CEC5DD9008FC24B /* UIView+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Category.h"; sourceTree = "<group>"; };
0F1D1E061CEC5DD9008FC24B /* UIView+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Category.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
0F1D1DC81CEC5D3E008FC24B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
0F1D1DE11CEC5D3E008FC24B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
0F1D1DEC1CEC5D3E008FC24B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0F1D1DC21CEC5D3E008FC24B = {
isa = PBXGroup;
children = (
0F1D1DCD1CEC5D3E008FC24B /* CodeView */,
0F1D1DE71CEC5D3E008FC24B /* CodeViewTests */,
0F1D1DF21CEC5D3E008FC24B /* CodeViewUITests */,
0F1D1DCC1CEC5D3E008FC24B /* Products */,
);
sourceTree = "<group>";
};
0F1D1DCC1CEC5D3E008FC24B /* Products */ = {
isa = PBXGroup;
children = (
0F1D1DCB1CEC5D3E008FC24B /* CodeView.app */,
0F1D1DE41CEC5D3E008FC24B /* CodeViewTests.xctest */,
0F1D1DEF1CEC5D3E008FC24B /* CodeViewUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
0F1D1DCD1CEC5D3E008FC24B /* CodeView */ = {
isa = PBXGroup;
children = (
0F1D1E011CEC5D71008FC24B /* CodeView */,
0F1D1DD11CEC5D3E008FC24B /* AppDelegate.h */,
0F1D1DD21CEC5D3E008FC24B /* AppDelegate.m */,
0F1D1DD41CEC5D3E008FC24B /* ViewController.h */,
0F1D1DD51CEC5D3E008FC24B /* ViewController.m */,
0F1D1DD71CEC5D3E008FC24B /* Main.storyboard */,
0F1D1DDA1CEC5D3E008FC24B /* Assets.xcassets */,
0F1D1DDC1CEC5D3E008FC24B /* LaunchScreen.storyboard */,
0F1D1DDF1CEC5D3E008FC24B /* Info.plist */,
0F1D1DCE1CEC5D3E008FC24B /* Supporting Files */,
);
path = CodeView;
sourceTree = "<group>";
};
0F1D1DCE1CEC5D3E008FC24B /* Supporting Files */ = {
isa = PBXGroup;
children = (
0F1D1DCF1CEC5D3E008FC24B /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
0F1D1DE71CEC5D3E008FC24B /* CodeViewTests */ = {
isa = PBXGroup;
children = (
0F1D1DE81CEC5D3E008FC24B /* CodeViewTests.m */,
0F1D1DEA1CEC5D3E008FC24B /* Info.plist */,
);
path = CodeViewTests;
sourceTree = "<group>";
};
0F1D1DF21CEC5D3E008FC24B /* CodeViewUITests */ = {
isa = PBXGroup;
children = (
0F1D1DF31CEC5D3E008FC24B /* CodeViewUITests.m */,
0F1D1DF51CEC5D3E008FC24B /* Info.plist */,
);
path = CodeViewUITests;
sourceTree = "<group>";
};
0F1D1E011CEC5D71008FC24B /* CodeView */ = {
isa = PBXGroup;
children = (
0F1D1E051CEC5DD9008FC24B /* UIView+Category.h */,
0F1D1E061CEC5DD9008FC24B /* UIView+Category.m */,
0F1D1E021CEC5D71008FC24B /* CodeView.h */,
0F1D1E031CEC5D71008FC24B /* CodeView.m */,
);
path = CodeView;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
0F1D1DCA1CEC5D3E008FC24B /* CodeView */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0F1D1DF81CEC5D3E008FC24B /* Build configuration list for PBXNativeTarget "CodeView" */;
buildPhases = (
0F1D1DC71CEC5D3E008FC24B /* Sources */,
0F1D1DC81CEC5D3E008FC24B /* Frameworks */,
0F1D1DC91CEC5D3E008FC24B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = CodeView;
productName = CodeView;
productReference = 0F1D1DCB1CEC5D3E008FC24B /* CodeView.app */;
productType = "com.apple.product-type.application";
};
0F1D1DE31CEC5D3E008FC24B /* CodeViewTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0F1D1DFB1CEC5D3E008FC24B /* Build configuration list for PBXNativeTarget "CodeViewTests" */;
buildPhases = (
0F1D1DE01CEC5D3E008FC24B /* Sources */,
0F1D1DE11CEC5D3E008FC24B /* Frameworks */,
0F1D1DE21CEC5D3E008FC24B /* Resources */,
);
buildRules = (
);
dependencies = (
0F1D1DE61CEC5D3E008FC24B /* PBXTargetDependency */,
);
name = CodeViewTests;
productName = CodeViewTests;
productReference = 0F1D1DE41CEC5D3E008FC24B /* CodeViewTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
0F1D1DEE1CEC5D3E008FC24B /* CodeViewUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0F1D1DFE1CEC5D3E008FC24B /* Build configuration list for PBXNativeTarget "CodeViewUITests" */;
buildPhases = (
0F1D1DEB1CEC5D3E008FC24B /* Sources */,
0F1D1DEC1CEC5D3E008FC24B /* Frameworks */,
0F1D1DED1CEC5D3E008FC24B /* Resources */,
);
buildRules = (
);
dependencies = (
0F1D1DF11CEC5D3E008FC24B /* PBXTargetDependency */,
);
name = CodeViewUITests;
productName = CodeViewUITests;
productReference = 0F1D1DEF1CEC5D3E008FC24B /* CodeViewUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0F1D1DC31CEC5D3E008FC24B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = MS;
TargetAttributes = {
0F1D1DCA1CEC5D3E008FC24B = {
CreatedOnToolsVersion = 7.2.1;
};
0F1D1DE31CEC5D3E008FC24B = {
CreatedOnToolsVersion = 7.2.1;
TestTargetID = 0F1D1DCA1CEC5D3E008FC24B;
};
0F1D1DEE1CEC5D3E008FC24B = {
CreatedOnToolsVersion = 7.2.1;
TestTargetID = 0F1D1DCA1CEC5D3E008FC24B;
};
};
};
buildConfigurationList = 0F1D1DC61CEC5D3E008FC24B /* Build configuration list for PBXProject "CodeView" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 0F1D1DC21CEC5D3E008FC24B;
productRefGroup = 0F1D1DCC1CEC5D3E008FC24B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
0F1D1DCA1CEC5D3E008FC24B /* CodeView */,
0F1D1DE31CEC5D3E008FC24B /* CodeViewTests */,
0F1D1DEE1CEC5D3E008FC24B /* CodeViewUITests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
0F1D1DC91CEC5D3E008FC24B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0F1D1DDE1CEC5D3E008FC24B /* LaunchScreen.storyboard in Resources */,
0F1D1DDB1CEC5D3E008FC24B /* Assets.xcassets in Resources */,
0F1D1DD91CEC5D3E008FC24B /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0F1D1DE21CEC5D3E008FC24B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
0F1D1DED1CEC5D3E008FC24B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
0F1D1DC71CEC5D3E008FC24B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0F1D1DD61CEC5D3E008FC24B /* ViewController.m in Sources */,
0F1D1DD31CEC5D3E008FC24B /* AppDelegate.m in Sources */,
0F1D1DD01CEC5D3E008FC24B /* main.m in Sources */,
0F1D1E071CEC5DD9008FC24B /* UIView+Category.m in Sources */,
0F1D1E041CEC5D71008FC24B /* CodeView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0F1D1DE01CEC5D3E008FC24B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0F1D1DE91CEC5D3E008FC24B /* CodeViewTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0F1D1DEB1CEC5D3E008FC24B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0F1D1DF41CEC5D3E008FC24B /* CodeViewUITests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
0F1D1DE61CEC5D3E008FC24B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0F1D1DCA1CEC5D3E008FC24B /* CodeView */;
targetProxy = 0F1D1DE51CEC5D3E008FC24B /* PBXContainerItemProxy */;
};
0F1D1DF11CEC5D3E008FC24B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0F1D1DCA1CEC5D3E008FC24B /* CodeView */;
targetProxy = 0F1D1DF01CEC5D3E008FC24B /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
0F1D1DD71CEC5D3E008FC24B /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
0F1D1DD81CEC5D3E008FC24B /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
0F1D1DDC1CEC5D3E008FC24B /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
0F1D1DDD1CEC5D3E008FC24B /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
0F1D1DF61CEC5D3E008FC24B /* 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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
0F1D1DF71CEC5D3E008FC24B /* 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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
0F1D1DF91CEC5D3E008FC24B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = CodeView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.MLM.CodeView;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
0F1D1DFA1CEC5D3E008FC24B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = CodeView/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.MLM.CodeView;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
0F1D1DFC1CEC5D3E008FC24B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = CodeViewTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.MLM.CodeViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodeView.app/CodeView";
};
name = Debug;
};
0F1D1DFD1CEC5D3E008FC24B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = CodeViewTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.MLM.CodeViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodeView.app/CodeView";
};
name = Release;
};
0F1D1DFF1CEC5D3E008FC24B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = CodeViewUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.MLM.CodeViewUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_TARGET_NAME = CodeView;
USES_XCTRUNNER = YES;
};
name = Debug;
};
0F1D1E001CEC5D3E008FC24B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = CodeViewUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.MLM.CodeViewUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_TARGET_NAME = CodeView;
USES_XCTRUNNER = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
0F1D1DC61CEC5D3E008FC24B /* Build configuration list for PBXProject "CodeView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0F1D1DF61CEC5D3E008FC24B /* Debug */,
0F1D1DF71CEC5D3E008FC24B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
0F1D1DF81CEC5D3E008FC24B /* Build configuration list for PBXNativeTarget "CodeView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0F1D1DF91CEC5D3E008FC24B /* Debug */,
0F1D1DFA1CEC5D3E008FC24B /* Release */,
);
defaultConfigurationIsVisible = 0;
};
0F1D1DFB1CEC5D3E008FC24B /* Build configuration list for PBXNativeTarget "CodeViewTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0F1D1DFC1CEC5D3E008FC24B /* Debug */,
0F1D1DFD1CEC5D3E008FC24B /* Release */,
);
defaultConfigurationIsVisible = 0;
};
0F1D1DFE1CEC5D3E008FC24B /* Build configuration list for PBXNativeTarget "CodeViewUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0F1D1DFF1CEC5D3E008FC24B /* Debug */,
0F1D1E001CEC5D3E008FC24B /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 0F1D1DC31CEC5D3E008FC24B /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:CodeView.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0F1D1DCA1CEC5D3E008FC24B"
BuildableName = "CodeView.app"
BlueprintName = "CodeView"
ReferencedContainer = "container:CodeView.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0F1D1DE31CEC5D3E008FC24B"
BuildableName = "CodeViewTests.xctest"
BlueprintName = "CodeViewTests"
ReferencedContainer = "container:CodeView.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0F1D1DEE1CEC5D3E008FC24B"
BuildableName = "CodeViewUITests.xctest"
BlueprintName = "CodeViewUITests"
ReferencedContainer = "container:CodeView.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0F1D1DCA1CEC5D3E008FC24B"
BuildableName = "CodeView.app"
BlueprintName = "CodeView"
ReferencedContainer = "container:CodeView.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0F1D1DCA1CEC5D3E008FC24B"
BuildableName = "CodeView.app"
BlueprintName = "CodeView"
ReferencedContainer = "container:CodeView.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0F1D1DCA1CEC5D3E008FC24B"
BuildableName = "CodeView.app"
BlueprintName = "CodeView"
ReferencedContainer = "container:CodeView.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CodeView.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>0F1D1DCA1CEC5D3E008FC24B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>0F1D1DE31CEC5D3E008FC24B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>0F1D1DEE1CEC5D3E008FC24B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

17
CodeView/AppDelegate.h Normal file
View File

@@ -0,0 +1,17 @@
//
// AppDelegate.h
// CodeView
//
// Created by my on 16/5/18.
// Copyright © 2016年 MS. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

45
CodeView/AppDelegate.m Normal file
View File

@@ -0,0 +1,45 @@
//
// AppDelegate.m
// CodeView
//
// Created by my on 16/5/18.
// Copyright © 2016 MS. All rights reserved.
//
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@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

View File

@@ -0,0 +1,68 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,26 @@
//
// CodeView.h
// BaseProject
//
// Created by my on 16/3/24.
// Copyright © 2016年 base. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CodeView : UIView
//输入完成回调
@property (nonatomic,copy) void(^EndEditBlcok)(NSString *text);
- (instancetype)initWithFrame:(CGRect)frame
num:(NSInteger)num
lineWith:(CGFloat)width
lineColor:(UIColor *)lColor
textColor:(UIColor *)tColor
textFont:(CGFloat)font;
- (void)beginEdit;
- (void)endEdit;
@end

View File

@@ -0,0 +1,142 @@
//
// CodeView.m
// BaseProject
//
// Created by my on 16/3/24.
// Copyright © 2016 base. All rights reserved.
//
#import "CodeView.h"
@interface CodeView ()
{
NSMutableArray *textArray;
//线
NSInteger lineNum;
CGFloat lineWidth;
UIColor *linecolor;
UIColor *textcolor;
CGFloat fontSize;
}
@property (nonatomic,strong) UITextField *textField;
@property (nonatomic, strong) NSMutableArray *lineArr;
@end
@implementation CodeView
- (instancetype)initWithFrame:(CGRect)frame
num:(NSInteger)num
lineWith:(CGFloat)width
lineColor:(UIColor *)lColor
textColor:(UIColor *)tColor
textFont:(CGFloat)font {
self = [super initWithFrame:frame];
if (self) {
self.frame = frame;
self.backgroundColor = [UIColor whiteColor];
textArray = [NSMutableArray arrayWithCapacity:num];
lineNum = num;
lineWidth = width;
linecolor = lColor;
textcolor = tColor;
fontSize = font;
[self addLine];
[self addNotification];
}
return self;
}
#pragma mark -
- (void)addNotification {
[[NSNotificationCenter defaultCenter] addObserverForName:UITextFieldTextDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {
NSInteger length = _textField.text.length;
if (length == lineNum && self.EndEditBlcok) {
[_textField resignFirstResponder];
self.EndEditBlcok(_textField.text);
}
if (length > lineNum) {
[_textField resignFirstResponder];
_textField.text = [_textField.text substringToIndex:lineNum];
}
//
//textfield
if (length<=lineNum) {
if (length > textArray.count) {
[textArray addObject:[_textField.text substringWithRange:NSMakeRange(length - 1, 1)]];
} else {
[textArray removeLastObject];
}
//
[self setNeedsDisplay];
}
//view
for (NSInteger i = 0; i < lineNum; i ++) {
CAShapeLayer *obj = [_lineArr objectAtIndex:i];
if (i < _textField.text.length) {
obj.hidden = YES;
} else {
obj.hidden = NO;
}
}
}];
}
//
- (void)beginEdit {
if (_textField == nil) {
_textField = [[UITextField alloc] init];
_textField.keyboardType = UIKeyboardTypeNumberPad;
_textField.hidden = YES;
[self addSubview:_textField];
}
[self.textField becomeFirstResponder];}
- (void)endEdit {
[self.textField resignFirstResponder];
}
- (void)addLine {
//线
CGFloat line_sep = (self.frame.size.width - lineNum * lineWidth)/(lineNum + 1);
for (NSInteger i = 0; i < lineNum; i ++) {
CAShapeLayer *line = [CAShapeLayer layer];
line.fillColor = linecolor.CGColor;
UIBezierPath *path = [UIBezierPath bezierPathWithRect:CGRectMake(line_sep * (i + 1) + i * lineWidth, self.frame.size.height - 10, lineWidth, 3)];
line.path = path.CGPath;
line.hidden = NO;
[self.layer addSublayer:line];
[self.lineArr addObject:line];
}
}
#pragma mark -
- (NSMutableArray *)lineArr{
if (_lineArr == nil) {
_lineArr = [NSMutableArray array];
}
return _lineArr;
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
//
CGFloat line_sep = (self.frame.size.width - lineNum * lineWidth)/(lineNum + 1);
CGContextRef context = UIGraphicsGetCurrentContext();
UIFont *font = [UIFont boldSystemFontOfSize:fontSize];
for (NSInteger i = 0; i < textArray.count; i ++) {
[textArray[i] drawInRect:CGRectMake(line_sep * (i + 1) + i * lineWidth, self.frame.size.height - (fontSize + 15), lineWidth, fontSize + 5) withAttributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:textcolor}];
}
CGContextDrawPath(context, kCGPathFill);
}
@end

View File

@@ -0,0 +1,19 @@
//
// UIView+Category.h
// BaseProject
//
// Created by my on 16/3/24.
// Copyright © 2016年 base. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^TapAction)();
@interface UIView (Category)
- (void)tapHandle:(TapAction)block;
- (void)shakeView;
- (void)shakeRotation:(CGFloat)rotation;
@end

View File

@@ -0,0 +1,68 @@
//
// UIView+Category.m
// BaseProject
//
// Created by my on 16/3/24.
// Copyright © 2016 base. All rights reserved.
//
#import "UIView+Category.h"
#import <objc/runtime.h>
static char tapKey;
@implementation UIView (Category)
#pragma mark -
- (void)tapHandle:(TapAction)block {
self.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
[self addGestureRecognizer:tap];
objc_setAssociatedObject(self, &tapKey, block, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
- (void)tapAction:(UITapGestureRecognizer *)tap {
TapAction blcok = objc_getAssociatedObject(self, &tapKey);
if (blcok) {
blcok();
}
}
#pragma mark
- (void)shakeView
{
// CGFloat t =4.0;
// CGAffineTransform translateRight =CGAffineTransformTranslate(CGAffineTransformIdentity, t,0.0);
// CGAffineTransform translateLeft =CGAffineTransformTranslate(CGAffineTransformIdentity,-t,0.0);
// self.transform = translateLeft;
// [UIView animateWithDuration:0.07 delay:0.0 options:UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat animations:^{
// [UIView setAnimationRepeatCount:2.0];
// self.transform = translateRight;
// } completion:^(BOOL finished){
// if(finished){
// [UIView animateWithDuration:0.05 delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
// self.transform =CGAffineTransformIdentity;
// } completion:NULL];
// }
// }];
//view
CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
anim.repeatCount = 1;
anim.values = @[@-4,@4,@-4,@4];
[self.layer addAnimation:anim forKey:nil];
}
- (void)shakeRotation:(CGFloat)rotation {
CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
anim.repeatCount = 2;
anim.duration = .2;
anim.values = @[@0,@(rotation),@0,@(-rotation),@0];
[self.layer addAnimation:anim forKey:nil];
}
@end

47
CodeView/Info.plist Normal file
View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

15
CodeView/ViewController.h Normal file
View File

@@ -0,0 +1,15 @@
//
// ViewController.h
// CodeView
//
// Created by my on 16/5/18.
// Copyright © 2016年 MS. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end

48
CodeView/ViewController.m Normal file
View File

@@ -0,0 +1,48 @@
//
// ViewController.m
// CodeView
//
// Created by my on 16/5/18.
// Copyright © 2016 MS. All rights reserved.
//
#import "ViewController.h"
#import "CodeView.h"
#import "UIView+Category.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
CodeView *v = [[CodeView alloc] initWithFrame:CGRectMake(0, 0, 200, 80)
num:4
lineWith:30
lineColor:[UIColor redColor]
textColor:[UIColor redColor]
textFont:50];
v.center = self.view.center;
v.layer.borderWidth = 1;
v.layer.borderColor = [UIColor redColor].CGColor;
[v tapHandle:^{
[v beginEdit];
}];
v.EndEditBlcok = ^(NSString *str) {
NSLog(@"%@",str);
};
[self.view addSubview:v];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end

16
CodeView/main.m Normal file
View File

@@ -0,0 +1,16 @@
//
// main.m
// CodeView
//
// Created by my on 16/5/18.
// Copyright © 2016 MS. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

View File

@@ -0,0 +1,39 @@
//
// CodeViewTests.m
// CodeViewTests
//
// Created by my on 16/5/18.
// Copyright © 2016 MS. All rights reserved.
//
#import <XCTest/XCTest.h>
@interface CodeViewTests : XCTestCase
@end
@implementation CodeViewTests
- (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 {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end

24
CodeViewTests/Info.plist Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@@ -0,0 +1,40 @@
//
// CodeViewUITests.m
// CodeViewUITests
//
// Created by my on 16/5/18.
// Copyright © 2016 MS. All rights reserved.
//
#import <XCTest/XCTest.h>
@interface CodeViewUITests : XCTestCase
@end
@implementation CodeViewUITests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
self.continueAfterFailure = NO;
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
[[[XCUIApplication alloc] init] launch];
// In UI tests its 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.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
@end

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>