├── PhotoSecurity ├── zh-Hans.lproj │ ├── LaunchScreen.strings │ └── Main.strings ├── Assets.xcassets │ ├── Contents.json │ ├── HUD │ │ ├── Contents.json │ │ ├── hud-error.imageset │ │ │ ├── hud-error@2x.png │ │ │ ├── hud-error@3x.png │ │ │ └── Contents.json │ │ ├── hud-info.imageset │ │ │ ├── hud-info@2x.png │ │ │ ├── hud-info@3x.png │ │ │ └── Contents.json │ │ └── hud-success.imageset │ │ │ ├── hud-success@2x.png │ │ │ ├── hud-success@3x.png │ │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── AppIcon20.png │ │ ├── AppIcon29.png │ │ ├── AppIcon40.png │ │ ├── AppIcon76.png │ │ ├── AppIcon20@2x.png │ │ ├── AppIcon20@3x.png │ │ ├── AppIcon29@2x.png │ │ ├── AppIcon29@3x.png │ │ ├── AppIcon40@2x.png │ │ ├── AppIcon40@3x.png │ │ ├── AppIcon60@2x.png │ │ ├── AppIcon60@3x.png │ │ ├── AppIcon76@2x.png │ │ ├── AppIcon835@2x.png │ │ ├── AppIcon20@2x-1.png │ │ ├── AppIcon29@2x-1.png │ │ ├── AppIcon40@2x-1.png │ │ └── Contents.json │ ├── icon-add.imageset │ │ ├── icon-add@2x.png │ │ ├── icon-add@3x.png │ │ └── Contents.json │ ├── round-logo.imageset │ │ ├── round-logo.png │ │ ├── round-logo@2x.png │ │ ├── round-logo@3x.png │ │ └── Contents.json │ ├── empty-box.imageset │ │ ├── empty-box@2x.png │ │ ├── empty-box@3x.png │ │ └── Contents.json │ ├── icon-back.imageset │ │ ├── icon-back@2x.png │ │ ├── icon-back@3x.png │ │ └── Contents.json │ ├── icon-done.imageset │ │ ├── icon-done@2x.png │ │ ├── icon-done@3x.png │ │ └── Contents.json │ ├── icon-edit.imageset │ │ ├── icon-edit@2x.png │ │ ├── icon-edit@3x.png │ │ └── Contents.json │ ├── home-album.imageset │ │ ├── home-album@2x.png │ │ ├── home-album@3x.png │ │ └── Contents.json │ ├── icon-setting.imageset │ │ ├── icon-setting@2x.png │ │ ├── icon-setting@3x.png │ │ └── Contents.json │ ├── unauthorized.imageset │ │ ├── unauthorized@2x.png │ │ ├── unauthorized@3x.png │ │ └── Contents.json │ ├── icon-selected.imageset │ │ ├── icon-selected@2x.png │ │ ├── icon-selected@3x.png │ │ └── Contents.json │ ├── gif-identifier.imageset │ │ ├── gif-identifier@2x.png │ │ ├── gif-identifier@3x.png │ │ └── Contents.json │ ├── video-identifier.imageset │ │ ├── video-identifier@2x.png │ │ ├── video-identifier@3x.png │ │ └── Contents.json │ └── album-placeholder.imageset │ │ ├── album-placeholder@2x.png │ │ ├── album-placeholder@3x.png │ │ └── Contents.json ├── Resources │ └── AlternateIcon │ │ ├── AppAlternateIcon@2x.png │ │ ├── AppAlternateIcon@3x.png │ │ ├── AppAlternateIcon2@2x.png │ │ ├── AppAlternateIcon2@3x.png │ │ ├── AppAlternateIconiPad2@2x.png │ │ └── AppAlternateIconiPad@2x.png ├── System │ ├── Base.lproj │ │ ├── InfoPlist.strings │ │ └── Localizable.strings │ ├── AppDelegate.h │ ├── zh-Hans.lproj │ │ ├── InfoPlist.strings │ │ └── Localizable.strings │ ├── main.m │ ├── PhotoSecurity-prefix.pch │ ├── AppDelegate.m │ └── Info.plist ├── Home │ ├── Model │ │ ├── XPAlbumModel.m │ │ └── XPAlbumModel.h │ ├── Controller │ │ ├── XPHomeViewController.h │ │ ├── XPUnlockViewController.h │ │ ├── XPSetPasswordViewController.h │ │ ├── XPUnlockViewController.m │ │ └── XPSetPasswordViewController.m │ └── View │ │ ├── XPAlbumCell.h │ │ └── XPAlbumCell.m ├── AlbumDetail │ ├── Model │ │ ├── XPPhotoModel.m │ │ └── XPPhotoModel.h │ ├── Controller │ │ └── XPAlbumDetailViewController.h │ └── View │ │ ├── XPAlbumDetailCell.h │ │ └── XPAlbumDetailCell.m ├── General │ ├── Category │ │ ├── QLPreviewController+XP.h │ │ ├── UIViewController+XP.h │ │ ├── NSString+XP.h │ │ ├── UIColor+XP.h │ │ ├── Image+Snapshot.h │ │ ├── UIView+XP.h │ │ ├── QLPreviewController+XP.m │ │ ├── NSString+XP.m │ │ ├── UIViewController+XP.m │ │ ├── UIColor+XP.m │ │ ├── UIImage+XP.h │ │ ├── Image+Snapshot.m │ │ └── UIView+XP.m │ ├── Controller │ │ ├── XPNavigationController.h │ │ └── XPNavigationController.m │ ├── Library │ │ ├── XMFTPServer │ │ │ ├── XMFTPHelper.h │ │ │ ├── XMFTPDefines.h │ │ │ ├── XMFTPDataConnection.h │ │ │ ├── xmftp_commands.plist │ │ │ └── XMFTPServer.h │ │ └── GHPopupEditView │ │ │ └── GHPopupEditView.h │ └── Utils │ │ ├── XPPasswordTool.h │ │ ├── XPProgressHUD.h │ │ ├── XPPasswordTool.m │ │ ├── XPSQLiteManager.h │ │ └── functions.h ├── Setting │ ├── Controller │ │ ├── XPFTPViewController.h │ │ ├── XPSettingViewController.h │ │ ├── XPChangePasswordViewController.h │ │ ├── XPFTPViewController.m │ │ └── XPChangePasswordViewController.m │ └── View │ │ ├── XPSettingCell.h │ │ └── XPSettingCell.m ├── Photos │ ├── Controller │ │ ├── XPPhotoCollectionViewController.h │ │ └── XPPhotoPickerViewController.h │ ├── Model │ │ ├── XPAlbumCollectionModel.h │ │ └── XPAlbumCollectionModel.m │ └── View │ │ ├── XPPhotoCollectionViewCell.h │ │ └── XPPhotoCollectionViewCell.m └── Base.lproj │ └── LaunchScreen.storyboard ├── Pods ├── Headers │ ├── Private │ │ ├── FMDB │ │ │ ├── FMDB.h │ │ │ ├── FMDatabase.h │ │ │ ├── FMResultSet.h │ │ │ ├── FMDatabasePool.h │ │ │ ├── FMDatabaseQueue.h │ │ │ └── FMDatabaseAdditions.h │ │ ├── MBProgressHUD │ │ │ └── MBProgressHUD.h │ │ ├── IQKeyboardManager │ │ │ ├── IQToolbar.h │ │ │ ├── IQKeyboardManager.h │ │ │ ├── IQTextView.h │ │ │ ├── IQBarButtonItem.h │ │ │ ├── IQNSArray+Sort.h │ │ │ ├── IQPreviousNextView.h │ │ │ ├── IQTitleBarButtonItem.h │ │ │ ├── IQUIView+Hierarchy.h │ │ │ ├── IQKeyboardReturnKeyHandler.h │ │ │ ├── IQUIWindow+Hierarchy.h │ │ │ ├── IQUIScrollView+Additions.h │ │ │ ├── IQKeyboardManagerConstants.h │ │ │ ├── IQUITextFieldView+Additions.h │ │ │ ├── IQUIView+IQKeyboardToolbar.h │ │ │ ├── IQUIViewController+Additions.h │ │ │ └── IQKeyboardManagerConstantsInternal.h │ │ └── DZNEmptyDataSet │ │ │ └── UIScrollView+EmptyDataSet.h │ └── Public │ │ ├── FMDB │ │ ├── FMDB.h │ │ ├── FMDatabase.h │ │ ├── FMResultSet.h │ │ ├── FMDatabasePool.h │ │ ├── FMDatabaseQueue.h │ │ └── FMDatabaseAdditions.h │ │ ├── MBProgressHUD │ │ └── MBProgressHUD.h │ │ ├── IQKeyboardManager │ │ ├── IQTextView.h │ │ ├── IQToolbar.h │ │ ├── IQKeyboardManager.h │ │ ├── IQBarButtonItem.h │ │ ├── IQNSArray+Sort.h │ │ ├── IQPreviousNextView.h │ │ ├── IQTitleBarButtonItem.h │ │ ├── IQUIView+Hierarchy.h │ │ ├── IQUIWindow+Hierarchy.h │ │ ├── IQKeyboardReturnKeyHandler.h │ │ ├── IQUIScrollView+Additions.h │ │ ├── IQKeyboardManagerConstants.h │ │ ├── IQUITextFieldView+Additions.h │ │ ├── IQUIView+IQKeyboardToolbar.h │ │ ├── IQUIViewController+Additions.h │ │ └── IQKeyboardManagerConstantsInternal.h │ │ └── DZNEmptyDataSet │ │ └── UIScrollView+EmptyDataSet.h ├── Target Support Files │ ├── FMDB │ │ ├── FMDB-prefix.pch │ │ ├── FMDB-dummy.m │ │ └── FMDB.xcconfig │ ├── MBProgressHUD │ │ ├── MBProgressHUD-prefix.pch │ │ ├── MBProgressHUD-dummy.m │ │ └── MBProgressHUD.xcconfig │ ├── DZNEmptyDataSet │ │ ├── DZNEmptyDataSet-prefix.pch │ │ ├── DZNEmptyDataSet-dummy.m │ │ └── DZNEmptyDataSet.xcconfig │ ├── IQKeyboardManager │ │ ├── IQKeyboardManager-prefix.pch │ │ ├── IQKeyboardManager-dummy.m │ │ └── IQKeyboardManager.xcconfig │ └── Pods-PhotoSecurity │ │ ├── Pods-PhotoSecurity-dummy.m │ │ ├── Pods-PhotoSecurity.debug.xcconfig │ │ ├── Pods-PhotoSecurity.release.xcconfig │ │ └── Pods-PhotoSecurity-frameworks.sh ├── IQKeyboardManager │ ├── IQKeyboardManager │ │ ├── Resources │ │ │ └── IQKeyboardManager.bundle │ │ │ │ ├── IQButtonBarArrowUp@2x.png │ │ │ │ ├── IQButtonBarArrowUp@3x.png │ │ │ │ ├── IQButtonBarArrowDown@2x.png │ │ │ │ ├── IQButtonBarArrowDown@3x.png │ │ │ │ ├── IQButtonBarArrowLeft@2x.png │ │ │ │ ├── IQButtonBarArrowLeft@3x.png │ │ │ │ ├── IQButtonBarArrowRight@2x.png │ │ │ │ ├── IQButtonBarArrowRight@3x.png │ │ │ │ ├── zh-Hans │ │ │ │ └── IQKeyboardManager.strings │ │ │ │ ├── zh-Hant │ │ │ │ └── IQKeyboardManager.strings │ │ │ │ ├── en.lproj │ │ │ │ └── IQKeyboardManager.strings │ │ │ │ ├── de.lproj │ │ │ │ └── IQKeyboardManager.strings │ │ │ │ ├── fr.lproj │ │ │ │ └── IQKeyboardManager.strings │ │ │ │ └── es.lproj │ │ │ │ └── IQKeyboardManager.strings │ │ ├── IQToolbar │ │ │ ├── IQPreviousNextView.m │ │ │ ├── IQBarButtonItem.h │ │ │ ├── IQPreviousNextView.h │ │ │ ├── IQToolbar.h │ │ │ ├── IQTitleBarButtonItem.h │ │ │ └── IQTitleBarButtonItem.m │ │ ├── Categories │ │ │ ├── IQUIScrollView+Additions.h │ │ │ ├── IQUIViewController+Additions.h │ │ │ ├── IQUIViewController+Additions.m │ │ │ ├── IQNSArray+Sort.h │ │ │ ├── IQUIWindow+Hierarchy.h │ │ │ ├── IQUITextFieldView+Additions.h │ │ │ ├── IQUIScrollView+Additions.m │ │ │ ├── IQUIWindow+Hierarchy.m │ │ │ ├── IQUITextFieldView+Additions.m │ │ │ ├── IQNSArray+Sort.m │ │ │ └── IQUIView+Hierarchy.h │ │ ├── IQTextView │ │ │ ├── IQTextView.h │ │ │ └── IQTextView.m │ │ ├── Constants │ │ │ └── IQKeyboardManagerConstantsInternal.h │ │ └── IQKeyboardReturnKeyHandler.h │ └── LICENSE.md ├── FMDB │ ├── src │ │ └── fmdb │ │ │ └── FMDB.h │ └── LICENSE.txt ├── Manifest.lock ├── DZNEmptyDataSet │ └── LICENSE └── MBProgressHUD │ └── LICENSE ├── demo.gif ├── AppIcon.sketch ├── gif-video.gif ├── Podfile ├── PhotoSecurity.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── PhotoSecurity.xcworkspace └── contents.xcworkspacedata ├── Podfile.lock ├── LICENSE ├── README.md └── .gitignore /PhotoSecurity/zh-Hans.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Pods/Headers/Private/FMDB/FMDB.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDB.h -------------------------------------------------------------------------------- /Pods/Headers/Public/FMDB/FMDB.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDB.h -------------------------------------------------------------------------------- /Pods/Headers/Private/FMDB/FMDatabase.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabase.h -------------------------------------------------------------------------------- /Pods/Headers/Public/FMDB/FMDatabase.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabase.h -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/demo.gif -------------------------------------------------------------------------------- /Pods/Headers/Private/FMDB/FMResultSet.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMResultSet.h -------------------------------------------------------------------------------- /Pods/Headers/Public/FMDB/FMResultSet.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMResultSet.h -------------------------------------------------------------------------------- /AppIcon.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/AppIcon.sketch -------------------------------------------------------------------------------- /Pods/Headers/Private/FMDB/FMDatabasePool.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabasePool.h -------------------------------------------------------------------------------- /Pods/Headers/Private/FMDB/FMDatabaseQueue.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseQueue.h -------------------------------------------------------------------------------- /Pods/Headers/Public/FMDB/FMDatabasePool.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabasePool.h -------------------------------------------------------------------------------- /Pods/Headers/Public/FMDB/FMDatabaseQueue.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseQueue.h -------------------------------------------------------------------------------- /gif-video.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/gif-video.gif -------------------------------------------------------------------------------- /Pods/Headers/Private/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Private/FMDB/FMDatabaseAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/FMDB/FMDatabaseAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseAdditions.h -------------------------------------------------------------------------------- /Pods/Target Support Files/FMDB/FMDB-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQTextView.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQTextView/IQTextView.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Private/DZNEmptyDataSet/UIScrollView+EmptyDataSet.h: -------------------------------------------------------------------------------- 1 | ../../../DZNEmptyDataSet/Source/UIScrollView+EmptyDataSet.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardManager.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQKeyboardManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQTextView.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQTextView/IQTextView.h -------------------------------------------------------------------------------- /Pods/Headers/Public/DZNEmptyDataSet/UIScrollView+EmptyDataSet.h: -------------------------------------------------------------------------------- 1 | ../../../DZNEmptyDataSet/Source/UIScrollView+EmptyDataSet.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardManager.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQKeyboardManager.h -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQNSArray+Sort.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQNSArray+Sort.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQNSArray+Sort.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQNSArray+Sort.h -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQPreviousNextView.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQPreviousNextView.h -------------------------------------------------------------------------------- /Pods/Target Support Files/DZNEmptyDataSet/DZNEmptyDataSet-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQPreviousNextView.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQPreviousNextView.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQTitleBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIView+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIView+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQTitleBarButtonItem.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIView+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIView+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIWindow+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIWindow+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardReturnKeyHandler.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQKeyboardReturnKeyHandler.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIWindow+Hierarchy.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIWindow+Hierarchy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardReturnKeyHandler.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQKeyboardReturnKeyHandler.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIScrollView+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIScrollView+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIScrollView+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIScrollView+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardManagerConstants.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Constants/IQKeyboardManagerConstants.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUITextFieldView+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUITextFieldView+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIView+IQKeyboardToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQUIView+IQKeyboardToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardManagerConstants.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Constants/IQKeyboardManagerConstants.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUITextFieldView+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUITextFieldView+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIView+IQKeyboardToolbar.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/IQToolbar/IQUIView+IQKeyboardToolbar.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQUIViewController+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIViewController+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQUIViewController+Additions.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Categories/IQUIViewController+Additions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/IQKeyboardManager/IQKeyboardManagerConstantsInternal.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Constants/IQKeyboardManagerConstantsInternal.h -------------------------------------------------------------------------------- /Pods/Headers/Public/IQKeyboardManager/IQKeyboardManagerConstantsInternal.h: -------------------------------------------------------------------------------- 1 | ../../../IQKeyboardManager/IQKeyboardManager/Constants/IQKeyboardManagerConstantsInternal.h -------------------------------------------------------------------------------- /PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon@3x.png -------------------------------------------------------------------------------- /Pods/Target Support Files/FMDB/FMDB-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FMDB : NSObject 3 | @end 4 | @implementation PodsDummy_FMDB 5 | @end 6 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon76.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-add.imageset/icon-add@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-add.imageset/icon-add@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-add.imageset/icon-add@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-add.imageset/icon-add@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/round-logo.imageset/round-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/round-logo.imageset/round-logo.png -------------------------------------------------------------------------------- /PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon2@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Resources/AlternateIcon/AppAlternateIcon2@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon60@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon60@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon76@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon835@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon835@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/empty-box.imageset/empty-box@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/empty-box.imageset/empty-box@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/empty-box.imageset/empty-box@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/empty-box.imageset/empty-box@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-back.imageset/icon-back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-back.imageset/icon-back@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-back.imageset/icon-back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-back.imageset/icon-back@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-done.imageset/icon-done@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-done.imageset/icon-done@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-done.imageset/icon-done@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-done.imageset/icon-done@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-edit.imageset/icon-edit@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-edit.imageset/icon-edit@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-edit.imageset/icon-edit@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-edit.imageset/icon-edit@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Resources/AlternateIcon/AppAlternateIconiPad2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Resources/AlternateIcon/AppAlternateIconiPad2@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Resources/AlternateIcon/AppAlternateIconiPad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Resources/AlternateIcon/AppAlternateIconiPad@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon20@2x-1.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon29@2x-1.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/AppIcon.appiconset/AppIcon40@2x-1.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-error.imageset/hud-error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/HUD/hud-error.imageset/hud-error@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-error.imageset/hud-error@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/HUD/hud-error.imageset/hud-error@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-info.imageset/hud-info@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/HUD/hud-info.imageset/hud-info@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-info.imageset/hud-info@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/HUD/hud-info.imageset/hud-info@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/home-album.imageset/home-album@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/home-album.imageset/home-album@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/home-album.imageset/home-album@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/home-album.imageset/home-album@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/round-logo.imageset/round-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/round-logo.imageset/round-logo@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/round-logo.imageset/round-logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/round-logo.imageset/round-logo@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-setting.imageset/icon-setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-setting.imageset/icon-setting@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-setting.imageset/icon-setting@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-setting.imageset/icon-setting@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/unauthorized.imageset/unauthorized@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/unauthorized.imageset/unauthorized@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/unauthorized.imageset/unauthorized@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/unauthorized.imageset/unauthorized@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-success.imageset/hud-success@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/HUD/hud-success.imageset/hud-success@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-success.imageset/hud-success@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/HUD/hud-success.imageset/hud-success@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-selected.imageset/icon-selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-selected.imageset/icon-selected@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-selected.imageset/icon-selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/icon-selected.imageset/icon-selected@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/gif-identifier.imageset/gif-identifier@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/gif-identifier.imageset/gif-identifier@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/gif-identifier.imageset/gif-identifier@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/gif-identifier.imageset/gif-identifier@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/System/Base.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* 2 | InfoPlist.strings 3 | PhotoSecurity 4 | 5 | Created by nhope on 2017/3/23. 6 | Copyright © 2017年 xiaopin. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /PhotoSecurity/System/Base.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | PhotoSecurity 4 | 5 | Created by nhope on 2017/3/13. 6 | Copyright © 2017年 xiaopin. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/video-identifier.imageset/video-identifier@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/video-identifier.imageset/video-identifier@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/video-identifier.imageset/video-identifier@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/video-identifier.imageset/video-identifier@3x.png -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MBProgressHUD : NSObject 3 | @end 4 | @implementation PodsDummy_MBProgressHUD 5 | @end 6 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/album-placeholder.imageset/album-placeholder@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/album-placeholder.imageset/album-placeholder@2x.png -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/album-placeholder.imageset/album-placeholder@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/PhotoSecurity/Assets.xcassets/album-placeholder.imageset/album-placeholder@3x.png -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | 3 | target 'PhotoSecurity' do 4 | pod 'MBProgressHUD', '~> 1.0.0' 5 | pod 'IQKeyboardManager', '~> 4.0.8' 6 | pod 'DZNEmptyDataSet', '~> 1.8.1' 7 | pod 'FMDB', '~> 2.6.2' 8 | end 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/DZNEmptyDataSet/DZNEmptyDataSet-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_DZNEmptyDataSet : NSObject 3 | @end 4 | @implementation PodsDummy_DZNEmptyDataSet 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_IQKeyboardManager : NSObject 3 | @end 4 | @implementation PodsDummy_IQKeyboardManager 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PhotoSecurity/Pods-PhotoSecurity-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_PhotoSecurity : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_PhotoSecurity 5 | @end 6 | -------------------------------------------------------------------------------- /PhotoSecurity.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@2x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowUp@3x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@2x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowDown@3x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@2x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowLeft@3x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@2x.png -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaopin/PhotosVault/HEAD/Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/IQButtonBarArrowRight@3x.png -------------------------------------------------------------------------------- /PhotoSecurity/Home/Model/XPAlbumModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumModel.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/7. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPAlbumModel.h" 10 | 11 | @implementation XPAlbumModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/AlbumDetail/Model/XPPhotoModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPPhotoModel.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/16. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPPhotoModel.h" 10 | 11 | @implementation XPPhotoModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/QLPreviewController+XP.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLPreviewController+XP.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/23. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QLPreviewController (XP) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Setting/Controller/XPFTPViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPFTPViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/24. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPFTPViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/Controller/XPHomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPHomeViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by xiaopin on 2017/3/1. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPHomeViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/Controller/XPUnlockViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPUnlockViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/6. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPUnlockViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/FMDB/src/fmdb/FMDB.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double FMDBVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char FMDBVersionString[]; 5 | 6 | #import "FMDatabase.h" 7 | #import "FMResultSet.h" 8 | #import "FMDatabaseAdditions.h" 9 | #import "FMDatabaseQueue.h" 10 | #import "FMDatabasePool.h" 11 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Controller/XPNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPNavigationController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPNavigationController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/Controller/XPSetPasswordViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPSetPasswordViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/3. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPSetPasswordViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Setting/Controller/XPSettingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPSettingViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/20. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPSettingViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Setting/Controller/XPChangePasswordViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPChangePasswordViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/21. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPChangePasswordViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PhotoSecurity/System/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PhotoSecurity 4 | // 5 | // Created by xiaopin on 2017/3/1. 6 | // Copyright © 2017年 xiaopin. 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 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/View/XPAlbumCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumCell.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/24. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XPAlbumModel; 12 | 13 | @interface XPAlbumCell : UITableViewCell 14 | 15 | - (void)configureWithAlbum:(XPAlbumModel *)album; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /PhotoSecurity/System/zh-Hans.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* 2 | InfoPlist.strings 3 | PhotoSecurity 4 | 5 | Created by nhope on 2017/3/23. 6 | Copyright © 2017年 xiaopin. All rights reserved. 7 | */ 8 | 9 | "CFBundleDisplayName" = "相册保险柜"; 10 | "NSCameraUsageDescription" = "允许使用摄像头拍照/录制视频"; 11 | "NSMicrophoneUsageDescription" = "允许在录制视频时使用麦克风录制声音"; 12 | "NSPhotoLibraryUsageDescription" = "查看并选择系统相册图片"; 13 | -------------------------------------------------------------------------------- /PhotoSecurity/System/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PhotoSecurity 4 | // 5 | // Created by xiaopin on 2017/3/1. 6 | // Copyright © 2017年 xiaopin. 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 | -------------------------------------------------------------------------------- /PhotoSecurity/Setting/View/XPSettingCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPSettingCell.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/21. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPSettingCell : UITableViewCell 12 | 13 | @property (weak, nonatomic) IBOutlet UILabel *titleLabel; 14 | @property (weak, nonatomic) IBOutlet UISwitch *stateSwitch; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /PhotoSecurity/AlbumDetail/Controller/XPAlbumDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumDetailViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/8. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XPAlbumModel; 12 | 13 | @interface XPAlbumDetailViewController : UICollectionViewController 14 | 15 | @property (nonatomic, strong) XPAlbumModel *album; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/UIViewController+XP.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+XP.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIViewController (XP) 12 | 13 | /** 14 | 从Main.storyboard中加载实例对象 15 | 需要设置Storyboard ID且确保和类名保持一致 16 | 17 | @return 控制器实例 18 | */ 19 | + (instancetype)instanceFromMainStoryboard; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-info.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "hud-info@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "hud-info@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/empty-box.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "empty-box@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "empty-box@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-error.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "hud-error@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "hud-error@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/home-album.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home-album@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "home-album@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/HUD/hud-success.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "hud-success@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "hud-success@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon-selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon-selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/unauthorized.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "unauthorized@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "unauthorized@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/AlbumDetail/View/XPAlbumDetailCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumDetailCell.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/16. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XPAlbumModel; 12 | @class XPPhotoModel; 13 | 14 | @interface XPAlbumDetailCell : UICollectionViewCell 15 | 16 | - (void)showImageWithAlbum:(XPAlbumModel *)album photo:(XPPhotoModel *)photo; 17 | - (void)changeSelectState:(BOOL)select; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/gif-identifier.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "gif-identifier@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "gif-identifier@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/video-identifier.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "video-identifier@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "video-identifier@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/album-placeholder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "album-placeholder@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "album-placeholder@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/round-logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "round-logo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "round-logo@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "round-logo@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/zh-Hans/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "开启"; 3 | 4 | "disabled" = "关闭"; 5 | 6 | "already disabled" = "已经开启"; 7 | 8 | "already enabled" = "已经关闭"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "为了使用IQKeyboardManager,必须在你的 AppDelegate 中设置 UIWindow.rootViewController。"; 11 | 12 | "Previous" = "前一个"; 13 | "Next" = "下一个"; 14 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/zh-Hant/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "開啟"; 3 | 4 | "disabled" = "關閉"; 5 | 6 | "already disabled" = "已經開啟"; 7 | 8 | "already enabled" = "已經關閉"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "為了使用IQKeyboardManager,必須在妳的 AppDelegate 中設置 UIWindow.rootViewController。"; 11 | 12 | "Previous" = "前一個"; 13 | "Next" = "下一個"; 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon-add@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon-add@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "original" 24 | } 25 | } -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/NSString+XP.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XP.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/3. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (XP) 12 | 13 | /** 14 | 去除字符串首尾的空白字符 15 | 16 | @return 过滤后的字符串 17 | */ 18 | - (NSString *)trim; 19 | 20 | /** 21 | MD5加密 22 | 23 | @return 加密的字符串 24 | */ 25 | - (NSString *)md5; 26 | 27 | /** 28 | 判断字符串是否为IP地址 29 | 30 | @return YES:合法的IP地址 NO:不是IP地址 31 | */ 32 | - (BOOL)isIP; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon-back@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon-back@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "original" 24 | } 25 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-done.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon-done@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon-done@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "original" 24 | } 25 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-edit.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon-edit@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon-edit@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "original" 24 | } 25 | } -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/icon-setting.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon-setting@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon-setting@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "original" 24 | } 25 | } -------------------------------------------------------------------------------- /PhotoSecurity/Setting/View/XPSettingCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPSettingCell.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/21. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPSettingCell.h" 10 | 11 | @implementation XPSettingCell 12 | 13 | #pragma mark - Lifecycle 14 | 15 | - (void)awakeFromNib { 16 | [super awakeFromNib]; 17 | // Initialization code 18 | } 19 | 20 | - (void)prepareForReuse { 21 | [super prepareForReuse]; 22 | [self.stateSwitch setHidden:YES]; 23 | self.accessoryType = UITableViewCellAccessoryNone; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/en.lproj/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "enabled"; 3 | 4 | "disabled" = "disabled"; 5 | 6 | "already disabled" = "already disabled"; 7 | 8 | "already enabled" = "already enabled"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager"; 11 | 12 | "Previous" = "Previous"; 13 | "Next" = "Next"; 14 | -------------------------------------------------------------------------------- /PhotoSecurity/Photos/Controller/XPPhotoCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPPhotoCollectionViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/9. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XPAlbumCollectionModel; 12 | @class PHAsset; 13 | 14 | @interface XPPhotoCollectionViewController : UICollectionViewController 15 | 16 | /// 相册信息模型 17 | @property (nonatomic, strong) XPAlbumCollectionModel *album; 18 | /// 选择图片后的回调block 19 | @property (nonatomic, copy) void(^didSelectAssetsCompletionHandler)(NSArray *assets); 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/de.lproj/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "aktiviert"; 3 | 4 | "disabled" = "deaktiviert"; 5 | 6 | "already disabled" = "bereits deaktiviert"; 7 | 8 | "already enabled" = "bereits aktiviert"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "Sie müssen im AppDelegate UIWindow.rootViewController setzen um mit IQKeyboardManager zu arbeiten"; 11 | 12 | "Previous" = "Zurück"; 13 | "Next" = "Vor"; 14 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/fr.lproj/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "activé"; 3 | 4 | "disabled" = "désactivé"; 5 | 6 | "already disabled" = "déjà désactivé"; 7 | 8 | "already enabled" = "déjà activé"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "Vous devez définir UIWindow.rootViewController dans votre AppDelegate pour IQKeyboardManager fonctionne"; 11 | 12 | "Previous" = "Précédent"; 13 | "Next" = "Suivant"; 14 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle/es.lproj/IQKeyboardManager.strings: -------------------------------------------------------------------------------- 1 | 2 | "enabled" = "activado"; 3 | 4 | "disabled" = "desactivado"; 5 | 6 | "already disabled" = "ya está desactivado"; 7 | 8 | "already enabled" = "ya está activado"; 9 | 10 | "You must set UIWindow.rootViewController in your AppDelegate to work with IQKeyboardManager" = "Debe establecer UIWindow.rootViewController en su AppDelegate para trabajar con IQKeyboardManager"; 11 | 12 | "Previous" = "Anterior"; 13 | 14 | "Next" = "Siguiente"; 15 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Library/XMFTPServer/XMFTPHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMFTPHelper.h 3 | // XMFtpServer 4 | // 5 | // Created by chi on 16/3/28. 6 | // Copyright © 2016年 chi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XMFTPHelper : NSObject 12 | 13 | + (NSString *)localIPAddress; 14 | 15 | @end 16 | 17 | 18 | 19 | #pragma mark LS replacement 20 | NSString* createList(NSString* directoryPath); 21 | 22 | #pragma mark Supporting Functions 23 | int filesinDirectory(NSString* filePath ); 24 | NSMutableString* int2BinString(int x); 25 | NSMutableString *byte2String(int x ); 26 | NSMutableString *bin2perms(NSString *binaryValue); 27 | -------------------------------------------------------------------------------- /PhotoSecurity/Photos/Model/XPAlbumCollectionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumCollectionModel.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/9. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface XPAlbumCollectionModel : NSObject 13 | 14 | /// 相册 15 | @property (nonatomic, strong) PHAssetCollection *albumCollection; 16 | /// 该相册下图片资源数量 17 | @property (nonatomic, assign, readonly) NSUInteger assetCounts; 18 | /// 相册下的图片资源数据 19 | //@property (nonatomic, strong) PHFetchResult *assetResult; 20 | 21 | - (PHFetchResult *)fetchAssetsWithptions:(PHFetchOptions *)options; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DZNEmptyDataSet (1.8.1) 3 | - FMDB (2.6.2): 4 | - FMDB/standard (= 2.6.2) 5 | - FMDB/standard (2.6.2) 6 | - IQKeyboardManager (4.0.8) 7 | - MBProgressHUD (1.0.0) 8 | 9 | DEPENDENCIES: 10 | - DZNEmptyDataSet (~> 1.8.1) 11 | - FMDB (~> 2.6.2) 12 | - IQKeyboardManager (~> 4.0.8) 13 | - MBProgressHUD (~> 1.0.0) 14 | 15 | SPEC CHECKSUMS: 16 | DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7 17 | FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a 18 | IQKeyboardManager: 1a8189fa153bf09044355ee0ad36826f6767e7f7 19 | MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a 20 | 21 | PODFILE CHECKSUM: ba059952cf818e2db33a1b55523a2e4e4df1476a 22 | 23 | COCOAPODS: 1.1.1 24 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DZNEmptyDataSet (1.8.1) 3 | - FMDB (2.6.2): 4 | - FMDB/standard (= 2.6.2) 5 | - FMDB/standard (2.6.2) 6 | - IQKeyboardManager (4.0.8) 7 | - MBProgressHUD (1.0.0) 8 | 9 | DEPENDENCIES: 10 | - DZNEmptyDataSet (~> 1.8.1) 11 | - FMDB (~> 2.6.2) 12 | - IQKeyboardManager (~> 4.0.8) 13 | - MBProgressHUD (~> 1.0.0) 14 | 15 | SPEC CHECKSUMS: 16 | DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7 17 | FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a 18 | IQKeyboardManager: 1a8189fa153bf09044355ee0ad36826f6767e7f7 19 | MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a 20 | 21 | PODFILE CHECKSUM: ba059952cf818e2db33a1b55523a2e4e4df1476a 22 | 23 | COCOAPODS: 1.1.1 24 | -------------------------------------------------------------------------------- /Pods/Target Support Files/FMDB/FMDB.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FMDB 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FMDB" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/MBProgressHUD" 4 | OTHER_LDFLAGS = -l"sqlite3" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/UIColor+XP.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+XP.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/7. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (XP) 12 | 13 | /** 14 | 根据RGB获取颜色 15 | 16 | @param r Red色值,0~255 17 | @param g Green色值,0~255 18 | @param b Blue色值,0~255 19 | @return 对应的颜色 20 | */ 21 | + (instancetype)colorWithR:(CGFloat)r g:(CGFloat)g b:(CGFloat)b; 22 | 23 | /** 24 | 通过十六进制字符串获取颜色 25 | 26 | @param hexStr 十六进制字符串,如: #FFFFFF,FFFFFF,0xFFFFFF 27 | @return 对应的颜色实例 28 | */ 29 | + (instancetype)colorWithHex:(NSString *)hexStr; 30 | 31 | /** 32 | 获取随机颜色 33 | */ 34 | + (instancetype)randomColor; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/Model/XPAlbumModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumModel.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/7. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XPPhotoModel; 12 | 13 | @interface XPAlbumModel : NSObject 14 | 15 | /// 相册id 16 | @property (nonatomic, assign) NSInteger albumid; 17 | /// 相册目录 18 | @property (nonatomic, copy) NSString *directory; 19 | /// 相册名称 20 | @property (nonatomic, copy) NSString *name; 21 | /// 该相册下的图片数量 22 | @property (nonatomic, assign) NSInteger count; 23 | /// 排序id 24 | @property (nonatomic, assign) NSInteger orderid; 25 | /// 缩略图 26 | @property (nonatomic, strong) XPPhotoModel *thumbImage; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /PhotoSecurity/Photos/Model/XPAlbumCollectionModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumCollectionModel.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/9. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPAlbumCollectionModel.h" 10 | 11 | @implementation XPAlbumCollectionModel 12 | 13 | - (PHFetchResult *)fetchAssetsWithptions:(PHFetchOptions *)options { 14 | if (nil == self.albumCollection) return nil; 15 | return [PHAsset fetchAssetsInAssetCollection:self.albumCollection options:options]; 16 | } 17 | 18 | - (void)setAlbumCollection:(PHAssetCollection *)albumCollection { 19 | _albumCollection = albumCollection; 20 | _assetCounts = [self fetchAssetsWithptions:nil].count; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Utils/XPPasswordTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPPasswordTool.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/6. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XPPasswordTool : NSObject 12 | 13 | /** 14 | 是否已经设置过密码 15 | 16 | @return YES:已设置了密码 NO:首次使用,还未设置密码 17 | */ 18 | + (BOOL)isSetPassword; 19 | 20 | ///** 21 | // 是否开启了TouchID功能 22 | // */ 23 | //+ (BOOL)isEnableTouchID; 24 | 25 | /** 26 | 校验给定的密码是否与用户设置的密码匹配 27 | 28 | @param password 待校验的密码明文 29 | @return Bool 30 | */ 31 | + (BOOL)verifyPassword:(NSString *)password; 32 | 33 | /** 34 | 存储密码到本地沙盒文件中 35 | 36 | @param password 待存储的密码明文(存储之前会进行加密) 37 | */ 38 | + (void)storagePassword:(NSString *)password; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/Target Support Files/DZNEmptyDataSet/DZNEmptyDataSet.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/DZNEmptyDataSet 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/MBProgressHUD" 4 | OTHER_LDFLAGS = -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/MBProgressHUD" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Library/XMFTPServer/XMFTPDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMFTPDefines.h 3 | // XMFtpServer 4 | // 5 | // Created by chi on 16/3/28. 6 | // Copyright © 2016年 chi. All rights reserved. 7 | // 8 | 9 | #ifndef XMFTPDefines_h 10 | #define XMFTPDefines_h 11 | 12 | 13 | enum { 14 | pasvftp=0,epsvftp,portftp,lprtftp, eprtftp 15 | }; 16 | 17 | #define DATASTR(args) [ args dataUsingEncoding:NSUTF8StringEncoding ] 18 | 19 | #define SERVER_PORT 20000 20 | #define READ_TIMEOUT -1 21 | 22 | #define FTP_CLIENT_REQUEST 0 23 | 24 | enum { 25 | 26 | clientSending=0, clientReceiving=1, clientQuiet=2,clientSent=3 27 | }; 28 | 29 | 30 | #ifdef DEBUG 31 | #define XMFTPLog(...) NSLog(__VA_ARGS__) 32 | #else 33 | #define XMFTPLog(...) 34 | #endif 35 | 36 | 37 | extern BOOL g_XMFTP_LogEnabled; 38 | 39 | #endif /* XMFTPDefines_h */ 40 | -------------------------------------------------------------------------------- /Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/IQKeyboardManager 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/IQKeyboardManager" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/MBProgressHUD" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/Image+Snapshot.h: -------------------------------------------------------------------------------- 1 | // 2 | // Image+Video.h 3 | // 4 | // 5 | // Created by nhope on 2017/4/12. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #if TARGET_OS_IPHONE || TARGET_OS_TV 12 | #import 13 | #define XP_IMAGE UIImage 14 | #elif TARGET_OS_MAC 15 | #import 16 | #define XP_IMAGE NSImage 17 | #endif 18 | 19 | 20 | 21 | @interface XP_IMAGE (Snapshot) 22 | 23 | /** 24 | 从视频文件中提取缩略图 25 | 26 | @param videoURL 本地视频文件URL 27 | @return 视频缩略图 28 | */ 29 | + (instancetype)snapshotImageWithVideoURL:(NSURL *)videoURL; 30 | 31 | /** 32 | 从GIF图片中提取第一帧作为缩略图 33 | 34 | @param gifURL 本地GIF文件URL 35 | @return 缩略图 36 | */ 37 | + (instancetype)snapshotImageWithGIFImageURL:(NSURL *)gifURL; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PhotoSecurity/System/PhotoSecurity-prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PhotoSecurity-prefix.pch 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #ifndef PhotoSecurity_prefix_pch 10 | #define PhotoSecurity_prefix_pch 11 | 12 | /// 全局函数 13 | #import "functions.h" 14 | 15 | /// 分类 16 | #import "UIView+XP.h" 17 | #import "UIImage+XP.h" 18 | #import "NSString+XP.h" 19 | #import "UIColor+XP.h" 20 | #import "Image+Snapshot.h" 21 | 22 | #import "XPPasswordTool.h" 23 | #import "XPProgressHUD.h" 24 | #import "XPSQLiteManager.h" 25 | 26 | 27 | ///////////////// 28 | //// 宏 //// 29 | ///////////////// 30 | 31 | /// 处理Block循环引用 32 | #define weakify(obj) autoreleasepool{} __weak __typeof(obj) weak##obj = obj; 33 | #define strongify(obj) autoreleasepool{} __strong __typeof(obj) obj = weak##obj; 34 | 35 | #endif /* PhotoSecurity_prefix_pch */ 36 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/UIView+XP.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+XP.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (XP) 12 | 13 | /** 14 | 视图抖动效果 15 | */ 16 | - (void)shake; 17 | 18 | @end 19 | 20 | @interface UIView (PCIBInspectable) 21 | 22 | /** 23 | 设置边框宽度 24 | */ 25 | @property (nonatomic, assign) IBInspectable CGFloat borderWidth; 26 | 27 | /** 28 | 设置边框颜色 29 | */ 30 | @property (nonatomic, assign) IBInspectable UIColor *borderColor; 31 | 32 | /** 33 | 根据十六进制颜色值设置边框颜色,如:0xFFFFFF、#FFFFFF 34 | */ 35 | @property (nonatomic, assign) IBInspectable NSString *borderHexColor; 36 | 37 | /** 38 | 设置圆角半径 39 | */ 40 | @property (nonatomic, assign) IBInspectable CGFloat cornerRadius; 41 | 42 | /** 43 | 设置背景色,如:0xFFFFFF、#FFFFFF 44 | */ 45 | @property (nonatomic, assign) IBInspectable NSString *hexBgColor; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /PhotoSecurity/Photos/Controller/XPPhotoPickerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPPhotoPickerViewController.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/9. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XPPhotoPickerViewController; 12 | @class PHAsset; 13 | 14 | 15 | @protocol XPPhotoPickerViewControllerDelegate 16 | 17 | @optional 18 | 19 | /** 20 | 取消选择图片 21 | */ 22 | - (void)photoPickerViewControllerDidCalcel:(XPPhotoPickerViewController *)picker; 23 | 24 | /** 25 | 图片选择后的回调 26 | 27 | @param picker XPPhotoPickerViewController 28 | @param assets 选中的图片资源 29 | */ 30 | - (void)photoPickerViewController:(XPPhotoPickerViewController *)picker didSelectedAssets:(NSArray *)assets; 31 | 32 | @end 33 | 34 | 35 | @interface XPPhotoPickerViewController : UITableViewController 36 | 37 | @property (nonatomic, weak) id delegate; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PhotoSecurity/AlbumDetail/Model/XPPhotoModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPPhotoModel.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/16. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef NS_ENUM(NSInteger, XPFileType) { 13 | XPFileTypeImage = 0, //普通图片 14 | XPFileTypeGIFImage = 1, //GIF图片 15 | XPFileTypeVideo = 2, //视频文件 16 | }; 17 | 18 | 19 | @interface XPPhotoModel : NSObject 20 | 21 | /// 照片id 22 | @property (nonatomic, assign) NSInteger ID; 23 | /// 所属相册id 24 | @property (nonatomic, assign) NSInteger albumid; 25 | /// 文件名称 26 | @property (nonatomic, copy) NSString *filename; 27 | /// 图片原始名称 28 | @property (nonatomic, copy) NSString *originalname; 29 | /// 图片创建时间 30 | @property (nonatomic, assign) NSInteger createtime; 31 | /// 图片添加时间 32 | @property (nonatomic, assign) NSInteger addtime; 33 | /// 图片大小 34 | @property (nonatomic, assign) NSUInteger filesize; 35 | /// 文件类型 36 | @property (nonatomic, assign) XPFileType filetype; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/DZNEmptyDataSet/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Ignacio Romero Zurbuchen iromero@dzen.cl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Pods/MBProgressHUD/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2009-2016 Matej Bukovinski 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. -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/LICENSE.md: -------------------------------------------------------------------------------- 1 | IQKeyboardManager license 2 | ========================= 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2013-16 Iftekhar Qurashi 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of 9 | this software and associated documentation files (the "Software"), to deal in 10 | the Software without restriction, including without limitation the rights to 11 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | of the Software, and to permit persons to whom the Software is furnished to do 13 | so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PhotoSecurity/Pods-PhotoSecurity.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/MBProgressHUD" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/DZNEmptyDataSet" "$PODS_CONFIGURATION_BUILD_DIR/FMDB" "$PODS_CONFIGURATION_BUILD_DIR/IQKeyboardManager" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"DZNEmptyDataSet" -l"FMDB" -l"IQKeyboardManager" -l"MBProgressHUD" -l"sqlite3" -framework "CoreGraphics" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PhotoSecurity/Pods-PhotoSecurity.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/MBProgressHUD" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/DZNEmptyDataSet" "$PODS_CONFIGURATION_BUILD_DIR/FMDB" "$PODS_CONFIGURATION_BUILD_DIR/IQKeyboardManager" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/DZNEmptyDataSet" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"DZNEmptyDataSet" -l"FMDB" -l"IQKeyboardManager" -l"MBProgressHUD" -l"sqlite3" -framework "CoreGraphics" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/View/XPAlbumCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumCell.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/24. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPAlbumCell.h" 10 | #import "XPAlbumModel.h" 11 | #import "XPPhotoModel.h" 12 | 13 | @interface XPAlbumCell () 14 | 15 | @property (weak, nonatomic) IBOutlet UIImageView *thumbImageView; 16 | @property (weak, nonatomic) IBOutlet UILabel *nameLabel; 17 | @property (weak, nonatomic) IBOutlet UILabel *numberLabel; 18 | 19 | @end 20 | 21 | @implementation XPAlbumCell 22 | 23 | - (void)awakeFromNib { 24 | [super awakeFromNib]; 25 | // Initialization code 26 | } 27 | 28 | - (void)configureWithAlbum:(XPAlbumModel *)album { 29 | UIImage *image = nil; 30 | if (album.count && album.thumbImage) { 31 | NSString *path = [NSString stringWithFormat:@"%@/%@/%@/%@", photoRootDirectory(),album.directory,XPThumbDirectoryNameKey,album.thumbImage.filename]; 32 | image = [[UIImage alloc] initWithContentsOfFile:path]; 33 | } 34 | self.nameLabel.text = album.name; 35 | self.numberLabel.text = [NSString stringWithFormat:@"%ld", album.count]; 36 | self.thumbImageView.image = image ?: [UIImage imageNamed:@"album-placeholder"]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/QLPreviewController+XP.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLPreviewController+XP.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/23. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "QLPreviewController+XP.h" 10 | #import 11 | 12 | /** 13 | 由于QLPreviewController在真机测试时(iPhone5s iOS9.3.5)未能返回正确的状态栏样式 14 | 重新对QLPreviewController的`-preferredStatusBarStyle`方法进行hook,返回正确的状态栏样式 15 | 16 | 至于为什么在`UIViewController+XP`文件中的hook失败原因,初步猜想有可能是: 17 | 因为QuickLook.framework是系统动态库,系统在App使用前已经将QLPreviewController类加载进内存了, 18 | 导致在`UIViewController+XP`的hook失败,此时需要重新hook,并指明是QLPreviewController类的Category 19 | */ 20 | 21 | @implementation QLPreviewController (XP) 22 | 23 | + (void)load { 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | Method originalMethod = class_getInstanceMethod([QLPreviewController class], @selector(preferredStatusBarStyle)); 27 | Method swizzledMethod = class_getInstanceMethod([QLPreviewController class], @selector(ql_preferredStatusBarStyle)); 28 | method_exchangeImplementations(originalMethod, swizzledMethod); 29 | }); 30 | } 31 | 32 | 33 | - (UIStatusBarStyle)ql_preferredStatusBarStyle { 34 | return UIStatusBarStyleLightContent; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /PhotoSecurity/Photos/View/XPPhotoCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPPhotoCollectionViewCell.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/9. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PHAsset; 12 | @class XPPhotoCollectionViewCell; 13 | 14 | @protocol XPPhotoCollectionViewCellDelegate 15 | 16 | @optional 17 | 18 | /** 19 | 图片加载完毕的回调 20 | */ 21 | - (void)photoCollectionViewCell:(XPPhotoCollectionViewCell *)cell didRequestImage:(UIImage *)image atIndex:(NSInteger)index; 22 | 23 | /** 24 | 点击图片后的回调 25 | */ 26 | - (void)photoCollectionViewCell:(XPPhotoCollectionViewCell *)cell didTappedImageForSelected:(BOOL)isSelected atIndex:(NSInteger)index; 27 | 28 | @end 29 | 30 | @interface XPPhotoCollectionViewCell : UICollectionViewCell 31 | 32 | /// 代理 33 | @property (nonatomic, weak) id delegate; 34 | /// 图片是否选中的状态 35 | @property (nonatomic, assign, getter=isImageSelectedState) BOOL imageSelectedState; 36 | 37 | 38 | /** 39 | 根据资源去加载系统图片 40 | 当图片加载完毕时会通过代理进行回调 41 | 42 | @param asset 资源 43 | @param index 索引 44 | */ 45 | - (void)requestImageWithAsset:(PHAsset *)asset index:(NSInteger)index; 46 | 47 | /** 48 | 显示图片 49 | 50 | @param image 待显示的图片 51 | @param index 索引 52 | */ 53 | - (void)showImage:(UIImage *)image index:(NSInteger)index; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQPreviousNextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQPreviousNextView.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQPreviousNextView.h" 25 | 26 | @implementation IQPreviousNextView 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/NSString+XP.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XP.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/3. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "NSString+XP.h" 10 | #import 11 | 12 | @implementation NSString (XP) 13 | 14 | /** 15 | 去除字符串首尾的空白字符 16 | 17 | @return 过滤后的字符串 18 | */ 19 | - (NSString *)trim { 20 | return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 21 | } 22 | 23 | /** 24 | MD5加密 25 | 26 | @return 加密的字符串 27 | */ 28 | - (NSString *)md5 { 29 | const char *value = [self UTF8String]; 30 | unsigned char outputBuffer[CC_MD5_DIGEST_LENGTH]; 31 | CC_MD5(value, (CC_LONG)strlen(value), outputBuffer); 32 | 33 | NSMutableString *outputString = [[NSMutableString alloc] initWithCapacity:CC_MD5_DIGEST_LENGTH*2]; 34 | for(NSInteger count = 0; count < CC_MD5_DIGEST_LENGTH; count++){ 35 | [outputString appendFormat:@"%02x",outputBuffer[count]]; 36 | } 37 | 38 | return outputString; 39 | } 40 | 41 | /** 42 | 判断字符串是否为IP地址 43 | 44 | @return YES:合法的IP地址 NO:不是IP地址 45 | */ 46 | - (BOOL)isIP { 47 | if (nil == self || 0 == self.length) { 48 | return NO; 49 | } 50 | NSString *regexp = @"^(\\d{1,3}\\.){3}\\d{1,3}$"; 51 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexp]; 52 | return [predicate evaluateWithObject:self]; 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PhotosVault 2 | 3 | [![Build](https://img.shields.io/wercker/ci/wercker/docs.svg)]() 4 | [![Platform](https://img.shields.io/badge/platform-iOS-blue.svg?style=flat)]() 5 | [![License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat)]() 6 | 7 | > 并不反对你使用该项目代码并上架App Store,但是严禁换个App Icon后就上架的行为。 8 | 9 | 一个管理私密相片的App 10 | 11 | ## Feature 12 | 13 | - 支持Touch ID解锁应用 14 | - 内置FTP服务器,可以通过FTP服务快速将图片从App拷贝到PC端 15 | 16 | ## Framework 17 | 18 | - Photos.framework 访问系统相册/将图片存储到系统相册 19 | - LocalAuthentication.framework 支持Touch ID快速解锁 20 | 21 | 22 | ## Requirements 23 | 24 | - Xcode 8.1+ 25 | - iOS9.0+ 26 | 27 | ## TODO 28 | 29 | - 优化内存使用,目前是一次性加载完某个相册下的图片数据,这在大量图片的情况下将会导致内存占用率飙升,很可能会被系统kill掉,后期可以考虑采用分页加载以及其他手段进行优化 30 | - 目前图片预览功能用的是系统的QuickLook.framework,底部的UIToolbar不支持功能扩展(不过就目前来说也足够使用),后期可以考虑采用其他第三方库 31 | 32 | ## 演示GIF 33 | 34 | ![GIF](./demo.gif) 35 | 36 | ## Changlog 37 | 38 | ###### 2017/04/19 39 | 40 | - 增加视频录制功能 41 | - 增加对GIF/视频的支持 42 | 43 | ![](./gif-video.gif) 44 | 45 | ###### 2017/04/12 46 | 47 | - 针对iOS10.3的新API,在设置界面中提供通过摇一摇随机更换应用图标的功能,支持iPhone/iPad 48 | ``` ObjC 49 | - (void)setAlternateIconName:(nullable NSString *)alternateIconName completionHandler:(nullable void (^)(NSError *_Nullable error))completionHandler NS_EXTENSION_UNAVAILABLE("Extensions may not have alternate icons") API_AVAILABLE(ios(10.3), tvos(10.2)); 50 | ``` 51 | - 添加`Image+Snapshot.{h/m}`文件,可以从视频/GIF文件中获取第一帧作为预览图使用,支持iOS/macOS 52 | 53 | ## License 54 | 55 | 基于MIT License进行开源,详细内容请参阅`LICENSE`文件。 56 | -------------------------------------------------------------------------------- /Pods/FMDB/LICENSE.txt: -------------------------------------------------------------------------------- 1 | If you are using FMDB in your project, I'd love to hear about it. Let Gus know 2 | by sending an email to gus@flyingmeat.com. 3 | 4 | And if you happen to come across either Gus Mueller or Rob Ryan in a bar, you 5 | might consider purchasing a drink of their choosing if FMDB has been useful to 6 | you. 7 | 8 | Finally, and shortly, this is the MIT License. 9 | 10 | Copyright (c) 2008-2014 Flying Meat Inc. 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files (the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions: 18 | 19 | The above copyright notice and this permission notice shall be included in 20 | all copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQBarButtonItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQBarButtonItem.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | #import 26 | 27 | /** 28 | IQBarButtonItem used for IQToolbar. 29 | */ 30 | @interface IQBarButtonItem : UIBarButtonItem 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Library/XMFTPServer/XMFTPDataConnection.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMFTPDataConnection.h 3 | // XMFtpServer 4 | // 5 | // Created by chi on 16/3/28. 6 | // Copyright © 2016年 chi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AsyncSocket.h" 12 | #import "XMFTPDefines.h" 13 | 14 | @class XMFTPConnection; 15 | 16 | @interface XMFTPDataConnection : NSObject{ 17 | AsyncSocket *dataSocket; 18 | XMFTPConnection *ftpConnection; // connection which generated data socket we are tied to 19 | 20 | AsyncSocket *dataListeningSocket; 21 | id dataConnection; 22 | NSMutableData *receivedData; 23 | int connectionState; 24 | 25 | } 26 | -(id)initWithAsyncSocket:(AsyncSocket*)newSocket forConnection:(id)aConnection withQueuedData:(NSMutableArray*)queuedData; 27 | -(void)writeString:(NSString*)dataString; 28 | -(void)writeData:(NSMutableData*)data; 29 | -(void)writeQueuedData:(NSMutableArray*)queuedData; 30 | -(void)closeConnection; 31 | 32 | #pragma mark ASYNCSOCKET DELEGATES 33 | -(BOOL)onSocketWillConnect:(AsyncSocket *)sock; 34 | -(void)onSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket; 35 | -(void)onSocket:(AsyncSocket*)sock didReadData:(NSData*)data withTag:(long)tag; 36 | -(void)onSocket:(AsyncSocket*)sock didWriteDataWithTag:(long)tag; 37 | 38 | -(void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err; 39 | 40 | @property (readonly) NSMutableData *receivedData; 41 | @property (readwrite) int connectionState; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/UIViewController+XP.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+XP.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+XP.h" 10 | #import 11 | 12 | @implementation UIViewController (XP) 13 | 14 | #pragma mark - Public 15 | 16 | /** 17 | 从Main.storyboard中加载实例对象 18 | 需要设置Storyboard ID且确保和类名保持一致 19 | 20 | @return 控制器实例 21 | */ 22 | + (instancetype)instanceFromMainStoryboard { 23 | NSString *identifier = NSStringFromClass([self class]); 24 | UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 25 | UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:identifier]; 26 | return vc; 27 | } 28 | 29 | #pragma mark - 30 | 31 | + (void)load { 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | Method originalMethod = class_getInstanceMethod([UIViewController class], @selector(preferredStatusBarStyle)); 35 | Method swizzledMethod = class_getInstanceMethod([UIViewController class], @selector(xp_preferredStatusBarStyle)); 36 | method_exchangeImplementations(originalMethod, swizzledMethod); 37 | }); 38 | } 39 | 40 | /** 41 | * 通过hook系统preferredStatusBarStyle方法,返回App全局的状态栏样式 42 | * 如果某个控制器需要显示不同的状态栏样式,重写preferredStatusBarStyle方法即可 43 | * 44 | * @return 状态栏样式 45 | */ 46 | - (UIStatusBarStyle)xp_preferredStatusBarStyle { 47 | return UIStatusBarStyleLightContent; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/UIColor+XP.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+XP.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/7. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "UIColor+XP.h" 10 | 11 | @implementation UIColor (XP) 12 | 13 | /** 14 | 根据RGB获取颜色 15 | 16 | @param r Red色值,0~255 17 | @param g Green色值,0~255 18 | @param b Blue色值,0~255 19 | @return 对应的颜色 20 | */ 21 | + (instancetype)colorWithR:(CGFloat)r g:(CGFloat)g b:(CGFloat)b { 22 | return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]; 23 | } 24 | 25 | /** 26 | 通过十六进制字符串获取颜色 27 | 28 | @param hexStr 十六进制字符串,如: #FFFFFF,FFFFFF,0xFFFFFF 29 | @return 对应的颜色实例 30 | */ 31 | + (instancetype)colorWithHex:(NSString *)hexStr { 32 | if ([hexStr hasPrefix:@"#"]) { 33 | hexStr = [hexStr stringByReplacingOccurrencesOfString:@"#" withString:@""]; 34 | } 35 | NSScanner *scanner = [NSScanner scannerWithString:hexStr]; 36 | unsigned int hex; 37 | if (![scanner scanHexInt:&hex]) { 38 | return [UIColor whiteColor]; 39 | } 40 | int r = (hex >> 16) & 0xFF; 41 | int g = (hex >> 8) & 0xFF; 42 | int b = hex & 0xFF; 43 | return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]; 44 | } 45 | 46 | /** 47 | 获取随机颜色 48 | */ 49 | + (instancetype)randomColor { 50 | return [UIColor colorWithRed:arc4random_uniform(256)/255.0 51 | green:arc4random_uniform(256)/255.0 52 | blue:arc4random_uniform(256)/255.0 53 | alpha:1.0]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQPreviousNextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQPreviousNextView.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | If you need to enable previous/next toolbar button with some complex hierarchy where your textFields are not in same view, then make the top view as IQPreviousNextView. 28 | */ 29 | @interface IQPreviousNextView : UIView 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIScrollView+Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIScrollView+Additions.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | 27 | @interface UIScrollView (Additions) 28 | 29 | /** 30 | Restore scrollViewContentOffset when resigning from scrollView. Default is NO. 31 | */ 32 | @property(nonatomic, assign) BOOL shouldRestoreScrollViewContentOffset; 33 | 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIViewController+Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIViewController+Additions.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | @interface UIViewController (Additions) 27 | 28 | /** 29 | Top/Bottom Layout constraint which help library to manage keyboardTextField distance 30 | */ 31 | @property(nullable, nonatomic, strong) IBOutlet NSLayoutConstraint *IQLayoutGuideConstraint; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQTextView/IQTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQTextView.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQKeyboardManagerConstants.h" 25 | 26 | #import 27 | 28 | /** 29 | UITextView with placeholder support 30 | */ 31 | @interface IQTextView : UITextView 32 | 33 | /** 34 | Set textView's placeholder text. Default is nil. 35 | */ 36 | @property(nullable, nonatomic,copy) IBInspectable NSString *placeholder; 37 | 38 | @end 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Library/XMFTPServer/xmftp_commands.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | quit 6 | doQuit: 7 | list 8 | doList: 9 | nlst 10 | doList: 11 | stat 12 | doStat: 13 | feat 14 | doFeat: 15 | user 16 | doUser: 17 | pass 18 | doPass: 19 | ack 20 | doAck: 21 | pwd 22 | doPwd: 23 | cwd 24 | doCwd: 25 | noop 26 | doNoop: 27 | syst 28 | doSyst: 29 | pasv 30 | doPasv: 31 | epsv 32 | doEpsv: 33 | port 34 | doPort: 35 | lprt 36 | doLprt: 37 | eprt 38 | doEprt: 39 | opts 40 | doOpts: 41 | type 42 | doType: 43 | stor 44 | doStor: 45 | retr 46 | doRetr: 47 | dele 48 | doDele: 49 | mlst 50 | doMlst: 51 | size 52 | doSize: 53 | mkd 54 | doMkdir: 55 | cdup 56 | doCdUp: 57 | rmd 58 | doDele: 59 | rnfr 60 | doRnfr: 61 | rnto 62 | doRnto: 63 | 64 | 65 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Utils/XPProgressHUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPProgressHUD.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/6. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MBProgressHUD; 12 | 13 | @interface XPProgressHUD : NSObject 14 | 15 | /** 16 | * 显示一个操作成功的HUD(自动消失) 17 | * 18 | * @param message 提示信息 19 | * @param view 目标视图 20 | */ 21 | + (void)showSuccessHUD:(NSString *)message toView:(UIView *)view; 22 | 23 | /** 24 | * 显示一个操作失败的HUD(自动消失) 25 | * 26 | * @param message 提示信息 27 | * @param view 目标视图 28 | */ 29 | + (void)showFailureHUD:(NSString *)message toView:(UIView *)view; 30 | 31 | /** 32 | * 显示一个信息类HUD(自动消失) 33 | * 34 | * @param message 提示信息 35 | * @param view 目标视图 36 | */ 37 | + (void)showInfomationHUD:(NSString *)message toView:(UIView *)view; 38 | 39 | /** 40 | * 显示一个正在加载的HUD(不会自动消失) 41 | * 默认会拦截目标视图的点击事件 42 | * 43 | * @param message 提示信息 44 | * @param view 目标视图 45 | * 46 | * @return MBProgressHUD 47 | */ 48 | + (MBProgressHUD *)showLoadingHUD:(NSString *)message toView:(UIView *)view; 49 | 50 | /** 51 | * 隐藏HUD(该方法只会隐藏`第一个`添加到view中的HUD) 52 | * 53 | * @param view 目标视图 54 | */ 55 | + (BOOL)hideHUDForView:(UIView *)view; 56 | 57 | /** 58 | * 隐藏view中所有的HUD 59 | * 60 | * @param view 目标视图 61 | */ 62 | + (void)hideAllHUDForView:(UIView *)view; 63 | 64 | /** 65 | * 显示一个自定义的HUD(不会自动消失) 66 | * 67 | * @param message 提示信息 68 | * @param icon HUD图标 69 | * @param view 目标视图 70 | * 71 | * @return MBProgressHUD 72 | */ 73 | + (MBProgressHUD *)showCustomHUD:(NSString *)message iconName:(NSString *)icon toView:(UIView *)view; 74 | 75 | /** 76 | 显示一个吐司 77 | 78 | @param message 提示信息 79 | */ 80 | + (void)showToast:(NSString *)message; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/UIImage+XP.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+XP.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (XP) 12 | 13 | /** 14 | 将UIColor转换为UIImage且大小为1x1 15 | 16 | @param color 图片颜色 17 | @return UIImage 18 | */ 19 | + (instancetype)imageWithColor:(UIColor *)color; 20 | 21 | /** 22 | 将UIColor转换为UIImage并指定大小 23 | 24 | @param color 图片颜色 25 | @param size 图片大小 26 | @return UIImage 27 | */ 28 | + (instancetype)imageWithColor:(UIColor *)color size:(CGSize)size; 29 | 30 | /** 31 | 通过视图获取视图快照 32 | 33 | @param view 需要生成快照的视图 34 | @return 快照图片 35 | */ 36 | + (instancetype)snapshotImageWithView:(UIView *)view; 37 | 38 | /** 39 | 旋转图片 40 | 41 | @param angle 旋转角度 42 | @return 旋转后的图片 43 | */ 44 | - (UIImage *)imageRotationWithAngle:(CGFloat)angle; 45 | 46 | /** 47 | 绘制一个圆形的下标图片 48 | 49 | @param imageSize 图片大小 50 | @param backgoundColor 图片背景色 51 | @param subscript 下脚标 52 | @param fontSize 字体大小 53 | @param textColor 字体颜色 54 | @return 绘制的下脚标图片 55 | */ 56 | + (instancetype)roundSubscriptImageWithImageSize:(CGSize)imageSize backgoundColor:(UIColor *)backgoundColor subscript:(NSUInteger)subscript fontSize:(CGFloat)fontSize textColor:(UIColor *)textColor; 57 | 58 | /** 59 | 根据图片生成指定大小的缩略图 60 | 61 | @param sourceImage 原始图片 62 | @param destinationSize 缩略图尺寸 63 | @return 缩略图 64 | */ 65 | + (instancetype)thumbnailImageFromSourceImage:(UIImage *)sourceImage destinationSize:(CGSize)destinationSize; 66 | 67 | /** 68 | 根据图片二进制数据生成指定大小的缩略图 69 | 70 | @param imageData 原始图片数据 71 | @param destinationSize 缩略图尺寸 72 | @return 缩略图 73 | */ 74 | + (instancetype)thumbnailImageFromSourceImageData:(NSData *)imageData destinationSize:(CGSize)destinationSize; 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIViewController+Additions.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIViewController+Additions.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQUIViewController+Additions.h" 25 | #import 26 | 27 | @implementation UIViewController (Additions) 28 | 29 | -(void)setIQLayoutGuideConstraint:(NSLayoutConstraint *)IQLayoutGuideConstraint 30 | { 31 | objc_setAssociatedObject(self, @selector(IQLayoutGuideConstraint), IQLayoutGuideConstraint, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 32 | } 33 | 34 | -(NSLayoutConstraint *)IQLayoutGuideConstraint 35 | { 36 | return objc_getAssociatedObject(self, @selector(IQLayoutGuideConstraint)); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Utils/XPPasswordTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPPasswordTool.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/6. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPPasswordTool.h" 10 | 11 | @implementation XPPasswordTool 12 | 13 | /** 14 | 是否已经设置过密码 15 | 16 | @return YES:已设置了密码 NO:首次使用,还未设置密码 17 | */ 18 | + (BOOL)isSetPassword { 19 | NSString *password = [[NSUserDefaults standardUserDefaults] stringForKey:XPPasswordKey]; 20 | // 密码采用MD5加密,长度固定为32个字符 21 | return password.length==32; 22 | } 23 | 24 | ///** 25 | // 是否开启了TouchID功能 26 | // */ 27 | //+ (BOOL)isEnableTouchID { 28 | // BOOL isEnable = [[NSUserDefaults standardUserDefaults] boolForKey:XPTouchEnableStateKey]; 29 | // return isEnable; 30 | //} 31 | 32 | /** 33 | 校验给定的密码是否与用户设置的密码匹配 34 | 35 | @param password 待校验的密码明文 36 | @return Bool 37 | */ 38 | + (BOOL)verifyPassword:(NSString *)password { 39 | if (password.length < XPPasswordMinimalLength || ![self isSetPassword]) { 40 | return NO; 41 | } 42 | NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 43 | NSString *localPassword = [userDefaults stringForKey:XPPasswordKey]; 44 | NSString *random = [userDefaults stringForKey:XPEncryptionPasswordRandomKey]; 45 | NSString *newPassword = encryptionPassword(password, random); 46 | return [localPassword isEqualToString:newPassword]; 47 | } 48 | 49 | /** 50 | 存储密码到本地沙盒文件中 51 | 52 | @param password 待存储的密码明文(存储之前会进行加密) 53 | */ 54 | + (void)storagePassword:(NSString *)password { 55 | NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 56 | NSString *random = [userDefaults stringForKey:XPEncryptionPasswordRandomKey]; 57 | NSString *result = encryptionPassword(password, random); 58 | [userDefaults setObject:result forKey:XPPasswordKey]; 59 | [userDefaults synchronize]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQNSArray+Sort.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Sort.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | UIView.subviews sorting category. 28 | */ 29 | @interface NSArray (IQ_NSArray_Sort) 30 | 31 | ///-------------- 32 | /// @name Sorting 33 | ///-------------- 34 | 35 | /** 36 | Returns the array by sorting the UIView's by their tag property. 37 | */ 38 | @property (nonatomic, readonly, copy) NSArray * _Nonnull sortedArrayByTag; 39 | 40 | /** 41 | Returns the array by sorting the UIView's by their tag property. 42 | */ 43 | @property (nonatomic, readonly, copy) NSArray * _Nonnull sortedArrayByPosition; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Library/GHPopupEditView/GHPopupEditView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHPopupEditView.h 3 | // GitHub-iOS 4 | // https://github.com/xiaopin/GHPopupEditView 5 | // 6 | // Created by nhope on 2016/11/25. 7 | // Copyright © 2016年 xiaopin. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | /** 13 | 用户完成输入时的回调 14 | @param text 用户输入的文本 15 | */ 16 | typedef void(^GHPopupEditViewCompletionHandler)(NSString *text); 17 | 18 | /** 19 | 校验用户输入的文本 20 | @param text 用户输入的文本 21 | @return 返回空字符串@""即认为校验通过,否则请返回错误信息 22 | */ 23 | typedef NSString*(^GHPopupEditViewVerifyHandler)(NSString *text); 24 | 25 | /** 26 | 限制用户输入的字符 27 | @see UITextFieldDelegate -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; 28 | @param textField 输入框 29 | @param range 替换位置 30 | @param replacementString 替换的文本 31 | @return 返回NO则不更改文本(放弃用户当前输入的字符) 32 | */ 33 | typedef BOOL(^GHPopupEditViewShouldChangeHandler)(UITextField *textField, NSRange range, NSString *replacementString); 34 | 35 | 36 | @interface GHPopupEditView : UIView 37 | 38 | /// 完成输入时的回调 39 | @property (nonatomic, copy) GHPopupEditViewCompletionHandler completionHandler; 40 | /// 校验用户输入的文本是否合法 41 | @property (nonatomic, copy) GHPopupEditViewVerifyHandler verifyHandler; 42 | /// 限制用户输入的文本 43 | @property (nonatomic, copy) GHPopupEditViewShouldChangeHandler shouldChangeHandler; 44 | 45 | /// 设置标题 46 | - (void)setTitle:(NSString *)title; 47 | /// 设置输入框占位字符 48 | - (void)setPlaceholderString:(NSString *)placeholder; 49 | /// 设置输入框默认文本 50 | - (void)setDefaultText:(NSString *)text; 51 | /// 设置键盘类型 52 | - (void)setKeyboardType:(UIKeyboardType)keyboardType; 53 | /// 设置键盘`返回按钮`的类型,默认`UIReturnKeyDone` 54 | - (void)setReturnKeyType:(UIReturnKeyType)type; 55 | /// 设置`确定按钮`的主题色 56 | - (void)setOKButtonThemeColor:(UIColor *)color; 57 | /// 设置`取消按钮`的主题色 58 | - (void)setCancelButtonThemeColor:(UIColor *)color; 59 | /// 显示视图 60 | - (void)show; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIWindow+Hierarchy.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Hierarchy.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | @class UIViewController; 27 | 28 | /** 29 | UIWindow hierarchy category. 30 | */ 31 | @interface UIWindow (IQ_UIWindow_Hierarchy) 32 | 33 | ///---------------------- 34 | /// @name viewControllers 35 | ///---------------------- 36 | 37 | /** 38 | Returns the current Top Most ViewController in hierarchy. 39 | */ 40 | @property (nullable, nonatomic, readonly, strong) UIViewController *topMostController; 41 | 42 | /** 43 | Returns the topViewController in stack of topMostController. 44 | */ 45 | @property (nullable, nonatomic, readonly, strong) UIViewController *currentViewController; 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUITextFieldView+Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQUITextFieldView+Additions.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | UIView category for managing UITextField/UITextView 28 | */ 29 | 30 | @interface UIView (Additions) 31 | 32 | /** 33 | To set customized distance from keyboard for textField/textView. Can't be less than zero 34 | */ 35 | @property(nonatomic, assign) CGFloat keyboardDistanceFromTextField; 36 | 37 | @end 38 | 39 | ///------------------------------------------- 40 | /// @name Custom KeyboardDistanceFromTextField 41 | ///------------------------------------------- 42 | 43 | /** 44 | Uses default keyboard distance for textField. 45 | */ 46 | extern CGFloat const kIQUseDefaultKeyboardDistance; 47 | -------------------------------------------------------------------------------- /PhotoSecurity/AlbumDetail/View/XPAlbumDetailCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPAlbumDetailCell.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/16. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPAlbumDetailCell.h" 10 | #import "XPAlbumModel.h" 11 | #import "XPPhotoModel.h" 12 | 13 | @interface XPAlbumDetailCell () 14 | 15 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 16 | @property (weak, nonatomic) IBOutlet UIView *selectMaskView; 17 | @property (weak, nonatomic) IBOutlet UIImageView *stateImageView; 18 | @property (weak, nonatomic) IBOutlet UIImageView *filetypeImageView; 19 | 20 | @end 21 | 22 | @implementation XPAlbumDetailCell 23 | 24 | - (void)awakeFromNib { 25 | [super awakeFromNib]; 26 | self.selectMaskView.backgroundColor = [[UIColor colorWithR:223.0 g:223.0 b:223.0] colorWithAlphaComponent:0.3]; 27 | } 28 | 29 | - (void)prepareForReuse { 30 | [super prepareForReuse]; 31 | self.imageView.image = nil; 32 | self.stateImageView.hidden = YES; 33 | self.selectMaskView.hidden = YES; 34 | self.filetypeImageView.image = nil; 35 | } 36 | 37 | - (void)showImageWithAlbum:(XPAlbumModel *)album photo:(XPPhotoModel *)photo { 38 | // 加载并显示缩略图,节省内存 39 | NSString *path = [NSString stringWithFormat:@"%@/%@/%@/%@", photoRootDirectory(),album.directory,XPThumbDirectoryNameKey,photo.filename]; 40 | self.imageView.image = [[UIImage alloc] initWithContentsOfFile:path]; 41 | NSString *filetypeIcon = nil; 42 | switch (photo.filetype) { 43 | case XPFileTypeGIFImage: 44 | filetypeIcon = @"gif-identifier"; 45 | break; 46 | case XPFileTypeVideo: 47 | filetypeIcon = @"video-identifier"; 48 | break; 49 | default: 50 | break; 51 | } 52 | self.filetypeImageView.image = [UIImage imageNamed:filetypeIcon]; 53 | } 54 | 55 | - (void)changeSelectState:(BOOL)select { 56 | self.stateImageView.hidden = !select; 57 | self.selectMaskView.hidden = !select; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIScrollView+Additions.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQUIScrollView+Additions.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQUIScrollView+Additions.h" 25 | #import 26 | 27 | @implementation UIScrollView (Additions) 28 | 29 | -(void)setShouldRestoreScrollViewContentOffset:(BOOL)shouldRestoreScrollViewContentOffset 30 | { 31 | objc_setAssociatedObject(self, @selector(shouldRestoreScrollViewContentOffset), @(shouldRestoreScrollViewContentOffset), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 32 | } 33 | 34 | -(BOOL)shouldRestoreScrollViewContentOffset 35 | { 36 | NSNumber *shouldRestoreScrollViewContentOffset = objc_getAssociatedObject(self, @selector(shouldRestoreScrollViewContentOffset)); 37 | 38 | return [shouldRestoreScrollViewContentOffset boolValue]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Library/XMFTPServer/XMFTPServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMFTPServer.h 3 | // XMFtpServer 4 | // 5 | // Created by chi on 16/3/28. 6 | // Copyright © 2016年 chi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AsyncSocket.h" 12 | #import "XMFTPDefines.h" 13 | #import "XMFTPConnection.h" 14 | #import "XMFTPHelper.h" 15 | 16 | 17 | @interface XMFTPServer : NSObject{ 18 | 19 | AsyncSocket *listenSocket; 20 | NSMutableArray *connectedSockets; 21 | id server; 22 | id notificationObject; 23 | 24 | int portNumber; 25 | id delegate; 26 | 27 | NSMutableArray *connections; 28 | 29 | NSDictionary *commands; 30 | NSString *baseDir; 31 | Boolean changeRoot; // Change root to virtual root ( basedir ) 32 | int clientEncoding; // FTP client encoding type 33 | } 34 | - (id)initWithPort:(unsigned)serverPort withDir:(NSString *)aDirectory notifyObject:(id)sender; 35 | - (void)stopFtpServer; 36 | 37 | #pragma mark ASYNCSOCKET DELEGATES 38 | - (void)onSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket; 39 | - (void)onSocket:(AsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port; 40 | 41 | #pragma mark NOTIFICATIONS 42 | - (void)didReceiveFileListChanged; 43 | 44 | #pragma mark CONNECTIONS 45 | - (void)closeConnection:(id)theConnection; 46 | - (NSString *)createList:(NSString *)directoryPath; 47 | 48 | @property (readwrite, strong) AsyncSocket *listenSocket; 49 | @property (readwrite, strong) NSMutableArray *connectedSockets; 50 | @property (readwrite, strong) id server; 51 | @property (readwrite, strong) id notificationObject; 52 | @property (readwrite) int portNumber; 53 | @property (readwrite, strong) id delegate; 54 | @property (readwrite, strong) NSMutableArray *connections; 55 | @property (readwrite, strong) NSDictionary *commands; 56 | @property (readwrite, strong) NSString *baseDir; 57 | @property (readwrite) Boolean changeRoot; 58 | @property (readwrite) int clientEncoding; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /PhotoSecurity/Setting/Controller/XPFTPViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPFTPViewController.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/24. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPFTPViewController.h" 10 | #import "XMFTPServer.h" 11 | 12 | @interface XPFTPViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITextField *textField; 15 | @property (nonatomic, strong) XMFTPServer *ftpServer; 16 | 17 | @end 18 | 19 | @implementation XPFTPViewController 20 | 21 | #pragma mark - Lifecycle 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | self.title = NSLocalizedString(@"FTP Service", nil); 26 | } 27 | 28 | - (void)didReceiveMemoryWarning { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | - (void)dealloc { 34 | [self stopFTPServer]; 35 | } 36 | 37 | #pragma mark - Actions 38 | 39 | - (IBAction)toggleButtonAction:(UIButton *)sender { 40 | sender.selected = !sender.selected; 41 | if (sender.selected) { 42 | unsigned int ftpPort = 23023; 43 | NSString *ip = [XMFTPHelper localIPAddress]; 44 | if (![ip isIP]) { 45 | sender.selected = !sender.selected; 46 | [XPProgressHUD showFailureHUD:NSLocalizedString(@"FTP server failed to open, please confirm open WIFI and connect WIFI", nil) toView:self.view]; 47 | return; 48 | } 49 | self.textField.text = [NSString stringWithFormat:@"ftp://%@:%d", ip, ftpPort]; 50 | [self stopFTPServer]; 51 | /** 52 | 仅仅开放相片目录 53 | 如果notifyObject传递了self,则需要注意循环引用导致self不能释放的问题,在适当的时候需要自动停止FTP服务器 54 | */ 55 | _ftpServer = [[XMFTPServer alloc] initWithPort:ftpPort 56 | withDir:photoRootDirectory() 57 | notifyObject:nil]; 58 | } else { 59 | self.textField.text = nil; 60 | [self stopFTPServer]; 61 | } 62 | } 63 | 64 | #pragma mark - Private 65 | 66 | - (void)stopFTPServer { 67 | if (_ftpServer) { 68 | [_ftpServer stopFtpServer]; 69 | _ftpServer = nil; 70 | } 71 | } 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /PhotoSecurity/zh-Hans.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UITextField"; placeholder = "Please enter a new password"; ObjectID = "00K-Sd-YNY"; */ 3 | "00K-Sd-YNY.placeholder" = "请输入新密码"; 4 | 5 | /* Class = "UINavigationItem"; title = "All albums"; ObjectID = "2ki-Zi-qEU"; */ 6 | "2ki-Zi-qEU.title" = "所有相册"; 7 | 8 | /* Class = "UIButton"; normalTitle = "Setting"; ObjectID = "8Op-Z9-ApT"; */ 9 | "8Op-Z9-ApT.normalTitle" = "设置"; 10 | 11 | /* Class = "UITextField"; placeholder = "Please enter your password"; ObjectID = "9zB-2U-VPo"; */ 12 | "9zB-2U-VPo.placeholder" = "请输入密码"; 13 | 14 | /* Class = "UILabel"; text = "New Password"; ObjectID = "Bkq-TO-LOu"; */ 15 | "Bkq-TO-LOu.text" = "新密码"; 16 | 17 | /* Class = "UIButton"; normalTitle = "Unlock"; ObjectID = "C7Z-pU-v1d"; */ 18 | "C7Z-pU-v1d.normalTitle" = "解锁"; 19 | 20 | /* Class = "UITextField"; placeholder = "Please confirm your password"; ObjectID = "HCO-m2-FOD"; */ 21 | "HCO-m2-FOD.placeholder" = "请确认密码"; 22 | 23 | /* Class = "UIButton"; normalTitle = "Set Password"; ObjectID = "HX8-4n-VM5"; */ 24 | "HX8-4n-VM5.normalTitle" = "设置密码"; 25 | 26 | /* Class = "UILabel"; text = "Label"; ObjectID = "Jr6-uL-fh4"; */ 27 | "Jr6-uL-fh4.text" = "Label"; 28 | 29 | /* Class = "UIButton"; normalTitle = "Start FTP Service"; ObjectID = "N1e-Tv-dq3"; */ 30 | "N1e-Tv-dq3.normalTitle" = "开启FTP服务"; 31 | 32 | /* Class = "UIButton"; selectedTitle = "Stop FTP Service"; ObjectID = "N1e-Tv-dq3"; */ 33 | "N1e-Tv-dq3.selectedTitle" = "关闭FTP服务"; 34 | 35 | /* Class = "UITextField"; placeholder = "Please enter the old password"; ObjectID = "QzR-TV-Wa9"; */ 36 | "QzR-TV-Wa9.placeholder" = "请输入旧密码"; 37 | 38 | /* Class = "UILabel"; text = "Old Password"; ObjectID = "Rtp-mu-7ur"; */ 39 | "Rtp-mu-7ur.text" = "旧密码"; 40 | 41 | /* Class = "UITextField"; placeholder = "Please enter your password"; ObjectID = "hmx-il-Vov"; */ 42 | "hmx-il-Vov.placeholder" = "请输入密码"; 43 | 44 | /* Class = "UILabel"; text = "Label"; ObjectID = "nW4-SV-6PL"; */ 45 | "nW4-SV-6PL.text" = ""; 46 | 47 | /* Class = "UINavigationItem"; title = "Setting"; ObjectID = "slt-Hu-ynz"; */ 48 | "slt-Hu-ynz.title" = "设置"; 49 | 50 | /* Class = "UITextField"; placeholder = "Please confirm the new password"; ObjectID = "t4j-eR-t1g"; */ 51 | "t4j-eR-t1g.placeholder" = "请确认新密码"; 52 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/Image+Snapshot.m: -------------------------------------------------------------------------------- 1 | // 2 | // Image+Video.m 3 | // 4 | // 5 | // Created by nhope on 2017/4/12. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "Image+Snapshot.h" 10 | #import 11 | #import 12 | 13 | @implementation XP_IMAGE (Snapshot) 14 | 15 | /** 16 | 从视频文件中提取缩略图 17 | 18 | @param videoURL 本地视频文件URL 19 | @return 视频缩略图 20 | */ 21 | + (instancetype)snapshotImageWithVideoURL:(NSURL *)videoURL { 22 | if (![videoURL isFileURL]) { 23 | return nil; 24 | } 25 | AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoURL options:nil]; 26 | AVAssetImageGenerator *imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset]; 27 | CGImageRef imageRef = [imageGenerator copyCGImageAtTime:kCMTimeZero 28 | actualTime:NULL 29 | error:nil]; 30 | XP_IMAGE *image = nil; 31 | #if TARGET_OS_IPHONE || TARGET_OS_TV 32 | image = [[UIImage alloc] initWithCGImage:imageRef]; 33 | #elif TARGET_OS_MAC 34 | NSSize size = NSMakeSize(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 35 | image = [[NSImage alloc] initWithCGImage:imageRef size:size]; 36 | #endif 37 | CGImageRelease(imageRef); 38 | return image; 39 | } 40 | 41 | /** 42 | 从GIF图片中提取第一帧作为缩略图 43 | 44 | @param gifURL 本地GIF文件URL 45 | @return 缩略图 46 | */ 47 | + (instancetype)snapshotImageWithGIFImageURL:(NSURL *)gifURL { 48 | if (![gifURL isFileURL]) { 49 | return nil; 50 | } 51 | CFURLRef urlRef = (__bridge CFURLRef)gifURL; 52 | CGImageSourceRef sourceRef = CGImageSourceCreateWithURL(urlRef, NULL); 53 | if (0 == CGImageSourceGetCount(sourceRef)) { // empty gif file. 54 | return nil; 55 | } 56 | CGImageRef imageRef = CGImageSourceCreateImageAtIndex(sourceRef, 0, NULL); 57 | XP_IMAGE *image = nil; 58 | #if TARGET_OS_IPHONE || TARGET_OS_TV 59 | image = [[UIImage alloc] initWithCGImage:imageRef]; 60 | #elif TARGET_OS_MAC 61 | NSSize size = NSMakeSize(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 62 | image = [[NSImage alloc] initWithCGImage:imageRef size:size]; 63 | #endif 64 | CGImageRelease(imageRef); 65 | return image; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIWindow+Hierarchy.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Hierarchy.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQUIWindow+Hierarchy.h" 25 | #import 26 | 27 | @implementation UIWindow (IQ_UIWindow_Hierarchy) 28 | 29 | - (UIViewController*)topMostController 30 | { 31 | UIViewController *topController = [self rootViewController]; 32 | 33 | // Getting topMost ViewController 34 | while ([topController presentedViewController]) topController = [topController presentedViewController]; 35 | 36 | // Returning topMost ViewController 37 | return topController; 38 | } 39 | 40 | - (UIViewController*)currentViewController; 41 | { 42 | UIViewController *currentViewController = [self topMostController]; 43 | 44 | while ([currentViewController isKindOfClass:[UINavigationController class]] && [(UINavigationController*)currentViewController topViewController]) 45 | currentViewController = [(UINavigationController*)currentViewController topViewController]; 46 | 47 | return currentViewController; 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Utils/XPSQLiteManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // XPSQLiteManager.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/15. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XPAlbumModel; 12 | @class XPPhotoModel; 13 | 14 | @interface XPSQLiteManager : NSObject 15 | 16 | /** 17 | 单例 18 | */ 19 | + (instancetype)sharedSQLiteManager; 20 | 21 | /** 22 | 初始化数据库 23 | */ 24 | - (void)initializationDatabase; 25 | 26 | /** 27 | 获取用户的所有相册数据 28 | 29 | @return 相册数组 30 | */ 31 | - (NSMutableArray *)requestUserAlbums; 32 | 33 | /** 34 | 创建一个新相册 35 | 36 | @param name 相册名称 37 | @return 新创建的相册 38 | */ 39 | - (XPAlbumModel *)createAlbumWithName:(NSString *)name; 40 | 41 | /** 42 | 删除相册(会将该相册下的所有图片一并删除) 43 | 44 | @param album 相册信息 45 | @return 是否删除成功 46 | */ 47 | - (BOOL)deleteAlbumWithAlbum:(XPAlbumModel *)album; 48 | 49 | /** 50 | 对相册进行重新排序 51 | 52 | @param sortAlbums 待排序的相册数组(将根据索引进行排序) 53 | */ 54 | - (BOOL)resortAlbums:(NSArray *)sortAlbums; 55 | 56 | 57 | 58 | /** 59 | 保存图片信息 60 | 61 | @param photos 图片信息数组 62 | @return BOOL 63 | */ 64 | - (BOOL)addPhotos:(NSArray *)photos; 65 | 66 | /** 67 | 加载指定相册下的图片数据 68 | 69 | @param albumid 相册id 70 | @param page 页码 71 | @param pagesize 分页大小 72 | @return 指定页码对应的图片数据 73 | */ 74 | - (NSMutableArray *)requestPhotosWithAlbumid:(NSInteger)albumid page:(NSInteger)page pagesize:(NSInteger)pagesize; 75 | 76 | /** 77 | 加载指定相册下的所有图片数据(限定10k张图片之内) 78 | 79 | @param albumid 相册id 80 | @return 该相册下的所有图片数据 81 | */ 82 | - (NSMutableArray *)requestAllPhotosWithAlbumid:(NSInteger)albumid; 83 | 84 | /** 85 | 获取指定相册下最新添加的N张图片信息 86 | 87 | @param albumid 相册id 88 | @param count 图片数量 89 | @return 多张图片信息 90 | */ 91 | - (NSArray *)requestLatestPhotosWithAlbumid:(NSInteger)albumid count:(NSInteger)count; 92 | 93 | /** 94 | 删除某个相册下指定的图片 95 | 96 | @param photos 待删除的图片数据 97 | @param album 相册 98 | @return 成功删除图片的个数 99 | */ 100 | - (NSUInteger)deletePhotos:(NSArray *)photos fromAlbum:(XPAlbumModel *)album; 101 | 102 | 103 | - (instancetype)init NS_UNAVAILABLE; 104 | + (instancetype)new NS_UNAVAILABLE; 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQToolbar.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | IQToolbar for IQKeyboardManager. 28 | */ 29 | @interface IQToolbar : UIToolbar 30 | 31 | /** 32 | Title font for toolbar. 33 | */ 34 | @property(nullable, nonatomic, strong) UIFont *titleFont; 35 | 36 | /** 37 | Toolbar done title 38 | */ 39 | @property(nullable, nonatomic, strong) NSString *doneTitle; 40 | 41 | /** 42 | Toolbar done image 43 | */ 44 | @property(nullable, nonatomic, strong) UIImage *doneImage; 45 | 46 | /** 47 | Toolbar title 48 | */ 49 | @property(nullable, nonatomic, strong) NSString *title; 50 | 51 | /** 52 | Optional target & action to behave toolbar title button as clickable button 53 | 54 | @param target Target object. 55 | @param action Target Selector. 56 | */ 57 | -(void)setTitleTarget:(nullable id)target action:(nullable SEL)action; 58 | 59 | /** 60 | Customized Invocation to be called on title button action. titleInvocation is internally created using setTitleTarget:action: method. 61 | */ 62 | @property (nullable, strong, nonatomic) NSInvocation *titleInvocation; 63 | 64 | @end 65 | 66 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Constants/IQKeyboardManagerConstantsInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQKeyboardManagerConstantsInternal.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #ifndef IQKeyboardManagerConstantsInternal_h 25 | #define IQKeyboardManagerConstantsInternal_h 26 | 27 | 28 | ///----------------------------------- 29 | /// @name IQLayoutGuidePosition 30 | ///----------------------------------- 31 | 32 | /** 33 | `IQLayoutGuidePositionNone` 34 | If there are no IQLayoutGuideConstraint associated with viewController 35 | 36 | `IQLayoutGuidePositionTop` 37 | If provided IQLayoutGuideConstraint is associated with with viewController topLayoutGuide 38 | 39 | `IQLayoutGuidePositionBottom` 40 | If provided IQLayoutGuideConstraint is associated with with viewController bottomLayoutGuide 41 | */ 42 | typedef NS_ENUM(NSInteger, IQLayoutGuidePosition) { 43 | IQLayoutGuidePositionNone, 44 | IQLayoutGuidePositionTop, 45 | IQLayoutGuidePositionBottom, 46 | }; 47 | 48 | //Xcode 8 compatibility check 49 | #ifdef NSFoundationVersionNumber_iOS_9_x_Max 50 | #define IQ_IS_IOS10_OR_GREATER (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max) 51 | #else 52 | #define IQ_IS_IOS10_OR_GREATER NO 53 | #endif 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUITextFieldView+Additions.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQUITextFieldView+Additions.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQUITextFieldView+Additions.h" 25 | #import 26 | 27 | @implementation UIView (Additions) 28 | 29 | -(void)setKeyboardDistanceFromTextField:(CGFloat)keyboardDistanceFromTextField 30 | { 31 | //Can't be less than zero. Minimum is zero. 32 | keyboardDistanceFromTextField = MAX(keyboardDistanceFromTextField, 0); 33 | 34 | objc_setAssociatedObject(self, @selector(keyboardDistanceFromTextField), [NSNumber numberWithFloat:keyboardDistanceFromTextField], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 35 | } 36 | 37 | -(CGFloat)keyboardDistanceFromTextField 38 | { 39 | NSNumber *keyboardDistanceFromTextField = objc_getAssociatedObject(self, @selector(keyboardDistanceFromTextField)); 40 | 41 | return (keyboardDistanceFromTextField)?[keyboardDistanceFromTextField floatValue]:kIQUseDefaultKeyboardDistance; 42 | } 43 | 44 | @end 45 | 46 | ///------------------------------------ 47 | /// @name keyboardDistanceFromTextField 48 | ///------------------------------------ 49 | 50 | /** 51 | Uses default keyboard distance for textField. 52 | */ 53 | CGFloat const kIQUseDefaultKeyboardDistance = CGFLOAT_MAX; 54 | 55 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Utils/functions.h: -------------------------------------------------------------------------------- 1 | // 2 | // functions.h 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 获取相册根目录 13 | 14 | @return 相册根目录的绝对路径 15 | */ 16 | UIKIT_EXTERN NSString* photoRootDirectory(); 17 | 18 | /** 19 | 检测相册根目录,如果不存在则创建 20 | */ 21 | UIKIT_EXTERN void checkPhotoRootDirectory(); 22 | 23 | /** 24 | 对密码进行加密 25 | 26 | @param password 密码明文 27 | @param random 随机字符 28 | @return 加密后的新密码 29 | */ 30 | UIKIT_EXTERN NSString *encryptionPassword(NSString *password, NSString *random); 31 | 32 | /** 33 | 随机字符串 34 | 35 | @param length 字符串长度 36 | @return 返回规定长度的随机字符串 37 | */ 38 | UIKIT_EXTERN NSString* randomString(int length); 39 | 40 | /** 41 | 创建一个随机且不存在的相册目录 42 | 43 | @return 随机目录 44 | */ 45 | UIKIT_EXTERN NSString* createRandomAlbumDirectory(); 46 | 47 | /** 48 | 生成唯一标识的字符串(由当前时间加一个5位随机数组成) 49 | 50 | @return 唯一标识符 51 | */ 52 | UIKIT_EXTERN NSString* generateUniquelyIdentifier(); 53 | 54 | /** 55 | 是否开启TouchID功能 56 | 57 | @return YES:已启动TouchID, NO:未启用TouchID 58 | */ 59 | UIKIT_EXTERN BOOL isEnableTouchID(); 60 | 61 | /** 62 | 判断系统版本是否大于等于给定的版本 63 | 64 | @param majorVersion 主版本号 65 | @param minorVersion 次版本号 66 | @param patchVersion 补丁版本号 67 | @return BOOL 68 | */ 69 | UIKIT_EXTERN BOOL isOperatingSystemAtLeastVersion(NSInteger majorVersion, NSInteger minorVersion, NSInteger patchVersion); 70 | 71 | 72 | /////////////////////////////// 73 | //// 内联函数 //// 74 | /////////////////////////////// 75 | 76 | /** 77 | 通过RGB获取颜色 78 | */ 79 | UIKIT_STATIC_INLINE UIColor* rgbColor(CGFloat r, CGFloat g, CGFloat b) 80 | { 81 | return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]; 82 | } 83 | 84 | /** 85 | 判断当前设备是否为iPad 86 | */ 87 | UIKIT_STATIC_INLINE BOOL iPad() 88 | { 89 | return UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad; 90 | } 91 | 92 | 93 | /////////////////////////// 94 | //// 常量 //// 95 | /////////////////////////// 96 | 97 | /// 密码 98 | FOUNDATION_EXTERN NSString * const XPPasswordKey; 99 | /// 密码随机字符 100 | FOUNDATION_EXTERN NSString * const XPEncryptionPasswordRandomKey; 101 | /// 密码最小长度 102 | FOUNDATION_EXTERN NSInteger const XPPasswordMinimalLength; 103 | /// TouchID是否启用 104 | FOUNDATION_EXTERN NSString * const XPTouchEnableStateKey; 105 | /// 缩略图目录名称 106 | FOUNDATION_EXTERN NSString * const XPThumbDirectoryNameKey; 107 | /// 生成的缩略图的宽高尺寸 108 | FOUNDATION_EXTERN CGFloat const XPThumbImageWidthAndHeightKey; 109 | 110 | -------------------------------------------------------------------------------- /PhotoSecurity/Setting/Controller/XPChangePasswordViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPChangePasswordViewController.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/21. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPChangePasswordViewController.h" 10 | 11 | @interface XPChangePasswordViewController () 12 | 13 | /// 旧密码输入框 14 | @property (weak, nonatomic) IBOutlet UITextField *oldPasswordTextFiled; 15 | /// 新密码输入框 16 | @property (weak, nonatomic) IBOutlet UITextField *passwordTextField; 17 | /// 新密码确认框 18 | @property (weak, nonatomic) IBOutlet UITextField *confirmPasswordTextField; 19 | 20 | @end 21 | 22 | @implementation XPChangePasswordViewController 23 | 24 | #pragma mark - Lifecycle 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | self.title = NSLocalizedString(@"Change Password", nil); 29 | } 30 | 31 | - (void)didReceiveMemoryWarning { 32 | [super didReceiveMemoryWarning]; 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | #pragma mark - Actions 37 | 38 | - (IBAction)settingButtonAction:(UIButton *)sender { 39 | NSString *oldPassword = [self.oldPasswordTextFiled.text trim]; 40 | if (0 == oldPassword.length) { 41 | [self.oldPasswordTextFiled setText:nil]; 42 | [self.oldPasswordTextFiled shake]; 43 | return; 44 | } 45 | if (![XPPasswordTool verifyPassword:oldPassword]) { 46 | [XPProgressHUD showFailureHUD:NSLocalizedString(@"Old password is incorrect", nil) toView:self.view]; 47 | return; 48 | } 49 | NSString *password = [self.passwordTextField.text trim]; 50 | NSString *confirmPassword = [self.confirmPasswordTextField.text trim]; 51 | if (0 == password.length) { 52 | return [self.passwordTextField shake]; 53 | } 54 | if (0 == confirmPassword.length) { 55 | return [self.confirmPasswordTextField shake]; 56 | } 57 | if (password.length < XPPasswordMinimalLength) { 58 | [XPProgressHUD showFailureHUD:NSLocalizedString(@"Password length is at least 6 characters", nil) toView:self.view]; 59 | return; 60 | } 61 | if (![password isEqualToString:confirmPassword]) { 62 | [XPProgressHUD showFailureHUD:NSLocalizedString(@"The password entered twice is inconsistent", nil) toView:self.view]; 63 | return; 64 | } 65 | [XPPasswordTool storagePassword:password]; 66 | UIWindow *window = [[UIApplication sharedApplication] keyWindow]; 67 | [XPProgressHUD showSuccessHUD:NSLocalizedString(@"Password has been modified successfully", nil) toView:window]; 68 | [self.navigationController popViewControllerAnimated:YES]; 69 | } 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Controller/XPNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPNavigationController.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPNavigationController.h" 10 | 11 | @interface XPNavigationController () 12 | 13 | @end 14 | 15 | @implementation XPNavigationController 16 | 17 | #pragma mark - Lifecycle 18 | 19 | + (void)initialize { 20 | UINavigationBar *navigationBar = [UINavigationBar appearance]; 21 | [navigationBar setTranslucent:NO]; 22 | [navigationBar setBarTintColor:rgbColor(60.0, 65.0, 70.0)]; 23 | [navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]}]; 24 | UIImage *backImage = [[UIImage imageNamed:@"icon-back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 25 | [navigationBar setBackIndicatorImage:backImage]; 26 | [navigationBar setBackIndicatorTransitionMaskImage:backImage]; 27 | 28 | UIBarButtonItem *barButtonItem = [UIBarButtonItem appearance]; 29 | NSDictionary *dict = @{ 30 | NSFontAttributeName: [UIFont systemFontOfSize:15.0], 31 | NSForegroundColorAttributeName: [UIColor whiteColor] 32 | }; 33 | [barButtonItem setTitleTextAttributes:dict forState:UIControlStateNormal]; 34 | } 35 | 36 | - (void)viewDidLoad { 37 | [super viewDidLoad]; 38 | // Do any additional setup after loading the view. 39 | } 40 | 41 | - (void)didReceiveMemoryWarning { 42 | [super didReceiveMemoryWarning]; 43 | // Dispose of any resources that can be recreated. 44 | } 45 | 46 | #pragma mark - Override 47 | 48 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ 49 | if (self.childViewControllers.count > 0) { 50 | /// 清除掉返回按钮的文字 51 | UIBarButtonItem *backItem =[[UIBarButtonItem alloc] initWithTitle:@"" 52 | style:UIBarButtonItemStylePlain 53 | target:nil 54 | action:nil]; 55 | [self.topViewController.navigationItem setBackBarButtonItem:backItem]; 56 | } 57 | [viewController setHidesBottomBarWhenPushed:YES]; 58 | [super pushViewController:viewController animated:YES]; 59 | } 60 | 61 | /// 将状态栏样式交给当前控制器处理 62 | - (UIStatusBarStyle)preferredStatusBarStyle { 63 | if (self.topViewController != nil) { 64 | return [self.topViewController preferredStatusBarStyle]; 65 | } 66 | return [super preferredStatusBarStyle]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /PhotoSecurity/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "AppIcon20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "AppIcon20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "AppIcon29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "AppIcon29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "AppIcon40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "AppIcon40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "AppIcon60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "AppIcon60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "AppIcon20.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "AppIcon20@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "AppIcon29.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "AppIcon29@2x-1.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "AppIcon40.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "AppIcon40@2x-1.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "AppIcon76.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "AppIcon76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "AppIcon835@2x.png", 103 | "scale" : "2x" 104 | } 105 | ], 106 | "info" : { 107 | "version" : 1, 108 | "author" : "xcode" 109 | } 110 | } -------------------------------------------------------------------------------- /PhotoSecurity/System/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PhotoSecurity 4 | // 5 | // Created by xiaopin on 2017/3/1. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "GHPopupEditView.h" 11 | #import "XPUnlockViewController.h" 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | self.window.backgroundColor = [UIColor whiteColor]; 22 | checkPhotoRootDirectory(); 23 | NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 24 | if (0 == [userDefaults stringForKey:XPEncryptionPasswordRandomKey].length) { 25 | NSString *random = randomString(6); 26 | [userDefaults setObject:random forKey:XPEncryptionPasswordRandomKey]; 27 | [userDefaults synchronize]; 28 | } 29 | // 初始化数据库 30 | [[XPSQLiteManager sharedSQLiteManager] initializationDatabase]; 31 | return YES; 32 | } 33 | 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application { 36 | if ([XPPasswordTool isSetPassword]) { 37 | for (UIView *subview in self.window.subviews) { 38 | if ([subview isKindOfClass:[GHPopupEditView class]]) { 39 | [subview removeFromSuperview]; 40 | } 41 | } 42 | UIViewController *rootVc = [self.window rootViewController]; 43 | if (nil == rootVc.presentedViewController || ![rootVc.presentedViewController isKindOfClass:[XPUnlockViewController class]]) { 44 | [rootVc.presentedViewController dismissViewControllerAnimated:NO completion:nil]; 45 | UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 46 | UIViewController *unlockVc = [mainStoryboard instantiateViewControllerWithIdentifier:@"XPUnlockViewController"]; 47 | [rootVc presentViewController:unlockVc animated:NO completion:nil]; 48 | } 49 | } 50 | } 51 | 52 | 53 | - (void)applicationWillEnterForeground:(UIApplication *)application { 54 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 55 | } 56 | 57 | 58 | - (void)applicationDidBecomeActive:(UIApplication *)application { 59 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 60 | } 61 | 62 | 63 | - (void)applicationWillTerminate:(UIApplication *)application { 64 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQNSArray+Sort.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Sort.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQNSArray+Sort.h" 25 | #import "IQUIView+Hierarchy.h" 26 | 27 | #import 28 | 29 | @implementation NSArray (IQ_NSArray_Sort) 30 | 31 | - (NSArray*)sortedArrayByTag 32 | { 33 | return [self sortedArrayUsingComparator:^NSComparisonResult(UIView *view1, UIView *view2) { 34 | 35 | if ([view1 respondsToSelector:@selector(tag)] && [view2 respondsToSelector:@selector(tag)]) 36 | { 37 | if ([view1 tag] < [view2 tag]) return NSOrderedAscending; 38 | 39 | else if ([view1 tag] > [view2 tag]) return NSOrderedDescending; 40 | 41 | else return NSOrderedSame; 42 | } 43 | else 44 | return NSOrderedSame; 45 | }]; 46 | } 47 | 48 | - (NSArray*)sortedArrayByPosition 49 | { 50 | return [self sortedArrayUsingComparator:^NSComparisonResult(UIView *view1, UIView *view2) { 51 | 52 | CGFloat x1 = CGRectGetMinX(view1.frame); 53 | CGFloat y1 = CGRectGetMinY(view1.frame); 54 | CGFloat x2 = CGRectGetMinX(view2.frame); 55 | CGFloat y2 = CGRectGetMinY(view2.frame); 56 | 57 | if (y1 < y2) return NSOrderedAscending; 58 | 59 | else if (y1 > y2) return NSOrderedDescending; 60 | 61 | //Else both y are same so checking for x positions 62 | else if (x1 < x2) return NSOrderedAscending; 63 | 64 | else if (x1 > x2) return NSOrderedDescending; 65 | 66 | else return NSOrderedSame; 67 | }]; 68 | } 69 | 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQTitleBarButtonItem.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | #import "IQKeyboardManagerConstants.h" 26 | #import "IQBarButtonItem.h" 27 | 28 | /** 29 | BarButtonItem with title text. 30 | */ 31 | @interface IQTitleBarButtonItem : IQBarButtonItem 32 | 33 | /** 34 | Font to be used in bar button. Default is (system font 12.0 bold). 35 | */ 36 | @property(nullable, nonatomic, strong) UIFont *font; 37 | 38 | /** 39 | selectableTextColor to be used for displaying button text when button is enabled. 40 | */ 41 | @property(nullable, nonatomic, strong) UIColor *selectableTextColor; 42 | 43 | /** 44 | Initialize with frame and title. 45 | 46 | @param title Title of barButtonItem. 47 | */ 48 | -(nonnull instancetype)initWithTitle:(nullable NSString *)title NS_DESIGNATED_INITIALIZER; 49 | 50 | /** 51 | Optional target & action to behave toolbar title button as clickable button 52 | 53 | @param target Target object. 54 | @param action Target Selector. 55 | */ 56 | -(void)setTitleTarget:(nullable id)target action:(nullable SEL)action; 57 | 58 | /** 59 | Customized Invocation to be called on title button action. titleInvocation is internally created using setTitleTarget:action: method. 60 | */ 61 | @property (nullable, strong, nonatomic) NSInvocation *titleInvocation; 62 | 63 | /** 64 | Unavailable. Please use initWithFrame:title: method 65 | */ 66 | -(nonnull instancetype)init NS_UNAVAILABLE; 67 | 68 | /** 69 | Unavailable. Please use initWithFrame:title: method 70 | */ 71 | -(nonnull instancetype)initWithCoder:(nullable NSCoder *)aDecoder NS_UNAVAILABLE; 72 | 73 | /** 74 | Unavailable. Please use initWithFrame:title: method 75 | */ 76 | + (nonnull instancetype)new NS_UNAVAILABLE; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /PhotoSecurity/System/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | PhotoSecurity 4 | 5 | Created by nhope on 2017/3/13. 6 | Copyright © 2017年 xiaopin. All rights reserved. 7 | */ 8 | 9 | "Cancel" = "取消"; 10 | "OK" = "确定"; 11 | "Done" = "完成"; 12 | "Edit" = "编辑"; 13 | "Close" = "关闭"; 14 | "Copying the pictures..." = "正在保存图片..."; 15 | "Whether to delete the selected image from the photo library?" = "是否从系统图库中删除选中的图片?"; 16 | "Delete" = "删除"; 17 | "Delete fail." = "删除失败"; 18 | "Album is empty" = "空相册"; 19 | "Please click the button below to add a picture." = "该相册并没有任何图片,请点击下面的按钮添加图片"; 20 | "Add pictures" = "添加图片"; 21 | "Photo Library" = "照片图库"; 22 | "Take Photo or Video" = "拍照或者视频"; 23 | "No albums" = "没有相册"; 24 | "No albums, please create an album to facilitate the storage of photos." = "请先点击下面的按钮创建一个新相册以便于存储图片"; 25 | "Create a new album" = "创建新相册"; 26 | "Please enter the album name" = "请输入相册名称"; 27 | "Album name" = "相册名称"; 28 | "Album name can not be empty" = "相册名称不能为空"; 29 | "You can only select up to 9 images." = "你最多只能选择9张图片"; 30 | "No photo or video" = "无照片或视频"; 31 | "Password is wrong, please try again." = "密码错误,请重新输入"; 32 | "The password entered twice is inconsistent" = "两次输入的密码不一致"; 33 | "Password length is at least 6 characters" = "密码长度不少于6位"; 34 | "You can use the Touch ID to verify the fingerprint quickly to complete the unlock application" = "您可以使用Touch ID快速验证指纹以完成解锁应用"; 35 | "Delete Album" = "删除相册"; 36 | "Are you sure you want to delete the album? All the pictures under the album will be deleted." = "你确定要删除该相册吗?该相册下的所有图片将会被删除。"; 37 | "The camera is not available" = "该设备没有摄像头"; 38 | "Photo saved failed" = "图片保存失败"; 39 | "Photo saved successfully" = "图片保存成功"; 40 | "Not authorized to use the camera" = "未获得授权使用摄像头"; 41 | "Please open in iPhone \"Settings - Privacy - Camera\"" = "请在iPhone的\"设置-隐私-相机\"中打开"; 42 | "Please open in iPhone \"Settings - Privacy - Photos\"" = "请在iPhone的\"设置-隐私-照片\"中打开"; 43 | "No authorization to access Photo Library" = "未授权访问图库"; 44 | "Open settings" = "打开设置"; 45 | "Unlock access to locked feature" = "解锁应用"; 46 | "Fingerprints are unlocked" = "指纹解锁"; 47 | "Change Password" = "修改密码"; 48 | "After opening, you can use the Touch ID to verify the fingerprint quickly to complete the unlock application" = "开启后,可使用Touch ID验证指纹快速完成解锁应用"; 49 | "Old password is incorrect" = "旧密码错误"; 50 | "Password has been modified successfully" = "密码已成功修改"; 51 | "Make sure you want to turn off Touch ID?" = "你确定要关闭指纹解锁吗?"; 52 | "Please select the pictures you want to delete" = "请先选择要删除的图片"; 53 | "Please select the pictures you want to save" = "请先选择要保存的图片"; 54 | "Deleting pictures..." = "正在删除图片..."; 55 | "Are you sure you want to delete the selected photos?" = "你确定要删除所选的照片吗?"; 56 | "FTP Service" = "FTP服务"; 57 | "After opening, you can quickly copy the photos through the FTP server" = "开启后,你可以通过FTP服务器快速地将图片拷贝出来"; 58 | "FTP server failed to open, please confirm open WIFI and connect WIFI" = "FTP服务器启动失败,请确认已成功连接WIFI"; 59 | "We have now provided by shaking random replacement application icon function, shake the phone try it" = "我们现在提供了通过摇一摇随机替换应用图标的功能,请摇一摇手机尝试一下吧!"; 60 | "Random icons are identical to existing icons and need not be replaced" = "随机图标与现有图标相同,无需更换"; 61 | 62 | -------------------------------------------------------------------------------- /PhotoSecurity/General/Category/UIView+XP.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+XP.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/2. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "UIView+XP.h" 10 | 11 | @implementation UIView (XP) 12 | 13 | /** 14 | 视图抖动效果 15 | */ 16 | - (void)shake { 17 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 18 | animation.duration = 0.5; 19 | animation.values = @[ 20 | [NSValue valueWithCGPoint:self.center], 21 | [NSValue valueWithCGPoint:CGPointMake(self.center.x-5, self.center.y)], 22 | [NSValue valueWithCGPoint:CGPointMake(self.center.x+5, self.center.y)], 23 | [NSValue valueWithCGPoint:self.center], 24 | [NSValue valueWithCGPoint:CGPointMake(self.center.x-5, self.center.y)], 25 | [NSValue valueWithCGPoint:CGPointMake(self.center.x+5, self.center.y)], 26 | [NSValue valueWithCGPoint:self.center], 27 | [NSValue valueWithCGPoint:CGPointMake(self.center.x-5, self.center.y)], 28 | [NSValue valueWithCGPoint:CGPointMake(self.center.x+5, self.center.y)], 29 | [NSValue valueWithCGPoint:self.center] 30 | ]; 31 | animation.keyTimes = @[@0.1, @0.2, @0.3, @0.4, @0.5, @0.6, @0.7, @0.8, @0.9, @1.0]; 32 | [self.layer addAnimation:animation forKey:nil]; 33 | } 34 | 35 | @end 36 | 37 | 38 | @implementation UIView (PCIBInspectable) 39 | 40 | - (void)setBorderWidth:(CGFloat)borderWidth { 41 | [self.layer setBorderWidth:borderWidth]; 42 | } 43 | 44 | - (CGFloat)borderWidth { 45 | return [self.layer borderWidth]; 46 | } 47 | 48 | - (void)setBorderColor:(UIColor *)borderColor { 49 | [self.layer setBorderColor:borderColor.CGColor]; 50 | } 51 | 52 | - (UIColor *)borderColor { 53 | return [UIColor colorWithCGColor:self.layer.borderColor]; 54 | } 55 | 56 | - (void)setBorderHexColor:(NSString *)borderHexColor { 57 | UIColor *color = [self colorWithHexString:borderHexColor]; 58 | [self.layer setBorderColor:[color CGColor]]; 59 | } 60 | 61 | - (NSString *)borderHexColor { 62 | return @"0xFFFFFF"; 63 | } 64 | 65 | - (void)setCornerRadius:(CGFloat)cornerRadius { 66 | [self.layer setCornerRadius:cornerRadius]; 67 | } 68 | 69 | - (CGFloat)cornerRadius { 70 | return [self.layer cornerRadius]; 71 | } 72 | 73 | - (void)setHexBgColor:(NSString *)hexStr { 74 | UIColor *color = [self colorWithHexString:hexStr]; 75 | [self setBackgroundColor:color]; 76 | } 77 | 78 | - (NSString *)hexBgColor { 79 | return @"0xFFFFFF"; 80 | } 81 | 82 | #pragma mark - Private 83 | 84 | - (UIColor *)colorWithHexString:(NSString *)hexStr { 85 | if ([hexStr hasPrefix:@"#"]) { 86 | hexStr = [hexStr stringByReplacingOccurrencesOfString:@"#" withString:@""]; 87 | } 88 | NSScanner *scanner = [NSScanner scannerWithString:hexStr]; 89 | unsigned int hex; 90 | if (![scanner scanHexInt:&hex]) { 91 | return [UIColor whiteColor]; 92 | } 93 | int r = (hex >> 16) & 0xFF; 94 | int g = (hex >> 8) & 0xFF; 95 | int b = hex & 0xFF; 96 | return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /PhotoSecurity/System/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Photos Vault 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIcons 12 | 13 | CFBundleAlternateIcons 14 | 15 | AppAlternateIcon 16 | 17 | CFBundleIconFiles 18 | 19 | AppAlternateIcon 20 | 21 | UIPrerenderedIcon 22 | 23 | 24 | AppAlternateIcon2 25 | 26 | CFBundleIconFiles 27 | 28 | AppAlternateIcon2 29 | 30 | UIPrerenderedIcon 31 | 32 | 33 | 34 | CFBundlePrimaryIcon 35 | 36 | CFBundleIconFiles 37 | 38 | AppIcon60x60 39 | 40 | 41 | 42 | CFBundleIcons~ipad 43 | 44 | CFBundleAlternateIcons 45 | 46 | AppAlternateIconiPad 47 | 48 | CFBundleIconFiles 49 | 50 | AppAlternateIconiPad 51 | 52 | UIPrerenderedIcon 53 | 54 | 55 | AppAlternateIconiPad2 56 | 57 | CFBundleIconFiles 58 | 59 | AppAlternateIconiPad2 60 | 61 | UIPrerenderedIcon 62 | 63 | 64 | 65 | CFBundlePrimaryIcon 66 | 67 | CFBundleIconFiles 68 | 69 | AppIcon83.5x83.5 70 | 71 | 72 | 73 | CFBundleIdentifier 74 | $(PRODUCT_BUNDLE_IDENTIFIER) 75 | CFBundleInfoDictionaryVersion 76 | 6.0 77 | CFBundleName 78 | $(PRODUCT_NAME) 79 | CFBundlePackageType 80 | APPL 81 | CFBundleShortVersionString 82 | 1.0 83 | CFBundleVersion 84 | 1 85 | LSRequiresIPhoneOS 86 | 87 | NSCameraUsageDescription 88 | Allows the camera to take pictures / record video 89 | NSMicrophoneUsageDescription 90 | Allows you to record sound using the microphone when recording video 91 | NSPhotoLibraryUsageDescription 92 | View and select the system album image 93 | UILaunchStoryboardName 94 | LaunchScreen 95 | UIMainStoryboardFile 96 | Main 97 | UIRequiredDeviceCapabilities 98 | 99 | armv7 100 | 101 | UIStatusBarStyle 102 | UIStatusBarStyleLightContent 103 | UISupportedInterfaceOrientations 104 | 105 | UIInterfaceOrientationPortrait 106 | UIInterfaceOrientationLandscapeLeft 107 | UIInterfaceOrientationLandscapeRight 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /PhotoSecurity/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/Controller/XPUnlockViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPUnlockViewController.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/6. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPUnlockViewController.h" 10 | #import 11 | 12 | @interface XPUnlockViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITextField *passwordTextField; 15 | 16 | @end 17 | 18 | @implementation XPUnlockViewController 19 | 20 | #pragma mark - Lifecycle 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillEnterForegroundNotificationAction:) name:UIApplicationWillEnterForegroundNotification object:nil]; 26 | } 27 | 28 | - (void)viewDidAppear:(BOOL)animated { 29 | [super viewDidAppear:animated]; 30 | [self prepareEnterPassword]; 31 | } 32 | 33 | - (void)dealloc { 34 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 35 | } 36 | 37 | - (void)didReceiveMemoryWarning { 38 | [super didReceiveMemoryWarning]; 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | #pragma mark - 43 | 44 | - (BOOL)textFieldShouldReturn:(UITextField *)textField { 45 | [self unlockButtonAction:nil]; 46 | return YES; 47 | } 48 | 49 | #pragma mark - Actions 50 | 51 | - (IBAction)unlockButtonAction:(UIButton *)sender { 52 | NSString *password = [self.passwordTextField.text trim]; 53 | if (XPPasswordMinimalLength > password.length) { 54 | return [self.passwordTextField shake]; 55 | } 56 | if (![XPPasswordTool verifyPassword:password]) { 57 | // TODO:密码错误,是否有必要限制每天的密码输入错误次数 58 | [XPProgressHUD showToast:NSLocalizedString(@"Password is wrong, please try again.", nil)]; 59 | return; 60 | } 61 | [self dismissViewControllerAnimated:YES completion:nil]; 62 | } 63 | 64 | - (void)applicationWillEnterForegroundNotificationAction:(NSNotification *)sender { 65 | [self prepareEnterPassword]; 66 | } 67 | 68 | #pragma mark - Private 69 | 70 | - (void)prepareEnterPassword { 71 | if (isEnableTouchID()) { 72 | @weakify(self); 73 | LAContext *context = [[LAContext alloc] init]; 74 | [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:NSLocalizedString(@"Unlock access to locked feature", nil) reply:^(BOOL success, NSError * _Nullable error) { 75 | dispatch_async(dispatch_get_main_queue(), ^{ 76 | @strongify(self); 77 | if (success) { 78 | [self dismissViewControllerAnimated:YES completion:nil]; 79 | return; 80 | } 81 | switch (error.code) { 82 | case LAErrorUserCancel: 83 | case LAErrorUserFallback: 84 | case LAErrorTouchIDLockout: 85 | case LAErrorAuthenticationFailed: 86 | [self.passwordTextField becomeFirstResponder]; 87 | break; 88 | default: 89 | break; 90 | } 91 | }); 92 | }]; 93 | } else { 94 | [self.passwordTextField becomeFirstResponder]; 95 | } 96 | } 97 | 98 | #pragma mark - StatusBar Style 99 | 100 | - (UIStatusBarStyle)preferredStatusBarStyle { 101 | return UIStatusBarStyleDefault; 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PhotoSecurity/Pods-PhotoSecurity-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /PhotoSecurity/Home/Controller/XPSetPasswordViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPSetPasswordViewController.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/3. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 首次使用时需设置密码 8 | 9 | #import "XPSetPasswordViewController.h" 10 | #import 11 | 12 | @interface XPSetPasswordViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITextField *passwordTextField; 15 | @property (weak, nonatomic) IBOutlet UITextField *confirmPasswordTextField; 16 | 17 | @end 18 | 19 | @implementation XPSetPasswordViewController 20 | 21 | #pragma mark - Lifecycle 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | // Do any additional setup after loading the view. 26 | } 27 | 28 | - (void)didReceiveMemoryWarning { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | #pragma mark - Actions 34 | 35 | - (IBAction)setPasswordButtonAction:(UIButton *)sender { 36 | NSString *pwd = [self.passwordTextField.text trim]; 37 | NSString *confirmPwd = [self.confirmPasswordTextField.text trim]; 38 | if (0 == pwd.length) { 39 | return [self.passwordTextField shake]; 40 | } 41 | if (0 == confirmPwd.length) { 42 | return [self.confirmPasswordTextField shake]; 43 | } 44 | if (XPPasswordMinimalLength > pwd.length) { 45 | [self.passwordTextField becomeFirstResponder]; 46 | [XPProgressHUD showToast:NSLocalizedString(@"Password length is at least 6 characters", nil)]; 47 | return; 48 | } 49 | if (![pwd isEqualToString:confirmPwd]) { 50 | [XPProgressHUD showToast:NSLocalizedString(@"The password entered twice is inconsistent", nil)]; 51 | return; 52 | } 53 | // 存储密码 54 | [XPPasswordTool storagePassword:pwd]; 55 | 56 | // TODO:检测设备是否支持TouchID 57 | LAContext *context = [[LAContext alloc] init]; 58 | NSError *error = nil; 59 | BOOL isSupportTouchID = [context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&error]; 60 | if (isSupportTouchID && nil == error) { 61 | [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:NSLocalizedString(@"You can use the Touch ID to verify the fingerprint quickly to complete the unlock application", nil) reply:^(BOOL success, NSError * _Nullable error) { 62 | if (success) { 63 | // TouchID验证成功,将TouchID功能标记为开启状态 64 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:XPTouchEnableStateKey]; 65 | [[NSUserDefaults standardUserDefaults] synchronize]; 66 | } else { 67 | NSLog(@"%@", error); 68 | switch (error.code) { 69 | case LAErrorSystemCancel: 70 | break; 71 | case LAErrorUserCancel: 72 | NSLog(@"用户取消"); 73 | break; 74 | case LAErrorPasscodeNotSet: 75 | NSLog(@"TouchID未设置密码,需要先设置密码"); 76 | break; 77 | case LAErrorAuthenticationFailed: 78 | NSLog(@"认证失败"); 79 | break; 80 | default: 81 | break; 82 | } 83 | } 84 | }]; 85 | } 86 | NSLog(@"%@", error.userInfo[NSLocalizedDescriptionKey]); 87 | 88 | // 跳转到首页 89 | [self dismissViewControllerAnimated:YES completion:nil]; 90 | } 91 | 92 | #pragma mark - StatusBar Style 93 | 94 | - (UIStatusBarStyle)preferredStatusBarStyle { 95 | return UIStatusBarStyleDefault; 96 | } 97 | 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQKeyboardReturnKeyHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQKeyboardReturnKeyHandler.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQKeyboardManagerConstants.h" 25 | 26 | #import 27 | #import 28 | 29 | #import 30 | #import 31 | 32 | @class UITextField,UIView, UIViewController; 33 | 34 | /** 35 | Manages the return key to work like next/done in a view hierarchy. 36 | */ 37 | @interface IQKeyboardReturnKeyHandler : NSObject 38 | 39 | ///---------------------- 40 | /// @name Initializations 41 | ///---------------------- 42 | 43 | /** 44 | Add all the textFields available in UIViewController's view. 45 | */ 46 | -(nonnull instancetype)initWithViewController:(nullable UIViewController*)controller NS_DESIGNATED_INITIALIZER; 47 | 48 | /** 49 | Unavailable. Please use initWithViewController: or init method 50 | */ 51 | -(nonnull instancetype)initWithCoder:(nullable NSCoder *)aDecoder NS_UNAVAILABLE; 52 | 53 | ///--------------- 54 | /// @name Settings 55 | ///--------------- 56 | 57 | /** 58 | Delegate of textField/textView. 59 | */ 60 | @property(nullable, nonatomic, weak) id delegate; 61 | 62 | /** 63 | Set the last textfield return key type. Default is UIReturnKeyDefault. 64 | */ 65 | @property(nonatomic, assign) UIReturnKeyType lastTextFieldReturnKeyType; 66 | 67 | ///---------------------------------------------- 68 | /// @name Registering/Unregistering textFieldView 69 | ///---------------------------------------------- 70 | 71 | /** 72 | Should pass UITextField/UITextView instance. Assign textFieldView delegate to self, change it's returnKeyType. 73 | 74 | @param textFieldView UITextField/UITextView object to register. 75 | */ 76 | -(void)addTextFieldView:(nonnull UIView*)textFieldView; 77 | 78 | /** 79 | Should pass UITextField/UITextView instance. Restore it's textFieldView delegate and it's returnKeyType. 80 | 81 | @param textFieldView UITextField/UITextView object to unregister. 82 | */ 83 | -(void)removeTextFieldView:(nonnull UIView*)textFieldView; 84 | 85 | /** 86 | Add all the UITextField/UITextView responderView's. 87 | 88 | @param UIView object to register all it's responder subviews. 89 | */ 90 | -(void)addResponderFromView:(nonnull UIView*)view; 91 | 92 | /** 93 | Remove all the UITextField/UITextView responderView's. 94 | 95 | @param UIView object to unregister all it's responder subviews. 96 | */ 97 | -(void)removeResponderFromView:(nonnull UIView*)view; 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQTextView/IQTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQTextView.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQTextView.h" 25 | 26 | #import 27 | #import 28 | 29 | @interface IQTextView () 30 | 31 | -(void)refreshPlaceholder; 32 | 33 | @end 34 | 35 | @implementation IQTextView 36 | { 37 | UILabel *placeHolderLabel; 38 | } 39 | 40 | @synthesize placeholder = _placeholder; 41 | 42 | -(void)initialize 43 | { 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshPlaceholder) name:UITextViewTextDidChangeNotification object:self]; 45 | } 46 | 47 | -(void)dealloc 48 | { 49 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 50 | } 51 | 52 | - (instancetype)init 53 | { 54 | self = [super init]; 55 | if (self) { 56 | [self initialize]; 57 | } 58 | return self; 59 | } 60 | 61 | -(void)awakeFromNib 62 | { 63 | [super awakeFromNib]; 64 | [self initialize]; 65 | } 66 | 67 | -(void)refreshPlaceholder 68 | { 69 | if([[self text] length]) 70 | { 71 | [placeHolderLabel setAlpha:0]; 72 | } 73 | else 74 | { 75 | [placeHolderLabel setAlpha:1]; 76 | } 77 | 78 | [self setNeedsLayout]; 79 | [self layoutIfNeeded]; 80 | } 81 | 82 | - (void)setText:(NSString *)text 83 | { 84 | [super setText:text]; 85 | [self refreshPlaceholder]; 86 | } 87 | 88 | -(void)setFont:(UIFont *)font 89 | { 90 | [super setFont:font]; 91 | placeHolderLabel.font = self.font; 92 | 93 | [self setNeedsLayout]; 94 | [self layoutIfNeeded]; 95 | } 96 | 97 | -(void)layoutSubviews 98 | { 99 | [super layoutSubviews]; 100 | 101 | [placeHolderLabel sizeToFit]; 102 | placeHolderLabel.frame = CGRectMake(8, 8, CGRectGetWidth(self.frame)-16, CGRectGetHeight(placeHolderLabel.frame)); 103 | } 104 | 105 | -(void)setPlaceholder:(NSString *)placeholder 106 | { 107 | _placeholder = placeholder; 108 | 109 | if ( placeHolderLabel == nil ) 110 | { 111 | placeHolderLabel = [[UILabel alloc] init]; 112 | placeHolderLabel.autoresizingMask = (UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight); 113 | placeHolderLabel.lineBreakMode = NSLineBreakByWordWrapping; 114 | placeHolderLabel.numberOfLines = 0; 115 | placeHolderLabel.font = self.font; 116 | placeHolderLabel.backgroundColor = [UIColor clearColor]; 117 | placeHolderLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0]; 118 | placeHolderLabel.alpha = 0; 119 | [self addSubview:placeHolderLabel]; 120 | } 121 | 122 | placeHolderLabel.text = self.placeholder; 123 | [self refreshPlaceholder]; 124 | } 125 | 126 | //When any text changes on textField, the delegate getter is called. At this time we refresh the textView's placeholder 127 | -(id)delegate 128 | { 129 | [self refreshPlaceholder]; 130 | return [super delegate]; 131 | } 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQTitleBarButtonItem.m 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "IQTitleBarButtonItem.h" 25 | #import "IQKeyboardManagerConstants.h" 26 | #import "IQKeyboardManagerConstantsInternal.h" 27 | #import 28 | #import 29 | 30 | @implementation IQTitleBarButtonItem 31 | { 32 | UIView *_titleView; 33 | UIButton *_titleButton; 34 | } 35 | @synthesize font = _font; 36 | 37 | 38 | -(nonnull instancetype)initWithTitle:(nullable NSString *)title 39 | { 40 | self = [super init]; 41 | if (self) 42 | { 43 | _titleView = [[UIView alloc] init]; 44 | _titleView.backgroundColor = [UIColor clearColor]; 45 | _titleView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 46 | 47 | _titleButton = [UIButton buttonWithType:UIButtonTypeSystem]; 48 | _titleButton.enabled = NO; 49 | _titleButton.titleLabel.numberOfLines = 3; 50 | [_titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal]; 51 | [_titleButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled]; 52 | [_titleButton setBackgroundColor:[UIColor clearColor]]; 53 | [_titleButton.titleLabel setTextAlignment:NSTextAlignmentCenter]; 54 | _titleButton.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 55 | [self setTitle:title]; 56 | [self setFont:[UIFont systemFontOfSize:13.0]]; 57 | [_titleView addSubview:_titleButton]; 58 | self.customView = _titleView; 59 | } 60 | return self; 61 | } 62 | 63 | -(void)setFont:(UIFont *)font 64 | { 65 | _font = font; 66 | 67 | if (font) 68 | { 69 | _titleButton.titleLabel.font = font; 70 | } 71 | else 72 | { 73 | _titleButton.titleLabel.font = [UIFont systemFontOfSize:13]; 74 | } 75 | } 76 | 77 | -(void)setTitle:(NSString *)title 78 | { 79 | [super setTitle:title]; 80 | [_titleButton setTitle:title forState:UIControlStateNormal]; 81 | } 82 | 83 | -(void)setSelectableTextColor:(UIColor*)selectableTextColor 84 | { 85 | _selectableTextColor = selectableTextColor; 86 | [_titleButton setTitleColor:_selectableTextColor forState:UIControlStateNormal]; 87 | } 88 | 89 | -(void)setTitleTarget:(nullable id)target action:(nullable SEL)action 90 | { 91 | NSInvocation *invocation = nil; 92 | 93 | if (target && action) 94 | { 95 | invocation = [NSInvocation invocationWithMethodSignature:[target methodSignatureForSelector:action]]; 96 | invocation.target = target; 97 | invocation.selector = action; 98 | } 99 | 100 | self.titleInvocation = invocation; 101 | } 102 | 103 | -(void)setTitleInvocation:(NSInvocation*)invocation 104 | { 105 | _titleInvocation = invocation; 106 | 107 | if (_titleInvocation.target == nil || _titleInvocation.selector == NULL) 108 | { 109 | self.enabled = NO; 110 | _titleButton.enabled = NO; 111 | [_titleButton removeTarget:nil action:NULL forControlEvents:UIControlEventTouchUpInside]; 112 | } 113 | else 114 | { 115 | self.enabled = YES; 116 | _titleButton.enabled = YES; 117 | [_titleButton addTarget:_titleInvocation.target action:_titleInvocation.selector forControlEvents:UIControlEventTouchUpInside]; 118 | } 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIView+Hierarchy.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Hierarchy.h 3 | // https://github.com/hackiftekhar/IQKeyboardManager 4 | // Copyright (c) 2013-16 Iftekhar Qurashi. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | #import "IQKeyboardManagerConstants.h" 26 | 27 | @class UICollectionView, UIScrollView, UITableView, NSArray; 28 | 29 | /** 30 | UIView hierarchy category. 31 | */ 32 | @interface UIView (IQ_UIView_Hierarchy) 33 | 34 | ///------------------------------ 35 | /// @name canBecomeFirstResponder 36 | ///------------------------------ 37 | 38 | /** 39 | Returns YES if IQKeyboardManager asking for `canBecomeFirstResponder. Useful when doing custom work in `textFieldShouldBeginEditing:` delegate. 40 | */ 41 | @property (nonatomic, readonly) BOOL isAskingCanBecomeFirstResponder; 42 | 43 | ///---------------------- 44 | /// @name viewControllers 45 | ///---------------------- 46 | 47 | /** 48 | Returns the UIViewController object that manages the receiver. 49 | */ 50 | @property (nullable, nonatomic, readonly, strong) UIViewController *viewController; 51 | 52 | /** 53 | Returns the topMost UIViewController object in hierarchy. 54 | */ 55 | @property (nullable, nonatomic, readonly, strong) UIViewController *topMostController; 56 | 57 | ///----------------------------------- 58 | /// @name Superviews/Subviews/Siglings 59 | ///----------------------------------- 60 | 61 | /** 62 | Returns the superView of provided class type. 63 | */ 64 | -(nullable UIView*)superviewOfClassType:(nonnull Class)classType; 65 | 66 | /** 67 | Returns all siblings of the receiver which canBecomeFirstResponder. 68 | */ 69 | @property (nonnull, nonatomic, readonly, copy) NSArray *responderSiblings; 70 | 71 | /** 72 | Returns all deep subViews of the receiver which canBecomeFirstResponder. 73 | */ 74 | @property (nonnull, nonatomic, readonly, copy) NSArray *deepResponderViews; 75 | 76 | ///------------------------- 77 | /// @name Special TextFields 78 | ///------------------------- 79 | 80 | /** 81 | Returns YES if the receiver object is UISearchBarTextField, otherwise return NO. 82 | */ 83 | @property (nonatomic, getter=isSearchBarTextField, readonly) BOOL searchBarTextField; 84 | 85 | /** 86 | Returns YES if the receiver object is UIAlertSheetTextField, otherwise return NO. 87 | */ 88 | @property (nonatomic, getter=isAlertViewTextField, readonly) BOOL alertViewTextField; 89 | 90 | ///---------------- 91 | /// @name Transform 92 | ///---------------- 93 | 94 | /** 95 | Returns current view transform with respect to the 'toView'. 96 | */ 97 | -(CGAffineTransform)convertTransformToView:(nullable UIView*)toView; 98 | 99 | ///----------------- 100 | /// @name Hierarchy 101 | ///----------------- 102 | 103 | /** 104 | Returns a string that represent the information about it's subview's hierarchy. You can use this method to debug the subview's positions. 105 | */ 106 | @property (nonnull, nonatomic, readonly, copy) NSString *subHierarchy; 107 | 108 | /** 109 | Returns an string that represent the information about it's upper hierarchy. You can use this method to debug the superview's positions. 110 | */ 111 | @property (nonnull, nonatomic, readonly, copy) NSString *superHierarchy; 112 | 113 | /** 114 | Returns an string that represent the information about it's frame positions. You can use this method to debug self positions. 115 | */ 116 | @property (nonnull, nonatomic, readonly, copy) NSString *debugHierarchy; 117 | 118 | @end 119 | 120 | 121 | /** 122 | NSObject category to used for logging purposes 123 | */ 124 | @interface NSObject (IQ_Logging) 125 | 126 | /** 127 | Short description for logging purpose. 128 | */ 129 | @property (nonnull, nonatomic, readonly, copy) NSString *_IQDescription; 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /PhotoSecurity/Photos/View/XPPhotoCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XPPhotoCollectionViewCell.m 3 | // PhotoSecurity 4 | // 5 | // Created by nhope on 2017/3/9. 6 | // Copyright © 2017年 xiaopin. All rights reserved. 7 | // 8 | 9 | #import "XPPhotoCollectionViewCell.h" 10 | #import 11 | 12 | @interface XPPhotoCollectionViewCell () 13 | 14 | @property (nonatomic, strong) UIImageView *imageView; 15 | @property (nonatomic, strong) UIImageView *stateImageView; 16 | @property (nonatomic, strong) UIView *selectedMaskView; 17 | 18 | @property (nonatomic, assign) PHImageRequestID requestID; 19 | 20 | @end 21 | 22 | @implementation XPPhotoCollectionViewCell 23 | 24 | #pragma mark - Lifecycle 25 | 26 | - (instancetype)initWithFrame:(CGRect)frame { 27 | self = [super initWithFrame:frame]; 28 | if (self) { 29 | [self configureUserInterface]; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)prepareForReuse { 35 | [super prepareForReuse]; 36 | if (_requestID) { 37 | [[PHImageManager defaultManager] cancelImageRequest:_requestID]; 38 | _requestID = PHInvalidImageRequestID; 39 | } 40 | [self setImageSelectedState:NO]; 41 | } 42 | 43 | - (void)layoutSubviews { 44 | [super layoutSubviews]; 45 | CGFloat stateWH = 20.0; 46 | CGFloat width = CGRectGetWidth(self.contentView.frame); 47 | CGFloat height = CGRectGetHeight(self.contentView.frame); 48 | _imageView.frame = self.contentView.bounds; 49 | _selectedMaskView.frame = self.contentView.bounds; 50 | _stateImageView.frame = CGRectMake(width-stateWH-5.0, 51 | height-stateWH-5.0, 52 | stateWH, stateWH); 53 | } 54 | 55 | #pragma mark - Actions 56 | 57 | - (void)tapGestureRecognizerAction:(UITapGestureRecognizer *)sender { 58 | BOOL isSelected = !self.imageSelectedState; 59 | // [self setImageSelectedState:isSelected]; 60 | if ([self.delegate respondsToSelector:@selector(photoCollectionViewCell:didTappedImageForSelected:atIndex:)]) { 61 | [self.delegate photoCollectionViewCell:self didTappedImageForSelected:isSelected atIndex:self.imageView.tag]; 62 | } 63 | } 64 | 65 | #pragma mark - Public 66 | 67 | - (void)requestImageWithAsset:(PHAsset *)asset index:(NSInteger)index { 68 | self.imageView.tag = index; 69 | @weakify(self); 70 | // PHImageManagerMaximumSize 71 | // CGSize targetSize = CGSizeMake(asset.pixelWidth, asset.pixelHeight); 72 | CGFloat scale = [UIScreen mainScreen].scale; 73 | CGSize targetSize = CGSizeMake(self.contentView.frame.size.width*scale, self.contentView.frame.size.height*scale); 74 | _requestID = [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:targetSize contentMode:PHImageContentModeDefault options:nil resultHandler:^(UIImage * _Nullable result, NSDictionary * _Nullable info) { 75 | @strongify(self); 76 | if (self.imageView.tag != index) return; // Cell重用 77 | self.imageView.image = result; 78 | self.requestID = PHInvalidImageRequestID; 79 | if ([self.delegate respondsToSelector:@selector(photoCollectionViewCell:didRequestImage:atIndex:)]) { 80 | [self.delegate photoCollectionViewCell:self didRequestImage:result atIndex:self.imageView.tag]; 81 | } 82 | }]; 83 | } 84 | 85 | - (void)showImage:(UIImage *)image index:(NSInteger)index { 86 | if (_requestID) { 87 | [[PHImageManager defaultManager] cancelImageRequest:_requestID]; 88 | _requestID = PHInvalidImageRequestID; 89 | } 90 | self.imageView.tag = index; 91 | _imageView.image = image; 92 | } 93 | 94 | #pragma mark - Private 95 | 96 | - (void)configureUserInterface { 97 | _imageView = [[UIImageView alloc] init]; 98 | _imageView.contentMode = UIViewContentModeScaleAspectFill; 99 | _imageView.layer.masksToBounds = YES; 100 | [self.contentView addSubview:_imageView]; 101 | 102 | _selectedMaskView = [[UIView alloc] init]; 103 | _selectedMaskView.backgroundColor = [[UIColor colorWithR:223.0 g:223.0 b:223.0] colorWithAlphaComponent:0.3]; 104 | [self.contentView addSubview:_selectedMaskView]; 105 | 106 | _stateImageView = [[UIImageView alloc] init]; 107 | _stateImageView.image = [UIImage imageNamed:@"icon-selected"]; 108 | [self.contentView addSubview:_stateImageView]; 109 | 110 | SEL action = @selector(tapGestureRecognizerAction:); 111 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:action]; 112 | [self addGestureRecognizer:tap]; 113 | [self setImageSelectedState:NO]; 114 | } 115 | 116 | #pragma mark - setter&getter 117 | 118 | - (void)setImageSelectedState:(BOOL)imageSelectedState { 119 | _imageSelectedState = imageSelectedState; 120 | _selectedMaskView.hidden = !imageSelectedState; 121 | _stateImageView.hidden = !imageSelectedState; 122 | } 123 | 124 | @end 125 | --------------------------------------------------------------------------------