diff --git a/SDPhotoBrowser.xcodeproj/project.pbxproj b/SDPhotoBrowser.xcodeproj/project.pbxproj index 5c9d98d..5ccde0d 100755 --- a/SDPhotoBrowser.xcodeproj/project.pbxproj +++ b/SDPhotoBrowser.xcodeproj/project.pbxproj @@ -419,6 +419,9 @@ LastUpgradeCheck = 0510; ORGANIZATIONNAME = GSD; TargetAttributes = { + 9973FAAD1A824A1E0089A512 = { + DevelopmentTeam = P2E5TAYSV6; + }; 9973FACE1A824A1F0089A512 = { TestTargetID = 9973FAAD1A824A1E0089A512; }; @@ -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"; @@ -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"; diff --git a/SDPhotoBrowser.xcodeproj/project.xcworkspace/xcuserdata/hennychen.xcuserdatad/UserInterfaceState.xcuserstate b/SDPhotoBrowser.xcodeproj/project.xcworkspace/xcuserdata/hennychen.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..aeac8ed Binary files /dev/null and b/SDPhotoBrowser.xcodeproj/project.xcworkspace/xcuserdata/hennychen.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcschemes/SDPhotoBrowser.xcscheme b/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcschemes/SDPhotoBrowser.xcscheme new file mode 100644 index 0000000..8b6f48d --- /dev/null +++ b/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcschemes/SDPhotoBrowser.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcschemes/xcschememanagement.plist b/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..31b4b30 --- /dev/null +++ b/SDPhotoBrowser.xcodeproj/xcuserdata/hennychen.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + SDPhotoBrowser.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 9973FAAD1A824A1E0089A512 + + primary + + + 9973FACE1A824A1F0089A512 + + primary + + + + + diff --git a/SDPhotoBrowser/Demo/DemoVC/DemoCollectionViewVC/SDCollectionViewController.m b/SDPhotoBrowser/Demo/DemoVC/DemoCollectionViewVC/SDCollectionViewController.m index 7524564..87657b7 100644 --- a/SDPhotoBrowser/Demo/DemoVC/DemoCollectionViewVC/SDCollectionViewController.m +++ b/SDPhotoBrowser/Demo/DemoVC/DemoCollectionViewVC/SDCollectionViewController.m @@ -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]; diff --git a/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.h b/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.h index 9fe04fe..089d79d 100755 --- a/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.h +++ b/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.h @@ -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 delegate; - (void)show; diff --git a/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m b/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m index 1a420e2..b4507b1 100755 --- a/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m +++ b/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m @@ -30,6 +30,7 @@ @implementation SDPhotoBrowser UILabel *_indexLabel; UIButton *_saveButton; UIActivityIndicatorView *_indicatorView; + UITextView * txtDesc; BOOL _willDisappear; } @@ -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. 序标