├── 2017-08-29 17_06_50.gif ├── README.md ├── SelectPhoto.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── jixiang.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── jixiang.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── SelectPhoto.xcscheme │ └── xcschememanagement.plist └── SelectPhoto ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json └── 大头像.imageset │ ├── Contents.json │ └── 大头像@2x.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── SelectPhotoManager ├── SelectPhotoManager.h └── SelectPhotoManager.m ├── ViewController.h ├── ViewController.m └── main.m /2017-08-29 17_06_50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jixiang0903/SelectPhoto/b428f85cc58973c8f2c912a1cb87c380f98e051c/2017-08-29 17_06_50.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SelectPhoto 2 | 一个简单的类,实现从相册选择照片,修改头像 3 | 4 | ![](https://github.com/jixiang0903/SelectPhoto/blob/master/2017-08-29%2017_06_50.gif) 5 | -------------------------------------------------------------------------------- /SelectPhoto.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CB3B0A791F553EA3007F77E7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3B0A781F553EA3007F77E7 /* main.m */; }; 11 | CB3B0A7C1F553EA3007F77E7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3B0A7B1F553EA3007F77E7 /* AppDelegate.m */; }; 12 | CB3B0A7F1F553EA3007F77E7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3B0A7E1F553EA3007F77E7 /* ViewController.m */; }; 13 | CB3B0A821F553EA3007F77E7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB3B0A801F553EA3007F77E7 /* Main.storyboard */; }; 14 | CB3B0A841F553EA3007F77E7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB3B0A831F553EA3007F77E7 /* Assets.xcassets */; }; 15 | CB3B0A871F553EA3007F77E7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB3B0A851F553EA3007F77E7 /* LaunchScreen.storyboard */; }; 16 | CB3B0A971F553FF2007F77E7 /* SelectPhotoManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3B0A961F553FF2007F77E7 /* SelectPhotoManager.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | CB3B0A741F553EA3007F77E7 /* SelectPhoto.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SelectPhoto.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | CB3B0A781F553EA3007F77E7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 22 | CB3B0A7A1F553EA3007F77E7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | CB3B0A7B1F553EA3007F77E7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | CB3B0A7D1F553EA3007F77E7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 25 | CB3B0A7E1F553EA3007F77E7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 26 | CB3B0A811F553EA3007F77E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | CB3B0A831F553EA3007F77E7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | CB3B0A861F553EA3007F77E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | CB3B0A881F553EA3007F77E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | CB3B0A951F553FF2007F77E7 /* SelectPhotoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectPhotoManager.h; sourceTree = ""; }; 31 | CB3B0A961F553FF2007F77E7 /* SelectPhotoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectPhotoManager.m; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | CB3B0A711F553EA3007F77E7 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | CB3B0A6B1F553EA3007F77E7 = { 46 | isa = PBXGroup; 47 | children = ( 48 | CB3B0A761F553EA3007F77E7 /* SelectPhoto */, 49 | CB3B0A751F553EA3007F77E7 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | CB3B0A751F553EA3007F77E7 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | CB3B0A741F553EA3007F77E7 /* SelectPhoto.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | CB3B0A761F553EA3007F77E7 /* SelectPhoto */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | CB3B0A7A1F553EA3007F77E7 /* AppDelegate.h */, 65 | CB3B0A7B1F553EA3007F77E7 /* AppDelegate.m */, 66 | CB3B0A7D1F553EA3007F77E7 /* ViewController.h */, 67 | CB3B0A7E1F553EA3007F77E7 /* ViewController.m */, 68 | CB3B0A8E1F553F31007F77E7 /* SelectPhotoManager */, 69 | CB3B0A801F553EA3007F77E7 /* Main.storyboard */, 70 | CB3B0A831F553EA3007F77E7 /* Assets.xcassets */, 71 | CB3B0A851F553EA3007F77E7 /* LaunchScreen.storyboard */, 72 | CB3B0A881F553EA3007F77E7 /* Info.plist */, 73 | CB3B0A771F553EA3007F77E7 /* Supporting Files */, 74 | ); 75 | path = SelectPhoto; 76 | sourceTree = ""; 77 | }; 78 | CB3B0A771F553EA3007F77E7 /* Supporting Files */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | CB3B0A781F553EA3007F77E7 /* main.m */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | CB3B0A8E1F553F31007F77E7 /* SelectPhotoManager */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | CB3B0A951F553FF2007F77E7 /* SelectPhotoManager.h */, 90 | CB3B0A961F553FF2007F77E7 /* SelectPhotoManager.m */, 91 | ); 92 | path = SelectPhotoManager; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | CB3B0A731F553EA3007F77E7 /* SelectPhoto */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = CB3B0A8B1F553EA3007F77E7 /* Build configuration list for PBXNativeTarget "SelectPhoto" */; 101 | buildPhases = ( 102 | CB3B0A701F553EA3007F77E7 /* Sources */, 103 | CB3B0A711F553EA3007F77E7 /* Frameworks */, 104 | CB3B0A721F553EA3007F77E7 /* Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = SelectPhoto; 111 | productName = SelectPhoto; 112 | productReference = CB3B0A741F553EA3007F77E7 /* SelectPhoto.app */; 113 | productType = "com.apple.product-type.application"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | CB3B0A6C1F553EA3007F77E7 /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastUpgradeCheck = 0830; 122 | ORGANIZATIONNAME = jixiang; 123 | TargetAttributes = { 124 | CB3B0A731F553EA3007F77E7 = { 125 | CreatedOnToolsVersion = 8.3.3; 126 | ProvisioningStyle = Automatic; 127 | }; 128 | }; 129 | }; 130 | buildConfigurationList = CB3B0A6F1F553EA3007F77E7 /* Build configuration list for PBXProject "SelectPhoto" */; 131 | compatibilityVersion = "Xcode 3.2"; 132 | developmentRegion = English; 133 | hasScannedForEncodings = 0; 134 | knownRegions = ( 135 | en, 136 | Base, 137 | ); 138 | mainGroup = CB3B0A6B1F553EA3007F77E7; 139 | productRefGroup = CB3B0A751F553EA3007F77E7 /* Products */; 140 | projectDirPath = ""; 141 | projectRoot = ""; 142 | targets = ( 143 | CB3B0A731F553EA3007F77E7 /* SelectPhoto */, 144 | ); 145 | }; 146 | /* End PBXProject section */ 147 | 148 | /* Begin PBXResourcesBuildPhase section */ 149 | CB3B0A721F553EA3007F77E7 /* Resources */ = { 150 | isa = PBXResourcesBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | CB3B0A871F553EA3007F77E7 /* LaunchScreen.storyboard in Resources */, 154 | CB3B0A841F553EA3007F77E7 /* Assets.xcassets in Resources */, 155 | CB3B0A821F553EA3007F77E7 /* Main.storyboard in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXSourcesBuildPhase section */ 162 | CB3B0A701F553EA3007F77E7 /* Sources */ = { 163 | isa = PBXSourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | CB3B0A7F1F553EA3007F77E7 /* ViewController.m in Sources */, 167 | CB3B0A7C1F553EA3007F77E7 /* AppDelegate.m in Sources */, 168 | CB3B0A791F553EA3007F77E7 /* main.m in Sources */, 169 | CB3B0A971F553FF2007F77E7 /* SelectPhotoManager.m in Sources */, 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | }; 173 | /* End PBXSourcesBuildPhase section */ 174 | 175 | /* Begin PBXVariantGroup section */ 176 | CB3B0A801F553EA3007F77E7 /* Main.storyboard */ = { 177 | isa = PBXVariantGroup; 178 | children = ( 179 | CB3B0A811F553EA3007F77E7 /* Base */, 180 | ); 181 | name = Main.storyboard; 182 | sourceTree = ""; 183 | }; 184 | CB3B0A851F553EA3007F77E7 /* LaunchScreen.storyboard */ = { 185 | isa = PBXVariantGroup; 186 | children = ( 187 | CB3B0A861F553EA3007F77E7 /* Base */, 188 | ); 189 | name = LaunchScreen.storyboard; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXVariantGroup section */ 193 | 194 | /* Begin XCBuildConfiguration section */ 195 | CB3B0A891F553EA3007F77E7 /* Debug */ = { 196 | isa = XCBuildConfiguration; 197 | buildSettings = { 198 | ALWAYS_SEARCH_USER_PATHS = NO; 199 | CLANG_ANALYZER_NONNULL = YES; 200 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 201 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 202 | CLANG_CXX_LIBRARY = "libc++"; 203 | CLANG_ENABLE_MODULES = YES; 204 | CLANG_ENABLE_OBJC_ARC = YES; 205 | CLANG_WARN_BOOL_CONVERSION = YES; 206 | CLANG_WARN_CONSTANT_CONVERSION = YES; 207 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 208 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 209 | CLANG_WARN_EMPTY_BODY = YES; 210 | CLANG_WARN_ENUM_CONVERSION = YES; 211 | CLANG_WARN_INFINITE_RECURSION = YES; 212 | CLANG_WARN_INT_CONVERSION = YES; 213 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 214 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 215 | CLANG_WARN_UNREACHABLE_CODE = YES; 216 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 217 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 218 | COPY_PHASE_STRIP = NO; 219 | DEBUG_INFORMATION_FORMAT = dwarf; 220 | ENABLE_STRICT_OBJC_MSGSEND = YES; 221 | ENABLE_TESTABILITY = YES; 222 | GCC_C_LANGUAGE_STANDARD = gnu99; 223 | GCC_DYNAMIC_NO_PIC = NO; 224 | GCC_NO_COMMON_BLOCKS = YES; 225 | GCC_OPTIMIZATION_LEVEL = 0; 226 | GCC_PREPROCESSOR_DEFINITIONS = ( 227 | "DEBUG=1", 228 | "$(inherited)", 229 | ); 230 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 231 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 232 | GCC_WARN_UNDECLARED_SELECTOR = YES; 233 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 234 | GCC_WARN_UNUSED_FUNCTION = YES; 235 | GCC_WARN_UNUSED_VARIABLE = YES; 236 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 237 | MTL_ENABLE_DEBUG_INFO = YES; 238 | ONLY_ACTIVE_ARCH = YES; 239 | SDKROOT = iphoneos; 240 | TARGETED_DEVICE_FAMILY = "1,2"; 241 | }; 242 | name = Debug; 243 | }; 244 | CB3B0A8A1F553EA3007F77E7 /* Release */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | ALWAYS_SEARCH_USER_PATHS = NO; 248 | CLANG_ANALYZER_NONNULL = YES; 249 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_WARN_BOOL_CONVERSION = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 257 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INFINITE_RECURSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 263 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 264 | CLANG_WARN_UNREACHABLE_CODE = YES; 265 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | COPY_PHASE_STRIP = NO; 268 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 269 | ENABLE_NS_ASSERTIONS = NO; 270 | ENABLE_STRICT_OBJC_MSGSEND = YES; 271 | GCC_C_LANGUAGE_STANDARD = gnu99; 272 | GCC_NO_COMMON_BLOCKS = YES; 273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 275 | GCC_WARN_UNDECLARED_SELECTOR = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 277 | GCC_WARN_UNUSED_FUNCTION = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 280 | MTL_ENABLE_DEBUG_INFO = NO; 281 | SDKROOT = iphoneos; 282 | TARGETED_DEVICE_FAMILY = "1,2"; 283 | VALIDATE_PRODUCT = YES; 284 | }; 285 | name = Release; 286 | }; 287 | CB3B0A8C1F553EA3007F77E7 /* Debug */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | INFOPLIST_FILE = SelectPhoto/Info.plist; 292 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 293 | PRODUCT_BUNDLE_IDENTIFIER = com.jixinagruyi.SelectPhoto; 294 | PRODUCT_NAME = "$(TARGET_NAME)"; 295 | }; 296 | name = Debug; 297 | }; 298 | CB3B0A8D1F553EA3007F77E7 /* Release */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 302 | INFOPLIST_FILE = SelectPhoto/Info.plist; 303 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 304 | PRODUCT_BUNDLE_IDENTIFIER = com.jixinagruyi.SelectPhoto; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | }; 307 | name = Release; 308 | }; 309 | /* End XCBuildConfiguration section */ 310 | 311 | /* Begin XCConfigurationList section */ 312 | CB3B0A6F1F553EA3007F77E7 /* Build configuration list for PBXProject "SelectPhoto" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | CB3B0A891F553EA3007F77E7 /* Debug */, 316 | CB3B0A8A1F553EA3007F77E7 /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | CB3B0A8B1F553EA3007F77E7 /* Build configuration list for PBXNativeTarget "SelectPhoto" */ = { 322 | isa = XCConfigurationList; 323 | buildConfigurations = ( 324 | CB3B0A8C1F553EA3007F77E7 /* Debug */, 325 | CB3B0A8D1F553EA3007F77E7 /* Release */, 326 | ); 327 | defaultConfigurationIsVisible = 0; 328 | }; 329 | /* End XCConfigurationList section */ 330 | }; 331 | rootObject = CB3B0A6C1F553EA3007F77E7 /* Project object */; 332 | } 333 | -------------------------------------------------------------------------------- /SelectPhoto.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SelectPhoto.xcodeproj/project.xcworkspace/xcuserdata/jixiang.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jixiang0903/SelectPhoto/b428f85cc58973c8f2c912a1cb87c380f98e051c/SelectPhoto.xcodeproj/project.xcworkspace/xcuserdata/jixiang.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SelectPhoto.xcodeproj/xcuserdata/jixiang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SelectPhoto.xcodeproj/xcuserdata/jixiang.xcuserdatad/xcschemes/SelectPhoto.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 | -------------------------------------------------------------------------------- /SelectPhoto.xcodeproj/xcuserdata/jixiang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SelectPhoto.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | CB3B0A731F553EA3007F77E7 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SelectPhoto/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SelectPhoto 4 | // 5 | // Created by 吉祥 on 2017/8/29. 6 | // Copyright © 2017年 jixiang. 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 | -------------------------------------------------------------------------------- /SelectPhoto/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SelectPhoto 4 | // 5 | // Created by 吉祥 on 2017/8/29. 6 | // Copyright © 2017年 jixiang. 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 | -------------------------------------------------------------------------------- /SelectPhoto/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /SelectPhoto/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SelectPhoto/Assets.xcassets/大头像.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "大头像@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SelectPhoto/Assets.xcassets/大头像.imageset/大头像@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jixiang0903/SelectPhoto/b428f85cc58973c8f2c912a1cb87c380f98e051c/SelectPhoto/Assets.xcassets/大头像.imageset/大头像@2x.png -------------------------------------------------------------------------------- /SelectPhoto/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 | -------------------------------------------------------------------------------- /SelectPhoto/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /SelectPhoto/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPhotoLibraryUsageDescription 6 | App需要您的同意才能读取媒体资料库 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /SelectPhoto/SelectPhotoManager/SelectPhotoManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SelectPhotoManager.h 3 | // SelectPhoto 4 | // 5 | // Created by 吉祥 on 2017/8/29. 6 | // Copyright © 2017年 jixiang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | typedef enum { 12 | PhotoCamera = 0, 13 | PhotoAlbum, 14 | }SelectPhotoType; 15 | 16 | @protocol selectPhotoDelegate 17 | //照片选取成功 18 | - (void)selectPhotoManagerDidFinishImage:(UIImage *)image; 19 | //照片选取失败 20 | - (void)selectPhotoManagerDidError:(NSError *)error; 21 | 22 | @end 23 | 24 | @interface SelectPhotoManager : NSObject 25 | 26 | //代理对象 27 | @property(nonatomic, weak)__weak iddelegate; 28 | //是否开启照片编辑功能 29 | @property(nonatomic, assign)BOOL canEditPhoto; 30 | //跳转的控制器 可选参数 31 | @property(nonatomic, weak)__weak UIViewController *superVC; 32 | 33 | //照片选取成功回调 34 | @property(nonatomic, strong)void (^successHandle)(SelectPhotoManager *manager, UIImage *image); 35 | //照片选取失败回调 36 | @property(nonatomic, strong)void (^errorHandle)(NSString *error); 37 | 38 | //开始选取照片 39 | - (void)startSelectPhotoWithImageName:(NSString *)imageName; 40 | - (void)startSelectPhotoWithType:(SelectPhotoType )type andImageName:(NSString *)imageName; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /SelectPhoto/SelectPhotoManager/SelectPhotoManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // SelectPhotoManager.m 3 | // SelectPhoto 4 | // 5 | // Created by 吉祥 on 2017/8/29. 6 | // Copyright © 2017年 jixiang. All rights reserved. 7 | // 8 | 9 | #import "SelectPhotoManager.h" 10 | 11 | @implementation SelectPhotoManager { 12 | //图片名 13 | NSString *_imageName; 14 | } 15 | 16 | - (instancetype)init { 17 | self = [super init]; 18 | if (self) { 19 | _canEditPhoto = YES; 20 | } 21 | return self; 22 | } 23 | 24 | //开始选择照片 25 | - (void)startSelectPhotoWithImageName:(NSString *)imageName{ 26 | _imageName = imageName; 27 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"修改我的头像" message:nil preferredStyle: UIAlertControllerStyleActionSheet]; 28 | UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; 29 | [alertController addAction: [UIAlertAction actionWithTitle: @"拍照" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action) { 30 | [self selectPhotoWithType:0]; 31 | }]]; 32 | [alertController addAction: [UIAlertAction actionWithTitle: @"从相册获取" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action) { 33 | [self selectPhotoWithType:1]; 34 | }]]; 35 | [alertController addAction:cancelAction]; 36 | [[self getCurrentVC] presentViewController:alertController animated:YES completion:nil]; 37 | } 38 | 39 | //根据类型选取照片 40 | - (void)startSelectPhotoWithType:(SelectPhotoType)type andImageName:(NSString *)imageName { 41 | _imageName = imageName; 42 | UIImagePickerController *ipVC = [[UIImagePickerController alloc] init]; 43 | //设置跳转方式 44 | ipVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 45 | 46 | if (_canEditPhoto) { 47 | //设置是否可对图片进行编辑 48 | ipVC.allowsEditing = YES; 49 | } 50 | 51 | ipVC.delegate = self; 52 | if (type == PhotoCamera) { 53 | NSLog(@"相机"); 54 | BOOL isCamera = [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear]; 55 | if (!isCamera) { 56 | NSLog(@"没有摄像头"); 57 | if (_errorHandle) { 58 | _errorHandle(@"没有摄像头"); 59 | } 60 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"您的设备不支持拍照" preferredStyle:UIAlertControllerStyleAlert]; 61 | [alertController addAction: [UIAlertAction actionWithTitle: @"确定" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action) { 62 | }]]; 63 | [[self getCurrentVC] presentViewController:alertController animated:YES completion:nil]; 64 | return ; 65 | }else{ 66 | ipVC.sourceType = UIImagePickerControllerSourceTypeCamera; 67 | } 68 | }else{ 69 | NSLog(@"相册"); 70 | ipVC.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 71 | } 72 | 73 | [[self getCurrentVC] presentViewController:ipVC animated:YES completion:nil]; 74 | } 75 | //获取当前屏幕显示的viewcontroller 76 | - (UIViewController *)getCurrentVC { 77 | 78 | if (_superVC) { 79 | return _superVC; 80 | } 81 | UIViewController *result = nil; 82 | 83 | UIWindow * window = [[UIApplication sharedApplication] keyWindow]; 84 | if (window.windowLevel != UIWindowLevelNormal) 85 | { 86 | NSArray *windows = [[UIApplication sharedApplication] windows]; 87 | for(UIWindow * tmpWin in windows) 88 | { 89 | if (tmpWin.windowLevel == UIWindowLevelNormal) 90 | { 91 | window = tmpWin; 92 | break; 93 | } 94 | } 95 | } 96 | 97 | UIView *frontView = [[window subviews] objectAtIndex:0]; 98 | id nextResponder = [frontView nextResponder]; 99 | 100 | if ([nextResponder isKindOfClass:[UIViewController class]]) { 101 | result = nextResponder; 102 | 103 | }else{ 104 | result = window.rootViewController; 105 | } 106 | return result; 107 | } 108 | 109 | #pragma mark 方法 110 | -(void)selectPhotoWithType:(int)type { 111 | if (type == 2) { 112 | NSLog(@"取消"); 113 | 114 | }else{ 115 | UIImagePickerController *ipVC = [[UIImagePickerController alloc] init]; 116 | //设置跳转方式 117 | ipVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 118 | 119 | if (_canEditPhoto) { 120 | //设置是否可对图片进行编辑 121 | ipVC.allowsEditing = YES; 122 | } 123 | 124 | ipVC.delegate = self; 125 | if (type == 0) { 126 | NSLog(@"相机"); 127 | BOOL isCamera = [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear]; 128 | if (!isCamera) { 129 | NSLog(@"没有摄像头"); 130 | if (_errorHandle) { 131 | _errorHandle(@"没有摄像头"); 132 | } 133 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"您的设备不支持拍照" preferredStyle:UIAlertControllerStyleAlert]; 134 | [alertController addAction: [UIAlertAction actionWithTitle: @"确定" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action) { 135 | }]]; 136 | [[self getCurrentVC] presentViewController:alertController animated:YES completion:nil]; 137 | return ; 138 | }else{ 139 | ipVC.sourceType = UIImagePickerControllerSourceTypeCamera; 140 | } 141 | }else{ 142 | NSLog(@"相册"); 143 | ipVC.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 144 | 145 | } 146 | [[self getCurrentVC] presentViewController:ipVC animated:YES completion:nil]; 147 | } 148 | } 149 | 150 | #pragma mark -----------------imagePickerController协议方法 151 | - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ 152 | NSLog(@"info = %@",info); 153 | UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"]; 154 | if (image == nil) { 155 | image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; 156 | } 157 | //图片旋转 158 | if (image.imageOrientation != UIImageOrientationUp) { 159 | //图片旋转 160 | image = [self fixOrientation:image]; 161 | } 162 | if (_imageName==nil || _imageName.length == 0) { 163 | //获取当前时间,生成图片路径 164 | NSDate *date = [NSDate date]; 165 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 166 | [formatter setDateStyle:NSDateFormatterMediumStyle]; 167 | [formatter setTimeStyle:NSDateFormatterShortStyle]; 168 | [formatter setDateFormat:@"YYYY-MM-dd hh:mm:ss"]; 169 | NSString *dateStr = [formatter stringFromDate:date]; 170 | _imageName = [NSString stringWithFormat:@"photo_%@.png",dateStr]; 171 | } 172 | 173 | [[self getCurrentVC] dismissViewControllerAnimated:YES completion:nil]; 174 | 175 | if (_delegate && [_delegate respondsToSelector:@selector(selectPhotoManagerDidFinishImage:)]) { 176 | [_delegate selectPhotoManagerDidFinishImage:image]; 177 | } 178 | 179 | if (_successHandle) { 180 | _successHandle(self,image); 181 | } 182 | } 183 | 184 | - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { 185 | 186 | [[self getCurrentVC] dismissViewControllerAnimated:YES completion:nil]; 187 | if (_delegate && [_delegate respondsToSelector:@selector(selectPhotoManagerDidError:)]) { 188 | [_delegate selectPhotoManagerDidError:nil]; 189 | } 190 | if (_errorHandle) { 191 | _errorHandle(@"撤销"); 192 | } 193 | } 194 | 195 | #pragma mark 图片处理方法 196 | //图片旋转处理 197 | - (UIImage *)fixOrientation:(UIImage *)aImage { 198 | CGAffineTransform transform = CGAffineTransformIdentity; 199 | 200 | switch (aImage.imageOrientation) { 201 | case UIImageOrientationDown: 202 | case UIImageOrientationDownMirrored: 203 | transform = CGAffineTransformTranslate(transform, aImage.size.width, aImage.size.height); 204 | transform = CGAffineTransformRotate(transform, M_PI); 205 | break; 206 | 207 | case UIImageOrientationLeft: 208 | case UIImageOrientationLeftMirrored: 209 | transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); 210 | transform = CGAffineTransformRotate(transform, M_PI_2); 211 | break; 212 | 213 | case UIImageOrientationRight: 214 | case UIImageOrientationRightMirrored: 215 | transform = CGAffineTransformTranslate(transform, 0, aImage.size.height); 216 | transform = CGAffineTransformRotate(transform, -M_PI_2); 217 | break; 218 | default: 219 | break; 220 | } 221 | 222 | switch (aImage.imageOrientation) { 223 | case UIImageOrientationUpMirrored: 224 | case UIImageOrientationDownMirrored: 225 | transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); 226 | transform = CGAffineTransformScale(transform, -1, 1); 227 | break; 228 | 229 | case UIImageOrientationLeftMirrored: 230 | case UIImageOrientationRightMirrored: 231 | transform = CGAffineTransformTranslate(transform, aImage.size.height, 0); 232 | transform = CGAffineTransformScale(transform, -1, 1); 233 | break; 234 | default: 235 | break; 236 | } 237 | 238 | // Now we draw the underlying CGImage into a new context, applying the transform 239 | // calculated above. 240 | CGContextRef ctx = CGBitmapContextCreate(NULL, aImage.size.width, aImage.size.height, 241 | CGImageGetBitsPerComponent(aImage.CGImage), 0, 242 | CGImageGetColorSpace(aImage.CGImage), 243 | CGImageGetBitmapInfo(aImage.CGImage)); 244 | CGContextConcatCTM(ctx, transform); 245 | switch (aImage.imageOrientation) { 246 | case UIImageOrientationLeft: 247 | case UIImageOrientationLeftMirrored: 248 | case UIImageOrientationRight: 249 | case UIImageOrientationRightMirrored: 250 | // Grr... 251 | CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.height,aImage.size.width), aImage.CGImage); 252 | break; 253 | 254 | default: 255 | CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.width,aImage.size.height), aImage.CGImage); 256 | break; 257 | } 258 | // And now we just create a new UIImage from the drawing context 259 | CGImageRef cgimg = CGBitmapContextCreateImage(ctx); 260 | UIImage *img = [UIImage imageWithCGImage:cgimg]; 261 | CGContextRelease(ctx); 262 | CGImageRelease(cgimg); 263 | return img; 264 | } 265 | 266 | @end 267 | 268 | -------------------------------------------------------------------------------- /SelectPhoto/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SelectPhoto 4 | // 5 | // Created by 吉祥 on 2017/8/29. 6 | // Copyright © 2017年 jixiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SelectPhoto/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SelectPhoto 4 | // 5 | // Created by 吉祥 on 2017/8/29. 6 | // Copyright © 2017年 jixiang. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "SelectPhotoManager.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet UIImageView *headerImage; 14 | @property (nonatomic, strong)SelectPhotoManager *photoManager; 15 | @end 16 | 17 | @implementation ViewController 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | [self setHead]; 21 | } 22 | //头像点击事件 23 | -(void)tapClick:(UITapGestureRecognizer *)recognizer{ 24 | 25 | if (!_photoManager) { 26 | _photoManager =[[SelectPhotoManager alloc]init]; 27 | } 28 | [_photoManager startSelectPhotoWithImageName:@"选择头像"]; 29 | __weak typeof(self)mySelf=self; 30 | //选取照片成功 31 | _photoManager.successHandle=^(SelectPhotoManager *manager,UIImage *image){ 32 | 33 | mySelf.headerImage.image = image; 34 | //保存到本地 35 | NSData *data = UIImagePNGRepresentation(image); 36 | [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"headerImage"]; 37 | }; 38 | } 39 | 40 | -(void)setHead{ 41 | _headerImage.userInteractionEnabled=YES; 42 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)]; 43 | [_headerImage addGestureRecognizer:tap]; 44 | //这里是从本地取的,如果是上线项目一定要从服务器取头像地址加载 45 | UIImage *img = [UIImage imageWithData:[[NSUserDefaults standardUserDefaults] objectForKey:@"headerImage"]]; 46 | if (img) { 47 | _headerImage.image = img; 48 | } 49 | } 50 | 51 | 52 | - (void)didReceiveMemoryWarning { 53 | [super didReceiveMemoryWarning]; 54 | // Dispose of any resources that can be recreated. 55 | } 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /SelectPhoto/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SelectPhoto 4 | // 5 | // Created by 吉祥 on 2017/8/29. 6 | // Copyright © 2017年 jixiang. 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 | --------------------------------------------------------------------------------