-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94111cd
commit 18aedfe
Showing
47 changed files
with
3,346 additions
and
44 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
112 changes: 112 additions & 0 deletions
112
...NewFeatureVC.xcodeproj/xcuserdata/Charlin.xcuserdatad/xcschemes/CoreNewFeatureVC.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "0630" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "89335F5E1AEDFEE800BC444B" | ||
BuildableName = "CoreNewFeatureVC.app" | ||
BlueprintName = "CoreNewFeatureVC" | ||
ReferencedContainer = "container:CoreNewFeatureVC.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "NO" | ||
buildForArchiving = "NO" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "89335F771AEDFEE800BC444B" | ||
BuildableName = "CoreNewFeatureVCTests.xctest" | ||
BlueprintName = "CoreNewFeatureVCTests" | ||
ReferencedContainer = "container:CoreNewFeatureVC.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
buildConfiguration = "Debug"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "89335F771AEDFEE800BC444B" | ||
BuildableName = "CoreNewFeatureVCTests.xctest" | ||
BlueprintName = "CoreNewFeatureVCTests" | ||
ReferencedContainer = "container:CoreNewFeatureVC.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "89335F5E1AEDFEE800BC444B" | ||
BuildableName = "CoreNewFeatureVC.app" | ||
BlueprintName = "CoreNewFeatureVC" | ||
ReferencedContainer = "container:CoreNewFeatureVC.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</TestAction> | ||
<LaunchAction | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
buildConfiguration = "Debug" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "89335F5E1AEDFEE800BC444B" | ||
BuildableName = "CoreNewFeatureVC.app" | ||
BlueprintName = "CoreNewFeatureVC" | ||
ReferencedContainer = "container:CoreNewFeatureVC.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
buildConfiguration = "Release" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "89335F5E1AEDFEE800BC444B" | ||
BuildableName = "CoreNewFeatureVC.app" | ||
BlueprintName = "CoreNewFeatureVC" | ||
ReferencedContainer = "container:CoreNewFeatureVC.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
27 changes: 27 additions & 0 deletions
27
CoreNewFeatureVC.xcodeproj/xcuserdata/Charlin.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>CoreNewFeatureVC.xcscheme</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
<key>SuppressBuildableAutocreation</key> | ||
<dict> | ||
<key>89335F5E1AEDFEE800BC444B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>89335F771AEDFEE800BC444B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// CoreNewFeatureVC.h | ||
// CoreNewFeatureVC | ||
// | ||
// Created by 冯成林 on 15/4/27. | ||
// Copyright (c) 2015年 冯成林. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "NewFeatureModel.h" | ||
|
||
|
||
@interface CoreNewFeatureVC : UIViewController | ||
|
||
@property (nonatomic,strong) NSArray *images; | ||
|
||
|
||
|
||
/* | ||
* 初始化 | ||
*/ | ||
+(instancetype)newFeatureVCWithModels:(NSArray *)models; | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
// | ||
// CoreNewFeatureVC.m | ||
// CoreNewFeatureVC | ||
// | ||
// Created by 冯成林 on 15/4/27. | ||
// Copyright (c) 2015年 冯成林. All rights reserved. | ||
// | ||
|
||
#import "CoreNewFeatureVC.h" | ||
#import "UIView+Masony.h" | ||
#import "NewFeatureScrollView.h" | ||
#import "NewFeatureImageV.h" | ||
|
||
|
||
@interface CoreNewFeatureVC () | ||
|
||
|
||
/** 模型数组 */ | ||
@property (nonatomic,strong) NSArray *models; | ||
|
||
/** scrollView */ | ||
@property (nonatomic,weak) NewFeatureScrollView *scrollView; | ||
|
||
|
||
@end | ||
|
||
@implementation CoreNewFeatureVC | ||
|
||
/* | ||
* 初始化 | ||
*/ | ||
+(instancetype)newFeatureVCWithModels:(NSArray *)models{ | ||
|
||
CoreNewFeatureVC *newFeatureVC = [[CoreNewFeatureVC alloc] init]; | ||
|
||
newFeatureVC.models = models; | ||
|
||
return newFeatureVC; | ||
} | ||
|
||
|
||
-(void)viewDidLoad{ | ||
|
||
[super viewDidLoad]; | ||
|
||
//控制器准备 | ||
[self vcPrepare]; | ||
} | ||
|
||
|
||
/* | ||
* 控制器准备 | ||
*/ | ||
-(void)vcPrepare{ | ||
|
||
//添加scrollView | ||
NewFeatureScrollView *scrollView = [[NewFeatureScrollView alloc] init]; | ||
|
||
_scrollView = scrollView; | ||
|
||
//添加 | ||
[self.view addSubview:scrollView]; | ||
|
||
//添加约束 | ||
[scrollView masViewAddConstraintMakeEqualSuperViewWithInsets:UIEdgeInsetsZero]; | ||
|
||
//添加图片 | ||
[self imageViewsPrepare]; | ||
} | ||
|
||
|
||
|
||
|
||
/* | ||
* 添加图片 | ||
*/ | ||
-(void)imageViewsPrepare{ | ||
|
||
[self.models enumerateObjectsUsingBlock:^(NewFeatureModel *model, NSUInteger idx, BOOL *stop) { | ||
|
||
NewFeatureImageV *imageV = [[NewFeatureImageV alloc] init]; | ||
|
||
//设置图片 | ||
imageV.image = model.image; | ||
|
||
//记录tag | ||
imageV.tag = idx; | ||
|
||
if(idx == self.models.count -1) { | ||
|
||
//开启交互 | ||
imageV.userInteractionEnabled = YES; | ||
|
||
//添加手势 | ||
[imageV addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gestureAction:)]]; | ||
} | ||
|
||
[_scrollView addSubview:imageV]; | ||
}]; | ||
} | ||
|
||
|
||
|
||
-(void)gestureAction:(UITapGestureRecognizer *)tap{ | ||
|
||
UIView *tapView = tap.view; | ||
|
||
//禁用 | ||
tapView.userInteractionEnabled = NO; | ||
|
||
if(UIGestureRecognizerStateEnded == tap.state) [self dismiss]; | ||
|
||
|
||
} | ||
|
||
-(void)dismiss{ | ||
NSLog(@"消失"); | ||
} | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// NewFeatureModel.h | ||
// CoreNewFeatureVC | ||
// | ||
// Created by 冯成林 on 15/4/27. | ||
// Copyright (c) 2015年 冯成林. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <UIKit/UIKit.h> | ||
|
||
@interface NewFeatureModel : NSObject | ||
|
||
@property (nonatomic,strong) UIImage *image; | ||
|
||
|
||
/* | ||
* 初始化 | ||
*/ | ||
+(instancetype)model:(UIImage *)image; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// NewFeatureModel.m | ||
// CoreNewFeatureVC | ||
// | ||
// Created by 冯成林 on 15/4/27. | ||
// Copyright (c) 2015年 冯成林. All rights reserved. | ||
// | ||
|
||
#import "NewFeatureModel.h" | ||
|
||
@implementation NewFeatureModel | ||
|
||
/* | ||
* 初始化 | ||
*/ | ||
+(instancetype)model:(UIImage *)image{ | ||
|
||
NewFeatureModel *model = [[NewFeatureModel alloc] init]; | ||
|
||
model.image = image; | ||
|
||
return model; | ||
} | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.