├── UIScrollView极限优化demo
├── Images.xcassets
│ ├── img0.imageset
│ │ ├── img0.png
│ │ └── Contents.json
│ ├── img1.imageset
│ │ ├── img1.png
│ │ └── Contents.json
│ ├── img2.imageset
│ │ ├── img2.png
│ │ └── Contents.json
│ ├── img3.imageset
│ │ ├── img3.png
│ │ └── Contents.json
│ ├── img4.imageset
│ │ ├── img4.png
│ │ └── Contents.json
│ ├── LaunchImage.launchimage
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── ViewController.h
├── AppDelegate.h
├── main.m
├── Base.lproj
│ └── Main.storyboard
├── Info.plist
├── AppDelegate.m
└── ViewController.m
├── UIScrollView极限优化demo.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── wgj.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── UIScrollView极限优化demo.xcscheme
└── project.pbxproj
└── UIScrollView极限优化demoTests
├── Info.plist
└── UIScrollView____demoTests.m
/UIScrollView极限优化demo/Images.xcassets/img0.imageset/img0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devgj/UIScrollView-demo/HEAD/UIScrollView极限优化demo/Images.xcassets/img0.imageset/img0.png
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img1.imageset/img1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devgj/UIScrollView-demo/HEAD/UIScrollView极限优化demo/Images.xcassets/img1.imageset/img1.png
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img2.imageset/img2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devgj/UIScrollView-demo/HEAD/UIScrollView极限优化demo/Images.xcassets/img2.imageset/img2.png
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img3.imageset/img3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devgj/UIScrollView-demo/HEAD/UIScrollView极限优化demo/Images.xcassets/img3.imageset/img3.png
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img4.imageset/img4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devgj/UIScrollView-demo/HEAD/UIScrollView极限优化demo/Images.xcassets/img4.imageset/img4.png
--------------------------------------------------------------------------------
/UIScrollView极限优化demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // UIScrollView极限优化demo
4 | //
5 | // Created by imooc_gj on 15/6/6.
6 | // Copyright (c) 2015年 devgj. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // UIScrollView极限优化demo
4 | //
5 | // Created by imooc_gj on 15/6/6.
6 | // Copyright (c) 2015年 devgj. 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 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // UIScrollView极限优化demo
4 | //
5 | // Created by imooc_gj on 15/6/6.
6 | // Copyright (c) 2015年 devgj. 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 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img0.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x",
6 | "filename" : "img0.png"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x",
6 | "filename" : "img1.png"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x",
6 | "filename" : "img2.png"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x",
6 | "filename" : "img3.png"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/img4.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x",
6 | "filename" : "img4.png"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIScrollView极限优化demo.xcodeproj/xcuserdata/wgj.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | UIScrollView极限优化demo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | F24A6D581B23052D00303B3F
16 |
17 | primary
18 |
19 |
20 | F24A6D711B23052D00303B3F
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.devgj.$(PRODUCT_NAME:rfc1034identifier)
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 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demoTests/UIScrollView____demoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIScrollView____demoTests.m
3 | // UIScrollView极限优化demoTests
4 | //
5 | // Created by imooc_gj on 15/6/6.
6 | // Copyright (c) 2015年 devgj. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface UIScrollView____demoTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation UIScrollView____demoTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "ipad",
6 | "minimum-system-version" : "7.0",
7 | "extent" : "full-screen",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "landscape",
12 | "idiom" : "ipad",
13 | "minimum-system-version" : "7.0",
14 | "extent" : "full-screen",
15 | "scale" : "1x"
16 | },
17 | {
18 | "orientation" : "landscape",
19 | "idiom" : "ipad",
20 | "minimum-system-version" : "7.0",
21 | "extent" : "full-screen",
22 | "scale" : "2x"
23 | },
24 | {
25 | "orientation" : "portrait",
26 | "idiom" : "iphone",
27 | "minimum-system-version" : "7.0",
28 | "scale" : "2x"
29 | },
30 | {
31 | "orientation" : "portrait",
32 | "idiom" : "iphone",
33 | "minimum-system-version" : "7.0",
34 | "subtype" : "retina4",
35 | "scale" : "2x"
36 | },
37 | {
38 | "orientation" : "portrait",
39 | "idiom" : "ipad",
40 | "minimum-system-version" : "7.0",
41 | "extent" : "full-screen",
42 | "scale" : "1x"
43 | }
44 | ],
45 | "info" : {
46 | "version" : 1,
47 | "author" : "xcode"
48 | }
49 | }
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/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 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.devgj.$(PRODUCT_NAME:rfc1034identifier)
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 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // UIScrollView极限优化demo
4 | //
5 | // Created by imooc_gj on 15/6/6.
6 | // Copyright (c) 2015年 devgj. 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 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // UIScrollView极限优化demo
4 | //
5 | // Created by imooc_gj on 15/6/6.
6 | // Copyright (c) 2015年 devgj. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | /**
14 | * 保存可见的视图
15 | */
16 | @property (nonatomic, strong) NSMutableSet *visibleImageViews;
17 |
18 | /**
19 | * 保存可重用的
20 | */
21 | @property (nonatomic, strong) NSMutableSet *reusedImageViews;
22 |
23 | /**
24 | * 滚动视图
25 | */
26 | @property (nonatomic, weak) UIScrollView *scrollView;
27 |
28 | /**
29 | * 所有的图片名
30 | */
31 | @property (nonatomic, strong) NSArray *imageNames;
32 |
33 | @end
34 |
35 | @implementation ViewController
36 |
37 | #pragma mark - Life Cycle
38 |
39 | - (void)viewDidLoad {
40 | [super viewDidLoad];
41 |
42 | // 添加UIScrollView
43 | [self setupScrollView];
44 | }
45 |
46 | #pragma mark Init Views
47 |
48 | // 添加UIScrollView
49 | - (void)setupScrollView {
50 | UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
51 | scrollView.pagingEnabled = YES;
52 | scrollView.delegate = self;
53 | scrollView.showsHorizontalScrollIndicator = NO;
54 | scrollView.showsVerticalScrollIndicator = NO;
55 | scrollView.contentSize = CGSizeMake(self.imageNames.count * CGRectGetWidth(scrollView.frame), 0);
56 | [self.view addSubview:scrollView];
57 | _scrollView = scrollView;
58 | [self showImageViewAtIndex:0];
59 | }
60 |
61 | #pragma mark - UIScrollViewDelegate
62 |
63 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
64 | [self showImages];
65 | [self test];
66 | }
67 |
68 | - (void)test {
69 | NSMutableString *rs = [NSMutableString string];
70 | NSInteger count = [self.scrollView.subviews count];
71 | for (UIImageView *imageView in self.scrollView.subviews) {
72 | [rs appendFormat:@"%p - ", imageView];
73 | }
74 | [rs appendFormat:@"%ld", (long)count];
75 | NSLog(@"%@", rs);
76 | }
77 |
78 | #pragma mark - Private Method
79 |
80 | - (void)showImages {
81 |
82 | // 获取当前处于显示范围内的图片的索引
83 | CGRect visibleBounds = self.scrollView.bounds;
84 | CGFloat minX = CGRectGetMinX(visibleBounds);
85 | CGFloat maxX = CGRectGetMaxX(visibleBounds);
86 | CGFloat width = CGRectGetWidth(visibleBounds);
87 |
88 | NSInteger firstIndex = (NSInteger)floorf(minX / width);
89 | NSInteger lastIndex = (NSInteger)floorf(maxX / width);
90 |
91 | // 处理越界的情况
92 | if (firstIndex < 0) {
93 | firstIndex = 0;
94 | }
95 |
96 | if (lastIndex >= [self.imageNames count]) {
97 | lastIndex = [self.imageNames count] - 1;
98 | }
99 |
100 | // 回收不再显示的ImageView
101 | NSInteger imageViewIndex = 0;
102 | for (UIImageView *imageView in self.visibleImageViews) {
103 | imageViewIndex = imageView.tag;
104 | // 不在显示范围内
105 | if (imageViewIndex < firstIndex || imageViewIndex > lastIndex) {
106 | [self.reusedImageViews addObject:imageView];
107 | [imageView removeFromSuperview];
108 | }
109 | }
110 |
111 | [self.visibleImageViews minusSet:self.reusedImageViews];
112 |
113 | // 是否需要显示新的视图
114 | for (NSInteger index = firstIndex; index <= lastIndex; index++) {
115 | BOOL isShow = NO;
116 |
117 | for (UIImageView *imageView in self.visibleImageViews) {
118 | if (imageView.tag == index) {
119 | isShow = YES;
120 | }
121 | }
122 |
123 | if (!isShow) {
124 | [self showImageViewAtIndex:index];
125 | }
126 | }
127 | }
128 |
129 | // 显示一个图片view
130 | - (void)showImageViewAtIndex:(NSInteger)index {
131 |
132 | UIImageView *imageView = [self.reusedImageViews anyObject];
133 |
134 | if (imageView) {
135 | [self.reusedImageViews removeObject:imageView];
136 | } else {
137 | imageView = [[UIImageView alloc] init];
138 | imageView.contentMode = UIViewContentModeScaleAspectFit;
139 | }
140 |
141 | CGRect bounds = self.scrollView.bounds;
142 | CGRect imageViewFrame = bounds;
143 | imageViewFrame.origin.x = CGRectGetWidth(bounds) * index;
144 | imageView.tag = index;
145 | imageView.frame = imageViewFrame;
146 | imageView.image = [UIImage imageNamed:self.imageNames[index]];
147 |
148 | [self.visibleImageViews addObject:imageView];
149 | [self.scrollView addSubview:imageView];
150 | }
151 |
152 | #pragma mark - Getters and Setters
153 |
154 | - (NSArray *)imageNames {
155 | if (_imageNames == nil) {
156 | NSMutableArray *imageNames = [NSMutableArray arrayWithCapacity:50];
157 |
158 | for (int i = 0; i < 50; i++) {
159 | NSString *imageName = [NSString stringWithFormat:@"img%d", i % 5];
160 | [imageNames addObject:imageName];
161 | }
162 |
163 | _imageNames = imageNames;
164 | }
165 | return _imageNames;
166 | }
167 |
168 | - (NSMutableSet *)visibleImageViews {
169 | if (_visibleImageViews == nil) {
170 | _visibleImageViews = [[NSMutableSet alloc] init];
171 | }
172 | return _visibleImageViews;
173 | }
174 |
175 | - (NSMutableSet *)reusedImageViews {
176 | if (_reusedImageViews == nil) {
177 | _reusedImageViews = [[NSMutableSet alloc] init];
178 | }
179 | return _reusedImageViews;
180 | }
181 |
182 | @end
183 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo.xcodeproj/xcuserdata/wgj.xcuserdatad/xcschemes/UIScrollView极限优化demo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/UIScrollView极限优化demo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | F24A6D5F1B23052D00303B3F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F24A6D5E1B23052D00303B3F /* main.m */; };
11 | F24A6D621B23052D00303B3F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F24A6D611B23052D00303B3F /* AppDelegate.m */; };
12 | F24A6D651B23052D00303B3F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F24A6D641B23052D00303B3F /* ViewController.m */; };
13 | F24A6D681B23052D00303B3F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F24A6D661B23052D00303B3F /* Main.storyboard */; };
14 | F24A6D6A1B23052D00303B3F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F24A6D691B23052D00303B3F /* Images.xcassets */; };
15 | F24A6D791B23052D00303B3F /* UIScrollView____demoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F24A6D781B23052D00303B3F /* UIScrollView____demoTests.m */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXContainerItemProxy section */
19 | F24A6D731B23052D00303B3F /* PBXContainerItemProxy */ = {
20 | isa = PBXContainerItemProxy;
21 | containerPortal = F24A6D511B23052C00303B3F /* Project object */;
22 | proxyType = 1;
23 | remoteGlobalIDString = F24A6D581B23052D00303B3F;
24 | remoteInfo = "UIScrollView极限优化demo";
25 | };
26 | /* End PBXContainerItemProxy section */
27 |
28 | /* Begin PBXFileReference section */
29 | F24A6D591B23052D00303B3F /* UIScrollView极限优化demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "UIScrollView极限优化demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
30 | F24A6D5D1B23052D00303B3F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | F24A6D5E1B23052D00303B3F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
32 | F24A6D601B23052D00303B3F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
33 | F24A6D611B23052D00303B3F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
34 | F24A6D631B23052D00303B3F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
35 | F24A6D641B23052D00303B3F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
36 | F24A6D671B23052D00303B3F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
37 | F24A6D691B23052D00303B3F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
38 | F24A6D721B23052D00303B3F /* UIScrollView极限优化demoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UIScrollView极限优化demoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
39 | F24A6D771B23052D00303B3F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
40 | F24A6D781B23052D00303B3F /* UIScrollView____demoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView____demoTests.m"; sourceTree = ""; };
41 | /* End PBXFileReference section */
42 |
43 | /* Begin PBXFrameworksBuildPhase section */
44 | F24A6D561B23052D00303B3F /* Frameworks */ = {
45 | isa = PBXFrameworksBuildPhase;
46 | buildActionMask = 2147483647;
47 | files = (
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | F24A6D6F1B23052D00303B3F /* Frameworks */ = {
52 | isa = PBXFrameworksBuildPhase;
53 | buildActionMask = 2147483647;
54 | files = (
55 | );
56 | runOnlyForDeploymentPostprocessing = 0;
57 | };
58 | /* End PBXFrameworksBuildPhase section */
59 |
60 | /* Begin PBXGroup section */
61 | F24A6D501B23052C00303B3F = {
62 | isa = PBXGroup;
63 | children = (
64 | F24A6D5B1B23052D00303B3F /* UIScrollView极限优化demo */,
65 | F24A6D751B23052D00303B3F /* UIScrollView极限优化demoTests */,
66 | F24A6D5A1B23052D00303B3F /* Products */,
67 | );
68 | sourceTree = "";
69 | };
70 | F24A6D5A1B23052D00303B3F /* Products */ = {
71 | isa = PBXGroup;
72 | children = (
73 | F24A6D591B23052D00303B3F /* UIScrollView极限优化demo.app */,
74 | F24A6D721B23052D00303B3F /* UIScrollView极限优化demoTests.xctest */,
75 | );
76 | name = Products;
77 | sourceTree = "";
78 | };
79 | F24A6D5B1B23052D00303B3F /* UIScrollView极限优化demo */ = {
80 | isa = PBXGroup;
81 | children = (
82 | F24A6D601B23052D00303B3F /* AppDelegate.h */,
83 | F24A6D611B23052D00303B3F /* AppDelegate.m */,
84 | F24A6D631B23052D00303B3F /* ViewController.h */,
85 | F24A6D641B23052D00303B3F /* ViewController.m */,
86 | F24A6D661B23052D00303B3F /* Main.storyboard */,
87 | F24A6D691B23052D00303B3F /* Images.xcassets */,
88 | F24A6D5C1B23052D00303B3F /* Supporting Files */,
89 | );
90 | path = "UIScrollView极限优化demo";
91 | sourceTree = "";
92 | };
93 | F24A6D5C1B23052D00303B3F /* Supporting Files */ = {
94 | isa = PBXGroup;
95 | children = (
96 | F24A6D5D1B23052D00303B3F /* Info.plist */,
97 | F24A6D5E1B23052D00303B3F /* main.m */,
98 | );
99 | name = "Supporting Files";
100 | sourceTree = "";
101 | };
102 | F24A6D751B23052D00303B3F /* UIScrollView极限优化demoTests */ = {
103 | isa = PBXGroup;
104 | children = (
105 | F24A6D781B23052D00303B3F /* UIScrollView____demoTests.m */,
106 | F24A6D761B23052D00303B3F /* Supporting Files */,
107 | );
108 | path = "UIScrollView极限优化demoTests";
109 | sourceTree = "";
110 | };
111 | F24A6D761B23052D00303B3F /* Supporting Files */ = {
112 | isa = PBXGroup;
113 | children = (
114 | F24A6D771B23052D00303B3F /* Info.plist */,
115 | );
116 | name = "Supporting Files";
117 | sourceTree = "";
118 | };
119 | /* End PBXGroup section */
120 |
121 | /* Begin PBXNativeTarget section */
122 | F24A6D581B23052D00303B3F /* UIScrollView极限优化demo */ = {
123 | isa = PBXNativeTarget;
124 | buildConfigurationList = F24A6D7C1B23052D00303B3F /* Build configuration list for PBXNativeTarget "UIScrollView极限优化demo" */;
125 | buildPhases = (
126 | F24A6D551B23052D00303B3F /* Sources */,
127 | F24A6D561B23052D00303B3F /* Frameworks */,
128 | F24A6D571B23052D00303B3F /* Resources */,
129 | );
130 | buildRules = (
131 | );
132 | dependencies = (
133 | );
134 | name = "UIScrollView极限优化demo";
135 | productName = "UIScrollView极限优化demo";
136 | productReference = F24A6D591B23052D00303B3F /* UIScrollView极限优化demo.app */;
137 | productType = "com.apple.product-type.application";
138 | };
139 | F24A6D711B23052D00303B3F /* UIScrollView极限优化demoTests */ = {
140 | isa = PBXNativeTarget;
141 | buildConfigurationList = F24A6D7F1B23052D00303B3F /* Build configuration list for PBXNativeTarget "UIScrollView极限优化demoTests" */;
142 | buildPhases = (
143 | F24A6D6E1B23052D00303B3F /* Sources */,
144 | F24A6D6F1B23052D00303B3F /* Frameworks */,
145 | F24A6D701B23052D00303B3F /* Resources */,
146 | );
147 | buildRules = (
148 | );
149 | dependencies = (
150 | F24A6D741B23052D00303B3F /* PBXTargetDependency */,
151 | );
152 | name = "UIScrollView极限优化demoTests";
153 | productName = "UIScrollView极限优化demoTests";
154 | productReference = F24A6D721B23052D00303B3F /* UIScrollView极限优化demoTests.xctest */;
155 | productType = "com.apple.product-type.bundle.unit-test";
156 | };
157 | /* End PBXNativeTarget section */
158 |
159 | /* Begin PBXProject section */
160 | F24A6D511B23052C00303B3F /* Project object */ = {
161 | isa = PBXProject;
162 | attributes = {
163 | LastUpgradeCheck = 0630;
164 | ORGANIZATIONNAME = devgj;
165 | TargetAttributes = {
166 | F24A6D581B23052D00303B3F = {
167 | CreatedOnToolsVersion = 6.3.1;
168 | };
169 | F24A6D711B23052D00303B3F = {
170 | CreatedOnToolsVersion = 6.3.1;
171 | TestTargetID = F24A6D581B23052D00303B3F;
172 | };
173 | };
174 | };
175 | buildConfigurationList = F24A6D541B23052C00303B3F /* Build configuration list for PBXProject "UIScrollView极限优化demo" */;
176 | compatibilityVersion = "Xcode 3.2";
177 | developmentRegion = English;
178 | hasScannedForEncodings = 0;
179 | knownRegions = (
180 | en,
181 | Base,
182 | );
183 | mainGroup = F24A6D501B23052C00303B3F;
184 | productRefGroup = F24A6D5A1B23052D00303B3F /* Products */;
185 | projectDirPath = "";
186 | projectRoot = "";
187 | targets = (
188 | F24A6D581B23052D00303B3F /* UIScrollView极限优化demo */,
189 | F24A6D711B23052D00303B3F /* UIScrollView极限优化demoTests */,
190 | );
191 | };
192 | /* End PBXProject section */
193 |
194 | /* Begin PBXResourcesBuildPhase section */
195 | F24A6D571B23052D00303B3F /* Resources */ = {
196 | isa = PBXResourcesBuildPhase;
197 | buildActionMask = 2147483647;
198 | files = (
199 | F24A6D681B23052D00303B3F /* Main.storyboard in Resources */,
200 | F24A6D6A1B23052D00303B3F /* Images.xcassets in Resources */,
201 | );
202 | runOnlyForDeploymentPostprocessing = 0;
203 | };
204 | F24A6D701B23052D00303B3F /* Resources */ = {
205 | isa = PBXResourcesBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | );
209 | runOnlyForDeploymentPostprocessing = 0;
210 | };
211 | /* End PBXResourcesBuildPhase section */
212 |
213 | /* Begin PBXSourcesBuildPhase section */
214 | F24A6D551B23052D00303B3F /* Sources */ = {
215 | isa = PBXSourcesBuildPhase;
216 | buildActionMask = 2147483647;
217 | files = (
218 | F24A6D651B23052D00303B3F /* ViewController.m in Sources */,
219 | F24A6D621B23052D00303B3F /* AppDelegate.m in Sources */,
220 | F24A6D5F1B23052D00303B3F /* main.m in Sources */,
221 | );
222 | runOnlyForDeploymentPostprocessing = 0;
223 | };
224 | F24A6D6E1B23052D00303B3F /* Sources */ = {
225 | isa = PBXSourcesBuildPhase;
226 | buildActionMask = 2147483647;
227 | files = (
228 | F24A6D791B23052D00303B3F /* UIScrollView____demoTests.m in Sources */,
229 | );
230 | runOnlyForDeploymentPostprocessing = 0;
231 | };
232 | /* End PBXSourcesBuildPhase section */
233 |
234 | /* Begin PBXTargetDependency section */
235 | F24A6D741B23052D00303B3F /* PBXTargetDependency */ = {
236 | isa = PBXTargetDependency;
237 | target = F24A6D581B23052D00303B3F /* UIScrollView极限优化demo */;
238 | targetProxy = F24A6D731B23052D00303B3F /* PBXContainerItemProxy */;
239 | };
240 | /* End PBXTargetDependency section */
241 |
242 | /* Begin PBXVariantGroup section */
243 | F24A6D661B23052D00303B3F /* Main.storyboard */ = {
244 | isa = PBXVariantGroup;
245 | children = (
246 | F24A6D671B23052D00303B3F /* Base */,
247 | );
248 | name = Main.storyboard;
249 | sourceTree = "";
250 | };
251 | /* End PBXVariantGroup section */
252 |
253 | /* Begin XCBuildConfiguration section */
254 | F24A6D7A1B23052D00303B3F /* Debug */ = {
255 | isa = XCBuildConfiguration;
256 | buildSettings = {
257 | ALWAYS_SEARCH_USER_PATHS = NO;
258 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
259 | CLANG_CXX_LIBRARY = "libc++";
260 | CLANG_ENABLE_MODULES = YES;
261 | CLANG_ENABLE_OBJC_ARC = YES;
262 | CLANG_WARN_BOOL_CONVERSION = YES;
263 | CLANG_WARN_CONSTANT_CONVERSION = YES;
264 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
265 | CLANG_WARN_EMPTY_BODY = YES;
266 | CLANG_WARN_ENUM_CONVERSION = YES;
267 | CLANG_WARN_INT_CONVERSION = YES;
268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
269 | CLANG_WARN_UNREACHABLE_CODE = YES;
270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
272 | COPY_PHASE_STRIP = NO;
273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
274 | ENABLE_STRICT_OBJC_MSGSEND = YES;
275 | GCC_C_LANGUAGE_STANDARD = gnu99;
276 | GCC_DYNAMIC_NO_PIC = NO;
277 | GCC_NO_COMMON_BLOCKS = YES;
278 | GCC_OPTIMIZATION_LEVEL = 0;
279 | GCC_PREPROCESSOR_DEFINITIONS = (
280 | "DEBUG=1",
281 | "$(inherited)",
282 | );
283 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
284 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
285 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
286 | GCC_WARN_UNDECLARED_SELECTOR = YES;
287 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
288 | GCC_WARN_UNUSED_FUNCTION = YES;
289 | GCC_WARN_UNUSED_VARIABLE = YES;
290 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
291 | MTL_ENABLE_DEBUG_INFO = YES;
292 | ONLY_ACTIVE_ARCH = YES;
293 | SDKROOT = iphoneos;
294 | TARGETED_DEVICE_FAMILY = "1,2";
295 | };
296 | name = Debug;
297 | };
298 | F24A6D7B1B23052D00303B3F /* Release */ = {
299 | isa = XCBuildConfiguration;
300 | buildSettings = {
301 | ALWAYS_SEARCH_USER_PATHS = NO;
302 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
303 | CLANG_CXX_LIBRARY = "libc++";
304 | CLANG_ENABLE_MODULES = YES;
305 | CLANG_ENABLE_OBJC_ARC = YES;
306 | CLANG_WARN_BOOL_CONVERSION = YES;
307 | CLANG_WARN_CONSTANT_CONVERSION = YES;
308 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
309 | CLANG_WARN_EMPTY_BODY = YES;
310 | CLANG_WARN_ENUM_CONVERSION = YES;
311 | CLANG_WARN_INT_CONVERSION = YES;
312 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
313 | CLANG_WARN_UNREACHABLE_CODE = YES;
314 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
315 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
316 | COPY_PHASE_STRIP = NO;
317 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
318 | ENABLE_NS_ASSERTIONS = NO;
319 | ENABLE_STRICT_OBJC_MSGSEND = YES;
320 | GCC_C_LANGUAGE_STANDARD = gnu99;
321 | GCC_NO_COMMON_BLOCKS = YES;
322 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
323 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
324 | GCC_WARN_UNDECLARED_SELECTOR = YES;
325 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
326 | GCC_WARN_UNUSED_FUNCTION = YES;
327 | GCC_WARN_UNUSED_VARIABLE = YES;
328 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
329 | MTL_ENABLE_DEBUG_INFO = NO;
330 | SDKROOT = iphoneos;
331 | TARGETED_DEVICE_FAMILY = "1,2";
332 | VALIDATE_PRODUCT = YES;
333 | };
334 | name = Release;
335 | };
336 | F24A6D7D1B23052D00303B3F /* Debug */ = {
337 | isa = XCBuildConfiguration;
338 | buildSettings = {
339 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
340 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
341 | INFOPLIST_FILE = "UIScrollView极限优化demo/Info.plist";
342 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
343 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
344 | PRODUCT_NAME = "$(TARGET_NAME)";
345 | };
346 | name = Debug;
347 | };
348 | F24A6D7E1B23052D00303B3F /* Release */ = {
349 | isa = XCBuildConfiguration;
350 | buildSettings = {
351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
352 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
353 | INFOPLIST_FILE = "UIScrollView极限优化demo/Info.plist";
354 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
355 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
356 | PRODUCT_NAME = "$(TARGET_NAME)";
357 | };
358 | name = Release;
359 | };
360 | F24A6D801B23052D00303B3F /* Debug */ = {
361 | isa = XCBuildConfiguration;
362 | buildSettings = {
363 | BUNDLE_LOADER = "$(TEST_HOST)";
364 | FRAMEWORK_SEARCH_PATHS = (
365 | "$(SDKROOT)/Developer/Library/Frameworks",
366 | "$(inherited)",
367 | );
368 | GCC_PREPROCESSOR_DEFINITIONS = (
369 | "DEBUG=1",
370 | "$(inherited)",
371 | );
372 | INFOPLIST_FILE = "UIScrollView极限优化demoTests/Info.plist";
373 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
374 | PRODUCT_NAME = "$(TARGET_NAME)";
375 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIScrollView极限优化demo.app/UIScrollView极限优化demo";
376 | };
377 | name = Debug;
378 | };
379 | F24A6D811B23052D00303B3F /* Release */ = {
380 | isa = XCBuildConfiguration;
381 | buildSettings = {
382 | BUNDLE_LOADER = "$(TEST_HOST)";
383 | FRAMEWORK_SEARCH_PATHS = (
384 | "$(SDKROOT)/Developer/Library/Frameworks",
385 | "$(inherited)",
386 | );
387 | INFOPLIST_FILE = "UIScrollView极限优化demoTests/Info.plist";
388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
389 | PRODUCT_NAME = "$(TARGET_NAME)";
390 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIScrollView极限优化demo.app/UIScrollView极限优化demo";
391 | };
392 | name = Release;
393 | };
394 | /* End XCBuildConfiguration section */
395 |
396 | /* Begin XCConfigurationList section */
397 | F24A6D541B23052C00303B3F /* Build configuration list for PBXProject "UIScrollView极限优化demo" */ = {
398 | isa = XCConfigurationList;
399 | buildConfigurations = (
400 | F24A6D7A1B23052D00303B3F /* Debug */,
401 | F24A6D7B1B23052D00303B3F /* Release */,
402 | );
403 | defaultConfigurationIsVisible = 0;
404 | defaultConfigurationName = Release;
405 | };
406 | F24A6D7C1B23052D00303B3F /* Build configuration list for PBXNativeTarget "UIScrollView极限优化demo" */ = {
407 | isa = XCConfigurationList;
408 | buildConfigurations = (
409 | F24A6D7D1B23052D00303B3F /* Debug */,
410 | F24A6D7E1B23052D00303B3F /* Release */,
411 | );
412 | defaultConfigurationIsVisible = 0;
413 | };
414 | F24A6D7F1B23052D00303B3F /* Build configuration list for PBXNativeTarget "UIScrollView极限优化demoTests" */ = {
415 | isa = XCConfigurationList;
416 | buildConfigurations = (
417 | F24A6D801B23052D00303B3F /* Debug */,
418 | F24A6D811B23052D00303B3F /* Release */,
419 | );
420 | defaultConfigurationIsVisible = 0;
421 | };
422 | /* End XCConfigurationList section */
423 | };
424 | rootObject = F24A6D511B23052C00303B3F /* Project object */;
425 | }
426 |
--------------------------------------------------------------------------------