├── StitchingImage ├── images.xcassets │ ├── Contents.json │ ├── avatar │ │ ├── Contents.json │ │ ├── 1.imageset │ │ │ ├── 3.png │ │ │ └── Contents.json │ │ ├── 2.imageset │ │ │ ├── 2.jpeg │ │ │ └── Contents.json │ │ ├── 3.imageset │ │ │ ├── 1.jpeg │ │ │ └── Contents.json │ │ ├── 4.imageset │ │ │ ├── 4.jpg │ │ │ └── Contents.json │ │ ├── 5.imageset │ │ │ ├── 5.jpeg │ │ │ └── Contents.json │ │ ├── 6.imageset │ │ │ ├── 6.jpeg │ │ │ └── Contents.json │ │ ├── 7.imageset │ │ │ ├── 7.png │ │ │ └── Contents.json │ │ ├── 8.imageset │ │ │ ├── 8.jpg │ │ │ └── Contents.json │ │ └── 9.imageset │ │ │ ├── 9.jpeg │ │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── ViewController.h ├── AppDelegate.h ├── main.m ├── Classes │ ├── StitchingImage.h │ └── StitchingImage.m ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── AppDelegate.m └── ViewController.m ├── StitchingImage.xcodeproj ├── xcuserdata │ └── zhengjinghua.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── StitchingImage.xcscheme ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── zhengjinghua.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── project.pbxproj ├── Classes ├── StitchingImage.h └── StitchingImage.m ├── StitchingImageTests ├── Info.plist └── StitchingImageTests.m ├── StitchingImageUITests ├── Info.plist └── StitchingImageUITests.m ├── StitchingImage.podspec ├── LICENSE └── README.md /StitchingImage/images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/1.imageset/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/1.imageset/3.png -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/2.imageset/2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/2.imageset/2.jpeg -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/3.imageset/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/3.imageset/1.jpeg -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/4.imageset/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/4.imageset/4.jpg -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/5.imageset/5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/5.imageset/5.jpeg -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/6.imageset/6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/6.imageset/6.jpeg -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/7.imageset/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/7.imageset/7.png -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/8.imageset/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/8.imageset/8.jpg -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/9.imageset/9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage/images.xcassets/avatar/9.imageset/9.jpeg -------------------------------------------------------------------------------- /StitchingImage.xcodeproj/xcuserdata/zhengjinghua.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /StitchingImage.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /StitchingImage.xcodeproj/project.xcworkspace/xcuserdata/zhengjinghua.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengjinghua/StitchingImage/HEAD/StitchingImage.xcodeproj/project.xcworkspace/xcuserdata/zhengjinghua.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /StitchingImage/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /StitchingImage/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. 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 | -------------------------------------------------------------------------------- /StitchingImage/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. 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 | -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "3.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "2.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "1.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "4.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "5.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "6.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "7.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "8.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/avatar/9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "9.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Classes/StitchingImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // StitchImage.h 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface StitchingImage : UIImageView 12 | 13 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews; 14 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews marginValue:(CGFloat)marginValue; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /StitchingImage/Classes/StitchingImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // StitchImage.h 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface StitchingImage : UIImageView 12 | 13 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews; 14 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews marginValue:(CGFloat)marginValue; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /StitchingImageTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /StitchingImageUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /StitchingImage.xcodeproj/xcuserdata/zhengjinghua.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | StitchingImage.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C15035C61BC7B84C00E7818C 16 | 17 | primary 18 | 19 | 20 | C15035DF1BC7B84C00E7818C 21 | 22 | primary 23 | 24 | 25 | C15035EA1BC7B84C00E7818C 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /StitchingImage.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | 4 | s.name = "StitchingImage" 5 | s.version = "1.0" 6 | s.summary = "仿微信群组封面拼接功能" 7 | 8 | s.description = <<-DESC 9 | A longer description of stitchingImage in Markdown format. 10 | 11 | * Think: Why did you write this? What is the focus? What does it do? 12 | * CocoaPods will be using this to generate tags, and improve search results. 13 | * Try to keep it short, snappy and to the point. 14 | * Finally, don't worry about the indent, CocoaPods strips it! 15 | DESC 16 | 17 | s.homepage = "https://github.com/zhengjinghua/StitchingImage" 18 | s.license = "MIT (example)" 19 | s.author = { "Monkey Jin" => "jin114001251@gmail.com" } 20 | s.source = { :git => "https://github.com/zhengjinghua/StitchingImage.git", :tag=>"1.0" } 21 | s.source_files = "Classes", "Classes/**/*.{h,m}" 22 | s.exclude_files = "Classes/Exclude" 23 | 24 | 25 | 26 | end 27 | -------------------------------------------------------------------------------- /StitchingImageTests/StitchingImageTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // StitchingImageTests.m 3 | // StitchingImageTests 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface StitchingImageTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation StitchingImageTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /StitchingImage/images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "3x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "3x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "57x57", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "57x57", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "iphone", 45 | "size" : "60x60", 46 | "scale" : "3x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-present Yannick Loriot 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /StitchingImage/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 19 | CFBundleSignature 20 | ???? 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 | 40 | 41 | -------------------------------------------------------------------------------- /StitchingImageUITests/StitchingImageUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // StitchingImageUITests.m 3 | // StitchingImageUITests 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface StitchingImageUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation StitchingImageUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /StitchingImage/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 | -------------------------------------------------------------------------------- /StitchingImage/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 | -------------------------------------------------------------------------------- /StitchingImage/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. 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 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /StitchingImage/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "StitchingImage.h" 11 | 12 | #define DeviceWidth [UIScreen mainScreen].bounds.size.width 13 | #define DeviceHeight [UIScreen mainScreen].bounds.size.height 14 | 15 | const CGFloat canvasViewSideLength = 100.0f; 16 | 17 | @interface ViewController () 18 | { 19 | CGFloat _beginningY; 20 | CGFloat _canvasViewMargin; 21 | } 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | _canvasViewMargin = (DeviceWidth - canvasViewSideLength * 3) / 4; 30 | _beginningY = (DeviceHeight - canvasViewSideLength * 3 - _canvasViewMargin * 2) / 2; 31 | 32 | [self createCanvasViews]; 33 | } 34 | 35 | - (void)createCanvasViews { 36 | int maxRow = 3; 37 | int maxColumn = 3; 38 | 39 | for (int i = 0; i < 9; i++) { 40 | int row = floor((float)i / maxRow); 41 | int column = i % maxColumn; 42 | 43 | CGFloat originX = _canvasViewMargin + column * canvasViewSideLength + column * _canvasViewMargin; 44 | CGFloat originY = _beginningY + row * canvasViewSideLength + row * _canvasViewMargin; 45 | 46 | UIImageView *canvasView = [[UIImageView alloc] initWithFrame:CGRectMake(originX, originY, canvasViewSideLength, canvasViewSideLength)]; 47 | canvasView.layer.cornerRadius = canvasViewSideLength / 10; 48 | canvasView.layer.masksToBounds = YES; 49 | canvasView.backgroundColor = [UIColor colorWithWhite:0.839 alpha:1.000]; 50 | 51 | int imageViewsCount = i + 1; 52 | UIImageView *exampleView = [self createImageViewWithCanvasView:canvasView withImageViewsCount:imageViewsCount]; 53 | 54 | [self.view addSubview:exampleView]; 55 | } 56 | } 57 | 58 | - (UIImageView *)createImageViewWithCanvasView:(UIImageView *)canvasView withImageViewsCount:(NSInteger)count { 59 | NSMutableArray *imageViews = [[NSMutableArray alloc] init]; 60 | 61 | for (int index = 1; index <= count; index++) { 62 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; 63 | 64 | UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%d", index]]; 65 | imageView.image = image; 66 | 67 | [imageViews addObject:imageView]; 68 | } 69 | 70 | // also can use: 71 | // return [[StitchingImage alloc] stitchingOnImageView:canvasView withImageViews:imageViews marginValue:15.0f]; 72 | return [[StitchingImage alloc] stitchingOnImageView:canvasView withImageViews:imageViews]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /StitchingImage.xcodeproj/xcuserdata/zhengjinghua.xcuserdatad/xcschemes/StitchingImage.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |
3 |  创造不息,交付不止 4 |
5 | 6 | 7 | 8 |

