Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SDPhotoBrowser.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = GSD;
TargetAttributes = {
9973FAAD1A824A1E0089A512 = {
DevelopmentTeam = P2E5TAYSV6;
};
9973FACE1A824A1F0089A512 = {
TestTargetID = 9973FAAD1A824A1E0089A512;
};
Expand Down Expand Up @@ -615,6 +618,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = P2E5TAYSV6;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SDPhotoBrowser/Others/SDPhotoBrowser-Prefix.pch";
INFOPLIST_FILE = "SDPhotoBrowser/Others/SDPhotoBrowser-Info.plist";
Expand All @@ -629,6 +633,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = P2E5TAYSV6;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SDPhotoBrowser/Others/SDPhotoBrowser-Prefix.pch";
INFOPLIST_FILE = "SDPhotoBrowser/Others/SDPhotoBrowser-Info.plist";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9973FAAD1A824A1E0089A512"
BuildableName = "SDPhotoBrowser.app"
BlueprintName = "SDPhotoBrowser"
ReferencedContainer = "container:SDPhotoBrowser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9973FACE1A824A1F0089A512"
BuildableName = "SDPhotoBrowserTests.xctest"
BlueprintName = "SDPhotoBrowserTests"
ReferencedContainer = "container:SDPhotoBrowser.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9973FAAD1A824A1E0089A512"
BuildableName = "SDPhotoBrowser.app"
BlueprintName = "SDPhotoBrowser"
ReferencedContainer = "container:SDPhotoBrowser.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9973FAAD1A824A1E0089A512"
BuildableName = "SDPhotoBrowser.app"
BlueprintName = "SDPhotoBrowser"
ReferencedContainer = "container:SDPhotoBrowser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9973FAAD1A824A1E0089A512"
BuildableName = "SDPhotoBrowser.app"
BlueprintName = "SDPhotoBrowser"
ReferencedContainer = "container:SDPhotoBrowser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
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>SDPhotoBrowser.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9973FAAD1A824A1E0089A512</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9973FACE1A824A1F0089A512</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
SDPhotoBrowser *photoBrowser = [SDPhotoBrowser new];
photoBrowser.delegate = self;
photoBrowser.currentImageIndex = indexPath.item;
photoBrowser.desc = @"dddsdsd";
photoBrowser.imageCount = self.modelsArray.count;

photoBrowser.sourceImagesContainerView = self.collectionView;

[photoBrowser show];
Expand Down
3 changes: 2 additions & 1 deletion SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
@property (nonatomic, weak) UIView *sourceImagesContainerView;
@property (nonatomic, assign) NSInteger currentImageIndex;
@property (nonatomic, assign) NSInteger imageCount;

@property (nonatomic, assign)BOOL enableToolbar;//是否启用工具栏
@property (nonatomic, strong) NSString * desc;//图片描述
@property (nonatomic, weak) id<SDPhotoBrowserDelegate> delegate;

- (void)show;
Expand Down
20 changes: 18 additions & 2 deletions SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ @implementation SDPhotoBrowser
UILabel *_indexLabel;
UIButton *_saveButton;
UIActivityIndicatorView *_indicatorView;
UITextView * txtDesc;
BOOL _willDisappear;
}

Expand All @@ -45,16 +46,31 @@ - (id)initWithFrame:(CGRect)frame

- (void)didMoveToSuperview
{

[self setupScrollView];
if (_enableToolbar) {
[self setupToolbars];
}

[self setupToolbars];
[self setupDesc];
}

- (void)dealloc
{
[[UIApplication sharedApplication].keyWindow removeObserver:self forKeyPath:@"frame"];
}

//初始化描述
-(void)setupDesc{
txtDesc = [[UITextView alloc] initWithFrame:CGRectMake(0.0, self.frame.size.height - 100.0, self.frame.size.width, 100.0)];
txtDesc.backgroundColor = [UIColor clearColor];
txtDesc.font = [UIFont systemFontOfSize:18.0];
txtDesc.textColor = [UIColor whiteColor];
txtDesc.text = _desc;
txtDesc.textAlignment = NSTextAlignmentCenter;
[self addSubview:txtDesc];

}
//初始化工具栏
- (void)setupToolbars
{
// 1. 序标
Expand Down