diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7a0a5e0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +#Change Log +All notable changes to this project will be documented in this file. +`DLRadioButton` adheres to [Semantic Versioning](http://semver.org/). + +--- + +## [1.4.6](https://github.com/DavydLiu/DLRadioButton/releases/tag/1.4.6) (01/31/2016) +* Added support for Carthage. +* Updated example project. +* Organized folder structure. +* Added change log. \ No newline at end of file diff --git a/DLRadioButton.podspec.json b/DLRadioButton.podspec.json index 09d105a..0a68289 100644 --- a/DLRadioButton.podspec.json +++ b/DLRadioButton.podspec.json @@ -1,11 +1,11 @@ { "name": "DLRadioButton", - "version": "1.4.5", + "version": "1.4.6", "summary": "A highly customizable Radio Button for iOS", "description": "A highly customizable Radio Button for iOS.\n\n* Buttons are drew by UIBezierPath, customize it however you want.\n* You can also use pictures to indicate buttons' selection state.\n", "homepage": "https://github.com/DavydLiu/DLRadioButton", "screenshots": [ - "https://raw.githubusercontent.com/DavydLiu/DLRadioButton/master/DLRadioButton_screenshot1.png" + "https://raw.githubusercontent.com/DavydLiu/DLRadioButton/master/Images/DLRadioButton_screenshot1.png" ], "license": "MIT", "authors": { @@ -17,7 +17,7 @@ }, "source": { "git": "https://github.com/DavydLiu/DLRadioButton.git", - "tag": "1.4.5" + "tag": "1.4.6" }, "source_files": "DLRadioButton/**/*.{h,m}", "exclude_files": "Classes/Exclude", diff --git a/DLRadioButton.xcodeproj/project.pbxproj b/DLRadioButton.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d0d506d --- /dev/null +++ b/DLRadioButton.xcodeproj/project.pbxproj @@ -0,0 +1,463 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXAggregateTarget section */ + 63F965031C5ED24C00FFD1A2 /* DLRadioButtonUniversal */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 63F965061C5ED24C00FFD1A2 /* Build configuration list for PBXAggregateTarget "DLRadioButtonUniversal" */; + buildPhases = ( + 63F965071C5ED26400FFD1A2 /* ShellScript */, + ); + dependencies = ( + ); + name = DLRadioButtonUniversal; + productName = DLRadioButtonUniversal; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 636C501E1C5D91DB008B5C96 /* DLRadioButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 636C501C1C5D91DB008B5C96 /* DLRadioButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 636C501F1C5D91DB008B5C96 /* DLRadioButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 636C501D1C5D91DB008B5C96 /* DLRadioButton.m */; }; + 636C50271C5D9315008B5C96 /* DLRadioButtonTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 636C50261C5D9315008B5C96 /* DLRadioButtonTests.m */; }; + 636C50291C5D9315008B5C96 /* DLRadioButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 634D5B5A1C5D8B0F00A3740D /* DLRadioButton.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 636C502A1C5D9315008B5C96 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 634D5B511C5D8B0F00A3740D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 634D5B591C5D8B0F00A3740D; + remoteInfo = DLRadioButton; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 634D5B5A1C5D8B0F00A3740D /* DLRadioButton.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DLRadioButton.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 634D5B5F1C5D8B0F00A3740D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 636C501C1C5D91DB008B5C96 /* DLRadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DLRadioButton.h; path = DLRadioButton/DLRadioButton.h; sourceTree = SOURCE_ROOT; }; + 636C501D1C5D91DB008B5C96 /* DLRadioButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DLRadioButton.m; path = DLRadioButton/DLRadioButton.m; sourceTree = SOURCE_ROOT; }; + 636C50241C5D9315008B5C96 /* DLRadioButtonTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DLRadioButtonTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 636C50261C5D9315008B5C96 /* DLRadioButtonTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DLRadioButtonTests.m; sourceTree = ""; }; + 636C50281C5D9315008B5C96 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 634D5B561C5D8B0F00A3740D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 636C50211C5D9315008B5C96 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 636C50291C5D9315008B5C96 /* DLRadioButton.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 634D5B501C5D8B0F00A3740D = { + isa = PBXGroup; + children = ( + 634D5B5C1C5D8B0F00A3740D /* DLRadioButton */, + 636C50251C5D9315008B5C96 /* DLRadioButtonTests */, + 636C501B1C5D91C1008B5C96 /* Supporting Files */, + 634D5B5B1C5D8B0F00A3740D /* Products */, + ); + sourceTree = ""; + }; + 634D5B5B1C5D8B0F00A3740D /* Products */ = { + isa = PBXGroup; + children = ( + 634D5B5A1C5D8B0F00A3740D /* DLRadioButton.framework */, + 636C50241C5D9315008B5C96 /* DLRadioButtonTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 634D5B5C1C5D8B0F00A3740D /* DLRadioButton */ = { + isa = PBXGroup; + children = ( + 636C501C1C5D91DB008B5C96 /* DLRadioButton.h */, + 636C501D1C5D91DB008B5C96 /* DLRadioButton.m */, + ); + name = DLRadioButton; + path = Framework; + sourceTree = ""; + }; + 636C501B1C5D91C1008B5C96 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 634D5B5F1C5D8B0F00A3740D /* Info.plist */, + ); + path = "Supporting Files"; + sourceTree = ""; + }; + 636C50251C5D9315008B5C96 /* DLRadioButtonTests */ = { + isa = PBXGroup; + children = ( + 636C50261C5D9315008B5C96 /* DLRadioButtonTests.m */, + 636C50281C5D9315008B5C96 /* Info.plist */, + ); + path = DLRadioButtonTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 634D5B571C5D8B0F00A3740D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 636C501E1C5D91DB008B5C96 /* DLRadioButton.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 634D5B591C5D8B0F00A3740D /* DLRadioButton */ = { + isa = PBXNativeTarget; + buildConfigurationList = 634D5B6E1C5D8B0F00A3740D /* Build configuration list for PBXNativeTarget "DLRadioButton" */; + buildPhases = ( + 634D5B551C5D8B0F00A3740D /* Sources */, + 634D5B561C5D8B0F00A3740D /* Frameworks */, + 634D5B571C5D8B0F00A3740D /* Headers */, + 634D5B581C5D8B0F00A3740D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DLRadioButton; + productName = DLRadioButton; + productReference = 634D5B5A1C5D8B0F00A3740D /* DLRadioButton.framework */; + productType = "com.apple.product-type.framework"; + }; + 636C50231C5D9315008B5C96 /* DLRadioButtonTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 636C502C1C5D9315008B5C96 /* Build configuration list for PBXNativeTarget "DLRadioButtonTests" */; + buildPhases = ( + 636C50201C5D9315008B5C96 /* Sources */, + 636C50211C5D9315008B5C96 /* Frameworks */, + 636C50221C5D9315008B5C96 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 636C502B1C5D9315008B5C96 /* PBXTargetDependency */, + ); + name = DLRadioButtonTests; + productName = DLRadioButtonTests; + productReference = 636C50241C5D9315008B5C96 /* DLRadioButtonTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 634D5B511C5D8B0F00A3740D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = "David Liu"; + TargetAttributes = { + 634D5B591C5D8B0F00A3740D = { + CreatedOnToolsVersion = 7.2; + }; + 636C50231C5D9315008B5C96 = { + CreatedOnToolsVersion = 7.2; + }; + 63F965031C5ED24C00FFD1A2 = { + CreatedOnToolsVersion = 7.2; + }; + }; + }; + buildConfigurationList = 634D5B541C5D8B0F00A3740D /* Build configuration list for PBXProject "DLRadioButton" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 634D5B501C5D8B0F00A3740D; + productRefGroup = 634D5B5B1C5D8B0F00A3740D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 634D5B591C5D8B0F00A3740D /* DLRadioButton */, + 636C50231C5D9315008B5C96 /* DLRadioButtonTests */, + 63F965031C5ED24C00FFD1A2 /* DLRadioButtonUniversal */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 634D5B581C5D8B0F00A3740D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 636C50221C5D9315008B5C96 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 63F965071C5ED26400FFD1A2 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal\nIPHONE_OS_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-iphoneos\nIPHONE_SIMULATOR_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator\n\n# make sure the output directory exists\nmkdir -p \"${UNIVERSAL_OUTPUTFOLDER}\"\n\n# Step 1. Build Device and Simulator versions\nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" -target \"${PROJECT_NAME}\" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -project \"${PROJECT_NAME}.xcodeproj\" -target \"${PROJECT_NAME}\" -configuration ${CONFIGURATION} -sdk iphonesimulator -arch x86_64 BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\n\n# Step 2. Copy the framework structure to the universal folder\ncp -R \"${IPHONE_OS_OUTPUTFOLDER}/${PROJECT_NAME}.framework\" \"${UNIVERSAL_OUTPUTFOLDER}/\"\n\n# Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory\nlipo -create -output \"${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}\" \"${IPHONE_SIMULATOR_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}\" \"${IPHONE_OS_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 634D5B551C5D8B0F00A3740D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 636C501F1C5D91DB008B5C96 /* DLRadioButton.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 636C50201C5D9315008B5C96 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 636C50271C5D9315008B5C96 /* DLRadioButtonTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 636C502B1C5D9315008B5C96 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 634D5B591C5D8B0F00A3740D /* DLRadioButton */; + targetProxy = 636C502A1C5D9315008B5C96 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 634D5B6C1C5D8B0F00A3740D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + 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; + CURRENT_PROJECT_VERSION = 1; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 634D5B6D1C5D8B0F00A3740D /* 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; + CURRENT_PROJECT_VERSION = 1; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 634D5B6F1C5D8B0F00A3740D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.liuxingruo.DLRadioButton; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 634D5B701C5D8B0F00A3740D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.liuxingruo.DLRadioButton; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 636C502D1C5D9315008B5C96 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = DLRadioButtonTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.liuxingruo.DLRadioButtonTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 636C502E1C5D9315008B5C96 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = DLRadioButtonTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.liuxingruo.DLRadioButtonTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63F965041C5ED24C00FFD1A2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 63F965051C5ED24C00FFD1A2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 634D5B541C5D8B0F00A3740D /* Build configuration list for PBXProject "DLRadioButton" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 634D5B6C1C5D8B0F00A3740D /* Debug */, + 634D5B6D1C5D8B0F00A3740D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 634D5B6E1C5D8B0F00A3740D /* Build configuration list for PBXNativeTarget "DLRadioButton" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 634D5B6F1C5D8B0F00A3740D /* Debug */, + 634D5B701C5D8B0F00A3740D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 636C502C1C5D9315008B5C96 /* Build configuration list for PBXNativeTarget "DLRadioButtonTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 636C502D1C5D9315008B5C96 /* Debug */, + 636C502E1C5D9315008B5C96 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63F965061C5ED24C00FFD1A2 /* Build configuration list for PBXAggregateTarget "DLRadioButtonUniversal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63F965041C5ED24C00FFD1A2 /* Debug */, + 63F965051C5ED24C00FFD1A2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 634D5B511C5D8B0F00A3740D /* Project object */; +} diff --git a/DLRadioButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DLRadioButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..5a11213 --- /dev/null +++ b/DLRadioButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/DLRadioButton.xcodeproj/xcshareddata/xcschemes/DLRadioButton.xcscheme b/DLRadioButton.xcodeproj/xcshareddata/xcschemes/DLRadioButton.xcscheme new file mode 100644 index 0000000..6166632 --- /dev/null +++ b/DLRadioButton.xcodeproj/xcshareddata/xcschemes/DLRadioButton.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DLRadioButtonExample/DLRadioButtonExampleTests/en.lproj/InfoPlist.strings b/DLRadioButtonExample/DLRadioButtonExampleTests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/DLRadioButtonExample/DLRadioButtonExampleTests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/DLRadioButtonExample/DLRadioButtonExampleTests/DLRadioButtonExampleTests.m b/DLRadioButtonTests/DLRadioButtonTests.m similarity index 80% rename from DLRadioButtonExample/DLRadioButtonExampleTests/DLRadioButtonExampleTests.m rename to DLRadioButtonTests/DLRadioButtonTests.m index 1a606b2..ee84ebd 100644 --- a/DLRadioButtonExample/DLRadioButtonExampleTests/DLRadioButtonExampleTests.m +++ b/DLRadioButtonTests/DLRadioButtonTests.m @@ -1,7 +1,15 @@ +// +// DLRadioButtonTests.m +// DLRadioButtonTests +// +// Created by David Liu on 1/30/16. +// Copyright © 2016 David Liu. All rights reserved. +// + #import #import "DLRadioButton.h" -@interface DLRadioButtonExampleTests : XCTestCase +@interface DLRadioButtonUnitTests : XCTestCase @property DLRadioButton *firstButton; @property DLRadioButton *secondButton; @@ -9,7 +17,7 @@ @interface DLRadioButtonExampleTests : XCTestCase @end -@implementation DLRadioButtonExampleTests +@implementation DLRadioButtonUnitTests - (void)setUp { [super setUp]; @@ -17,6 +25,7 @@ - (void)setUp { self.secondButton = [[DLRadioButton alloc] init]; self.thirdButton = [[DLRadioButton alloc] init]; self.firstButton.otherButtons = @[self.secondButton, self.thirdButton]; + } - (void)tearDown { @@ -27,8 +36,8 @@ - (void)tearDown { } - (void)testButtonSelection { - [self.firstButton sendActionsForControlEvents:UIControlEventTouchUpInside]; - [self.secondButton sendActionsForControlEvents:UIControlEventTouchUpInside]; + [self.firstButton setSelected:YES]; + [self.secondButton setSelected:YES]; // selected button should be second button. XCTAssertEqualObjects([self.firstButton selectedButton], self.secondButton); @@ -36,7 +45,7 @@ - (void)testButtonSelection { XCTAssertEqualObjects([self.thirdButton selectedButton], self.secondButton); // selected button should be third button. - [self.thirdButton sendActionsForControlEvents:UIControlEventTouchUpInside]; + [self.thirdButton setSelected:YES]; XCTAssertEqualObjects([self.secondButton selectedButton], self.thirdButton); } @@ -48,8 +57,8 @@ - (void)testButtonDeselection { - (void)testMultipleButtonsSelection { self.firstButton.multipleSelectionEnabled = YES; - [self.secondButton sendActionsForControlEvents:UIControlEventTouchUpInside]; - [self.thirdButton sendActionsForControlEvents:UIControlEventTouchUpInside]; + [self.secondButton setSelected:YES]; + [self.thirdButton setSelected:YES]; // selected button should return nil, once multiple selection enabled. XCTAssertNil([self.firstButton selectedButton]); @@ -62,8 +71,8 @@ - (void)testMultipleButtonsSelection { XCTAssertTrue([[self.firstButton selectedButtons] containsObject:self.thirdButton]); // first and second button should be selected. - [self.firstButton sendActionsForControlEvents:UIControlEventTouchUpInside]; - [self.thirdButton sendActionsForControlEvents:UIControlEventTouchUpInside]; + [self.firstButton setSelected:YES]; + [self.thirdButton setSelected:YES]; XCTAssertTrue([[self.secondButton selectedButtons] containsObject:self.firstButton]); XCTAssertTrue([[self.secondButton selectedButtons] containsObject:self.secondButton]); XCTAssertFalse([[self.secondButton selectedButtons] containsObject:self.thirdButton]); @@ -81,3 +90,4 @@ - (void)testButtonsGroupModifingPerformance { } @end + diff --git a/DLRadioButtonExample/DLRadioButtonExampleTests/DLRadioButtonExampleTests-Info.plist b/DLRadioButtonTests/Info.plist similarity index 86% rename from DLRadioButtonExample/DLRadioButtonExampleTests/DLRadioButtonExampleTests-Info.plist rename to DLRadioButtonTests/Info.plist index 169b6f7..ba72822 100644 --- a/DLRadioButtonExample/DLRadioButtonExampleTests/DLRadioButtonExampleTests-Info.plist +++ b/DLRadioButtonTests/Info.plist @@ -5,11 +5,13 @@ CFBundleDevelopmentRegion en CFBundleExecutable - ${EXECUTABLE_NAME} + $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString diff --git a/Example/DLRadioButton.framework/DLRadioButton b/Example/DLRadioButton.framework/DLRadioButton new file mode 100755 index 0000000..26328c4 Binary files /dev/null and b/Example/DLRadioButton.framework/DLRadioButton differ diff --git a/Example/DLRadioButton.framework/Headers/DLRadioButton.h b/Example/DLRadioButton.framework/Headers/DLRadioButton.h new file mode 100644 index 0000000..df84146 --- /dev/null +++ b/Example/DLRadioButton.framework/Headers/DLRadioButton.h @@ -0,0 +1,85 @@ +#import + +/** + A hightly customizable Radio Button for iOS. +*/ +IB_DESIGNABLE +@interface DLRadioButton : UIButton + +/**@name Properties*/ +/** + Container for holding other buttons in same group. +*/ +@property (nonatomic) IBOutletCollection(DLRadioButton) NSArray *otherButtons; + +/** + Size of icon, default is kDefaulIconSize. +*/ +@property (nonatomic) IBInspectable CGFloat iconSize; + +/** + Color of icon, default is title color for current UIControlState. + */ +@property (nonatomic) IBInspectable UIColor *iconColor; + +/** + Stroke width of icon, default is iconSize / 9. + */ +@property (nonatomic) IBInspectable CGFloat iconStrokeWidth; + +/** + Size of selection indicator, default is iconSize * 0.5. + */ +@property (nonatomic) IBInspectable CGFloat indicatorSize; + +/** + Color of selection indicator, default is title color for current UIControlState. +*/ +@property (nonatomic) IBInspectable UIColor *indicatorColor; + +/** + Margin width between icon and title, default is kDefaultMarginWidth. + */ +@property (nonatomic) IBInspectable CGFloat marginWidth; + +/** + Whether icon on the right side, default is NO. +*/ +@property (nonatomic, getter=isIconOnRight) IBInspectable BOOL iconOnRight; + +/** + Whether use square icon, default is NO. +*/ +@property (nonatomic, getter=isIconSquare) IBInspectable BOOL iconSquare; + +/** + Image for radio button icon (optional). + */ +@property (nonatomic) IBInspectable UIImage *icon; + +/** + Image for radio button icon when selected (optional). + */ +@property (nonatomic) IBInspectable UIImage *iconSelected; + +/** + Whether enable multiple selection, default is NO. + */ +@property (nonatomic, getter=isMultipleSelectionEnabled) BOOL multipleSelectionEnabled; + +/** + @return Selected button in same group. + */ +- (DLRadioButton *)selectedButton; + +/** + @return Selected buttons in same group, use it only if multiple selection is enabled. + */ +- (NSArray *)selectedButtons; + +/** + Clears selection for other buttons in in same group. +*/ +- (void)deselectOtherButtons; + +@end diff --git a/Example/DLRadioButton.framework/Info.plist b/Example/DLRadioButton.framework/Info.plist new file mode 100644 index 0000000..91c5c2b Binary files /dev/null and b/Example/DLRadioButton.framework/Info.plist differ diff --git a/Example/DLRadioButton.framework/Modules/module.modulemap b/Example/DLRadioButton.framework/Modules/module.modulemap new file mode 100644 index 0000000..5668b07 --- /dev/null +++ b/Example/DLRadioButton.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module DLRadioButton { + umbrella header "DLRadioButton.h" + + export * + module * { export * } +} diff --git a/Example/DLRadioButton.framework/_CodeSignature/CodeResources b/Example/DLRadioButton.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..3a55605 --- /dev/null +++ b/Example/DLRadioButton.framework/_CodeSignature/CodeResources @@ -0,0 +1,127 @@ + + + + + files + + Headers/DLRadioButton.h + + c0yBQwfclgj8rnPAB/LpTxzzhtE= + + Info.plist + + 2cSbAYtvpdbDjdRkDU8MDAaHQQo= + + Modules/module.modulemap + + nfXHSd4ttXRVnMqiHasypSc5vmA= + + + files2 + + Headers/DLRadioButton.h + + c0yBQwfclgj8rnPAB/LpTxzzhtE= + + Modules/module.modulemap + + nfXHSd4ttXRVnMqiHasypSc5vmA= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DLRadioButtonExample/DLRadioButtonExample.xcodeproj/project.pbxproj b/Example/DLRadioButtonExample.xcodeproj/project.pbxproj similarity index 61% rename from DLRadioButtonExample/DLRadioButtonExample.xcodeproj/project.pbxproj rename to Example/DLRadioButtonExample.xcodeproj/project.pbxproj index d13c883..b71c3cc 100644 --- a/DLRadioButtonExample/DLRadioButtonExample.xcodeproj/project.pbxproj +++ b/Example/DLRadioButtonExample.xcodeproj/project.pbxproj @@ -8,34 +8,38 @@ /* Begin PBXBuildFile section */ 63C933161B48EB1C009DD715 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 63C933151B48EB1C009DD715 /* Images.xcassets */; }; + 63F965121C5ED7A900FFD1A2 /* DLRadioButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63F965101C5ED6A100FFD1A2 /* DLRadioButton.framework */; }; + 63F9651F1C5EDC2B00FFD1A2 /* DLRadioButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63F9651E1C5EDC2B00FFD1A2 /* DLRadioButton.framework */; }; + 63F965201C5EDC4400FFD1A2 /* DLRadioButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63F9651E1C5EDC2B00FFD1A2 /* DLRadioButton.framework */; }; + 63F965211C5EDC4400FFD1A2 /* DLRadioButton.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 63F9651E1C5EDC2B00FFD1A2 /* DLRadioButton.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D1BE3A0319A7D263004BD3F5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1BE3A0219A7D263004BD3F5 /* Foundation.framework */; }; D1BE3A0519A7D263004BD3F5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1BE3A0419A7D263004BD3F5 /* CoreGraphics.framework */; }; D1BE3A0719A7D263004BD3F5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1BE3A0619A7D263004BD3F5 /* UIKit.framework */; }; D1BE3A0D19A7D263004BD3F5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D1BE3A0B19A7D263004BD3F5 /* InfoPlist.strings */; }; D1BE3A0F19A7D263004BD3F5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D1BE3A0E19A7D263004BD3F5 /* main.m */; }; D1BE3A1319A7D263004BD3F5 /* DLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D1BE3A1219A7D263004BD3F5 /* DLAppDelegate.m */; }; - D1BE3A1C19A7D264004BD3F5 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1BE3A1B19A7D264004BD3F5 /* XCTest.framework */; }; - D1BE3A1D19A7D264004BD3F5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1BE3A0219A7D263004BD3F5 /* Foundation.framework */; }; - D1BE3A1E19A7D264004BD3F5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1BE3A0619A7D263004BD3F5 /* UIKit.framework */; }; - D1BE3A2619A7D264004BD3F5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D1BE3A2419A7D264004BD3F5 /* InfoPlist.strings */; }; - D1BE3A2819A7D264004BD3F5 /* DLRadioButtonExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D1BE3A2719A7D264004BD3F5 /* DLRadioButtonExampleTests.m */; }; - D1BE3A3419A7D675004BD3F5 /* DLRadioButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D1BE3A3319A7D675004BD3F5 /* DLRadioButton.m */; }; - D1BE3A3619AB683D004BD3F5 /* iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D1BE3A3519AB683D004BD3F5 /* iPhone.storyboard */; }; + D1BE3A3619AB683D004BD3F5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D1BE3A3519AB683D004BD3F5 /* Main.storyboard */; }; D1BE3A3919AB7000004BD3F5 /* DLDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D1BE3A3819AB7000004BD3F5 /* DLDemoViewController.m */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - D1BE3A1F19A7D264004BD3F5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D1BE39F719A7D263004BD3F5 /* Project object */; - proxyType = 1; - remoteGlobalIDString = D1BE39FE19A7D263004BD3F5; - remoteInfo = DLRadioButtonExample; +/* Begin PBXCopyFilesBuildPhase section */ + 634D5B4F1C5D84FE00A3740D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 63F965211C5EDC4400FFD1A2 /* DLRadioButton.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXContainerItemProxy section */ +/* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 63C933151B48EB1C009DD715 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 63F965101C5ED6A100FFD1A2 /* DLRadioButton.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DLRadioButton.framework; path = /Users/David/Dropbox/Projects/iOS/DLRadioButton/DLRadioButton.framework; sourceTree = ""; }; + 63F9651E1C5EDC2B00FFD1A2 /* DLRadioButton.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = DLRadioButton.framework; sourceTree = ""; }; D1BE39FF19A7D263004BD3F5 /* DLRadioButtonExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DLRadioButtonExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; D1BE3A0219A7D263004BD3F5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; D1BE3A0419A7D263004BD3F5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; @@ -46,14 +50,7 @@ D1BE3A1019A7D263004BD3F5 /* DLRadioButtonExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DLRadioButtonExample-Prefix.pch"; sourceTree = ""; }; D1BE3A1119A7D263004BD3F5 /* DLAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DLAppDelegate.h; sourceTree = ""; }; D1BE3A1219A7D263004BD3F5 /* DLAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DLAppDelegate.m; sourceTree = ""; }; - D1BE3A1A19A7D264004BD3F5 /* DLRadioButtonExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DLRadioButtonExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - D1BE3A1B19A7D264004BD3F5 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - D1BE3A2319A7D264004BD3F5 /* DLRadioButtonExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DLRadioButtonExampleTests-Info.plist"; sourceTree = ""; }; - D1BE3A2519A7D264004BD3F5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - D1BE3A2719A7D264004BD3F5 /* DLRadioButtonExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DLRadioButtonExampleTests.m; sourceTree = ""; }; - D1BE3A3219A7D675004BD3F5 /* DLRadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLRadioButton.h; sourceTree = ""; }; - D1BE3A3319A7D675004BD3F5 /* DLRadioButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLRadioButton.m; sourceTree = ""; }; - D1BE3A3519AB683D004BD3F5 /* iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = iPhone.storyboard; sourceTree = ""; }; + D1BE3A3519AB683D004BD3F5 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; D1BE3A3719AB7000004BD3F5 /* DLDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLDemoViewController.h; sourceTree = ""; }; D1BE3A3819AB7000004BD3F5 /* DLDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLDemoViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -63,22 +60,15 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 63F965201C5EDC4400FFD1A2 /* DLRadioButton.framework in Frameworks */, D1BE3A0519A7D263004BD3F5 /* CoreGraphics.framework in Frameworks */, D1BE3A0719A7D263004BD3F5 /* UIKit.framework in Frameworks */, + 63F9651F1C5EDC2B00FFD1A2 /* DLRadioButton.framework in Frameworks */, + 63F965121C5ED7A900FFD1A2 /* DLRadioButton.framework in Frameworks */, D1BE3A0319A7D263004BD3F5 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - D1BE3A1719A7D264004BD3F5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D1BE3A1C19A7D264004BD3F5 /* XCTest.framework in Frameworks */, - D1BE3A1E19A7D264004BD3F5 /* UIKit.framework in Frameworks */, - D1BE3A1D19A7D264004BD3F5 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -86,7 +76,6 @@ isa = PBXGroup; children = ( D1BE3A0819A7D263004BD3F5 /* DLRadioButtonExample */, - D1BE3A2119A7D264004BD3F5 /* DLRadioButtonExampleTests */, D1BE3A0119A7D263004BD3F5 /* Frameworks */, D1BE3A0019A7D263004BD3F5 /* Products */, ); @@ -96,7 +85,6 @@ isa = PBXGroup; children = ( D1BE39FF19A7D263004BD3F5 /* DLRadioButtonExample.app */, - D1BE3A1A19A7D264004BD3F5 /* DLRadioButtonExampleTests.xctest */, ); name = Products; sourceTree = ""; @@ -104,10 +92,10 @@ D1BE3A0119A7D263004BD3F5 /* Frameworks */ = { isa = PBXGroup; children = ( + 63F9651E1C5EDC2B00FFD1A2 /* DLRadioButton.framework */, D1BE3A0219A7D263004BD3F5 /* Foundation.framework */, D1BE3A0419A7D263004BD3F5 /* CoreGraphics.framework */, D1BE3A0619A7D263004BD3F5 /* UIKit.framework */, - D1BE3A1B19A7D264004BD3F5 /* XCTest.framework */, ); name = Frameworks; sourceTree = ""; @@ -115,12 +103,11 @@ D1BE3A0819A7D263004BD3F5 /* DLRadioButtonExample */ = { isa = PBXGroup; children = ( - D1BE3A3119A7D2A7004BD3F5 /* DLRadioButton */, D1BE3A1119A7D263004BD3F5 /* DLAppDelegate.h */, D1BE3A1219A7D263004BD3F5 /* DLAppDelegate.m */, 63C933151B48EB1C009DD715 /* Images.xcassets */, D1BE3A0919A7D263004BD3F5 /* Supporting Files */, - D1BE3A3519AB683D004BD3F5 /* iPhone.storyboard */, + D1BE3A3519AB683D004BD3F5 /* Main.storyboard */, D1BE3A3719AB7000004BD3F5 /* DLDemoViewController.h */, D1BE3A3819AB7000004BD3F5 /* DLDemoViewController.m */, ); @@ -138,34 +125,6 @@ name = "Supporting Files"; sourceTree = ""; }; - D1BE3A2119A7D264004BD3F5 /* DLRadioButtonExampleTests */ = { - isa = PBXGroup; - children = ( - D1BE3A2719A7D264004BD3F5 /* DLRadioButtonExampleTests.m */, - D1BE3A2219A7D264004BD3F5 /* Supporting Files */, - ); - path = DLRadioButtonExampleTests; - sourceTree = ""; - }; - D1BE3A2219A7D264004BD3F5 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - D1BE3A2319A7D264004BD3F5 /* DLRadioButtonExampleTests-Info.plist */, - D1BE3A2419A7D264004BD3F5 /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - D1BE3A3119A7D2A7004BD3F5 /* DLRadioButton */ = { - isa = PBXGroup; - children = ( - D1BE3A3219A7D675004BD3F5 /* DLRadioButton.h */, - D1BE3A3319A7D675004BD3F5 /* DLRadioButton.m */, - ); - name = DLRadioButton; - path = ../../DLRadioButton; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -176,6 +135,7 @@ D1BE39FB19A7D263004BD3F5 /* Sources */, D1BE39FC19A7D263004BD3F5 /* Frameworks */, D1BE39FD19A7D263004BD3F5 /* Resources */, + 634D5B4F1C5D84FE00A3740D /* Embed Frameworks */, ); buildRules = ( ); @@ -186,24 +146,6 @@ productReference = D1BE39FF19A7D263004BD3F5 /* DLRadioButtonExample.app */; productType = "com.apple.product-type.application"; }; - D1BE3A1919A7D264004BD3F5 /* DLRadioButtonExampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = D1BE3A2E19A7D264004BD3F5 /* Build configuration list for PBXNativeTarget "DLRadioButtonExampleTests" */; - buildPhases = ( - D1BE3A1619A7D264004BD3F5 /* Sources */, - D1BE3A1719A7D264004BD3F5 /* Frameworks */, - D1BE3A1819A7D264004BD3F5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - D1BE3A2019A7D264004BD3F5 /* PBXTargetDependency */, - ); - name = DLRadioButtonExampleTests; - productName = DLRadioButtonExampleTests; - productReference = D1BE3A1A19A7D264004BD3F5 /* DLRadioButtonExampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -215,16 +157,12 @@ ORGANIZATIONNAME = "Xingruo Liu"; TargetAttributes = { D1BE39FE19A7D263004BD3F5 = { - DevelopmentTeam = 2526SYE8N7; SystemCapabilities = { com.apple.DataProtection = { enabled = 1; }; }; }; - D1BE3A1919A7D264004BD3F5 = { - TestTargetID = D1BE39FE19A7D263004BD3F5; - }; }; }; buildConfigurationList = D1BE39FA19A7D263004BD3F5 /* Build configuration list for PBXProject "DLRadioButtonExample" */; @@ -240,7 +178,6 @@ projectRoot = ""; targets = ( D1BE39FE19A7D263004BD3F5 /* DLRadioButtonExample */, - D1BE3A1919A7D264004BD3F5 /* DLRadioButtonExampleTests */, ); }; /* End PBXProject section */ @@ -252,15 +189,7 @@ files = ( 63C933161B48EB1C009DD715 /* Images.xcassets in Resources */, D1BE3A0D19A7D263004BD3F5 /* InfoPlist.strings in Resources */, - D1BE3A3619AB683D004BD3F5 /* iPhone.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D1BE3A1819A7D264004BD3F5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D1BE3A2619A7D264004BD3F5 /* InfoPlist.strings in Resources */, + D1BE3A3619AB683D004BD3F5 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -273,29 +202,12 @@ files = ( D1BE3A1319A7D263004BD3F5 /* DLAppDelegate.m in Sources */, D1BE3A3919AB7000004BD3F5 /* DLDemoViewController.m in Sources */, - D1BE3A3419A7D675004BD3F5 /* DLRadioButton.m in Sources */, D1BE3A0F19A7D263004BD3F5 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - D1BE3A1619A7D264004BD3F5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D1BE3A2819A7D264004BD3F5 /* DLRadioButtonExampleTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - D1BE3A2019A7D264004BD3F5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D1BE39FE19A7D263004BD3F5 /* DLRadioButtonExample */; - targetProxy = D1BE3A1F19A7D264004BD3F5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ D1BE3A0B19A7D263004BD3F5 /* InfoPlist.strings */ = { isa = PBXVariantGroup; @@ -305,21 +217,13 @@ name = InfoPlist.strings; sourceTree = ""; }; - D1BE3A2419A7D264004BD3F5 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - D1BE3A2519A7D264004BD3F5 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ D1BE3A2919A7D264004BD3F5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -359,7 +263,7 @@ D1BE3A2A19A7D264004BD3F5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -393,13 +297,18 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "DLRadioButtonExample/DLRadioButtonExample-Prefix.pch"; INFOPLIST_FILE = "DLRadioButtonExample/DLRadioButtonExample-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.liuxingruo.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; @@ -411,13 +320,18 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "DLRadioButtonExample/DLRadioButtonExample-Prefix.pch"; INFOPLIST_FILE = "DLRadioButtonExample/DLRadioButtonExample-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.liuxingruo.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; @@ -425,46 +339,6 @@ }; name = Release; }; - D1BE3A2F19A7D264004BD3F5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/DLRadioButtonExample.app/DLRadioButtonExample"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "DLRadioButtonExample/DLRadioButtonExample-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "DLRadioButtonExampleTests/DLRadioButtonExampleTests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "com.liuxingruo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = xctest; - }; - name = Debug; - }; - D1BE3A3019A7D264004BD3F5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/DLRadioButtonExample.app/DLRadioButtonExample"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "DLRadioButtonExample/DLRadioButtonExample-Prefix.pch"; - INFOPLIST_FILE = "DLRadioButtonExampleTests/DLRadioButtonExampleTests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "com.liuxingruo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = xctest; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -486,15 +360,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - D1BE3A2E19A7D264004BD3F5 /* Build configuration list for PBXNativeTarget "DLRadioButtonExampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D1BE3A2F19A7D264004BD3F5 /* Debug */, - D1BE3A3019A7D264004BD3F5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = D1BE39F719A7D263004BD3F5 /* Project object */; diff --git a/DLRadioButtonExample/DLRadioButtonExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/DLRadioButtonExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Example/DLRadioButtonExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/DLRadioButtonExample/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/2F747D6B-3143-4BAE-88E8-DE582D17B47F.plist b/Example/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/2F747D6B-3143-4BAE-88E8-DE582D17B47F.plist similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/2F747D6B-3143-4BAE-88E8-DE582D17B47F.plist rename to Example/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/2F747D6B-3143-4BAE-88E8-DE582D17B47F.plist diff --git a/DLRadioButtonExample/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/Info.plist b/Example/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/Info.plist similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/Info.plist rename to Example/DLRadioButtonExample.xcodeproj/xcshareddata/xcbaselines/D1BE3A1919A7D264004BD3F5.xcbaseline/Info.plist diff --git a/DLRadioButtonExample/DLRadioButtonExample/DLAppDelegate.h b/Example/DLRadioButtonExample/DLAppDelegate.h similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/DLAppDelegate.h rename to Example/DLRadioButtonExample/DLAppDelegate.h diff --git a/DLRadioButtonExample/DLRadioButtonExample/DLAppDelegate.m b/Example/DLRadioButtonExample/DLAppDelegate.m similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/DLAppDelegate.m rename to Example/DLRadioButtonExample/DLAppDelegate.m diff --git a/DLRadioButtonExample/DLRadioButtonExample/DLDemoViewController.h b/Example/DLRadioButtonExample/DLDemoViewController.h similarity index 78% rename from DLRadioButtonExample/DLRadioButtonExample/DLDemoViewController.h rename to Example/DLRadioButtonExample/DLDemoViewController.h index 63d3d91..0969752 100644 --- a/DLRadioButtonExample/DLRadioButtonExample/DLDemoViewController.h +++ b/Example/DLRadioButtonExample/DLDemoViewController.h @@ -1,5 +1,5 @@ #import -#import "DLRadioButton.h" +#import @interface DLDemoViewController : UIViewController diff --git a/DLRadioButtonExample/DLRadioButtonExample/DLDemoViewController.m b/Example/DLRadioButtonExample/DLDemoViewController.m similarity index 84% rename from DLRadioButtonExample/DLRadioButtonExample/DLDemoViewController.m rename to Example/DLRadioButtonExample/DLDemoViewController.m index b577700..c0e5921 100644 --- a/DLRadioButtonExample/DLRadioButtonExample/DLDemoViewController.m +++ b/Example/DLRadioButtonExample/DLDemoViewController.m @@ -24,7 +24,7 @@ - (void)viewDidLoad { // programmatically add buttons // first button - DLRadioButton *firstRadioButton = [[DLRadioButton alloc] initWithFrame:CGRectMake(30, 350, self.view.frame.size.width - 60, 15)]; + DLRadioButton *firstRadioButton = [[DLRadioButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 131, 350, 262, 17)]; firstRadioButton.titleLabel.font = [UIFont systemFontOfSize:14]; [firstRadioButton setTitle:@"Red Button" forState:UIControlStateNormal]; [firstRadioButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; @@ -35,13 +35,13 @@ - (void)viewDidLoad { [self.view addSubview:firstRadioButton]; // other buttons - NSArray *colorNames = @[@"Orange", @"Blue", @"Purple"]; - NSArray *buttonColors = @[[UIColor orangeColor], [UIColor blueColor], [UIColor purpleColor]]; + NSArray *colorNames = @[@"Brown", @"Orange", @"Green", @"Blue", @"Purple"]; + NSArray *buttonColors = @[[UIColor brownColor], [UIColor orangeColor], [UIColor greenColor], [UIColor blueColor], [UIColor purpleColor]]; NSInteger i = 0; NSMutableArray *otherButtons = [NSMutableArray new]; for (UIColor *buttonColor in buttonColors) { // customize button - DLRadioButton *radioButton = [[DLRadioButton alloc] initWithFrame:CGRectMake(30, 380 + 30 * i, self.view.frame.size.width - 60, 15)]; + DLRadioButton *radioButton = [[DLRadioButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 131, 380 + 30 * i, 262, 17)]; radioButton.titleLabel.font = [UIFont systemFontOfSize:14]; [radioButton setTitle:[colorNames[i] stringByAppendingString:@" Button"] forState:UIControlStateNormal]; [radioButton setTitleColor:buttonColor forState:UIControlStateNormal]; @@ -50,7 +50,7 @@ - (void)viewDidLoad { if (i % 2 == 0) { radioButton.iconSquare = YES; } - if (i > 0) { + if (i > 1) { // put icon on the right side radioButton.iconOnRight = YES; radioButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; @@ -66,4 +66,8 @@ - (void)viewDidLoad { firstRadioButton.otherButtons = otherButtons; } +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + +} + @end diff --git a/DLRadioButtonExample/DLRadioButtonExample/DLRadioButtonExample-Info.plist b/Example/DLRadioButtonExample/DLRadioButtonExample-Info.plist similarity index 91% rename from DLRadioButtonExample/DLRadioButtonExample/DLRadioButtonExample-Info.plist rename to Example/DLRadioButtonExample/DLRadioButtonExample-Info.plist index d853cea..049ba14 100644 --- a/DLRadioButtonExample/DLRadioButtonExample/DLRadioButtonExample-Info.plist +++ b/Example/DLRadioButtonExample/DLRadioButtonExample-Info.plist @@ -24,8 +24,10 @@ 1.0 LSRequiresIPhoneOS - UIMainStoryboardFile + UILaunchStoryboardName iPhone + UIMainStoryboardFile + Main UIRequiredDeviceCapabilities armv7 @@ -33,13 +35,12 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight diff --git a/DLRadioButtonExample/DLRadioButtonExample/DLRadioButtonExample-Prefix.pch b/Example/DLRadioButtonExample/DLRadioButtonExample-Prefix.pch similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/DLRadioButtonExample-Prefix.pch rename to Example/DLRadioButtonExample/DLRadioButtonExample-Prefix.pch diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/DLRadioButtonExample/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 78% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/AppIcon.appiconset/Contents.json rename to Example/DLRadioButtonExample/Images.xcassets/AppIcon.appiconset/Contents.json index b7f3352..eeea76c 100644 --- a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/DLRadioButtonExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -5,11 +5,21 @@ "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", @@ -49,6 +59,11 @@ "idiom" : "ipad", "size" : "76x76", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" } ], "info" : { diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/LaunchImage.launchimage/Contents.json b/Example/DLRadioButtonExample/Images.xcassets/LaunchImage.launchimage/Contents.json similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/LaunchImage.launchimage/Contents.json rename to Example/DLRadioButtonExample/Images.xcassets/LaunchImage.launchimage/Contents.json diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar.png b/Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar.png similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar.png rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar.png diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@2x.png b/Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@2x.png similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@2x.png rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@2x.png diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@3x.png b/Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@3x.png similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@3x.png rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/778-thumbs-down-toolbar@3x.png diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/Contents.json b/Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/Contents.json similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/Contents.json rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-down.imageset/Contents.json diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar.png b/Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar.png similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar.png rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar.png diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@2x.png b/Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@2x.png similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@2x.png rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@2x.png diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@3x.png b/Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@3x.png similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@3x.png rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/777-thumbs-up-toolbar@3x.png diff --git a/DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/Contents.json b/Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/Contents.json similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/Contents.json rename to Example/DLRadioButtonExample/Images.xcassets/thumbs-up.imageset/Contents.json diff --git a/DLRadioButtonExample/DLRadioButtonExample/iPhone.storyboard b/Example/DLRadioButtonExample/Main.storyboard similarity index 62% rename from DLRadioButtonExample/DLRadioButtonExample/iPhone.storyboard rename to Example/DLRadioButtonExample/Main.storyboard index 400a4b0..9027c17 100644 --- a/DLRadioButtonExample/DLRadioButtonExample/iPhone.storyboard +++ b/Example/DLRadioButtonExample/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -14,19 +14,20 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -249,7 +296,7 @@ - + diff --git a/DLRadioButtonExample/DLRadioButtonExample/en.lproj/InfoPlist.strings b/Example/DLRadioButtonExample/en.lproj/InfoPlist.strings similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/en.lproj/InfoPlist.strings rename to Example/DLRadioButtonExample/en.lproj/InfoPlist.strings diff --git a/DLRadioButtonExample/DLRadioButtonExample/main.m b/Example/DLRadioButtonExample/main.m similarity index 100% rename from DLRadioButtonExample/DLRadioButtonExample/main.m rename to Example/DLRadioButtonExample/main.m diff --git a/DLRadioButton.png b/Images/DLRadioButton.png similarity index 100% rename from DLRadioButton.png rename to Images/DLRadioButton.png diff --git a/DLRadioButton_screenshot1.png b/Images/DLRadioButton_screenshot1.png similarity index 100% rename from DLRadioButton_screenshot1.png rename to Images/DLRadioButton_screenshot1.png diff --git a/change_UIButton_class.png b/Images/change_UIButton_class.png similarity index 100% rename from change_UIButton_class.png rename to Images/change_UIButton_class.png diff --git a/change_UIButton_type.png b/Images/change_UIButton_type.png similarity index 100% rename from change_UIButton_type.png rename to Images/change_UIButton_type.png diff --git a/design_DLRadioButton.png b/Images/design_DLRadioButton.png similarity index 100% rename from design_DLRadioButton.png rename to Images/design_DLRadioButton.png diff --git a/set_otherButtons_outlet.png b/Images/set_otherButtons_outlet.png similarity index 100% rename from set_otherButtons_outlet.png rename to Images/set_otherButtons_outlet.png diff --git a/README.md b/README.md index 867f35a..6d8fdaa 100644 --- a/README.md +++ b/README.md @@ -3,39 +3,42 @@ [![Version](https://img.shields.io/cocoapods/v/DLRadioButton.svg?style=flat)](http://cocoadocs.org/docsets/DLRadioButton) [![License](https://img.shields.io/cocoapods/l/DLRadioButton.svg?style=flat)](http://cocoadocs.org/docsets/DLRaidoButton) [![Platform](https://img.shields.io/cocoapods/p/DLRadioButton.svg?style=flat)](http://cocoadocs.org/docsets/DLRadioButton) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ## Preview -![screenshot1](DLRadioButton_screenshot1.png) +![screenshot1](Images/DLRadioButton_screenshot1.png) ## Usage ####To install: -* Put `DLRadioButton.h` and `DLRadiobutton.m` in your project, or add `pod DLRadioButton` to your Podfile. +* Option 1: simply put `DLRadioButton.h` and `DLRadiobutton.m` in your project. +* Option 2: add `pod DLRadioButton, '~> 1.4'` to your `Podfile`. +* Option 3: add `github "DavydLiu/DLRadioButton" ~> 1.4` to your `Cartfile`. ####To add radio buttons in interface builder: 1. Put some UIButtons onto a View and change the UIButtons' type to "custom". - ![change UIButton Type](change_UIButton_type.png) + ![change UIButton Type](Images/change_UIButton_type.png) 2. Set the UIButtons' class to "DLRadioButton". - ![change UIButton Class](change_UIButton_class.png) + ![change UIButton Class](Images/change_UIButton_class.png) 3. Set "otherButtons" outlet. - ![set otherButtons outlet](set_otherButtons_outlet.png) + ![set otherButtons outlet](Images/set_otherButtons_outlet.png) ####To customize DLRadiobutton: * Simply set properties directly in Interface Builder. - ![design DLButton](design_DLRadioButton.png) + ![design DLButton](Images/design_DLRadioButton.png) * Property reference: - ![DLRadioButton](DLRadioButton.png) + ![DLRadioButton](Images/DLRadioButton.png) ####To add raido buttons programmatically, please refer to example project. diff --git a/Supporting Files/Info.plist b/Supporting Files/Info.plist new file mode 100644 index 0000000..d3de8ee --- /dev/null +++ b/Supporting Files/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + +