├── BrightnessVolumeView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── admin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── hb.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── admin.xcuserdatad │ └── xcschemes │ │ ├── BrightnessVolumeView.xcscheme │ │ └── xcschememanagement.plist │ └── hb.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── BrightnessVolumeView ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── BrightnessVolumeView │ ├── BrightnessView.h │ ├── BrightnessView.m │ ├── BrightnessVolumeView.h │ ├── BrightnessVolumeView.m │ └── resource.bundle │ │ └── brightness.png ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── README.md └── Screenshot ├── IMG_1.PNG └── IMG_2.PNG /BrightnessVolumeView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 84C544841EA74E5200CD1E55 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C544831EA74E5200CD1E55 /* main.m */; }; 11 | 84C544871EA74E5200CD1E55 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C544861EA74E5200CD1E55 /* AppDelegate.m */; }; 12 | 84C5448A1EA74E5200CD1E55 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C544891EA74E5200CD1E55 /* ViewController.m */; }; 13 | 84C5448D1EA74E5200CD1E55 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84C5448B1EA74E5200CD1E55 /* Main.storyboard */; }; 14 | 84C5448F1EA74E5200CD1E55 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84C5448E1EA74E5200CD1E55 /* Assets.xcassets */; }; 15 | 84C544921EA74E5200CD1E55 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84C544901EA74E5200CD1E55 /* LaunchScreen.storyboard */; }; 16 | 84C5449F1EA74E6100CD1E55 /* BrightnessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C5449B1EA74E6100CD1E55 /* BrightnessView.m */; }; 17 | 84C544A01EA74E6100CD1E55 /* BrightnessVolumeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C5449D1EA74E6100CD1E55 /* BrightnessVolumeView.m */; }; 18 | 84C544A11EA74E6100CD1E55 /* resource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 84C5449E1EA74E6100CD1E55 /* resource.bundle */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 84C5447F1EA74E5200CD1E55 /* BrightnessVolumeView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BrightnessVolumeView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 84C544831EA74E5200CD1E55 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 24 | 84C544851EA74E5200CD1E55 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 25 | 84C544861EA74E5200CD1E55 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 26 | 84C544881EA74E5200CD1E55 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 27 | 84C544891EA74E5200CD1E55 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 28 | 84C5448C1EA74E5200CD1E55 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | 84C5448E1EA74E5200CD1E55 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | 84C544911EA74E5200CD1E55 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 31 | 84C544931EA74E5200CD1E55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 84C5449A1EA74E6100CD1E55 /* BrightnessView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BrightnessView.h; sourceTree = ""; }; 33 | 84C5449B1EA74E6100CD1E55 /* BrightnessView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BrightnessView.m; sourceTree = ""; }; 34 | 84C5449C1EA74E6100CD1E55 /* BrightnessVolumeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BrightnessVolumeView.h; sourceTree = ""; }; 35 | 84C5449D1EA74E6100CD1E55 /* BrightnessVolumeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BrightnessVolumeView.m; sourceTree = ""; }; 36 | 84C5449E1EA74E6100CD1E55 /* resource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = resource.bundle; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 84C5447C1EA74E5200CD1E55 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 84C544761EA74E5200CD1E55 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 84C544811EA74E5200CD1E55 /* BrightnessVolumeView */, 54 | 84C544801EA74E5200CD1E55 /* Products */, 55 | ); 56 | sourceTree = ""; 57 | }; 58 | 84C544801EA74E5200CD1E55 /* Products */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 84C5447F1EA74E5200CD1E55 /* BrightnessVolumeView.app */, 62 | ); 63 | name = Products; 64 | sourceTree = ""; 65 | }; 66 | 84C544811EA74E5200CD1E55 /* BrightnessVolumeView */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 84C544991EA74E6100CD1E55 /* BrightnessVolumeView */, 70 | 84C544851EA74E5200CD1E55 /* AppDelegate.h */, 71 | 84C544861EA74E5200CD1E55 /* AppDelegate.m */, 72 | 84C544881EA74E5200CD1E55 /* ViewController.h */, 73 | 84C544891EA74E5200CD1E55 /* ViewController.m */, 74 | 84C5448B1EA74E5200CD1E55 /* Main.storyboard */, 75 | 84C5448E1EA74E5200CD1E55 /* Assets.xcassets */, 76 | 84C544901EA74E5200CD1E55 /* LaunchScreen.storyboard */, 77 | 84C544931EA74E5200CD1E55 /* Info.plist */, 78 | 84C544821EA74E5200CD1E55 /* Supporting Files */, 79 | ); 80 | path = BrightnessVolumeView; 81 | sourceTree = ""; 82 | }; 83 | 84C544821EA74E5200CD1E55 /* Supporting Files */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 84C544831EA74E5200CD1E55 /* main.m */, 87 | ); 88 | name = "Supporting Files"; 89 | sourceTree = ""; 90 | }; 91 | 84C544991EA74E6100CD1E55 /* BrightnessVolumeView */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 84C5449A1EA74E6100CD1E55 /* BrightnessView.h */, 95 | 84C5449B1EA74E6100CD1E55 /* BrightnessView.m */, 96 | 84C5449C1EA74E6100CD1E55 /* BrightnessVolumeView.h */, 97 | 84C5449D1EA74E6100CD1E55 /* BrightnessVolumeView.m */, 98 | 84C5449E1EA74E6100CD1E55 /* resource.bundle */, 99 | ); 100 | path = BrightnessVolumeView; 101 | sourceTree = ""; 102 | }; 103 | /* End PBXGroup section */ 104 | 105 | /* Begin PBXNativeTarget section */ 106 | 84C5447E1EA74E5200CD1E55 /* BrightnessVolumeView */ = { 107 | isa = PBXNativeTarget; 108 | buildConfigurationList = 84C544961EA74E5200CD1E55 /* Build configuration list for PBXNativeTarget "BrightnessVolumeView" */; 109 | buildPhases = ( 110 | 84C5447B1EA74E5200CD1E55 /* Sources */, 111 | 84C5447C1EA74E5200CD1E55 /* Frameworks */, 112 | 84C5447D1EA74E5200CD1E55 /* Resources */, 113 | ); 114 | buildRules = ( 115 | ); 116 | dependencies = ( 117 | ); 118 | name = BrightnessVolumeView; 119 | productName = BrightnessVolumeView; 120 | productReference = 84C5447F1EA74E5200CD1E55 /* BrightnessVolumeView.app */; 121 | productType = "com.apple.product-type.application"; 122 | }; 123 | /* End PBXNativeTarget section */ 124 | 125 | /* Begin PBXProject section */ 126 | 84C544771EA74E5200CD1E55 /* Project object */ = { 127 | isa = PBXProject; 128 | attributes = { 129 | LastUpgradeCheck = 0830; 130 | ORGANIZATIONNAME = admin; 131 | TargetAttributes = { 132 | 84C5447E1EA74E5200CD1E55 = { 133 | CreatedOnToolsVersion = 8.3.1; 134 | ProvisioningStyle = Automatic; 135 | }; 136 | }; 137 | }; 138 | buildConfigurationList = 84C5447A1EA74E5200CD1E55 /* Build configuration list for PBXProject "BrightnessVolumeView" */; 139 | compatibilityVersion = "Xcode 3.2"; 140 | developmentRegion = English; 141 | hasScannedForEncodings = 0; 142 | knownRegions = ( 143 | en, 144 | Base, 145 | ); 146 | mainGroup = 84C544761EA74E5200CD1E55; 147 | productRefGroup = 84C544801EA74E5200CD1E55 /* Products */; 148 | projectDirPath = ""; 149 | projectRoot = ""; 150 | targets = ( 151 | 84C5447E1EA74E5200CD1E55 /* BrightnessVolumeView */, 152 | ); 153 | }; 154 | /* End PBXProject section */ 155 | 156 | /* Begin PBXResourcesBuildPhase section */ 157 | 84C5447D1EA74E5200CD1E55 /* Resources */ = { 158 | isa = PBXResourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | 84C544921EA74E5200CD1E55 /* LaunchScreen.storyboard in Resources */, 162 | 84C5448F1EA74E5200CD1E55 /* Assets.xcassets in Resources */, 163 | 84C5448D1EA74E5200CD1E55 /* Main.storyboard in Resources */, 164 | 84C544A11EA74E6100CD1E55 /* resource.bundle in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 84C5447B1EA74E5200CD1E55 /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 84C5448A1EA74E5200CD1E55 /* ViewController.m in Sources */, 176 | 84C544871EA74E5200CD1E55 /* AppDelegate.m in Sources */, 177 | 84C544A01EA74E6100CD1E55 /* BrightnessVolumeView.m in Sources */, 178 | 84C544841EA74E5200CD1E55 /* main.m in Sources */, 179 | 84C5449F1EA74E6100CD1E55 /* BrightnessView.m in Sources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXSourcesBuildPhase section */ 184 | 185 | /* Begin PBXVariantGroup section */ 186 | 84C5448B1EA74E5200CD1E55 /* Main.storyboard */ = { 187 | isa = PBXVariantGroup; 188 | children = ( 189 | 84C5448C1EA74E5200CD1E55 /* Base */, 190 | ); 191 | name = Main.storyboard; 192 | sourceTree = ""; 193 | }; 194 | 84C544901EA74E5200CD1E55 /* LaunchScreen.storyboard */ = { 195 | isa = PBXVariantGroup; 196 | children = ( 197 | 84C544911EA74E5200CD1E55 /* Base */, 198 | ); 199 | name = LaunchScreen.storyboard; 200 | sourceTree = ""; 201 | }; 202 | /* End PBXVariantGroup section */ 203 | 204 | /* Begin XCBuildConfiguration section */ 205 | 84C544941EA74E5200CD1E55 /* Debug */ = { 206 | isa = XCBuildConfiguration; 207 | buildSettings = { 208 | ALWAYS_SEARCH_USER_PATHS = NO; 209 | CLANG_ANALYZER_NONNULL = YES; 210 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 211 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 212 | CLANG_CXX_LIBRARY = "libc++"; 213 | CLANG_ENABLE_MODULES = YES; 214 | CLANG_ENABLE_OBJC_ARC = YES; 215 | CLANG_WARN_BOOL_CONVERSION = YES; 216 | CLANG_WARN_CONSTANT_CONVERSION = YES; 217 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 218 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 219 | CLANG_WARN_EMPTY_BODY = YES; 220 | CLANG_WARN_ENUM_CONVERSION = YES; 221 | CLANG_WARN_INFINITE_RECURSION = YES; 222 | CLANG_WARN_INT_CONVERSION = YES; 223 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 224 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 225 | CLANG_WARN_UNREACHABLE_CODE = YES; 226 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 227 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 228 | COPY_PHASE_STRIP = NO; 229 | DEBUG_INFORMATION_FORMAT = dwarf; 230 | ENABLE_STRICT_OBJC_MSGSEND = YES; 231 | ENABLE_TESTABILITY = YES; 232 | GCC_C_LANGUAGE_STANDARD = gnu99; 233 | GCC_DYNAMIC_NO_PIC = NO; 234 | GCC_NO_COMMON_BLOCKS = YES; 235 | GCC_OPTIMIZATION_LEVEL = 0; 236 | GCC_PREPROCESSOR_DEFINITIONS = ( 237 | "DEBUG=1", 238 | "$(inherited)", 239 | ); 240 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 241 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 242 | GCC_WARN_UNDECLARED_SELECTOR = YES; 243 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 244 | GCC_WARN_UNUSED_FUNCTION = YES; 245 | GCC_WARN_UNUSED_VARIABLE = YES; 246 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 247 | MTL_ENABLE_DEBUG_INFO = YES; 248 | ONLY_ACTIVE_ARCH = YES; 249 | SDKROOT = iphoneos; 250 | }; 251 | name = Debug; 252 | }; 253 | 84C544951EA74E5200CD1E55 /* Release */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | CLANG_ANALYZER_NONNULL = YES; 258 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 259 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 260 | CLANG_CXX_LIBRARY = "libc++"; 261 | CLANG_ENABLE_MODULES = YES; 262 | CLANG_ENABLE_OBJC_ARC = YES; 263 | CLANG_WARN_BOOL_CONVERSION = YES; 264 | CLANG_WARN_CONSTANT_CONVERSION = YES; 265 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 266 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 267 | CLANG_WARN_EMPTY_BODY = YES; 268 | CLANG_WARN_ENUM_CONVERSION = YES; 269 | CLANG_WARN_INFINITE_RECURSION = YES; 270 | CLANG_WARN_INT_CONVERSION = YES; 271 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 272 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 276 | COPY_PHASE_STRIP = NO; 277 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 278 | ENABLE_NS_ASSERTIONS = NO; 279 | ENABLE_STRICT_OBJC_MSGSEND = YES; 280 | GCC_C_LANGUAGE_STANDARD = gnu99; 281 | GCC_NO_COMMON_BLOCKS = YES; 282 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 283 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 284 | GCC_WARN_UNDECLARED_SELECTOR = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 286 | GCC_WARN_UNUSED_FUNCTION = YES; 287 | GCC_WARN_UNUSED_VARIABLE = YES; 288 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 289 | MTL_ENABLE_DEBUG_INFO = NO; 290 | SDKROOT = iphoneos; 291 | VALIDATE_PRODUCT = YES; 292 | }; 293 | name = Release; 294 | }; 295 | 84C544971EA74E5200CD1E55 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 299 | INFOPLIST_FILE = BrightnessVolumeView/Info.plist; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 301 | PRODUCT_BUNDLE_IDENTIFIER = com.zlcode.BrightnessVolumeView; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | }; 304 | name = Debug; 305 | }; 306 | 84C544981EA74E5200CD1E55 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | INFOPLIST_FILE = BrightnessVolumeView/Info.plist; 311 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 312 | PRODUCT_BUNDLE_IDENTIFIER = com.zlcode.BrightnessVolumeView; 313 | PRODUCT_NAME = "$(TARGET_NAME)"; 314 | }; 315 | name = Release; 316 | }; 317 | /* End XCBuildConfiguration section */ 318 | 319 | /* Begin XCConfigurationList section */ 320 | 84C5447A1EA74E5200CD1E55 /* Build configuration list for PBXProject "BrightnessVolumeView" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 84C544941EA74E5200CD1E55 /* Debug */, 324 | 84C544951EA74E5200CD1E55 /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | 84C544961EA74E5200CD1E55 /* Build configuration list for PBXNativeTarget "BrightnessVolumeView" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | 84C544971EA74E5200CD1E55 /* Debug */, 333 | 84C544981EA74E5200CD1E55 /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | defaultConfigurationName = Release; 337 | }; 338 | /* End XCConfigurationList section */ 339 | }; 340 | rootObject = 84C544771EA74E5200CD1E55 /* Project object */; 341 | } 342 | -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-zlcode/BrightnessVolumeView/02f7afb47642d290830b8cc88beda5656d626f0b/BrightnessVolumeView.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/project.xcworkspace/xcuserdata/hb.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-zlcode/BrightnessVolumeView/02f7afb47642d290830b8cc88beda5656d626f0b/BrightnessVolumeView.xcodeproj/project.xcworkspace/xcuserdata/hb.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/BrightnessVolumeView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BrightnessVolumeView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 84C5447E1EA74E5200CD1E55 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/xcuserdata/hb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /BrightnessVolumeView.xcodeproj/xcuserdata/hb.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BrightnessVolumeView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /BrightnessVolumeView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // BrightnessVolumeView 4 | // 5 | // Created by admin on 2017/4/19. 6 | // Copyright © 2017年 admin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /BrightnessVolumeView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // BrightnessVolumeView 4 | // 5 | // Created by admin on 2017/4/19. 6 | // Copyright © 2017年 admin. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /BrightnessVolumeView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /BrightnessVolumeView/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /BrightnessVolumeView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /BrightnessVolumeView/BrightnessVolumeView/BrightnessView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by zlcode on 2017/4/19. 3 | // Copyright © 2017年 zlcode. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | #define ZLScreenWidth [UIScreen mainScreen].bounds.size.width 9 | #define ZLScreenHeight [UIScreen mainScreen].bounds.size.height 10 | #define ZLSystemVersion ([[[UIDevice currentDevice] systemVersion] floatValue]) 11 | 12 | @interface BrightnessView : UIView 13 | 14 | + (instancetype)sharedBrightnessView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BrightnessVolumeView/BrightnessVolumeView/BrightnessView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by zlcode on 2017/4/19. 3 | // Copyright © 2017年 zlcode. All rights reserved. 4 | // 5 | 6 | #import "BrightnessView.h" 7 | 8 | @interface BrightnessView () 9 | 10 | @property (nonatomic, strong) UIImageView *backImage; 11 | @property (nonatomic, strong) UILabel *title; 12 | @property (nonatomic, strong) UIView *brightnessLevelView; 13 | @property (nonatomic, strong) NSMutableArray *tipArray; 14 | @property (nonatomic, strong) NSTimer *timer; 15 | 16 | @end 17 | 18 | @implementation BrightnessView 19 | 20 | #pragma mark - 懒加载 21 | -(UILabel *)title { 22 | if (!_title) { 23 | _title = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, self.bounds.size.width, 30)]; 24 | _title.font = [UIFont boldSystemFontOfSize:16]; 25 | _title.textColor = [UIColor colorWithRed:0.25f green:0.22f blue:0.21f alpha:1.00f]; 26 | _title.textAlignment = NSTextAlignmentCenter; 27 | _title.text = @"亮度"; 28 | } 29 | return _title; 30 | } 31 | 32 | - (UIImageView *)backImage { 33 | 34 | if (!_backImage) { 35 | _backImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 79, 76)]; 36 | _backImage.image = [UIImage imageNamed:getResourceFromBundleFileName(@"brightness")]; 37 | } 38 | return _backImage; 39 | } 40 | 41 | -(UIView *)brightnessLevelView { 42 | 43 | if (!_brightnessLevelView) { 44 | _brightnessLevelView = [[UIView alloc]initWithFrame:CGRectMake(13, 132, self.bounds.size.width - 26, 7)]; 45 | _brightnessLevelView.backgroundColor = [UIColor colorWithRed:0.25f green:0.22f blue:0.21f alpha:1.00f]; 46 | [self addSubview:_brightnessLevelView]; 47 | } 48 | return _brightnessLevelView; 49 | } 50 | 51 | #pragma mark - 单例 52 | + (instancetype)sharedBrightnessView { 53 | static BrightnessView *instance; 54 | static dispatch_once_t onceToken; 55 | dispatch_once(&onceToken, ^{ 56 | instance = [[BrightnessView alloc] init]; 57 | [[[UIApplication sharedApplication].windows firstObject] addSubview:instance]; 58 | }); 59 | return instance; 60 | } 61 | 62 | - (instancetype)init { 63 | if (self = [super init]) { 64 | [self setupUI]; 65 | } 66 | return self; 67 | } 68 | 69 | - (void)setupUI { 70 | self.frame = CGRectMake(ZLScreenWidth * 0.5, ZLScreenHeight * 0.5 - 20, 155, 155); 71 | self.layer.cornerRadius = 10; 72 | self.layer.masksToBounds = YES; 73 | 74 | // 毛玻璃效果 75 | UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:self.bounds]; 76 | [self addSubview:toolbar]; 77 | 78 | [self addSubview:self.backImage]; 79 | [self addSubview:self.title]; 80 | [self addSubview:self.brightnessLevelView]; 81 | 82 | [self createTips]; 83 | [self addStatusBarNotification]; 84 | [self addKVOObserver]; 85 | 86 | self.alpha = 0.0; 87 | } 88 | 89 | #pragma makr - 创建 Tips 90 | - (void)createTips { 91 | 92 | self.tipArray = [NSMutableArray arrayWithCapacity:16]; 93 | CGFloat tipW = (self.brightnessLevelView.bounds.size.width - 17) / 16; 94 | CGFloat tipH = 5; 95 | CGFloat tipY = 1; 96 | 97 | for (int i = 0; i < 16; i++) { 98 | CGFloat tipX = i * (tipW + 1) + 1; 99 | UIImageView *image = [[UIImageView alloc] init]; 100 | image.backgroundColor = [UIColor whiteColor]; 101 | image.frame = CGRectMake(tipX, tipY, tipW, tipH); 102 | [self.brightnessLevelView addSubview:image]; 103 | [self.tipArray addObject:image]; 104 | } 105 | [self updateBrightnessLevel:[UIScreen mainScreen].brightness]; 106 | } 107 | 108 | #pragma makr - 通知 KVO 109 | - (void)addStatusBarNotification { 110 | /** 注册 UIApplicationDidChangeStatusBarOrientationNotification -状态栏方向改变 111 | */ 112 | [[NSNotificationCenter defaultCenter] addObserver:self 113 | selector:@selector(statusBarOrientationNotification:) 114 | name:UIApplicationDidChangeStatusBarOrientationNotification 115 | object:nil]; 116 | } 117 | 118 | - (void)addKVOObserver { 119 | [[UIScreen mainScreen] addObserver:self 120 | forKeyPath:@"brightness" 121 | options:NSKeyValueObservingOptionNew context:NULL]; 122 | } 123 | 124 | - (void)observeValueForKeyPath:(NSString *)keyPath 125 | ofObject:(id)object 126 | change:(NSDictionary *)change 127 | context:(void *)context { 128 | 129 | CGFloat levelValue = [change[@"new"] floatValue]; 130 | 131 | [self removeTimer]; 132 | [self appearBrightnessView]; 133 | [self updateBrightnessLevel:levelValue]; 134 | } 135 | 136 | #pragma mark - 状态栏方向改变通知 137 | - (void)statusBarOrientationNotification:(NSNotification *)notify { 138 | [self setNeedsLayout]; 139 | } 140 | 141 | #pragma mark - Brightness显示 隐藏 142 | - (void)appearBrightnessView { 143 | [UIView animateWithDuration:0.5 animations:^{ 144 | self.alpha = 1; 145 | } completion:^(BOOL finished) { 146 | [self addtimer]; 147 | }]; 148 | } 149 | 150 | - (void)disAppearBrightnessView { 151 | if (self.alpha == 1.0) { 152 | [UIView animateWithDuration:0.5 animations:^{ 153 | self.alpha = 0.0; 154 | } completion:^(BOOL finished) { 155 | [self removeTimer]; 156 | }]; 157 | } 158 | } 159 | 160 | #pragma mark - 定时器 161 | - (void)addtimer { 162 | if (self.timer) { 163 | return; 164 | } 165 | self.timer = [NSTimer timerWithTimeInterval:2 166 | target:self 167 | selector:@selector(disAppearBrightnessView) 168 | userInfo:nil 169 | repeats:NO]; 170 | [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode]; 171 | } 172 | 173 | - (void)removeTimer{ 174 | [self.timer invalidate]; 175 | self.timer = nil; 176 | } 177 | 178 | #pragma mark - 更新亮度值 179 | - (void)updateBrightnessLevel:(CGFloat)brightnessLevel { 180 | CGFloat stage = 1 / 15.0; 181 | NSInteger level = brightnessLevel / stage; 182 | for (int i = 0; i < self.tipArray.count; i++) { 183 | UIImageView *img = self.tipArray[i]; 184 | if (i <= level) { 185 | img.hidden = NO; 186 | } else { 187 | img.hidden = YES; 188 | } 189 | } 190 | } 191 | 192 | #pragma mark - 更新布局 193 | - (void)layoutSubviews { 194 | [super layoutSubviews]; 195 | //InterfaceOrientation值 196 | UIInterfaceOrientation currInterfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation]; 197 | switch (currInterfaceOrientation) 198 | { 199 | case UIInterfaceOrientationPortrait: 200 | case UIInterfaceOrientationPortraitUpsideDown: 201 | { 202 | self.center = CGPointMake(ZLScreenWidth * 0.5, (ZLScreenHeight - 10) * 0.5); 203 | } 204 | break; 205 | case UIInterfaceOrientationLandscapeLeft: 206 | case UIInterfaceOrientationLandscapeRight: 207 | { 208 | self.center = CGPointMake(ZLScreenWidth * 0.5, (ZLScreenHeight) * 0.5); 209 | } 210 | break; 211 | default: 212 | break; 213 | } 214 | self.backImage.center = CGPointMake(155 * 0.5, 155 * 0.5); 215 | [self.superview bringSubviewToFront:self]; 216 | } 217 | 218 | #pragma mark - 获取bundle资源 219 | NSString* getResourceFromBundleFileName( NSString * filename) { 220 | NSString * vodPlayerBundle = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"resource.bundle"] ; 221 | NSBundle *resoureBundle = [NSBundle bundleWithPath:vodPlayerBundle]; 222 | 223 | if (resoureBundle && filename) 224 | { 225 | NSString * bundlePath = [[resoureBundle resourcePath ] stringByAppendingPathComponent:filename]; 226 | 227 | return bundlePath; 228 | } 229 | return nil ; 230 | } 231 | 232 | #pragma mark - 销毁 233 | - (void)dealloc { 234 | [[UIScreen mainScreen] removeObserver:self forKeyPath:@"brightness"]; 235 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 236 | } 237 | 238 | @end 239 | -------------------------------------------------------------------------------- /BrightnessVolumeView/BrightnessVolumeView/BrightnessVolumeView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by zlcode on 2017/4/19. 3 | // Copyright © 2017年 zlcode. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | #import 9 | #import 10 | 11 | #import "BrightnessView.h" 12 | 13 | @interface BrightnessVolumeView : UIView 14 | 15 | @property (nonatomic, strong) UISlider* volumeViewSlider; // 获取MediaPlayer的Slider 16 | @property (nonatomic, assign) float lastVolume; // 上一次调节音量时的音量大小 17 | @property (nonatomic, assign) float lastBrightness; // 上一次调节亮度时的亮度大小 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /BrightnessVolumeView/BrightnessVolumeView/BrightnessVolumeView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by zlcode on 2017/4/19. 3 | // Copyright © 2017年 zlcode. All rights reserved. 4 | // 5 | 6 | #import "BrightnessVolumeView.h" 7 | #import 8 | 9 | @implementation BrightnessVolumeView 10 | 11 | #pragma mark - xib初始化入口 12 | - (id)initWithCoder:(NSCoder *)aDecoder{ 13 | self = [super initWithCoder:aDecoder]; 14 | if (self) { 15 | [self addPanGesture]; 16 | [BrightnessView sharedBrightnessView]; 17 | } 18 | return self; 19 | } 20 | 21 | #pragma mark - 代码初始化入口 22 | - (id)initWithFrame:(CGRect)frame{ 23 | self = [super initWithFrame:frame]; 24 | if (self) { 25 | [self addPanGesture]; 26 | [BrightnessView sharedBrightnessView]; 27 | } 28 | return self; 29 | } 30 | 31 | #pragma mark - 添加拖动手势 32 | - (void)addPanGesture{ 33 | // 拖动手势 34 | UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; 35 | [self addGestureRecognizer:panRecognizer]; 36 | } 37 | 38 | #pragma mark - 处理音量和亮度 39 | - (void)handlePan:(UIPanGestureRecognizer*)recognizer 40 | { 41 | CGPoint location = [recognizer locationInView:self]; 42 | CGPoint point = [recognizer translationInView:recognizer.view]; 43 | 44 | // 音量 45 | if (location.x > ZLScreenWidth * 0.5) { 46 | 47 | if (recognizer.state == UIGestureRecognizerStateBegan) { 48 | self.lastVolume = [self bfGetCurrentVolume]; 49 | } 50 | 51 | float volumeDelta = point.y / (recognizer.view.bounds.size.height) * 0.5; 52 | float newVolume = self.lastVolume - volumeDelta; 53 | 54 | [self bfSetVolume:newVolume]; 55 | 56 | } else {// 亮度 57 | 58 | if (recognizer.state == UIGestureRecognizerStateBegan) { 59 | self.lastBrightness = [UIScreen mainScreen].brightness; 60 | } 61 | 62 | float volumeDelta = point.y / (recognizer.view.bounds.size.height) * 0.5; 63 | float newVolume = self.lastBrightness - volumeDelta; 64 | 65 | [[UIScreen mainScreen] setBrightness:newVolume]; 66 | } 67 | } 68 | 69 | #pragma mark - 兼容iOS 7.0前后的音量控制 70 | - (float)bfGetCurrentVolume { 71 | // 通过控制系统声音 控制音量 72 | if (ZLSystemVersion >= 7) { 73 | if (_volumeViewSlider) { 74 | return _volumeViewSlider.value; 75 | } 76 | MPVolumeView *volumeView = [[MPVolumeView alloc] init]; 77 | for (UIView *view in [volumeView subviews]){ 78 | if ([view.class.description isEqualToString:@"MPVolumeSlider"]){ 79 | _volumeViewSlider = (UISlider*)view; 80 | break; 81 | } 82 | } 83 | 84 | // 解决初始状态下获取不到系统音量 85 | AVAudioSession *audioSession = [AVAudioSession sharedInstance]; 86 | CGFloat systemVolume = audioSession.outputVolume; 87 | 88 | return systemVolume; 89 | } else { 90 | #pragma clang diagnostic push 91 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 92 | // 过期api写在这里不会有警告 93 | return [[MPMusicPlayerController applicationMusicPlayer] volume]; 94 | #pragma clang diagnostic pop 95 | } 96 | } 97 | 98 | #pragma mark - 控制音量 99 | - (void)bfSetVolume:(float)newVolume { 100 | // 通过控制系统声音 控制音量 101 | newVolume = newVolume > 1 ? 1 : newVolume; 102 | newVolume = newVolume < 0 ? 0 : newVolume; 103 | 104 | if (ZLSystemVersion >= 7) { 105 | [self.volumeViewSlider setValue:newVolume animated:NO]; 106 | } else { 107 | #pragma clang diagnostic push 108 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 109 | // 过期api写在这里不会有警告 110 | [[MPMusicPlayerController applicationMusicPlayer] setVolume:newVolume]; 111 | #pragma clang diagnostic pop 112 | } 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /BrightnessVolumeView/BrightnessVolumeView/resource.bundle/brightness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-zlcode/BrightnessVolumeView/02f7afb47642d290830b8cc88beda5656d626f0b/BrightnessVolumeView/BrightnessVolumeView/resource.bundle/brightness.png -------------------------------------------------------------------------------- /BrightnessVolumeView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0.1 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /BrightnessVolumeView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // BrightnessVolumeView 4 | // 5 | // Created by admin on 2017/4/19. 6 | // Copyright © 2017年 admin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /BrightnessVolumeView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // BrightnessVolumeView 4 | // 5 | // Created by admin on 2017/4/19. 6 | // Copyright © 2017年 admin. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | #import "BrightnessVolumeView.h" 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | // 使用方法一 xib使用 拖一个UIView修改继承类为BrightnessVolumeView就可以了 23 | 24 | // 使用方法二 全代码使用 25 | BrightnessVolumeView *brightnessVolumeView = [[BrightnessVolumeView alloc] initWithFrame:self.view.bounds]; 26 | [self.view addSubview:brightnessVolumeView]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /BrightnessVolumeView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BrightnessVolumeView 4 | // 5 | // Created by admin on 2017/4/19. 6 | // Copyright © 2017年 admin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### 代码示例 2 | 3 | ``` 4 | 5 | // 使用方法一 xib使用 拖一个UIView修改继承类为BrightnessVolumeView就可以了 6 | 7 | // 使用方法二 全代码使用 8 | BrightnessVolumeView *brightnessVolumeView = [[BrightnessVolumeView alloc] initWithFrame:self.view.bounds]; 9 | [self.view addSubview:brightnessVolumeView]; 10 | 11 | ``` 12 | 13 | ### 图片示例: 14 | 15 | ![uiwebview-menu-1](./Screenshot/IMG_1.PNG) 16 | ![uiwebview-menu-1](./Screenshot/IMG_2.PNG) 17 | 18 | [完整代码下载](https://github.com/YiQieSuiYuan/BrightnessVolumeView) 19 | 20 | ### 原理说明 21 | [http://blog.zlcode.com/2017/04/19/ios-brightnessvolumeview/](http://blog.zlcode.com/2017/04/19/ios-brightnessvolumeview/) 22 | 23 | -------------------------------------------------------------------------------- /Screenshot/IMG_1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-zlcode/BrightnessVolumeView/02f7afb47642d290830b8cc88beda5656d626f0b/Screenshot/IMG_1.PNG -------------------------------------------------------------------------------- /Screenshot/IMG_2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-zlcode/BrightnessVolumeView/02f7afb47642d290830b8cc88beda5656d626f0b/Screenshot/IMG_2.PNG --------------------------------------------------------------------------------