├── .gitignore ├── .travis.yml ├── LCNewFeature.podspec ├── LCNewFeature ├── LCNewFeatureVC.h ├── LCNewFeatureVC.m ├── UIImage+LC.h └── UIImage+LC.m ├── LCNewFeatureDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── LCNewFeatureDemo.xccheckout └── xcuserdata │ └── Leo.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── LCNewFeatureDemo.xcscheme │ └── xcschememanagement.plist ├── LCNewFeatureDemo ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── NewFeature │ │ ├── Contents.json │ │ ├── new_feature_1.imageset │ │ ├── Contents.json │ │ └── new_feature_1@2x.png │ │ ├── new_feature_1_iphone5.imageset │ │ ├── Contents.json │ │ └── new_feature_1_568h@2x.png │ │ ├── new_feature_1_iphone6.imageset │ │ ├── Contents.json │ │ └── new_feature_1_iphone6@2x.png │ │ ├── new_feature_1_iphone6p.imageset │ │ ├── Contents.json │ │ └── new_feature_1_iphone6p@2x.png │ │ ├── new_feature_2.imageset │ │ ├── Contents.json │ │ └── new_feature_2@2x.png │ │ ├── new_feature_2_iphone5.imageset │ │ ├── Contents.json │ │ └── new_feature_2_iphone5@2x.png │ │ ├── new_feature_2_iphone6.imageset │ │ ├── Contents.json │ │ └── new_feature_2_iphone6@2x.png │ │ ├── new_feature_2_iphone6p.imageset │ │ ├── Contents.json │ │ └── new_feature_2_iphone6p@2x.png │ │ ├── new_feature_3.imageset │ │ ├── Contents.json │ │ ├── new_feature_3@2x.png │ │ └── new_feature_3_iphone5@2x.png │ │ ├── new_feature_3_iphone5.imageset │ │ ├── Contents.json │ │ └── new_feature_3_iphone5@2x.png │ │ ├── new_feature_3_iphone6.imageset │ │ ├── Contents.json │ │ └── new_feature_3_iphone6@2x.png │ │ └── new_feature_3_iphone6p.imageset │ │ ├── Contents.json │ │ └── new_feature_3_iphone6p@2x.png ├── Info.plist ├── ViewController.h ├── ViewController.m ├── main.m └── zh-Hans.lproj │ ├── LaunchScreen.strings │ └── Main.strings ├── LCNewFeatureDemoTests ├── Info.plist └── LCNewFeatureDemoTests.m ├── LICENSE ├── README.md ├── ScreenShot.png └── new_feature_1_iphone6@2x.psd /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | LCNewFeatureDemo.xcodeproj/project.xcworkspace/xcuserdata/Leo.xcuserdatad/UserInterfaceState.xcuserstate 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | os: osx 3 | osx_image: xcode7.2 -------------------------------------------------------------------------------- /LCNewFeature.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "LCNewFeature" 4 | s.version = "1.1.3" 5 | s.summary = "Finish a new feature interface with a few lines of code. Support: http://LeoDev.me" 6 | s.homepage = "https://github.com/iTofu/LCNewFeature" 7 | s.license = { :type => "MIT", :file => "LICENSE" } 8 | s.author = { "Leo" => "devtip@163.com" } 9 | s.social_media_url = "http://LeoDev.me" 10 | s.platform = :ios, "7.0" 11 | s.source = { :git => "https://github.com/iTofu/LCNewFeature.git", :tag => s.version } 12 | s.source_files = "LCNewFeature/*" 13 | s.requires_arc = true 14 | 15 | end 16 | -------------------------------------------------------------------------------- /LCNewFeature/LCNewFeatureVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 刘超 on 15/4/30. 3 | // Copyright (c) 2015年 Leo. All rights reserved. 4 | // 5 | // Mail: mailto:devtip@163.com 6 | // GitHub: http://github.com/iTofu 7 | // 如有问题或建议请给我发邮件, 或在该项目的 GitHub 主页提 Issue, 谢谢:) 8 | // 9 | // V 1.1.2 10 | 11 | 12 | // !! WARNING 必读!! 13 | 14 | /** 15 | * !!!!!! 必读 !!!!!! 16 | * 17 | * 1. 为什么传一个图片名字和图片个数就可以展示所有图片? 18 | * 19 | * Why? No why. 按以下要求命名图片即可: 20 | * 第一张图: `_1@2x.png` 21 | * 第二张图: `_2@2x.png` 22 | * ... 23 | * 24 | * 如: 25 | * `NewFeature_1@2x.png` 将作为第一张图展示 26 | * `NewFeature_2@2x.png` 将作为第二张图展示 27 | * ... 28 | * 29 | * 30 | * 2. 怎么适配 iPhone 5 / 5s, iPhone 6 / 6s, iPhone 6 p / 6s p? 31 | * 32 | * iPhone 5 / 5s 的图片请在名字后面拼接 `_iphone5`; 33 | * iPhone 6 / 6s 的图片请在名字后面拼接 `_iphone6`; 34 | * iPhone 6 p / 6s p 的图片请在名字后面拼接 `_iphone6p`; 35 | * 36 | * 如: 37 | * `NewFeature_1@2x.png` 将展示在 iPhone 4 / 4s 上 38 | * `NewFeature_1_iphone5@2x.png` 将展示在 iPhone 5 / 5s 上 39 | * `NewFeature_1_iphone6@2x.png` 将展示在 iPhone 6 / 6s 上 40 | * `NewFeature_1_iphone6p@2x.png` 将展示在 iPhone 6 p / 6s p 上 41 | * 42 | * 43 | * 3. 如果想变更状态栏的样式, 打开项目的 Info.plist, 先添加下列键值对, 然后 statusBarStyle 属性才会生效: 44 | * 45 | * Key : View controller-based status bar appearance 46 | * Value : NO (添加 Key 后,Value 默认值就是 NO) 47 | * 48 | * 49 | * 4. 如果还有问题或者建议, 请联系我, 我也想做的更好! 联系方式在顶部:) 50 | */ 51 | 52 | 53 | 54 | #import 55 | 56 | 57 | // 屏幕尺寸 58 | #define LC_NEW_FEATURE_SCREEN_SIZE [UIScreen mainScreen].bounds.size 59 | 60 | @class LCNewFeatureVC; 61 | 62 | /** 63 | * 完成新特性界面展示后的block回调 64 | */ 65 | typedef void (^LCNewFeatureFinishBlock)(); 66 | 67 | //typedef void (^LCNewFeaturePageBlock)(NSInteger page); 68 | 69 | /** 70 | 状态栏样式 71 | */ 72 | typedef enum : NSUInteger { 73 | LCStatusBarStyleBlack, // 黑色 74 | LCStatusBarStyleWhite, // 白色 75 | LCStatusBarStyleNone, // 隐藏 76 | } LCStatusBarStyle; 77 | 78 | /** 79 | 设备型号 80 | */ 81 | typedef enum : NSUInteger { 82 | DeviceModelUnknow, // 未知设备 83 | DeviceModeliPhone4, // iPhone 4 / 4s 84 | DeviceModeliPhone56, // iPhone 5 / 5s / 6 / 6 p / 6s / 6s p 85 | DeviceModeliPad, // iPad 86 | } DeviceModel; 87 | 88 | 89 | @protocol LCNewFeatureVCDelegate 90 | 91 | @optional 92 | 93 | /** 94 | * 代理方法,回调当前页码 95 | * 96 | * @param newFeatureVC 控制器 97 | * @param page 当前页码 98 | */ 99 | - (void)newFeatureVC:(LCNewFeatureVC *)newFeatureVC page:(NSInteger)page; 100 | 101 | @end 102 | 103 | 104 | 105 | @interface LCNewFeatureVC : UIViewController 106 | 107 | 108 | 109 | #pragma mark - 属性 Properties 110 | 111 | /** 112 | * 当前点(分页控制器)的颜色 113 | */ 114 | @property (nonatomic, strong) UIColor *pointCurrentColor; 115 | 116 | /** 117 | * 其他点(分页控制器)的颜色 118 | */ 119 | @property (nonatomic, strong) UIColor *pointOtherColor; 120 | 121 | /** 122 | * 状态栏样式, 请先参考`必读`第3条设置 123 | */ 124 | @property (nonatomic, assign) LCStatusBarStyle statusBarStyle; 125 | 126 | /** 127 | * 是否显示跳过按钮, 默认不显示 128 | */ 129 | @property (nonatomic, assign) BOOL showSkip; 130 | 131 | /** 132 | * 点击跳过按钮的 block 133 | */ 134 | @property (nonatomic, copy) LCNewFeatureFinishBlock skipBlock; 135 | 136 | /** 137 | * 代理 138 | */ 139 | @property (nonatomic, weak) id delegate; 140 | 141 | ///** 142 | // * 设备型号 143 | // */ 144 | //@property (nonatomic, assign) DeviceModel deviceModel; 145 | 146 | 147 | 148 | #pragma mark - 方法 Methods 149 | 150 | /** 151 | * 是否显示新特性视图控制器, 对比版本号得知 152 | */ 153 | + (BOOL)shouldShowNewFeature; 154 | 155 | /** 156 | * 初始化新特性视图控制器, 类方法 157 | * 158 | * @param imageName 图片名, 请将原图名称修改为该格式: `_1`, `_2`... 如: `NewFeature_1@2x.png` 159 | * 160 | * @param imageCount 图片个数 161 | * 162 | * @param showPageControl 是否显示分页控制器 163 | * 164 | * @param enterButton 进入主界面的按钮 165 | * 166 | * @return 初始化的控制器实例 167 | */ 168 | + (instancetype)newFeatureWithImageName:(NSString *)imageName 169 | imageCount:(NSInteger)imageCount 170 | showPageControl:(BOOL)showPageControl 171 | enterButton:(UIButton *)enterButton; 172 | 173 | /** 174 | * 初始化新特性视图控制器, 实例方法 175 | * 176 | * @param imageName 图片名, 请将原图名称修改为该格式: `_1`, `_2`... 如: `NewFeature_1@2x.png` 177 | * 178 | * @param imageCount 图片个数 179 | * 180 | * @param showPageControl 是否显示分页控制器 181 | * 182 | * @param enterButton 进入主界面的按钮 183 | * 184 | * @return 初始化的控制器实例 185 | */ 186 | - (instancetype)initWithImageName:(NSString *)imageName 187 | imageCount:(NSInteger)imageCount 188 | showPageControl:(BOOL)showPageControl 189 | enterButton:(UIButton *)enterButton; 190 | 191 | /** 192 | * 初始化新特性视图控制器, 类方法 193 | * 194 | * @param imageName 图片名, 请将原图名称修改为该格式: `_1`, `_2`... 如: `NewFeature_1@2x.png` 195 | * 196 | * @param imageCount 图片个数 197 | * 198 | * @param showPageControl 是否显示分页控制器 199 | * 200 | * @param finishBlock 完成新特性界面展示后的回调 201 | * 202 | * @return 初始化的控制器实例 203 | */ 204 | + (instancetype)newFeatureWithImageName:(NSString *)imageName 205 | imageCount:(NSInteger)imageCount 206 | showPageControl:(BOOL)showPageControl 207 | finishBlock:(LCNewFeatureFinishBlock)finishBlock; 208 | 209 | /** 210 | * 初始化新特性视图控制器, 实例方法 211 | * 212 | * @param imageName 图片名, 请将原图名称修改为该格式: `_1`, `_2`... 如: `NewFeature_1@2x.png` 213 | * 214 | * @param imageCount 图片个数 215 | * 216 | * @param showPageControl 是否显示分页控制器 217 | * 218 | * @param finishBlock 完成新特性界面展示后的回调 219 | * 220 | * @return 初始化的控制器实例 221 | */ 222 | - (instancetype)initWithImageName:(NSString *)imageName 223 | imageCount:(NSInteger)imageCount 224 | showPageControl:(BOOL)showPageControl 225 | finishBlock:(LCNewFeatureFinishBlock)finishBlock; 226 | 227 | @end 228 | -------------------------------------------------------------------------------- /LCNewFeature/LCNewFeatureVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 刘超 on 15/4/30. 3 | // Copyright (c) 2015年 Leo. All rights reserved. 4 | // 5 | 6 | #import "LCNewFeatureVC.h" 7 | #import "UIImage+LC.h" 8 | 9 | @interface LCNewFeatureVC () { 10 | 11 | /** 图片名 */ 12 | NSString *_imageName; 13 | 14 | /** 图片个数 */ 15 | NSInteger _imageCount; 16 | 17 | /** 分页控制器 */ 18 | UIPageControl *_pageControl; 19 | 20 | /** 是否显示分页控制器 */ 21 | BOOL _showPageControl; 22 | 23 | /** 进入主界面的按钮 */ 24 | UIButton *_enterButton; 25 | 26 | /** 完成新特性界面展示后的block回调 */ 27 | LCNewFeatureFinishBlock _finishBlock; 28 | } 29 | 30 | @property (nonatomic, weak) UIButton *skipBtn; 31 | 32 | @end 33 | 34 | 35 | 36 | @implementation LCNewFeatureVC 37 | 38 | #pragma mark - 设备型号 39 | 40 | - (DeviceModel)deviceModel { 41 | 42 | CGSize screenSize = [UIScreen mainScreen].bounds.size; 43 | if (10 * screenSize.height / screenSize.width == 15) { // iPhone 4 / 4s 44 | 45 | return DeviceModeliPhone4; 46 | 47 | } else if (10 * screenSize.height / screenSize.width == 17) { // iPhone 5 / 6 / 6 p / 6s / 6s p 48 | 49 | return DeviceModeliPhone56; 50 | 51 | } 52 | 53 | return DeviceModelUnknow; 54 | } 55 | 56 | #pragma mark - 是否显示新特性视图控制器 57 | 58 | + (BOOL)shouldShowNewFeature { 59 | 60 | NSString *key = @"CFBundleShortVersionString"; 61 | 62 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 63 | 64 | // 获取沙盒中版本号 65 | NSString *lastVersion = [defaults stringForKey:key]; 66 | 67 | // 获取当前的版本号 68 | NSString *currentVersion = [NSBundle mainBundle].infoDictionary[key]; 69 | 70 | if ([currentVersion isEqualToString:lastVersion]) { 71 | 72 | return NO; 73 | 74 | } else { 75 | 76 | [defaults setObject:currentVersion forKey:key]; 77 | [defaults synchronize]; 78 | 79 | return YES; 80 | } 81 | } 82 | 83 | #pragma mark - 初始化新特性视图控制器 84 | 85 | + (instancetype)newFeatureWithImageName:(NSString *)imageName 86 | imageCount:(NSInteger)imageCount 87 | showPageControl:(BOOL)showPageControl 88 | enterButton:(UIButton *)enterButton { 89 | 90 | return [[self alloc] initWithImageName:imageName 91 | imageCount:imageCount 92 | showPageControl:showPageControl 93 | enterButton:enterButton]; 94 | } 95 | 96 | + (instancetype)newFeatureWithImageName:(NSString *)imageName 97 | imageCount:(NSInteger)imageCount 98 | showPageControl:(BOOL)showPageControl 99 | finishBlock:(LCNewFeatureFinishBlock)finishBlock { 100 | 101 | return [[self alloc] initWithImageName:imageName 102 | imageCount:imageCount 103 | showPageControl:showPageControl 104 | finishBlock:finishBlock]; 105 | } 106 | 107 | - (instancetype)initWithImageName:(NSString *)imageName 108 | imageCount:(NSInteger)imageCount 109 | showPageControl:(BOOL)showPageControl 110 | enterButton:(UIButton *)enterButton { 111 | 112 | if (self = [super init]) { 113 | 114 | _imageName = imageName; 115 | _imageCount = imageCount; 116 | _showPageControl = showPageControl; 117 | _enterButton = enterButton; 118 | 119 | [self setupMainView]; 120 | } 121 | 122 | return self; 123 | } 124 | 125 | - (instancetype)initWithImageName:(NSString *)imageName 126 | imageCount:(NSInteger)imageCount 127 | showPageControl:(BOOL)showPageControl 128 | finishBlock:(LCNewFeatureFinishBlock)finishBlock { 129 | 130 | if (self = [super init]) { 131 | 132 | _imageName = imageName; 133 | _imageCount = imageCount; 134 | _showPageControl = showPageControl; 135 | _finishBlock = finishBlock; 136 | 137 | [self setupMainView]; 138 | } 139 | 140 | return self; 141 | } 142 | 143 | #pragma mark 设置主界面 144 | 145 | - (void)setupMainView { 146 | 147 | self.view.backgroundColor = [UIColor whiteColor]; 148 | 149 | // 默认状态栏样式为黑色 150 | self.statusBarStyle = LCStatusBarStyleBlack; 151 | 152 | // 图片数组非空时 153 | if (_imageCount) { 154 | 155 | // 滚动视图 156 | UIScrollView *scrollView = [[UIScrollView alloc] init]; 157 | [scrollView setDelegate:self]; 158 | [scrollView setBounces:NO]; 159 | [scrollView setPagingEnabled:YES]; 160 | [scrollView setShowsHorizontalScrollIndicator:NO]; 161 | [scrollView setFrame:(CGRect){0, 0, LC_NEW_FEATURE_SCREEN_SIZE}]; 162 | [scrollView setContentSize:(CGSize){LC_NEW_FEATURE_SCREEN_SIZE.width * _imageCount, 0}]; 163 | [self.view addSubview:scrollView]; 164 | 165 | // 滚动图片 166 | CGFloat imageW = LC_NEW_FEATURE_SCREEN_SIZE.width; 167 | CGFloat imageH = LC_NEW_FEATURE_SCREEN_SIZE.height; 168 | 169 | for (int i = 0; i < _imageCount; i++) { 170 | 171 | CGFloat imageX = imageW * i; 172 | NSString *realImageName = [NSString stringWithFormat:@"%@_%d", _imageName, i + 1]; 173 | UIImage *realImage = [UIImage imageNamedForAdaptation:realImageName iphone5:YES iphone6:YES iphone6p:YES]; 174 | 175 | UIImageView *imageView = [[UIImageView alloc] init]; 176 | [imageView setImage:realImage]; 177 | [imageView setFrame:(CGRect){imageX, 0, imageW, imageH}]; 178 | [scrollView addSubview:imageView]; 179 | 180 | if (_enterButton && i == _imageCount - 1) { 181 | 182 | [imageView setUserInteractionEnabled:YES]; 183 | [imageView addSubview:_enterButton]; 184 | } 185 | } 186 | 187 | // 分页视图 188 | if (_showPageControl) { 189 | 190 | UIPageControl *pageControl = [[UIPageControl alloc] init]; 191 | [pageControl setNumberOfPages:_imageCount]; 192 | [pageControl setHidesForSinglePage:YES]; 193 | [pageControl setUserInteractionEnabled:NO]; 194 | [pageControl setPageIndicatorTintColor:[UIColor lightGrayColor]]; 195 | [pageControl setCurrentPageIndicatorTintColor:[UIColor darkGrayColor]]; 196 | [pageControl setFrame:(CGRect){0, LC_NEW_FEATURE_SCREEN_SIZE.height * 0.9, LC_NEW_FEATURE_SCREEN_SIZE.width, 37.0f}]; 197 | [self.view addSubview:pageControl]; 198 | _pageControl = pageControl; 199 | } 200 | 201 | // 跳过按钮 202 | UIButton *skipBtn = [[UIButton alloc] init]; 203 | skipBtn.hidden = YES; 204 | skipBtn.backgroundColor = [UIColor lightGrayColor]; 205 | skipBtn.titleLabel.font = [UIFont systemFontOfSize:16.0f]; 206 | 207 | NSString *skipTitle = @"Skip"; 208 | NSString *currentLanguage = [[NSLocale preferredLanguages] objectAtIndex:0]; 209 | if ([currentLanguage isEqualToString:@"zh-Hans-CN"]) { 210 | skipTitle = @"跳过"; 211 | } else if ([currentLanguage isEqualToString:@"zh-Hant-CN"]) { 212 | skipTitle = @"跳過"; 213 | } 214 | 215 | [skipBtn setTitle:skipTitle forState:UIControlStateNormal]; 216 | [skipBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 217 | [skipBtn addTarget:self action:@selector(skipBtnClicked) forControlEvents:UIControlEventTouchUpInside]; 218 | skipBtn.frame = CGRectMake(LC_NEW_FEATURE_SCREEN_SIZE.width - 95, 30, 80, 40); 219 | skipBtn.layer.cornerRadius = 20.0f; 220 | [self.view addSubview:skipBtn]; 221 | self.skipBtn = skipBtn; 222 | 223 | } else { 224 | 225 | NSLog(@"警告: 请放入新特性图片!"); 226 | } 227 | } 228 | 229 | - (void)skipBtnClicked { 230 | 231 | if (self.skipBlock) { 232 | self.skipBlock(); 233 | } 234 | } 235 | 236 | - (void)setShowSkip:(BOOL)showSkip { 237 | _showSkip = showSkip; 238 | 239 | self.skipBtn.hidden = !self.showSkip; 240 | } 241 | 242 | #pragma mark - 新特性视图控制器的显示和消失 243 | 244 | - (void)viewWillAppear:(BOOL)animated { 245 | 246 | [super viewWillAppear:animated]; 247 | 248 | switch (self.statusBarStyle) { 249 | 250 | case LCStatusBarStyleBlack: 251 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; 252 | break; 253 | 254 | case LCStatusBarStyleWhite: 255 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 256 | break; 257 | 258 | case LCStatusBarStyleNone: 259 | [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; 260 | break; 261 | 262 | default: 263 | break; 264 | } 265 | 266 | if (_showPageControl) { 267 | 268 | // 如果设置了分页控制器当前点的颜色 269 | if (self.pointCurrentColor) { 270 | 271 | [_pageControl setCurrentPageIndicatorTintColor:self.pointCurrentColor]; 272 | } 273 | 274 | // 如果设置了分页控制器其他点的颜色 275 | if (self.pointOtherColor) { 276 | 277 | [_pageControl setPageIndicatorTintColor:self.pointOtherColor]; 278 | } 279 | } 280 | } 281 | 282 | - (void)viewWillDisappear:(BOOL)animated { 283 | 284 | [super viewWillDisappear:animated]; 285 | 286 | if (self.statusBarStyle == LCStatusBarStyleNone) { 287 | 288 | [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade]; 289 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; 290 | } 291 | } 292 | 293 | #pragma mark - UIScrollViewDelegate 方法 294 | 295 | - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView { 296 | 297 | // 最后一张再向左划的话 298 | if (scrollView.contentOffset.x == LC_NEW_FEATURE_SCREEN_SIZE.width * (_imageCount - 1)) { 299 | 300 | if (_finishBlock) { 301 | 302 | [UIView animateWithDuration:0.4f animations:^{ 303 | 304 | self.view.transform = CGAffineTransformMakeTranslation(-LC_NEW_FEATURE_SCREEN_SIZE.width, 0); 305 | 306 | } completion:^(BOOL finished) { 307 | 308 | _finishBlock(); 309 | }]; 310 | } 311 | } 312 | } 313 | 314 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 315 | 316 | CGPoint currentPoint = scrollView.contentOffset; 317 | NSInteger page = currentPoint.x / scrollView.bounds.size.width; 318 | _pageControl.currentPage = page; 319 | 320 | if ([self.delegate respondsToSelector:@selector(newFeatureVC:page:)]) { 321 | [self.delegate newFeatureVC:self page:page]; 322 | } 323 | } 324 | 325 | @end 326 | -------------------------------------------------------------------------------- /LCNewFeature/UIImage+LC.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 刘超 on 15/4/30. 3 | // Copyright (c) 2015年 Leo. All rights reserved. 4 | // 5 | // Email : leoios@sina.com 6 | // GitHub: http://github.com/LeoiOS 7 | // 如有问题或建议请给我发Email, 或在该项目的GitHub主页lssues我, 谢谢:) 8 | // 9 | 10 | #import 11 | 12 | @interface UIImage (LC) 13 | 14 | /** 15 | * 初始化一张适配iPhone屏幕尺寸的图片, 类方法 16 | * 17 | * @param imageName 图片名称 18 | * 19 | * @param iphone5 是否有iPhone5的图片, 默认`NO`, 无图片; 有图片请参考命名: `_iphone5`, 如: `Apple_iphone5h@2x.png` 20 | * 21 | * @param iphone6 是否有iPhone6的图片, 默认`NO`, 无图片; 有图片请参考命名: `_iphone6`, 如: `Apple_iphone6@2x.png` 22 | * 23 | * @param iphone6p 是否有iPhone6P的图片, 默认`NO`, 无图片; 有图片请参考命名: `_iphone6p`, 如: `Apple_iphone6p@2x.png` 24 | */ 25 | + (instancetype)imageNamedForAdaptation:(NSString *)imageName 26 | iphone5:(BOOL)iphone5 27 | iphone6:(BOOL)iphone6 28 | iphone6p:(BOOL)iphone6p; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /LCNewFeature/UIImage+LC.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 刘超 on 15/4/30. 3 | // Copyright (c) 2015年 Leo. All rights reserved. 4 | // 5 | // Email : leoios@sina.com 6 | // GitHub: http://github.com/LeoiOS 7 | // 如有问题或建议请给我发Email, 或在该项目的GitHub主页lssues我, 谢谢:) 8 | // 9 | 10 | #import "UIImage+LC.h" 11 | 12 | #define IPHONE5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) 13 | #define IPHONE6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size)) : NO) 14 | #define IPHONE6P ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(1125, 2001), [[UIScreen mainScreen] currentMode].size)) : NO) 15 | 16 | #ifdef DEBUG 17 | #define LCLog(...) NSLog(@"%s -> Line:%d -> %@", __func__, __LINE__, [NSString stringWithFormat:__VA_ARGS__]) 18 | #else 19 | #define LCLog(...) 20 | #endif 21 | 22 | @implementation UIImage (LC) 23 | 24 | + (instancetype)imageNamedForAdaptation:(NSString *)imageName 25 | iphone5:(BOOL)iphone5 26 | iphone6:(BOOL)iphone6 27 | iphone6p:(BOOL)iphone6p { 28 | 29 | NSString *realImageName = imageName; 30 | 31 | if (IPHONE5 && iphone5) { // 当前设备是 iPhone 5 / 5s 或 iPhone 6 / 6s 放大模式 32 | 33 | realImageName = [NSString stringWithFormat:@"%@_iphone5", realImageName]; 34 | 35 | } else if (IPHONE6 && iphone6) { // 当前设备是 iPhone 6 / 6s 36 | 37 | realImageName = [NSString stringWithFormat:@"%@_iphone6", realImageName]; 38 | 39 | } else if (IPHONE6P && iphone6p) { // 当前设备是 iPhone 6 p / 6s p 40 | 41 | realImageName = [NSString stringWithFormat:@"%@_iphone6p", realImageName]; 42 | } 43 | 44 | // LCLog(@"\nImageName: %@", realImageName); 45 | 46 | return [self imageNamed:realImageName]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /LCNewFeatureDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B38AA30D1BF0A1E100DD53DD /* LCNewFeatureVC.m in Sources */ = {isa = PBXBuildFile; fileRef = B38AA30A1BF0A1E100DD53DD /* LCNewFeatureVC.m */; }; 11 | B38AA30E1BF0A1E100DD53DD /* UIImage+LC.m in Sources */ = {isa = PBXBuildFile; fileRef = B38AA30C1BF0A1E100DD53DD /* UIImage+LC.m */; }; 12 | B3BC77FF1AF1C2E500276D01 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B3BC77FE1AF1C2E500276D01 /* main.m */; }; 13 | B3BC78021AF1C2E500276D01 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B3BC78011AF1C2E500276D01 /* AppDelegate.m */; }; 14 | B3BC78051AF1C2E500276D01 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B3BC78041AF1C2E500276D01 /* ViewController.m */; }; 15 | B3BC78081AF1C2E500276D01 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B3BC78061AF1C2E500276D01 /* Main.storyboard */; }; 16 | B3BC780A1AF1C2E500276D01 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B3BC78091AF1C2E500276D01 /* Images.xcassets */; }; 17 | B3BC780D1AF1C2E500276D01 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B3BC780B1AF1C2E500276D01 /* LaunchScreen.xib */; }; 18 | B3BC78191AF1C2E500276D01 /* LCNewFeatureDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B3BC78181AF1C2E500276D01 /* LCNewFeatureDemoTests.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | B3BC78131AF1C2E500276D01 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = B3BC77F11AF1C2E500276D01 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = B3BC77F81AF1C2E500276D01; 27 | remoteInfo = LCNewFeatureDemo; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | B38AA3091BF0A1E100DD53DD /* LCNewFeatureVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCNewFeatureVC.h; sourceTree = ""; }; 33 | B38AA30A1BF0A1E100DD53DD /* LCNewFeatureVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LCNewFeatureVC.m; sourceTree = ""; }; 34 | B38AA30B1BF0A1E100DD53DD /* UIImage+LC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+LC.h"; sourceTree = ""; }; 35 | B38AA30C1BF0A1E100DD53DD /* UIImage+LC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LC.m"; sourceTree = ""; }; 36 | B3BC77F91AF1C2E500276D01 /* LCNewFeatureDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LCNewFeatureDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | B3BC77FD1AF1C2E500276D01 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | B3BC77FE1AF1C2E500276D01 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | B3BC78001AF1C2E500276D01 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | B3BC78011AF1C2E500276D01 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | B3BC78031AF1C2E500276D01 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 42 | B3BC78041AF1C2E500276D01 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 43 | B3BC78071AF1C2E500276D01 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | B3BC78091AF1C2E500276D01 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 45 | B3BC780C1AF1C2E500276D01 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 46 | B3BC78121AF1C2E500276D01 /* LCNewFeatureDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LCNewFeatureDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | B3BC78171AF1C2E500276D01 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | B3BC78181AF1C2E500276D01 /* LCNewFeatureDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LCNewFeatureDemoTests.m; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | B3BC77F61AF1C2E500276D01 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | B3BC780F1AF1C2E500276D01 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | B38AA3081BF0A1E100DD53DD /* LCNewFeature */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | B38AA3091BF0A1E100DD53DD /* LCNewFeatureVC.h */, 73 | B38AA30A1BF0A1E100DD53DD /* LCNewFeatureVC.m */, 74 | B38AA30B1BF0A1E100DD53DD /* UIImage+LC.h */, 75 | B38AA30C1BF0A1E100DD53DD /* UIImage+LC.m */, 76 | ); 77 | path = LCNewFeature; 78 | sourceTree = ""; 79 | }; 80 | B3BC77F01AF1C2E500276D01 = { 81 | isa = PBXGroup; 82 | children = ( 83 | B38AA3081BF0A1E100DD53DD /* LCNewFeature */, 84 | B3BC77FB1AF1C2E500276D01 /* LCNewFeatureDemo */, 85 | B3BC78151AF1C2E500276D01 /* LCNewFeatureDemoTests */, 86 | B3BC77FA1AF1C2E500276D01 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | B3BC77FA1AF1C2E500276D01 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | B3BC77F91AF1C2E500276D01 /* LCNewFeatureDemo.app */, 94 | B3BC78121AF1C2E500276D01 /* LCNewFeatureDemoTests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | B3BC77FB1AF1C2E500276D01 /* LCNewFeatureDemo */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | B3BC78001AF1C2E500276D01 /* AppDelegate.h */, 103 | B3BC78011AF1C2E500276D01 /* AppDelegate.m */, 104 | B3BC78031AF1C2E500276D01 /* ViewController.h */, 105 | B3BC78041AF1C2E500276D01 /* ViewController.m */, 106 | B3BC78061AF1C2E500276D01 /* Main.storyboard */, 107 | B3BC77FC1AF1C2E500276D01 /* Supporting Files */, 108 | ); 109 | path = LCNewFeatureDemo; 110 | sourceTree = ""; 111 | }; 112 | B3BC77FC1AF1C2E500276D01 /* Supporting Files */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | B3BC78091AF1C2E500276D01 /* Images.xcassets */, 116 | B3BC780B1AF1C2E500276D01 /* LaunchScreen.xib */, 117 | B3BC77FD1AF1C2E500276D01 /* Info.plist */, 118 | B3BC77FE1AF1C2E500276D01 /* main.m */, 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | B3BC78151AF1C2E500276D01 /* LCNewFeatureDemoTests */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | B3BC78181AF1C2E500276D01 /* LCNewFeatureDemoTests.m */, 127 | B3BC78161AF1C2E500276D01 /* Supporting Files */, 128 | ); 129 | path = LCNewFeatureDemoTests; 130 | sourceTree = ""; 131 | }; 132 | B3BC78161AF1C2E500276D01 /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | B3BC78171AF1C2E500276D01 /* Info.plist */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | /* End PBXGroup section */ 141 | 142 | /* Begin PBXNativeTarget section */ 143 | B3BC77F81AF1C2E500276D01 /* LCNewFeatureDemo */ = { 144 | isa = PBXNativeTarget; 145 | buildConfigurationList = B3BC781C1AF1C2E500276D01 /* Build configuration list for PBXNativeTarget "LCNewFeatureDemo" */; 146 | buildPhases = ( 147 | B3BC77F51AF1C2E500276D01 /* Sources */, 148 | B3BC77F61AF1C2E500276D01 /* Frameworks */, 149 | B3BC77F71AF1C2E500276D01 /* Resources */, 150 | ); 151 | buildRules = ( 152 | ); 153 | dependencies = ( 154 | ); 155 | name = LCNewFeatureDemo; 156 | productName = LCNewFeatureDemo; 157 | productReference = B3BC77F91AF1C2E500276D01 /* LCNewFeatureDemo.app */; 158 | productType = "com.apple.product-type.application"; 159 | }; 160 | B3BC78111AF1C2E500276D01 /* LCNewFeatureDemoTests */ = { 161 | isa = PBXNativeTarget; 162 | buildConfigurationList = B3BC781F1AF1C2E500276D01 /* Build configuration list for PBXNativeTarget "LCNewFeatureDemoTests" */; 163 | buildPhases = ( 164 | B3BC780E1AF1C2E500276D01 /* Sources */, 165 | B3BC780F1AF1C2E500276D01 /* Frameworks */, 166 | B3BC78101AF1C2E500276D01 /* Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | B3BC78141AF1C2E500276D01 /* PBXTargetDependency */, 172 | ); 173 | name = LCNewFeatureDemoTests; 174 | productName = LCNewFeatureDemoTests; 175 | productReference = B3BC78121AF1C2E500276D01 /* LCNewFeatureDemoTests.xctest */; 176 | productType = "com.apple.product-type.bundle.unit-test"; 177 | }; 178 | /* End PBXNativeTarget section */ 179 | 180 | /* Begin PBXProject section */ 181 | B3BC77F11AF1C2E500276D01 /* Project object */ = { 182 | isa = PBXProject; 183 | attributes = { 184 | LastUpgradeCheck = 0630; 185 | ORGANIZATIONNAME = Leo; 186 | TargetAttributes = { 187 | B3BC77F81AF1C2E500276D01 = { 188 | CreatedOnToolsVersion = 6.3; 189 | }; 190 | B3BC78111AF1C2E500276D01 = { 191 | CreatedOnToolsVersion = 6.3; 192 | TestTargetID = B3BC77F81AF1C2E500276D01; 193 | }; 194 | }; 195 | }; 196 | buildConfigurationList = B3BC77F41AF1C2E500276D01 /* Build configuration list for PBXProject "LCNewFeatureDemo" */; 197 | compatibilityVersion = "Xcode 3.2"; 198 | developmentRegion = English; 199 | hasScannedForEncodings = 0; 200 | knownRegions = ( 201 | en, 202 | Base, 203 | ); 204 | mainGroup = B3BC77F01AF1C2E500276D01; 205 | productRefGroup = B3BC77FA1AF1C2E500276D01 /* Products */; 206 | projectDirPath = ""; 207 | projectRoot = ""; 208 | targets = ( 209 | B3BC77F81AF1C2E500276D01 /* LCNewFeatureDemo */, 210 | B3BC78111AF1C2E500276D01 /* LCNewFeatureDemoTests */, 211 | ); 212 | }; 213 | /* End PBXProject section */ 214 | 215 | /* Begin PBXResourcesBuildPhase section */ 216 | B3BC77F71AF1C2E500276D01 /* Resources */ = { 217 | isa = PBXResourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | B3BC78081AF1C2E500276D01 /* Main.storyboard in Resources */, 221 | B3BC780D1AF1C2E500276D01 /* LaunchScreen.xib in Resources */, 222 | B3BC780A1AF1C2E500276D01 /* Images.xcassets in Resources */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | B3BC78101AF1C2E500276D01 /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | /* End PBXResourcesBuildPhase section */ 234 | 235 | /* Begin PBXSourcesBuildPhase section */ 236 | B3BC77F51AF1C2E500276D01 /* Sources */ = { 237 | isa = PBXSourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | B3BC78051AF1C2E500276D01 /* ViewController.m in Sources */, 241 | B38AA30D1BF0A1E100DD53DD /* LCNewFeatureVC.m in Sources */, 242 | B3BC78021AF1C2E500276D01 /* AppDelegate.m in Sources */, 243 | B38AA30E1BF0A1E100DD53DD /* UIImage+LC.m in Sources */, 244 | B3BC77FF1AF1C2E500276D01 /* main.m in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | B3BC780E1AF1C2E500276D01 /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | B3BC78191AF1C2E500276D01 /* LCNewFeatureDemoTests.m in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXSourcesBuildPhase section */ 257 | 258 | /* Begin PBXTargetDependency section */ 259 | B3BC78141AF1C2E500276D01 /* PBXTargetDependency */ = { 260 | isa = PBXTargetDependency; 261 | target = B3BC77F81AF1C2E500276D01 /* LCNewFeatureDemo */; 262 | targetProxy = B3BC78131AF1C2E500276D01 /* PBXContainerItemProxy */; 263 | }; 264 | /* End PBXTargetDependency section */ 265 | 266 | /* Begin PBXVariantGroup section */ 267 | B3BC78061AF1C2E500276D01 /* Main.storyboard */ = { 268 | isa = PBXVariantGroup; 269 | children = ( 270 | B3BC78071AF1C2E500276D01 /* Base */, 271 | ); 272 | name = Main.storyboard; 273 | sourceTree = ""; 274 | }; 275 | B3BC780B1AF1C2E500276D01 /* LaunchScreen.xib */ = { 276 | isa = PBXVariantGroup; 277 | children = ( 278 | B3BC780C1AF1C2E500276D01 /* Base */, 279 | ); 280 | name = LaunchScreen.xib; 281 | sourceTree = ""; 282 | }; 283 | /* End PBXVariantGroup section */ 284 | 285 | /* Begin XCBuildConfiguration section */ 286 | B3BC781A1AF1C2E500276D01 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ALWAYS_SEARCH_USER_PATHS = NO; 290 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 291 | CLANG_CXX_LIBRARY = "libc++"; 292 | CLANG_ENABLE_MODULES = YES; 293 | CLANG_ENABLE_OBJC_ARC = YES; 294 | CLANG_WARN_BOOL_CONVERSION = YES; 295 | CLANG_WARN_CONSTANT_CONVERSION = YES; 296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 297 | CLANG_WARN_EMPTY_BODY = YES; 298 | CLANG_WARN_ENUM_CONVERSION = YES; 299 | CLANG_WARN_INT_CONVERSION = YES; 300 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 301 | CLANG_WARN_UNREACHABLE_CODE = YES; 302 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 303 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 304 | COPY_PHASE_STRIP = NO; 305 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 306 | ENABLE_STRICT_OBJC_MSGSEND = YES; 307 | GCC_C_LANGUAGE_STANDARD = gnu99; 308 | GCC_DYNAMIC_NO_PIC = NO; 309 | GCC_NO_COMMON_BLOCKS = YES; 310 | GCC_OPTIMIZATION_LEVEL = 0; 311 | GCC_PREPROCESSOR_DEFINITIONS = ( 312 | "DEBUG=1", 313 | "$(inherited)", 314 | ); 315 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 323 | MTL_ENABLE_DEBUG_INFO = YES; 324 | ONLY_ACTIVE_ARCH = YES; 325 | SDKROOT = iphoneos; 326 | TARGETED_DEVICE_FAMILY = "1,2"; 327 | }; 328 | name = Debug; 329 | }; 330 | B3BC781B1AF1C2E500276D01 /* Release */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | SDKROOT = iphoneos; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | B3BC781D1AF1C2E500276D01 /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | INFOPLIST_FILE = LCNewFeatureDemo/Info.plist; 373 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 374 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 375 | PRODUCT_NAME = "$(TARGET_NAME)"; 376 | }; 377 | name = Debug; 378 | }; 379 | B3BC781E1AF1C2E500276D01 /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 383 | INFOPLIST_FILE = LCNewFeatureDemo/Info.plist; 384 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | }; 388 | name = Release; 389 | }; 390 | B3BC78201AF1C2E500276D01 /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | BUNDLE_LOADER = "$(TEST_HOST)"; 394 | FRAMEWORK_SEARCH_PATHS = ( 395 | "$(SDKROOT)/Developer/Library/Frameworks", 396 | "$(inherited)", 397 | ); 398 | GCC_PREPROCESSOR_DEFINITIONS = ( 399 | "DEBUG=1", 400 | "$(inherited)", 401 | ); 402 | INFOPLIST_FILE = LCNewFeatureDemoTests/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LCNewFeatureDemo.app/LCNewFeatureDemo"; 406 | }; 407 | name = Debug; 408 | }; 409 | B3BC78211AF1C2E500276D01 /* Release */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | BUNDLE_LOADER = "$(TEST_HOST)"; 413 | FRAMEWORK_SEARCH_PATHS = ( 414 | "$(SDKROOT)/Developer/Library/Frameworks", 415 | "$(inherited)", 416 | ); 417 | INFOPLIST_FILE = LCNewFeatureDemoTests/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LCNewFeatureDemo.app/LCNewFeatureDemo"; 421 | }; 422 | name = Release; 423 | }; 424 | /* End XCBuildConfiguration section */ 425 | 426 | /* Begin XCConfigurationList section */ 427 | B3BC77F41AF1C2E500276D01 /* Build configuration list for PBXProject "LCNewFeatureDemo" */ = { 428 | isa = XCConfigurationList; 429 | buildConfigurations = ( 430 | B3BC781A1AF1C2E500276D01 /* Debug */, 431 | B3BC781B1AF1C2E500276D01 /* Release */, 432 | ); 433 | defaultConfigurationIsVisible = 0; 434 | defaultConfigurationName = Release; 435 | }; 436 | B3BC781C1AF1C2E500276D01 /* Build configuration list for PBXNativeTarget "LCNewFeatureDemo" */ = { 437 | isa = XCConfigurationList; 438 | buildConfigurations = ( 439 | B3BC781D1AF1C2E500276D01 /* Debug */, 440 | B3BC781E1AF1C2E500276D01 /* Release */, 441 | ); 442 | defaultConfigurationIsVisible = 0; 443 | defaultConfigurationName = Release; 444 | }; 445 | B3BC781F1AF1C2E500276D01 /* Build configuration list for PBXNativeTarget "LCNewFeatureDemoTests" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | B3BC78201AF1C2E500276D01 /* Debug */, 449 | B3BC78211AF1C2E500276D01 /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | /* End XCConfigurationList section */ 455 | }; 456 | rootObject = B3BC77F11AF1C2E500276D01 /* Project object */; 457 | } 458 | -------------------------------------------------------------------------------- /LCNewFeatureDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LCNewFeatureDemo.xcodeproj/project.xcworkspace/xcshareddata/LCNewFeatureDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 31A8A98F-7522-4B3E-9842-3679ED565EF5 9 | IDESourceControlProjectName 10 | LCNewFeatureDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 45B70F273E48E912988F37ECF9AFD5A17DB8462B 14 | https://github.com/LeoiOS/LCNewFeature.git 15 | 16 | IDESourceControlProjectPath 17 | LCNewFeatureDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 45B70F273E48E912988F37ECF9AFD5A17DB8462B 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/LeoiOS/LCNewFeature.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 45B70F273E48E912988F37ECF9AFD5A17DB8462B 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 45B70F273E48E912988F37ECF9AFD5A17DB8462B 36 | IDESourceControlWCCName 37 | LCNewFeatureDemo 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LCNewFeatureDemo.xcodeproj/xcuserdata/Leo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /LCNewFeatureDemo.xcodeproj/xcuserdata/Leo.xcuserdatad/xcschemes/LCNewFeatureDemo.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 | -------------------------------------------------------------------------------- /LCNewFeatureDemo.xcodeproj/xcuserdata/Leo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LCNewFeatureDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B3BC77F81AF1C2E500276D01 16 | 17 | primary 18 | 19 | 20 | B3BC78111AF1C2E500276D01 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LCNewFeatureDemo 4 | // 5 | // Created by 刘超 on 15/4/30. 6 | // Copyright (c) 2015年 Leo. 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 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LCNewFeatureDemo 4 | // 5 | // Created by 刘超 on 15/4/30. 6 | // Copyright (c) 2015年 Leo. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "LCNewFeatureVC.h" 11 | 12 | // 屏幕尺寸 13 | #define SCREEN_SIZE [UIScreen mainScreen].bounds.size 14 | 15 | @interface AppDelegate () { 16 | 17 | /** 新特性界面 (如果是通过 Block 方式进入主界面则不需要声明该属性) */ 18 | LCNewFeatureVC *_newFeatureVC; 19 | } 20 | 21 | @end 22 | 23 | @implementation AppDelegate 24 | 25 | #pragma mark - 快速集成方法如下:(请务必阅读`LCNewFeatureVC.h`顶部的`必读`) 26 | 27 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | self.window.backgroundColor = [UIColor whiteColor]; 31 | 32 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 33 | 34 | 35 | 36 | #pragma mark 1. 是否应该显示新特性界面 37 | 38 | BOOL showNewFeature = [LCNewFeatureVC shouldShowNewFeature]; 39 | 40 | // 演示--每次都进入新特性界面, 实际项目不需要此句代码 41 | showNewFeature = YES; 42 | 43 | if (showNewFeature) { // 如果需要显示新特性界面 44 | __weak typeof(self) weakSelf = self; 45 | 46 | #pragma mark 2.1. 方式一: 点击添加的按钮进入主界面 47 | 48 | 49 | // 进入主界面按钮 50 | UIButton *enterBtn = [[UIButton alloc] init]; 51 | [enterBtn setBackgroundColor:[UIColor redColor]]; 52 | [enterBtn setTitle:@"进入主界面" forState:UIControlStateNormal]; 53 | [enterBtn setFrame:(CGRect){10.0f, SCREEN_SIZE.height * 0.82, SCREEN_SIZE.width - 20.0f, 40.0f}]; 54 | [enterBtn addTarget:self action:@selector(didClickedBtn) forControlEvents:UIControlEventTouchUpInside]; 55 | 56 | LCNewFeatureVC *newFeatureVC = [LCNewFeatureVC newFeatureWithImageName:@"new_feature" 57 | imageCount:3 58 | showPageControl:YES 59 | enterButton:enterBtn]; 60 | newFeatureVC.showSkip = YES; 61 | newFeatureVC.skipBlock = ^(void) { 62 | [weakSelf didClickedBtn]; 63 | }; 64 | _newFeatureVC = newFeatureVC; 65 | 66 | #pragma mark 2.2. 方式二: 一直左划进入主界面 67 | 68 | /* 69 | LCNewFeatureVC *newFeatureVC = [LCNewFeatureVC newFeatureWithImageName:@"new_feature" 70 | imageCount:3 71 | showPageControl:YES 72 | finishBlock:^{ 73 | 74 | [weakSelf enterMainVC]; 75 | }]; 76 | */ 77 | 78 | #pragma mark 3. 设置新特性界面的属性(可选步骤) 79 | 80 | // 当前页码的代理 81 | newFeatureVC.delegate = self; 82 | 83 | // 当前点颜色, 默认[UIColor darkGrayColor] 84 | newFeatureVC.pointCurrentColor = [UIColor redColor]; 85 | 86 | // 其他点颜色, 默认[UIColor lightGrayColor] 87 | // newFeatureVC.pointOtherColor = [UIColor orangeColor]; 88 | 89 | // 状态栏样式, 默认LCStatusBarStyleBlack 90 | // newFeatureVC.statusBarStyle = LCStatusBarStyleWhite; 91 | 92 | #pragma mark 4. 设置新特性界面为当前窗口的根视图控制器 93 | 94 | self.window.rootViewController = newFeatureVC; 95 | 96 | } else { // 如果不需要显示新特性界面 97 | 98 | [self enterMainVC]; 99 | } 100 | 101 | 102 | 103 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 104 | 105 | [self.window makeKeyAndVisible]; 106 | 107 | return YES; 108 | } 109 | 110 | #pragma mark - 点击了进入主界面的按钮 111 | 112 | - (void)didClickedBtn { 113 | 114 | [self enterMainVC]; 115 | } 116 | 117 | #pragma mark - 进入主界面 118 | 119 | - (void)enterMainVC { 120 | 121 | UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 122 | 123 | [self restoreRootViewController:storyboard.instantiateInitialViewController]; 124 | } 125 | 126 | - (void)restoreRootViewController:(UIViewController *)rootViewController { 127 | 128 | [UIView transitionWithView:self.window duration:0.7f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ 129 | 130 | BOOL oldState = [UIView areAnimationsEnabled]; 131 | [UIView setAnimationsEnabled:NO]; 132 | self.window.rootViewController = rootViewController; 133 | [UIView setAnimationsEnabled:oldState]; 134 | 135 | } completion:nil]; 136 | } 137 | 138 | #pragma mark - LCNewFeatureVC Delegate 139 | 140 | /** 141 | * 代理方法,回调当前页码 142 | * 143 | * @param newFeatureVC 控制器 144 | * @param page 当前页码 145 | */ 146 | - (void)newFeatureVC:(LCNewFeatureVC *)newFeatureVC page:(NSInteger)page { 147 | NSLog(@"%@ -> Page: %d", newFeatureVC, (int)page); 148 | } 149 | 150 | @end 151 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/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 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_1@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1.imageset/new_feature_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1.imageset/new_feature_1@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_1_568h@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone5.imageset/new_feature_1_568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone5.imageset/new_feature_1_568h@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "new_feature_1_iphone6@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone6.imageset/new_feature_1_iphone6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone6.imageset/new_feature_1_iphone6@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone6p.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_1_iphone6p@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone6p.imageset/new_feature_1_iphone6p@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_1_iphone6p.imageset/new_feature_1_iphone6p@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_2@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2.imageset/new_feature_2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2.imageset/new_feature_2@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_2_iphone5@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone5.imageset/new_feature_2_iphone5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone5.imageset/new_feature_2_iphone5@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_2_iphone6@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone6.imageset/new_feature_2_iphone6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone6.imageset/new_feature_2_iphone6@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone6p.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_2_iphone6p@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone6p.imageset/new_feature_2_iphone6p@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_2_iphone6p.imageset/new_feature_2_iphone6p@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_3@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | }, 16 | { 17 | "idiom" : "universal", 18 | "filename" : "new_feature_3-568h@2x.png", 19 | "unassigned" : true, 20 | "subtype" : "retina4", 21 | "scale" : "2x" 22 | } 23 | ], 24 | "info" : { 25 | "version" : 1, 26 | "author" : "xcode" 27 | } 28 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3.imageset/new_feature_3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3.imageset/new_feature_3@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3.imageset/new_feature_3_iphone5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3.imageset/new_feature_3_iphone5@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_3_iphone5@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone5.imageset/new_feature_3_iphone5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone5.imageset/new_feature_3_iphone5@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_3_iphone6@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone6.imageset/new_feature_3_iphone6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone6.imageset/new_feature_3_iphone6@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone6p.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "new_feature_3_iphone6p@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone6p.imageset/new_feature_3_iphone6p@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/LCNewFeatureDemo/Images.xcassets/NewFeature/new_feature_3_iphone6p.imageset/new_feature_3_iphone6p@2x.png -------------------------------------------------------------------------------- /LCNewFeatureDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIViewControllerBasedStatusBarAppearance 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | com.leodong.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 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 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LCNewFeatureDemo 4 | // 5 | // Created by 刘超 on 15/4/30. 6 | // Copyright (c) 2015年 Leo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LCNewFeatureDemo 4 | // 5 | // Created by 刘超 on 15/4/30. 6 | // Copyright (c) 2015年 Leo. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LCNewFeatureDemo 4 | // 5 | // Created by 刘超 on 15/4/30. 6 | // Copyright (c) 2015年 Leo. 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 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/zh-Hans.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UILabel"; text = " Copyright (c) 2015年 Leo. All rights reserved."; ObjectID = "8ie-xW-0ye"; */ 3 | "8ie-xW-0ye.text" = " Copyright (c) 2015年 Leo. All rights reserved."; 4 | 5 | /* Class = "UILabel"; text = "LCNewFeatureDemo"; ObjectID = "kId-c2-rCX"; */ 6 | "kId-c2-rCX.text" = "LCNewFeatureDemo"; 7 | -------------------------------------------------------------------------------- /LCNewFeatureDemo/zh-Hans.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UILabel"; text = "我是主界面 :)"; ObjectID = "x60-P0-naV"; */ 3 | "x60-P0-naV.text" = "我是主界面 :)"; 4 | -------------------------------------------------------------------------------- /LCNewFeatureDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | cn.leo.$(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 | -------------------------------------------------------------------------------- /LCNewFeatureDemoTests/LCNewFeatureDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LCNewFeatureDemoTests.m 3 | // LCNewFeatureDemoTests 4 | // 5 | // Created by 刘超 on 15/4/30. 6 | // Copyright (c) 2015年 Leo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface LCNewFeatureDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation LCNewFeatureDemoTests 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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Leo (http://LeoDev.me) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LCNewFeature 2 | 3 | [![Travis](https://img.shields.io/travis/iTofu/LCNewFeature.svg?style=flat)](https://travis-ci.org/iTofu/LCNewFeature) 4 | [![CocoaPods](https://img.shields.io/cocoapods/v/LCNewFeature.svg)](http://cocoadocs.org/docsets/LCNewFeature) 5 | [![CocoaPods](https://img.shields.io/cocoapods/l/LCNewFeature.svg)](https://raw.githubusercontent.com/iTofu/LCNewFeature/master/LICENSE) 6 | [![CocoaPods](https://img.shields.io/cocoapods/p/LCNewFeature.svg)](http://cocoadocs.org/docsets/LCNewFeature) 7 | [![LeoDev](https://img.shields.io/badge/blog-LeoDev.me-brightgreen.svg)](http://leodev.me) 8 | 9 | 几行代码快速集成新特性界面! 10 | 11 | ![LCNewFeature](https://raw.githubusercontent.com/iTofu/LCNewFeature/master/ScreenShot.png) 12 | 13 | ```` 14 | In me the tiger sniffs the rose. 15 | 16 | 心有猛虎,细嗅蔷薇。 17 | ```` 18 | 19 | 欢迎访问 **[我的博客](http://LeoDev.me)** ~ 20 | 21 | 22 | 23 | ## 前言 Foreword 24 | 25 | 每次拿到一个项目的时候,头疼的几件事之一就是新特性界面,写一堆代码做一个简单的东西。所以抽空写了个快速集成新特性界面的框架,传了上来共享之~ 26 | 27 | 28 | 29 | ## 代码 Code 30 | 31 | * 下面是示例代码,请多参考Demo!! 32 | 33 | * 两种集成方法任选一: 34 | 35 | - 方法一:[CocoaPods](https://cocoapods.org/) 导入:`pod 'LCNewFeature'` 36 | - 方法二:在Demo中找到 `LCNewFeature` 文件夹,拖拽到你的项目中。 37 | 38 | * 在 `AppDelegate.m` 文件中,导入头文件:`#import "LCNewFeature.h"`,参考下列代码快速集成: 39 | 40 | ````objc 41 | BOOL showNewFeature = [LCNewFeatureVC shouldShowNewFeature]; 42 | 43 | if (showNewFeature) { // 如果需要显示新特性界面 44 | 45 | __weak typeof(self) weakSelf = self; 46 | LCNewFeatureVC *newFeatureVC = [LCNewFeatureVC newFeatureWithImageName:@"new_feature" 47 | imageCount:3 48 | showPageControl:YES 49 | finishBlock:^{ 50 | 51 | [weakSelf enterMainVC]; 52 | }]; 53 | 54 | self.window.rootViewController = newFeatureVC; 55 | 56 | } else { // 如果不需要显示新特性界面 57 | 58 | [self enterMainVC]; 59 | } 60 | ```` 61 | 62 | * `enterMainVC` (进入主界面) 方法参考: 63 | 64 | ````objc 65 | - (void)enterMainVC { 66 | 67 | UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 68 | 69 | self.window.rootViewController = storyboard.instantiateInitialViewController; 70 | } 71 | ```` 72 | 73 | * 回调当前页码的 delegate:(`@optional`) 74 | 75 | ````objc 76 | // 当前页码的代理 77 | newFeatureVC.delegate = self; 78 | 79 | // ... 80 | 81 | #pragma mark - LCNewFeatureVC Delegate 82 | 83 | - (void)newFeatureVC:(LCNewFeatureVC *)newFeatureVC page:(NSInteger)page { 84 | NSLog(@"%@ -> Page: %d", newFeatureVC, (int)page); 85 | } 86 | ```` 87 | 88 | * 有一些神奇的地方,比如赋值只需要传一次图片名是为什么?其实是这样的,你需要按以下规范来给图片命名:(这其实是美工的事:)) 89 | 90 | ```` 91 | 比如图片原名:`NewFeature@2x.png` 92 | 93 | 规范: 94 | `NewFeature_1@2x.png` 将作为第一张图展示 95 | `NewFeature_2@2x.png` 将作为第二张图展示 96 | ... 97 | ```` 98 | 99 | * 那么怎么适配不同尺寸的屏幕呢?简单,不用动代码,还是规范图片命名:(这还是美工的事:)) 100 | 101 | ```` 102 | 比如图片原名:`NewFeature_1@2x.png` 103 | 104 | 规范: 105 | `NewFeature_1@2x.png` 将展示在 iPhone 4 / 4s 上 106 | `NewFeature_1_iphone5@2x.png` 将展示在 iPhone 5 / 5s 上 107 | `NewFeature_1_iphone6@2x.png` 将展示在 iPhone 6 / 6s 上 108 | `NewFeature_1_iphone6p@2x.png` 将展示在 iPhone 6 p / 6s p 上 109 | ```` 110 | 111 | 112 | 113 | ## 版本 Release 114 | 115 | ### V 1.1.3 (2016.05.03) 116 | 117 | 118 | * 去除 Log。 119 | 120 | ### V 1.1.2 (2016.04.22) 121 | 122 | * 添加代理协议,回调当前页码。详见 [Issue 5](https://github.com/iTofu/LCNewFeature/issues/5)。 123 | 124 | 125 | ### V 1.1.1 (2016.04.05) 126 | 127 | * 更新 CocoaPods 源地址。 128 | 129 | 130 | ### V 1.1.0 (2016.03.23) 131 | 132 | * 添加跳过按钮。 133 | 134 | ````objc 135 | __weak typeof(self) weakSelf = self; 136 | 137 | newFeatureVC.showSkip = YES; 138 | newFeatureVC.skipBlock = ^(void) { 139 | [weakSelf enterMainVC]; // 进入首页 140 | }; 141 | ```` 142 | 143 | 144 | ### V 1.0.3 (2015.12.07) 145 | 146 | * Demo 中添加演示:切换 RootVC 时,如何搞淡入淡出效果。😈😈 147 | 148 | 149 | 150 | ### V 1.0.3 (2015.11.13) 151 | 152 | * 添加对 iPhone 6 / 6s / 6 p / 6s p 的放大模式的支持,感谢 [RobinChao](https://github.com/RobinChao) 等同学的提醒。 153 | 154 | * 已针对放大模式进行了显示测试和边框校对,例:Demo 中的 iPhone 6 / 6s 第一张启动图。(根目录下有个 PSD 文件,参考修改)附:放大模式下屏幕分辨率: 155 | - iPhone 6 / 6s 的放大模式下,屏幕分辨率为:640 x 1136 (框架将使用 iPhone 5 的图) 156 | - iPhone 6 p / 6s p 的放大模式下,屏幕分辨率为:1125 x 2001 (框架将使用 iPhone 6 p 的图) 157 | 158 | 159 | ### V 1.0.2 (2015.11.09) 160 | 161 | * 添加对 [CocoaPods](https://cocoapods.org/) 的支持:`pod 'LCNewFeature'` 162 | 163 | 164 | ### V 1.0.0 (2015.05.05) 165 | 166 | * 初始化提交。 167 | 168 | * 添加一些界面跳转的动画效果。 169 | 170 | 171 | 172 | ## 提示 Tips 173 | 174 | * 提供了两种进入主界面的方式: 175 | 176 | ```objc 177 | + (instancetype)newFeatureWithImageName:(NSString *)imageName imageCount:(NSInteger)imageCount showPageControl:(BOOL)showPageControl finishBlock:(finishBlock)finishBlock; 178 | 将通过一直左划的方式,通过block回调进入主界面。 179 | + (instancetype)newFeatureWithImageName:(NSString *)imageName imageCount:(NSInteger)imageCount showPageControl:(BOOL)showPageControl enterButton:(UIButton *)enterButton; 180 | 将在最后一张新特性图片上添加一个按钮,然后点击按钮进入主界面,按钮的属性设置好再传入(参考Demo中的代码)。 181 | ``` 182 | 183 | * 上述方法都是类方法,也提供了实例方法 `initWith...` 什么的,视个人习惯调用。 184 | 185 | * 提供了一些属性,可选设置: 186 | 187 | - 当前点(分页控制器)的颜色:`pointCurrentColor` 188 | - 其他点(分页控制器)的颜色:`pointOtherColor` 189 | - 状态栏样式:`statusBarStyle` 190 | 191 | * 记住一句话:经理可以顶,职位可以辞,但是服务器的哥们和美工的妹子绝对不能惹!2333 192 | 193 | * 多参考 Demo,如果还有问题或者建议,请联系我,我也想做的更好!联系方式在下面:) 194 | 195 | 196 | 197 | ## 联系 Support 198 | 199 | * 发现问题请直接 Issue,谢谢 :) 200 | 201 | * Mail: devtip@163.com 202 | 203 | * Blog: http://LeoDev.me 204 | 205 | 206 | ## 授权 License 207 | 208 | 本项目采用 [MIT license](http://opensource.org/licenses/MIT) 开源,你可以利用采用该协议的代码做任何事情,只需要继续继承 MIT 协议即可。 209 | -------------------------------------------------------------------------------- /ScreenShot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/ScreenShot.png -------------------------------------------------------------------------------- /new_feature_1_iphone6@2x.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iTofu/LCNewFeature/d66ebf53a9adb097ff9413258e9c4bed1eaf3e94/new_feature_1_iphone6@2x.psd --------------------------------------------------------------------------------