9 | 10 | --- 11 | 12 | [English Guide](https://github.com/zhengjinghua/StitchingImage#readme-english) 13 | 14 | ## 说明 15 | 16 | 类似**微信**群组封面拼接, 适用于聊天项目中, 之前翻遍了整个 Github 没找着, 就自己整了一个, 顺便开源. 17 | 18 | > Made with :heart: by [The EST Group](http://est-group.org) - We design and build: the Future! 19 | 20 | ![](http://ww3.sinaimg.cn/large/6d86d850jw1exg1k5v3fwj20bx0fkdho.jpg) 21 | ![screenshot](http://7xnfdc.com1.z0.glb.clouddn.com/stitchingImageScreenshot.png?imageView2/2/w/375) 22 | 23 | 24 | ## 系统要求 25 | 26 | * iOS7+ project 27 | * ARC project 28 | 29 | ## 安装 30 | 31 | ### CocoaPods 安装 32 | 33 | 将下面代码复制进你的 `Podfile` 文件中 34 | 35 | ``` bash 36 | pod 'StitchingImage', :git => 'https://github.com/zhengjinghua/StitchingImage.git' 37 | ``` 38 | 39 | ### 手工安装 40 | 41 | [下载](https://github.com//zhengjinghua/StitchingImage/archive/master.zip) 此项目, 并将该项目里的 `Classes` 文件夹里的所有文件复制进你的项目中, 然后在需要调用此项目的地方引入 `#import "StitchingImage.h"` . 42 | 43 | ## 使用 44 | 45 | ### 1. 收集头像数组 46 | 47 | ```objective-c 48 | // 将你要拼接的头像文件放入到一个 NSMutableArray 中 49 | NSMutableArray *imageViews = [[NSMutableArray alloc] init]; 50 | 51 | UIImageView *imageView_1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; 52 | imageView_1.image = [UIImage imageNamed:@"1.jpg"]; 53 | [imageViews addObject:imageView_1]; 54 | 55 | UIImageView *imageView_2 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; 56 | imageView_2.image = [UIImage imageNamed:@"2.jpg"]; 57 | [imageViews addObject:imageView_2]; 58 | 59 | ``` 60 | 61 | ### 2. 准备好画布 62 | 63 | ```objective-c 64 | // 生成一个背景 canvasView, 用于存放拼接好的群组封面, 相当于背景. 65 | UIImageView *canvasView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; 66 | canvasView.layer.cornerRadius = 10; 67 | canvasView.layer.masksToBounds = YES; 68 | canvasView.backgroundColor = [UIColor colorWithWhite:0.839 alpha:1.000]; 69 | ``` 70 | 71 | ### 3. 绘画并生成 72 | 73 | ```objective-c 74 | // 现在你可以调用以下方法, 将用户的头像画到指定的 canvasView 上 75 | UIImageView *coverImage = [[StitchingImage alloc] stitchingOnImageView:canvasView withImageViews:imageViews]; 76 | 77 | [self.view addSubview:coverImage]; 78 | ``` 79 | 80 | ### 4. 修改 Margin 81 | 82 | ```objective-c 83 | // 如果你想自定义生成的群组封面里的 margin 值, 你可以调用以下方法 84 | UIImageView *coverImage = [[StitchingImage alloc] stitchingOnImageView:canvasView withImageViews:imageViews marginValue:15.0f]; 85 | 86 | [self.view addSubview:coverImage]; 87 | ``` 88 | 89 | ## 协议 90 | 91 | StitchingImage 被许可在 MIT 协议下使用. 查阅 LICENSE 文件来获得更多信息. 92 | 93 | 94 | --- 95 | README (English) 96 | ========== 97 | 98 | ## Introduction 99 | 100 | Stitching image just like **WeChat** group chat's cover 101 | 102 | > Made with :heart: by [The EST Group](http://est-group.org) - We design and build: the Future! 103 | 104 | ## Requirements 105 | 106 | * iOS7+ project 107 | * ARC project 108 | 109 | ## Install 110 | 111 | ### CocoaPods 112 | 113 | If you're using [CocoaPods](http://cocoapods.org/) (You are not?! You should!!) just add 114 | 115 | ``` bash 116 | pod 'StitchingImage', :git => 'https://github.com/zhengjinghua/StitchingImage.git' 117 | ``` 118 | into your Podfile file. 119 | 120 | ### Manually 121 | 122 | [Download](https://github.com/YannickL/QRCodeReaderViewController/archive/master.zip) the project and copy the `Classes` folder into your project and then simply `#import "StitchingImage.h"` in the file(s) you would like to use it in. 123 | 124 | 125 | ## Usage 126 | 127 | ### 1. Create NSMutableArray for image views 128 | 129 | 130 | ```objective-c 131 | NSMutableArray *imageViews = [[NSMutableArray alloc] init]; 132 | 133 | UIImageView *imageView_1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; 134 | imageView_1.image = [UIImage imageNamed:@"1.jpg"]; 135 | [imageViews addObject:imageView_1]; 136 | 137 | UIImageView *imageView_2 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; 138 | imageView_2.image = [UIImage imageNamed:@"2.jpg"]; 139 | [imageViews addObject:imageView_2]; 140 | 141 | ``` 142 | 143 | ### 2. Create a canvasView 144 | 145 | ```objective-c 146 | UIImageView *canvasView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; 147 | canvasView.layer.cornerRadius = 10; 148 | canvasView.layer.masksToBounds = YES; 149 | canvasView.backgroundColor = [UIColor colorWithWhite:0.839 alpha:1.000]; 150 | ``` 151 | 152 | ### 3. Stitching images 153 | ```objective-c 154 | UIImageView *coverImage = [[StitchingImage alloc] stitchingOnImageView:canvasView withImageViews:imageViews]; 155 | 156 | [self.view addSubview:coverImage]; 157 | ``` 158 | 159 | ### 4. Change margin value 160 | 161 | ```objective-c 162 | UIImageView *coverImage = [[StitchingImage alloc] stitchingOnImageView:canvasView withImageViews:imageViews marginValue:15.0f]; 163 | 164 | [self.view addSubview:coverImage]; 165 | ``` 166 | 167 | ## License 168 | 169 | StitchingImage is available under the MIT license. See the LICENSE file for more info. 170 | 171 | -------------------------------------------------------------------------------- /Classes/StitchingImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // StitchImage.m 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import "StitchingImage.h" 10 | 11 | const CGFloat marginSpaceRatio = 27.0; 12 | 13 | @interface StitchingImage () 14 | { 15 | CGFloat _cellImageViewchrSideLength; 16 | CGFloat _margin; 17 | } 18 | @end 19 | 20 | @implementation StitchingImage 21 | 22 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews { 23 | _margin = canvasView.frame.size.width / marginSpaceRatio; 24 | return [self stitchingOnImageView:canvasView withImageViews:imageViews marginValue:_margin]; 25 | } 26 | 27 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews marginValue:(CGFloat)_marginValue { 28 | _margin = _marginValue; 29 | [self generateImageViewSideLengthWithCanvasView:canvasView byImageViewsCount:imageViews.count]; 30 | 31 | if ([imageViews count] == 1) 32 | { 33 | UIImageView* imageView_1 = imageViews[0]; 34 | imageView_1.frame = CGRectMake(0, 0, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 35 | } 36 | else if ([imageViews count] == 2) 37 | { 38 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength) / 2; 39 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 40 | } 41 | else if ([imageViews count] == 3) 42 | { 43 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2) / 3; 44 | 45 | UIImageView* imageView_1 = imageViews[0]; 46 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - _cellImageViewchrSideLength) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 47 | 48 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 49 | } 50 | else if ([imageViews count] == 4) 51 | { 52 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2) / 3; 53 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 54 | } 55 | else if ([imageViews count] == 5) 56 | { 57 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2 - _margin) / 2; 58 | 59 | UIImageView* imageView_1 = imageViews[0]; 60 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - 2 * _cellImageViewchrSideLength - _margin) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 61 | 62 | UIImageView* imageView_2 = imageViews[1]; 63 | imageView_2.frame = CGRectMake(imageView_1.frame.origin.x + imageView_1.frame.size.width + _margin, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 64 | 65 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 66 | } 67 | else if ([imageViews count] == 6) 68 | { 69 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2 - _margin) / 2; 70 | 71 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 72 | } 73 | else if ([imageViews count] == 7) 74 | { 75 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 3) / 4; 76 | 77 | UIImageView* imageView_1 = imageViews[0]; 78 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - _cellImageViewchrSideLength) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 79 | 80 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 81 | } 82 | else if ([imageViews count] == 8) 83 | { 84 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 3) / 4; 85 | 86 | UIImageView* imageView_1 = imageViews[0]; 87 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - 2 * _cellImageViewchrSideLength - _margin) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 88 | 89 | UIImageView* imageView_2 = imageViews[1]; 90 | imageView_2.frame = CGRectMake(imageView_1.frame.origin.x + imageView_1.frame.size.width + _margin, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 91 | 92 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 93 | 94 | } 95 | else if ([imageViews count] == 9) 96 | { 97 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 3) / 4; 98 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 99 | } 100 | 101 | for (UIImageView *imageView in imageViews) { 102 | [canvasView addSubview:imageView]; 103 | } 104 | 105 | return canvasView; 106 | } 107 | 108 | - (NSArray *)generatorMatrix:(NSArray *)imageViews beginOriginY:(CGFloat)beginOriginY { 109 | int count = (int)imageViews.count; 110 | 111 | int cellCount; 112 | int maxRow; 113 | int maxColumn; 114 | int ignoreCountOfBegining; 115 | 116 | if (count <= 4) 117 | { 118 | maxRow = 2; 119 | maxColumn = 2; 120 | ignoreCountOfBegining = count % 2; 121 | cellCount = 4; 122 | } 123 | else 124 | { 125 | maxRow = 3; 126 | maxColumn = 3; 127 | ignoreCountOfBegining = count % 3; 128 | cellCount = 9; 129 | } 130 | 131 | for (int i = 0; i < cellCount; i++) { 132 | if (i > imageViews.count - 1) break; 133 | if (i < ignoreCountOfBegining) continue; 134 | 135 | int row = floor((float)(i - ignoreCountOfBegining) / maxRow); 136 | int column = (i - ignoreCountOfBegining) % maxColumn; 137 | 138 | CGFloat origin_x = _margin + _cellImageViewchrSideLength * column + _margin * column; 139 | CGFloat origin_y = beginOriginY + _cellImageViewchrSideLength * row + _margin * row; 140 | 141 | UIImageView* imageView = imageViews[i]; 142 | imageView.frame = CGRectMake(origin_x, origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 143 | 144 | } 145 | 146 | return imageViews; 147 | } 148 | 149 | - (void)generateImageViewSideLengthWithCanvasView:(UIView *)canvasView byImageViewsCount:(NSInteger)count { 150 | CGFloat sideLength = 0.0f; 151 | 152 | if (count == 1) { 153 | sideLength = canvasView.frame.size.width; 154 | } else if (count >=2 && count <=4) { 155 | sideLength = (canvasView.frame.size.width - _margin * 3) / 2; 156 | } else { 157 | sideLength = (canvasView.frame.size.width - _margin * 4) / 3; 158 | } 159 | 160 | _cellImageViewchrSideLength = sideLength; 161 | } 162 | @end 163 | -------------------------------------------------------------------------------- /StitchingImage/Classes/StitchingImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // StitchImage.m 3 | // StitchingImage 4 | // 5 | // Created by Jin on 10/9/15. 6 | // Copyright © 2015 Jin. All rights reserved. 7 | // 8 | 9 | #import "StitchingImage.h" 10 | 11 | const CGFloat marginSpaceRatio = 27.0; 12 | 13 | @interface StitchingImage () 14 | { 15 | CGFloat _cellImageViewchrSideLength; 16 | CGFloat _margin; 17 | } 18 | @end 19 | 20 | @implementation StitchingImage 21 | 22 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews { 23 | _margin = canvasView.frame.size.width / marginSpaceRatio; 24 | return [self stitchingOnImageView:canvasView withImageViews:imageViews marginValue:_margin]; 25 | } 26 | 27 | - (UIImageView *)stitchingOnImageView:(UIImageView *)canvasView withImageViews:(NSArray *)imageViews marginValue:(CGFloat)_marginValue { 28 | _margin = _marginValue; 29 | [self generateImageViewSideLengthWithCanvasView:canvasView byImageViewsCount:imageViews.count]; 30 | 31 | if ([imageViews count] == 1) 32 | { 33 | UIImageView* imageView_1 = imageViews[0]; 34 | imageView_1.frame = CGRectMake(0, 0, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 35 | } 36 | else if ([imageViews count] == 2) 37 | { 38 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength) / 2; 39 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 40 | } 41 | else if ([imageViews count] == 3) 42 | { 43 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2) / 3; 44 | 45 | UIImageView* imageView_1 = imageViews[0]; 46 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - _cellImageViewchrSideLength) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 47 | 48 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 49 | } 50 | else if ([imageViews count] == 4) 51 | { 52 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2) / 3; 53 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 54 | } 55 | else if ([imageViews count] == 5) 56 | { 57 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2 - _margin) / 2; 58 | 59 | UIImageView* imageView_1 = imageViews[0]; 60 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - 2 * _cellImageViewchrSideLength - _margin) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 61 | 62 | UIImageView* imageView_2 = imageViews[1]; 63 | imageView_2.frame = CGRectMake(imageView_1.frame.origin.x + imageView_1.frame.size.width + _margin, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 64 | 65 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 66 | } 67 | else if ([imageViews count] == 6) 68 | { 69 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 2 - _margin) / 2; 70 | 71 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 72 | } 73 | else if ([imageViews count] == 7) 74 | { 75 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 3) / 4; 76 | 77 | UIImageView* imageView_1 = imageViews[0]; 78 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - _cellImageViewchrSideLength) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 79 | 80 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 81 | } 82 | else if ([imageViews count] == 8) 83 | { 84 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 3) / 4; 85 | 86 | UIImageView* imageView_1 = imageViews[0]; 87 | imageView_1.frame = CGRectMake((canvasView.frame.size.width - 2 * _cellImageViewchrSideLength - _margin) / 2, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 88 | 89 | UIImageView* imageView_2 = imageViews[1]; 90 | imageView_2.frame = CGRectMake(imageView_1.frame.origin.x + imageView_1.frame.size.width + _margin, row_1_origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 91 | 92 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y + _cellImageViewchrSideLength + _margin]; 93 | 94 | } 95 | else if ([imageViews count] == 9) 96 | { 97 | CGFloat row_1_origin_y = (canvasView.frame.size.height - _cellImageViewchrSideLength * 3) / 4; 98 | imageViews = [self generatorMatrix:imageViews beginOriginY:row_1_origin_y]; 99 | } 100 | 101 | for (UIImageView *imageView in imageViews) { 102 | [canvasView addSubview:imageView]; 103 | } 104 | 105 | return canvasView; 106 | } 107 | 108 | - (NSArray *)generatorMatrix:(NSArray *)imageViews beginOriginY:(CGFloat)beginOriginY { 109 | int count = (int)imageViews.count; 110 | 111 | int cellCount; 112 | int maxRow; 113 | int maxColumn; 114 | int ignoreCountOfBegining; 115 | 116 | if (count <= 4) 117 | { 118 | maxRow = 2; 119 | maxColumn = 2; 120 | ignoreCountOfBegining = count % 2; 121 | cellCount = 4; 122 | } 123 | else 124 | { 125 | maxRow = 3; 126 | maxColumn = 3; 127 | ignoreCountOfBegining = count % 3; 128 | cellCount = 9; 129 | } 130 | 131 | for (int i = 0; i < cellCount; i++) { 132 | if (i > imageViews.count - 1) break; 133 | if (i < ignoreCountOfBegining) continue; 134 | 135 | int row = floor((float)(i - ignoreCountOfBegining) / maxRow); 136 | int column = (i - ignoreCountOfBegining) % maxColumn; 137 | 138 | CGFloat origin_x = _margin + _cellImageViewchrSideLength * column + _margin * column; 139 | CGFloat origin_y = beginOriginY + _cellImageViewchrSideLength * row + _margin * row; 140 | 141 | UIImageView* imageView = imageViews[i]; 142 | imageView.frame = CGRectMake(origin_x, origin_y, _cellImageViewchrSideLength, _cellImageViewchrSideLength); 143 | 144 | } 145 | 146 | return imageViews; 147 | } 148 | 149 | - (void)generateImageViewSideLengthWithCanvasView:(UIView *)canvasView byImageViewsCount:(NSInteger)count { 150 | CGFloat sideLength = 0.0f; 151 | 152 | if (count == 1) { 153 | sideLength = canvasView.frame.size.width; 154 | } else if (count >=2 && count <=4) { 155 | sideLength = (canvasView.frame.size.width - _margin * 3) / 2; 156 | } else { 157 | sideLength = (canvasView.frame.size.width - _margin * 4) / 3; 158 | } 159 | 160 | _cellImageViewchrSideLength = sideLength; 161 | } 162 | @end 163 | -------------------------------------------------------------------------------- /StitchingImage.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C10498B41BE21476002AE2EA /* StitchingImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C10498B31BE21476002AE2EA /* StitchingImage.m */; }; 11 | C15035CC1BC7B84C00E7818C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C15035CB1BC7B84C00E7818C /* main.m */; }; 12 | C15035CF1BC7B84C00E7818C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C15035CE1BC7B84C00E7818C /* AppDelegate.m */; }; 13 | C15035D21BC7B84C00E7818C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C15035D11BC7B84C00E7818C /* ViewController.m */; }; 14 | C15035D51BC7B84C00E7818C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C15035D31BC7B84C00E7818C /* Main.storyboard */; }; 15 | C15035DA1BC7B84C00E7818C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C15035D81BC7B84C00E7818C /* LaunchScreen.storyboard */; }; 16 | C15035E51BC7B84C00E7818C /* StitchingImageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C15035E41BC7B84C00E7818C /* StitchingImageTests.m */; }; 17 | C15035F01BC7B84C00E7818C /* StitchingImageUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = C15035EF1BC7B84C00E7818C /* StitchingImageUITests.m */; }; 18 | C17ED0CF1BDB2AAF00B56E86 /* images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C17ED0CE1BDB2AAF00B56E86 /* images.xcassets */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | C15035E11BC7B84C00E7818C /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = C15035BF1BC7B84C00E7818C /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = C15035C61BC7B84C00E7818C; 27 | remoteInfo = StitchingImage; 28 | }; 29 | C15035EC1BC7B84C00E7818C /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = C15035BF1BC7B84C00E7818C /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = C15035C61BC7B84C00E7818C; 34 | remoteInfo = StitchingImage; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | C10498B21BE21476002AE2EA /* StitchingImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StitchingImage.h; sourceTree = ""; }; 40 | C10498B31BE21476002AE2EA /* StitchingImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StitchingImage.m; sourceTree = ""; }; 41 | C15035C71BC7B84C00E7818C /* StitchingImage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StitchingImage.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | C15035CB1BC7B84C00E7818C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 43 | C15035CD1BC7B84C00E7818C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 44 | C15035CE1BC7B84C00E7818C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 45 | C15035D01BC7B84C00E7818C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 46 | C15035D11BC7B84C00E7818C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 47 | C15035D41BC7B84C00E7818C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 48 | C15035D91BC7B84C00E7818C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | C15035DB1BC7B84C00E7818C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | C15035E01BC7B84C00E7818C /* StitchingImageTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StitchingImageTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | C15035E41BC7B84C00E7818C /* StitchingImageTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StitchingImageTests.m; sourceTree = ""; }; 52 | C15035E61BC7B84C00E7818C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | C15035EB1BC7B84C00E7818C /* StitchingImageUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StitchingImageUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | C15035EF1BC7B84C00E7818C /* StitchingImageUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StitchingImageUITests.m; sourceTree = ""; }; 55 | C15035F11BC7B84C00E7818C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | C17ED0CE1BDB2AAF00B56E86 /* images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = images.xcassets; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | C15035C41BC7B84C00E7818C /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | C15035DD1BC7B84C00E7818C /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | C15035E81BC7B84C00E7818C /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | C10498B11BE21476002AE2EA /* Classes */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | C10498B21BE21476002AE2EA /* StitchingImage.h */, 88 | C10498B31BE21476002AE2EA /* StitchingImage.m */, 89 | ); 90 | path = Classes; 91 | sourceTree = ""; 92 | }; 93 | C15035BE1BC7B84C00E7818C = { 94 | isa = PBXGroup; 95 | children = ( 96 | C15035C91BC7B84C00E7818C /* StitchingImage */, 97 | C15035E31BC7B84C00E7818C /* StitchingImageTests */, 98 | C15035EE1BC7B84C00E7818C /* StitchingImageUITests */, 99 | C15035C81BC7B84C00E7818C /* Products */, 100 | ); 101 | sourceTree = ""; 102 | }; 103 | C15035C81BC7B84C00E7818C /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | C15035C71BC7B84C00E7818C /* StitchingImage.app */, 107 | C15035E01BC7B84C00E7818C /* StitchingImageTests.xctest */, 108 | C15035EB1BC7B84C00E7818C /* StitchingImageUITests.xctest */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | C15035C91BC7B84C00E7818C /* StitchingImage */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | C10498B11BE21476002AE2EA /* Classes */, 117 | C15035CD1BC7B84C00E7818C /* AppDelegate.h */, 118 | C15035CE1BC7B84C00E7818C /* AppDelegate.m */, 119 | C15035D01BC7B84C00E7818C /* ViewController.h */, 120 | C15035D11BC7B84C00E7818C /* ViewController.m */, 121 | C15035D31BC7B84C00E7818C /* Main.storyboard */, 122 | C15035D81BC7B84C00E7818C /* LaunchScreen.storyboard */, 123 | C15035DB1BC7B84C00E7818C /* Info.plist */, 124 | C15035CA1BC7B84C00E7818C /* Supporting Files */, 125 | C17ED0CE1BDB2AAF00B56E86 /* images.xcassets */, 126 | ); 127 | path = StitchingImage; 128 | sourceTree = ""; 129 | }; 130 | C15035CA1BC7B84C00E7818C /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | C15035CB1BC7B84C00E7818C /* main.m */, 134 | ); 135 | name = "Supporting Files"; 136 | sourceTree = ""; 137 | }; 138 | C15035E31BC7B84C00E7818C /* StitchingImageTests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | C15035E41BC7B84C00E7818C /* StitchingImageTests.m */, 142 | C15035E61BC7B84C00E7818C /* Info.plist */, 143 | ); 144 | path = StitchingImageTests; 145 | sourceTree = ""; 146 | }; 147 | C15035EE1BC7B84C00E7818C /* StitchingImageUITests */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | C15035EF1BC7B84C00E7818C /* StitchingImageUITests.m */, 151 | C15035F11BC7B84C00E7818C /* Info.plist */, 152 | ); 153 | path = StitchingImageUITests; 154 | sourceTree = ""; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | C15035C61BC7B84C00E7818C /* StitchingImage */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = C15035F41BC7B84C00E7818C /* Build configuration list for PBXNativeTarget "StitchingImage" */; 162 | buildPhases = ( 163 | C15035C31BC7B84C00E7818C /* Sources */, 164 | C15035C41BC7B84C00E7818C /* Frameworks */, 165 | C15035C51BC7B84C00E7818C /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = StitchingImage; 172 | productName = StitchingImage; 173 | productReference = C15035C71BC7B84C00E7818C /* StitchingImage.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | C15035DF1BC7B84C00E7818C /* StitchingImageTests */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = C15035F71BC7B84C00E7818C /* Build configuration list for PBXNativeTarget "StitchingImageTests" */; 179 | buildPhases = ( 180 | C15035DC1BC7B84C00E7818C /* Sources */, 181 | C15035DD1BC7B84C00E7818C /* Frameworks */, 182 | C15035DE1BC7B84C00E7818C /* Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | C15035E21BC7B84C00E7818C /* PBXTargetDependency */, 188 | ); 189 | name = StitchingImageTests; 190 | productName = StitchingImageTests; 191 | productReference = C15035E01BC7B84C00E7818C /* StitchingImageTests.xctest */; 192 | productType = "com.apple.product-type.bundle.unit-test"; 193 | }; 194 | C15035EA1BC7B84C00E7818C /* StitchingImageUITests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = C15035FA1BC7B84C00E7818C /* Build configuration list for PBXNativeTarget "StitchingImageUITests" */; 197 | buildPhases = ( 198 | C15035E71BC7B84C00E7818C /* Sources */, 199 | C15035E81BC7B84C00E7818C /* Frameworks */, 200 | C15035E91BC7B84C00E7818C /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | C15035ED1BC7B84C00E7818C /* PBXTargetDependency */, 206 | ); 207 | name = StitchingImageUITests; 208 | productName = StitchingImageUITests; 209 | productReference = C15035EB1BC7B84C00E7818C /* StitchingImageUITests.xctest */; 210 | productType = "com.apple.product-type.bundle.ui-testing"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | C15035BF1BC7B84C00E7818C /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 0700; 219 | ORGANIZATIONNAME = Jin; 220 | TargetAttributes = { 221 | C15035C61BC7B84C00E7818C = { 222 | CreatedOnToolsVersion = 7.0; 223 | DevelopmentTeam = ZQA8RKS39U; 224 | }; 225 | C15035DF1BC7B84C00E7818C = { 226 | CreatedOnToolsVersion = 7.0; 227 | TestTargetID = C15035C61BC7B84C00E7818C; 228 | }; 229 | C15035EA1BC7B84C00E7818C = { 230 | CreatedOnToolsVersion = 7.0; 231 | TestTargetID = C15035C61BC7B84C00E7818C; 232 | }; 233 | }; 234 | }; 235 | buildConfigurationList = C15035C21BC7B84C00E7818C /* Build configuration list for PBXProject "StitchingImage" */; 236 | compatibilityVersion = "Xcode 3.2"; 237 | developmentRegion = English; 238 | hasScannedForEncodings = 0; 239 | knownRegions = ( 240 | en, 241 | Base, 242 | ); 243 | mainGroup = C15035BE1BC7B84C00E7818C; 244 | productRefGroup = C15035C81BC7B84C00E7818C /* Products */; 245 | projectDirPath = ""; 246 | projectRoot = ""; 247 | targets = ( 248 | C15035C61BC7B84C00E7818C /* StitchingImage */, 249 | C15035DF1BC7B84C00E7818C /* StitchingImageTests */, 250 | C15035EA1BC7B84C00E7818C /* StitchingImageUITests */, 251 | ); 252 | }; 253 | /* End PBXProject section */ 254 | 255 | /* Begin PBXResourcesBuildPhase section */ 256 | C15035C51BC7B84C00E7818C /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | C17ED0CF1BDB2AAF00B56E86 /* images.xcassets in Resources */, 261 | C15035DA1BC7B84C00E7818C /* LaunchScreen.storyboard in Resources */, 262 | C15035D51BC7B84C00E7818C /* Main.storyboard in Resources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | C15035DE1BC7B84C00E7818C /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | C15035E91BC7B84C00E7818C /* Resources */ = { 274 | isa = PBXResourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXResourcesBuildPhase section */ 281 | 282 | /* Begin PBXSourcesBuildPhase section */ 283 | C15035C31BC7B84C00E7818C /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | C15035D21BC7B84C00E7818C /* ViewController.m in Sources */, 288 | C15035CF1BC7B84C00E7818C /* AppDelegate.m in Sources */, 289 | C15035CC1BC7B84C00E7818C /* main.m in Sources */, 290 | C10498B41BE21476002AE2EA /* StitchingImage.m in Sources */, 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | }; 294 | C15035DC1BC7B84C00E7818C /* Sources */ = { 295 | isa = PBXSourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | C15035E51BC7B84C00E7818C /* StitchingImageTests.m in Sources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | C15035E71BC7B84C00E7818C /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | C15035F01BC7B84C00E7818C /* StitchingImageUITests.m in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | /* End PBXSourcesBuildPhase section */ 311 | 312 | /* Begin PBXTargetDependency section */ 313 | C15035E21BC7B84C00E7818C /* PBXTargetDependency */ = { 314 | isa = PBXTargetDependency; 315 | target = C15035C61BC7B84C00E7818C /* StitchingImage */; 316 | targetProxy = C15035E11BC7B84C00E7818C /* PBXContainerItemProxy */; 317 | }; 318 | C15035ED1BC7B84C00E7818C /* PBXTargetDependency */ = { 319 | isa = PBXTargetDependency; 320 | target = C15035C61BC7B84C00E7818C /* StitchingImage */; 321 | targetProxy = C15035EC1BC7B84C00E7818C /* PBXContainerItemProxy */; 322 | }; 323 | /* End PBXTargetDependency section */ 324 | 325 | /* Begin PBXVariantGroup section */ 326 | C15035D31BC7B84C00E7818C /* Main.storyboard */ = { 327 | isa = PBXVariantGroup; 328 | children = ( 329 | C15035D41BC7B84C00E7818C /* Base */, 330 | ); 331 | name = Main.storyboard; 332 | sourceTree = ""; 333 | }; 334 | C15035D81BC7B84C00E7818C /* LaunchScreen.storyboard */ = { 335 | isa = PBXVariantGroup; 336 | children = ( 337 | C15035D91BC7B84C00E7818C /* Base */, 338 | ); 339 | name = LaunchScreen.storyboard; 340 | sourceTree = ""; 341 | }; 342 | /* End PBXVariantGroup section */ 343 | 344 | /* Begin XCBuildConfiguration section */ 345 | C15035F21BC7B84C00E7818C /* Debug */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | ALWAYS_SEARCH_USER_PATHS = NO; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 360 | CLANG_WARN_UNREACHABLE_CODE = YES; 361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 363 | COPY_PHASE_STRIP = NO; 364 | DEBUG_INFORMATION_FORMAT = dwarf; 365 | ENABLE_STRICT_OBJC_MSGSEND = YES; 366 | ENABLE_TESTABILITY = YES; 367 | GCC_C_LANGUAGE_STANDARD = gnu99; 368 | GCC_DYNAMIC_NO_PIC = NO; 369 | GCC_NO_COMMON_BLOCKS = YES; 370 | GCC_OPTIMIZATION_LEVEL = 0; 371 | GCC_PREPROCESSOR_DEFINITIONS = ( 372 | "DEBUG=1", 373 | "$(inherited)", 374 | ); 375 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 376 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 377 | GCC_WARN_UNDECLARED_SELECTOR = YES; 378 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 379 | GCC_WARN_UNUSED_FUNCTION = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 382 | MTL_ENABLE_DEBUG_INFO = YES; 383 | ONLY_ACTIVE_ARCH = YES; 384 | SDKROOT = iphoneos; 385 | }; 386 | name = Debug; 387 | }; 388 | C15035F31BC7B84C00E7818C /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BOOL_CONVERSION = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INT_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN_UNREACHABLE_CODE = YES; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 406 | COPY_PHASE_STRIP = NO; 407 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 408 | ENABLE_NS_ASSERTIONS = NO; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | GCC_C_LANGUAGE_STANDARD = gnu99; 411 | GCC_NO_COMMON_BLOCKS = YES; 412 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 413 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 414 | GCC_WARN_UNDECLARED_SELECTOR = YES; 415 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 416 | GCC_WARN_UNUSED_FUNCTION = YES; 417 | GCC_WARN_UNUSED_VARIABLE = YES; 418 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 419 | MTL_ENABLE_DEBUG_INFO = NO; 420 | SDKROOT = iphoneos; 421 | VALIDATE_PRODUCT = YES; 422 | }; 423 | name = Release; 424 | }; 425 | C15035F51BC7B84C00E7818C /* Debug */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 429 | CODE_SIGN_IDENTITY = "iPhone Developer"; 430 | INFOPLIST_FILE = StitchingImage/Info.plist; 431 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 432 | PRODUCT_BUNDLE_IDENTIFIER = com.monkey.StitchingImage; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | }; 435 | name = Debug; 436 | }; 437 | C15035F61BC7B84C00E7818C /* Release */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 441 | CODE_SIGN_IDENTITY = "iPhone Developer"; 442 | INFOPLIST_FILE = StitchingImage/Info.plist; 443 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 444 | PRODUCT_BUNDLE_IDENTIFIER = com.monkey.StitchingImage; 445 | PRODUCT_NAME = "$(TARGET_NAME)"; 446 | }; 447 | name = Release; 448 | }; 449 | C15035F81BC7B84C00E7818C /* Debug */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | BUNDLE_LOADER = "$(TEST_HOST)"; 453 | INFOPLIST_FILE = StitchingImageTests/Info.plist; 454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 455 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyujiaoer.StitchingImageTests; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StitchingImage.app/StitchingImage"; 458 | }; 459 | name = Debug; 460 | }; 461 | C15035F91BC7B84C00E7818C /* Release */ = { 462 | isa = XCBuildConfiguration; 463 | buildSettings = { 464 | BUNDLE_LOADER = "$(TEST_HOST)"; 465 | INFOPLIST_FILE = StitchingImageTests/Info.plist; 466 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 467 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyujiaoer.StitchingImageTests; 468 | PRODUCT_NAME = "$(TARGET_NAME)"; 469 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StitchingImage.app/StitchingImage"; 470 | }; 471 | name = Release; 472 | }; 473 | C15035FB1BC7B84C00E7818C /* Debug */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | INFOPLIST_FILE = StitchingImageUITests/Info.plist; 477 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 478 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyujiaoer.StitchingImageUITests; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | TEST_TARGET_NAME = StitchingImage; 481 | USES_XCTRUNNER = YES; 482 | }; 483 | name = Debug; 484 | }; 485 | C15035FC1BC7B84C00E7818C /* Release */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | INFOPLIST_FILE = StitchingImageUITests/Info.plist; 489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 490 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyujiaoer.StitchingImageUITests; 491 | PRODUCT_NAME = "$(TARGET_NAME)"; 492 | TEST_TARGET_NAME = StitchingImage; 493 | USES_XCTRUNNER = YES; 494 | }; 495 | name = Release; 496 | }; 497 | /* End XCBuildConfiguration section */ 498 | 499 | /* Begin XCConfigurationList section */ 500 | C15035C21BC7B84C00E7818C /* Build configuration list for PBXProject "StitchingImage" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | C15035F21BC7B84C00E7818C /* Debug */, 504 | C15035F31BC7B84C00E7818C /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | C15035F41BC7B84C00E7818C /* Build configuration list for PBXNativeTarget "StitchingImage" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | C15035F51BC7B84C00E7818C /* Debug */, 513 | C15035F61BC7B84C00E7818C /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | C15035F71BC7B84C00E7818C /* Build configuration list for PBXNativeTarget "StitchingImageTests" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | C15035F81BC7B84C00E7818C /* Debug */, 522 | C15035F91BC7B84C00E7818C /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | C15035FA1BC7B84C00E7818C /* Build configuration list for PBXNativeTarget "StitchingImageUITests" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | C15035FB1BC7B84C00E7818C /* Debug */, 531 | C15035FC1BC7B84C00E7818C /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = C15035BF1BC7B84C00E7818C /* Project object */; 539 | } 540 | --------------------------------------------------------------------------------