Steven 2 năm trước cách đây
mục cha
commit
37f4a75b57
97 tập tin đã thay đổi với 2437 bổ sung10871 xóa
  1. 2 116
      KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj
  2. BIN
      KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate
  3. 86 22
      KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 0 19
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/NSBundle+TZImagePicker.h
  5. 0 35
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/NSBundle+TZImagePicker.m
  6. 0 56
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetCell.h
  7. 0 521
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetCell.m
  8. 0 56
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetModel.h
  9. 0 79
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetModel.m
  10. 0 16
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZGifPhotoPreviewController.h
  11. 0 173
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZGifPhotoPreviewController.m
  12. 0 39
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageCropManager.h
  13. 0 199
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageCropManager.m
  14. 0 139
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageManager.h
  15. 0 1067
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageManager.m
  16. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlay@2x.png
  17. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlayHL@2x.png
  18. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/VideoSendIcon@2x.png
  19. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ar.lproj/Localizable.strings
  20. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/bg.lproj/Localizable.strings
  21. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/cs-CZ.lproj/Localizable.strings
  22. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/de.lproj/Localizable.strings
  23. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/el.lproj/Localizable.strings
  24. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/en.lproj/Localizable.strings
  25. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/es.lproj/Localizable.strings
  26. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/fr.lproj/Localizable.strings
  27. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/he.lproj/Localizable.strings
  28. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/iCloudError@2x.png
  29. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/it.lproj/Localizable.strings
  30. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ja.lproj/Localizable.strings
  31. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ko-KP.lproj/Localizable.strings
  32. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ko.lproj/Localizable.strings
  33. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/navi_back@2x.png
  34. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/nl.lproj/Localizable.strings
  35. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_def_photoPickerVc@2x.png
  36. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_def_previewVc@2x.png
  37. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_number_icon@2x.png
  38. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_original_def@2x.png
  39. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_original_sel@2x.png
  40. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_sel_photoPickerVc@2x.png
  41. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_sel_previewVc@2x.png
  42. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/pl.lproj/Localizable.strings
  43. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/preview_number_icon@2x.png
  44. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/preview_original_def@2x.png
  45. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/pt.lproj/Localizable.strings
  46. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ro.lproj/Localizable.strings
  47. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ru.lproj/Localizable.strings
  48. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/sk.lproj/Localizable.strings
  49. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/sv.lproj/Localizable.strings
  50. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/takePicture80@2x.png
  51. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/takePicture@2x.png
  52. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/th.lproj/Localizable.strings
  53. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/tr.lproj/Localizable.strings
  54. 0 20
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/uk.lproj/Localizable.strings
  55. 0 27
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/vi.lproj/Localizable.strings
  56. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/zh-Hans.lproj/Localizable.strings
  57. BIN
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/zh-Hant.lproj/Localizable.strings
  58. 0 383
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.h
  59. 0 1097
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.m
  60. 0 30
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageRequestOperation.h
  61. 0 77
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageRequestOperation.m
  62. 0 27
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZLocationManager.h
  63. 0 91
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZLocationManager.m
  64. 0 22
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPickerController.h
  65. 0 1160
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPickerController.m
  66. 0 76
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewCell.h
  67. 0 576
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewCell.m
  68. 0 25
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewController.h
  69. 0 686
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewController.m
  70. 0 15
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZProgressView.h
  71. 0 55
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZProgressView.m
  72. 0 47
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoCropController.h
  73. 0 673
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoCropController.m
  74. 0 17
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoEditedPreviewController.h
  75. 0 129
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoEditedPreviewController.m
  76. 0 17
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoPlayerController.h
  77. 0 322
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoPlayerController.m
  78. 0 31
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/UIView+TZLayout.h
  79. 0 126
      KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/UIView+TZLayout.m
  80. 0 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m
  81. 22 4
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/CreateStyle/Controller/MyStyleViewController.m
  82. 28 3
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/Setting/Controller/UserSettingViewController.m
  83. 4 2
      KulexiuForTeacher/KulexiuForTeacher/Module/SealClass/Services/RTC/RTCService.m
  84. 1 0
      KulexiuForTeacher/Podfile
  85. 9 1
      KulexiuForTeacher/Podfile.lock
  86. 9 1
      KulexiuForTeacher/Pods/Manifest.lock
  87. 2203 2117
      KulexiuForTeacher/Pods/Pods.xcodeproj/project.pbxproj
  88. 5 0
      KulexiuForTeacher/Pods/Pods.xcodeproj/xcuserdata/wangzhi.xcuserdatad/xcschemes/xcschememanagement.plist
  89. 26 0
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-acknowledgements.markdown
  90. 32 0
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-acknowledgements.plist
  91. 1 0
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Debug-input-files.xcfilelist
  92. 1 0
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Debug-output-files.xcfilelist
  93. 1 0
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Release-input-files.xcfilelist
  94. 1 0
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Release-output-files.xcfilelist
  95. 2 0
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources.sh
  96. 2 4
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher.debug.xcconfig
  97. 2 4
      KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher.release.xcconfig

+ 2 - 116
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -274,24 +274,6 @@
 		277932BB27E30FFE0010E277 /* TAAnimatedDotView.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932AD27E30FFE0010E277 /* TAAnimatedDotView.m */; };
 		277932BC27E30FFE0010E277 /* TAAbstractDotView.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932AE27E30FFE0010E277 /* TAAbstractDotView.m */; };
 		277932BD27E30FFE0010E277 /* SDQWMaskCustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932B227E30FFE0010E277 /* SDQWMaskCustomView.m */; };
-		277932E227E310070010E277 /* TZImageCropManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932C127E310070010E277 /* TZImageCropManager.m */; };
-		277932E327E310070010E277 /* TZAssetCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932C327E310070010E277 /* TZAssetCell.m */; };
-		277932E427E310070010E277 /* TZVideoEditedPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932C427E310070010E277 /* TZVideoEditedPreviewController.m */; };
-		277932E527E310070010E277 /* TZVideoCropController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932C527E310070010E277 /* TZVideoCropController.m */; };
-		277932E627E310070010E277 /* TZVideoPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932C627E310070010E277 /* TZVideoPlayerController.m */; };
-		277932E727E310070010E277 /* TZAssetModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932C727E310070010E277 /* TZAssetModel.m */; };
-		277932E827E310070010E277 /* NSBundle+TZImagePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932C827E310070010E277 /* NSBundle+TZImagePicker.m */; };
-		277932E927E310070010E277 /* TZPhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932CC27E310070010E277 /* TZPhotoPreviewController.m */; };
-		277932EA27E310070010E277 /* TZImagePickerController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 277932CD27E310070010E277 /* TZImagePickerController.bundle */; };
-		277932EB27E310070010E277 /* TZProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932CE27E310070010E277 /* TZProgressView.m */; };
-		277932EC27E310070010E277 /* TZImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932D327E310070010E277 /* TZImageManager.m */; };
-		277932ED27E310070010E277 /* TZPhotoPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932D527E310070010E277 /* TZPhotoPickerController.m */; };
-		277932EE27E310070010E277 /* TZPhotoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932D627E310070010E277 /* TZPhotoPreviewCell.m */; };
-		277932EF27E310070010E277 /* UIView+TZLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932D827E310070010E277 /* UIView+TZLayout.m */; };
-		277932F027E310070010E277 /* TZImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932DD27E310070010E277 /* TZImagePickerController.m */; };
-		277932F127E310070010E277 /* TZLocationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932DE27E310070010E277 /* TZLocationManager.m */; };
-		277932F227E310070010E277 /* TZGifPhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932DF27E310070010E277 /* TZGifPhotoPreviewController.m */; };
-		277932F327E310070010E277 /* TZImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 277932E027E310070010E277 /* TZImageRequestOperation.m */; };
 		2779330E27E3105F0010E277 /* DZNSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 2779330D27E3105F0010E277 /* DZNSegmentedControl.m */; };
 		2779331127E310960010E277 /* NSObject+ReadDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2779330F27E310950010E277 /* NSObject+ReadDocument.m */; };
 		2779331627E310AA0010E277 /* UIView+ShowProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = 2779331227E310A60010E277 /* UIView+ShowProgress.m */; };
@@ -1551,41 +1533,6 @@
 		277932B027E30FFE0010E277 /* TAAnimatedDotView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TAAnimatedDotView.h; sourceTree = "<group>"; };
 		277932B127E30FFE0010E277 /* TAPageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TAPageControl.h; sourceTree = "<group>"; };
 		277932B227E30FFE0010E277 /* SDQWMaskCustomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDQWMaskCustomView.m; sourceTree = "<group>"; };
-		277932BF27E310070010E277 /* TZPhotoPreviewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZPhotoPreviewCell.h; sourceTree = "<group>"; };
-		277932C027E310070010E277 /* TZPhotoPickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZPhotoPickerController.h; sourceTree = "<group>"; };
-		277932C127E310070010E277 /* TZImageCropManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZImageCropManager.m; sourceTree = "<group>"; };
-		277932C227E310070010E277 /* TZImageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZImageManager.h; sourceTree = "<group>"; };
-		277932C327E310070010E277 /* TZAssetCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZAssetCell.m; sourceTree = "<group>"; };
-		277932C427E310070010E277 /* TZVideoEditedPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZVideoEditedPreviewController.m; sourceTree = "<group>"; };
-		277932C527E310070010E277 /* TZVideoCropController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZVideoCropController.m; sourceTree = "<group>"; };
-		277932C627E310070010E277 /* TZVideoPlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZVideoPlayerController.m; sourceTree = "<group>"; };
-		277932C727E310070010E277 /* TZAssetModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZAssetModel.m; sourceTree = "<group>"; };
-		277932C827E310070010E277 /* NSBundle+TZImagePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+TZImagePicker.m"; sourceTree = "<group>"; };
-		277932C927E310070010E277 /* UIView+TZLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+TZLayout.h"; sourceTree = "<group>"; };
-		277932CA27E310070010E277 /* TZLocationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZLocationManager.h; sourceTree = "<group>"; };
-		277932CB27E310070010E277 /* TZImagePickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZImagePickerController.h; sourceTree = "<group>"; };
-		277932CC27E310070010E277 /* TZPhotoPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZPhotoPreviewController.m; sourceTree = "<group>"; };
-		277932CD27E310070010E277 /* TZImagePickerController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TZImagePickerController.bundle; sourceTree = "<group>"; };
-		277932CE27E310070010E277 /* TZProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZProgressView.m; sourceTree = "<group>"; };
-		277932CF27E310070010E277 /* TZGifPhotoPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZGifPhotoPreviewController.h; sourceTree = "<group>"; };
-		277932D027E310070010E277 /* TZImageRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZImageRequestOperation.h; sourceTree = "<group>"; };
-		277932D127E310070010E277 /* TZVideoEditedPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZVideoEditedPreviewController.h; sourceTree = "<group>"; };
-		277932D227E310070010E277 /* TZAssetCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZAssetCell.h; sourceTree = "<group>"; };
-		277932D327E310070010E277 /* TZImageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZImageManager.m; sourceTree = "<group>"; };
-		277932D427E310070010E277 /* TZImageCropManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZImageCropManager.h; sourceTree = "<group>"; };
-		277932D527E310070010E277 /* TZPhotoPickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZPhotoPickerController.m; sourceTree = "<group>"; };
-		277932D627E310070010E277 /* TZPhotoPreviewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZPhotoPreviewCell.m; sourceTree = "<group>"; };
-		277932D727E310070010E277 /* NSBundle+TZImagePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+TZImagePicker.h"; sourceTree = "<group>"; };
-		277932D827E310070010E277 /* UIView+TZLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+TZLayout.m"; sourceTree = "<group>"; };
-		277932D927E310070010E277 /* TZAssetModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZAssetModel.h; sourceTree = "<group>"; };
-		277932DA27E310070010E277 /* TZVideoPlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZVideoPlayerController.h; sourceTree = "<group>"; };
-		277932DB27E310070010E277 /* TZVideoCropController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZVideoCropController.h; sourceTree = "<group>"; };
-		277932DC27E310070010E277 /* TZPhotoPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZPhotoPreviewController.h; sourceTree = "<group>"; };
-		277932DD27E310070010E277 /* TZImagePickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZImagePickerController.m; sourceTree = "<group>"; };
-		277932DE27E310070010E277 /* TZLocationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZLocationManager.m; sourceTree = "<group>"; };
-		277932DF27E310070010E277 /* TZGifPhotoPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZGifPhotoPreviewController.m; sourceTree = "<group>"; };
-		277932E027E310070010E277 /* TZImageRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZImageRequestOperation.m; sourceTree = "<group>"; };
-		277932E127E310070010E277 /* TZProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TZProgressView.h; sourceTree = "<group>"; };
 		2779330C27E3105E0010E277 /* DZNSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DZNSegmentedControl.h; sourceTree = "<group>"; };
 		2779330D27E3105F0010E277 /* DZNSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DZNSegmentedControl.m; sourceTree = "<group>"; };
 		2779330F27E310950010E277 /* NSObject+ReadDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+ReadDocument.m"; sourceTree = "<group>"; };
@@ -3282,7 +3229,6 @@
 				2779312327E30FC00010E277 /* KLTAnimateNav */,
 				2779318427E30FC00010E277 /* ALCalendarPicker */,
 				2779330B27E3104D0010E277 /* DZSegmentCtrl */,
-				277932BE27E310070010E277 /* TZImagePickerController */,
 				2779329C27E30FFE0010E277 /* SDCycleScrollView */,
 				2779327227E30FEB0010E277 /* MSSBrowse */,
 				2779324327E30FD70010E277 /* FSCalendar */,
@@ -3838,48 +3784,6 @@
 			path = PageControl;
 			sourceTree = "<group>";
 		};
-		277932BE27E310070010E277 /* TZImagePickerController */ = {
-			isa = PBXGroup;
-			children = (
-				277932BF27E310070010E277 /* TZPhotoPreviewCell.h */,
-				277932C027E310070010E277 /* TZPhotoPickerController.h */,
-				277932C127E310070010E277 /* TZImageCropManager.m */,
-				277932C227E310070010E277 /* TZImageManager.h */,
-				277932C327E310070010E277 /* TZAssetCell.m */,
-				277932C427E310070010E277 /* TZVideoEditedPreviewController.m */,
-				277932C527E310070010E277 /* TZVideoCropController.m */,
-				277932C627E310070010E277 /* TZVideoPlayerController.m */,
-				277932C727E310070010E277 /* TZAssetModel.m */,
-				277932C827E310070010E277 /* NSBundle+TZImagePicker.m */,
-				277932C927E310070010E277 /* UIView+TZLayout.h */,
-				277932CA27E310070010E277 /* TZLocationManager.h */,
-				277932CB27E310070010E277 /* TZImagePickerController.h */,
-				277932CC27E310070010E277 /* TZPhotoPreviewController.m */,
-				277932CD27E310070010E277 /* TZImagePickerController.bundle */,
-				277932CE27E310070010E277 /* TZProgressView.m */,
-				277932CF27E310070010E277 /* TZGifPhotoPreviewController.h */,
-				277932D027E310070010E277 /* TZImageRequestOperation.h */,
-				277932D127E310070010E277 /* TZVideoEditedPreviewController.h */,
-				277932D227E310070010E277 /* TZAssetCell.h */,
-				277932D327E310070010E277 /* TZImageManager.m */,
-				277932D427E310070010E277 /* TZImageCropManager.h */,
-				277932D527E310070010E277 /* TZPhotoPickerController.m */,
-				277932D627E310070010E277 /* TZPhotoPreviewCell.m */,
-				277932D727E310070010E277 /* NSBundle+TZImagePicker.h */,
-				277932D827E310070010E277 /* UIView+TZLayout.m */,
-				277932D927E310070010E277 /* TZAssetModel.h */,
-				277932DA27E310070010E277 /* TZVideoPlayerController.h */,
-				277932DB27E310070010E277 /* TZVideoCropController.h */,
-				277932DC27E310070010E277 /* TZPhotoPreviewController.h */,
-				277932DD27E310070010E277 /* TZImagePickerController.m */,
-				277932DE27E310070010E277 /* TZLocationManager.m */,
-				277932DF27E310070010E277 /* TZGifPhotoPreviewController.m */,
-				277932E027E310070010E277 /* TZImageRequestOperation.m */,
-				277932E127E310070010E277 /* TZProgressView.h */,
-			);
-			path = TZImagePickerController;
-			sourceTree = "<group>";
-		};
 		2779330B27E3104D0010E277 /* DZSegmentCtrl */ = {
 			isa = PBXGroup;
 			children = (
@@ -6872,7 +6776,6 @@
 				BCE6A0A027F84E4500C97704 /* MineIntroduceCell.xib in Resources */,
 				2728086C27E6C12900DB71EA /* FirstSettingBodyView.xib in Resources */,
 				275E8A7727E18F2800DD3F6E /* LaunchScreen.storyboard in Resources */,
-				277932EA27E310070010E277 /* TZImagePickerController.bundle in Resources */,
 				277932B427E30FFE0010E277 /* SDQWMaskCustomView.xib in Resources */,
 				BCC5840C28A9FA8100BAB4CF /* cloud_animation_5.png in Resources */,
 				BCE6A09127F823BE00C97704 /* LiveCourseCell.xib in Resources */,
@@ -7316,7 +7219,6 @@
 				BCC9F40A27F69BD200647449 /* InputView.m in Sources */,
 				BC5EB5B22804027500B4A3B0 /* MyStyleViewController.m in Sources */,
 				BCFE54182817BDFD00AD6786 /* IncomeHeaderView.m in Sources */,
-				277932F227E310070010E277 /* TZGifPhotoPreviewController.m in Sources */,
 				275B16FD27EB083C0081FDEF /* ChatAddressViewController.m in Sources */,
 				BC41104228066E5500800BD9 /* EvaluateCourseListViewController.m in Sources */,
 				BC41103B28066D2E00800BD9 /* HomeworkBodyView.m in Sources */,
@@ -7353,7 +7255,6 @@
 				275FA19727E723D700CFEA2E /* KSLocalWebViewController.m in Sources */,
 				BCA353D72858B18100377661 /* MusicRoomDetailModel.m in Sources */,
 				277931F827E30FC20010E277 /* UIImageView+CornerRadius.m in Sources */,
-				277932E627E310070010E277 /* TZVideoPlayerController.m in Sources */,
 				BC4BCE752823A1AE00522C8B /* AddressDetailViewController.m in Sources */,
 				BCDB093E2805C0EF00D0BDAD /* NewClassPopCell.m in Sources */,
 				BC02BCDD28B324A5005CB483 /* SeatBodyView.m in Sources */,
@@ -7371,7 +7272,6 @@
 				2779322127E30FC30010E277 /* NSString+phone.m in Sources */,
 				BCC9F44027F69BD200647449 /* MemberChangeMessage.m in Sources */,
 				BCC9F41827F69BD200647449 /* ClassroomTitleView.m in Sources */,
-				277932EE27E310070010E277 /* TZPhotoPreviewCell.m in Sources */,
 				BC5EB5BB2804083800B4A3B0 /* MyStyleIntroduceCell.m in Sources */,
 				277931D627E30FC20010E277 /* UIImage+Property.m in Sources */,
 				2779326727E30FD80010E277 /* FSCalendarStickyHeader.m in Sources */,
@@ -7406,13 +7306,11 @@
 				BCC9F43F27F69BD200647449 /* DeviceMessage.m in Sources */,
 				275E3DD127F463140010EC30 /* KSLiveChatroomSeatApply.m in Sources */,
 				2779322427E30FC30010E277 /* ShopButton.m in Sources */,
-				277932EC27E310070010E277 /* TZImageManager.m in Sources */,
 				BCE6A0A927F852CD00C97704 /* MineFansGroupCell.m in Sources */,
 				BCC03F88280460C000461B7C /* InstrumentHeaderView.m in Sources */,
 				2779323727E30FC30010E277 /* LLFileManager.m in Sources */,
 				27F902F127E8614D00C08A19 /* SettingViewController.m in Sources */,
 				BCB633FF27F6A18200ACFDCF /* MainToolView.m in Sources */,
-				277932F027E310070010E277 /* TZImagePickerController.m in Sources */,
 				BCF61BE128041FC90000ACFE /* UIView+ExtensionForDotLine.m in Sources */,
 				BCC9F42F27F69BD200647449 /* HTTPUtility.m in Sources */,
 				275FA1A327E7311700CFEA2E /* KSRCIMDataSource.m in Sources */,
@@ -7435,7 +7333,6 @@
 				277D433227E9A50800107DB7 /* PhoneCheckBodyView.m in Sources */,
 				275B172327EB1BE60081FDEF /* KSSearchRCLabel.m in Sources */,
 				2779327127E30FD80010E277 /* FSCalendarAppearance.m in Sources */,
-				277932E727E310070010E277 /* TZAssetModel.m in Sources */,
 				BC8B6E75285855B700866917 /* UIImage+KSScreenShot.m in Sources */,
 				2779323427E30FC30010E277 /* NSDate+KSBaseDatePicker.m in Sources */,
 				2779320C27E30FC30010E277 /* KSMediaManager.m in Sources */,
@@ -7509,7 +7406,6 @@
 				2779323027E30FC30010E277 /* ALCalendarPicker.m in Sources */,
 				BCB9FA13286C7C6C005D766B /* KSShareGroupViewController.m in Sources */,
 				2779323E27E30FC30010E277 /* VoCacheManager.m in Sources */,
-				277932E327E310070010E277 /* TZAssetCell.m in Sources */,
 				277931DE27E30FC20010E277 /* NSObject+AssociatedObject.m in Sources */,
 				27D83F4927F3EBC400062476 /* CreateLiveViewController.m in Sources */,
 				277D431D27E9999400107DB7 /* ModifyBodyView.m in Sources */,
@@ -7528,10 +7424,8 @@
 				BC48C3AE28292FB600EE65C5 /* ReceiveHeaderView.m in Sources */,
 				BCC9F42427F69BD200647449 /* VideoMaskView.m in Sources */,
 				BCB399BC27F9831D00AFF376 /* CourseForLiveCell.m in Sources */,
-				277932F127E310070010E277 /* TZLocationManager.m in Sources */,
 				275B172227EB1BE60081FDEF /* KSRCSearchBar.m in Sources */,
 				BC4CF28528D051C500961C61 /* HomeQualityMusicCellView.m in Sources */,
-				277932E927E310070010E277 /* TZPhotoPreviewController.m in Sources */,
 				BCC9F35527F5F4FD00647449 /* LiveSeatMember.m in Sources */,
 				277931DB27E30FC20010E277 /* UIButton+EnlargeEdge.m in Sources */,
 				2779324227E30FC30010E277 /* KSNetworkAccessibleManager.m in Sources */,
@@ -7591,7 +7485,6 @@
 				277931C827E30FC20010E277 /* KSVideoEditor.m in Sources */,
 				BCA193B5282A80AA004A585D /* RecentCourseModel.m in Sources */,
 				2779326B27E30FD80010E277 /* FSCalendarSeparatorDecorationView.m in Sources */,
-				277932E427E310070010E277 /* TZVideoEditedPreviewController.m in Sources */,
 				277931D327E30FC20010E277 /* UIScrollView+KSTouch.m in Sources */,
 				BC7CFFB22817E6DB00CAEB21 /* KSMutilDatePicker.m in Sources */,
 				277931FE27E30FC30010E277 /* UIImage+Addtions.m in Sources */,
@@ -7623,7 +7516,6 @@
 				2779328F27E30FEB0010E277 /* MSSBrowseLocalViewController.m in Sources */,
 				BC1365C4280D44EB00EB03E2 /* NotiferMessageViewController.m in Sources */,
 				27A54CF127E9BD3B007309A3 /* FeedbackViewController.m in Sources */,
-				277932E527E310070010E277 /* TZVideoCropController.m in Sources */,
 				BC7705FD287676D3003EFA7F /* HomeActionView.m in Sources */,
 				275E3DE127F467410010EC30 /* KSChatInputView.m in Sources */,
 				2779335527E316DD0010E277 /* WMPlayerModel.m in Sources */,
@@ -7678,8 +7570,6 @@
 				275FA55F27F31AAF00EB6240 /* MinePageViewController.m in Sources */,
 				2779323127E30FC30010E277 /* UIView+ALFrame.m in Sources */,
 				BCC9F41027F69BD200647449 /* TipMessageCell.m in Sources */,
-				277932ED27E310070010E277 /* TZPhotoPickerController.m in Sources */,
-				277932E227E310070010E277 /* TZImageCropManager.m in Sources */,
 				277932B327E30FFE0010E277 /* QWdynamicModel.m in Sources */,
 				BC542E3328406EA400633781 /* UserAuthViewController.m in Sources */,
 				BCF61BE8280425DA0000ACFE /* InstrumentChooseCell.m in Sources */,
@@ -7705,7 +7595,6 @@
 				2779326E27E30FD80010E277 /* FSCalendarCalculator.m in Sources */,
 				BCB9FA6B2872D57E005D766B /* LiveListModel.m in Sources */,
 				2779320027E30FC30010E277 /* QCCountdownButton.m in Sources */,
-				277932EF27E310070010E277 /* UIView+TZLayout.m in Sources */,
 				2779321427E30FC30010E277 /* MBProgressHUD+NJ.m in Sources */,
 				BC14A61228A0AC820086395C /* MineTeachToolView.m in Sources */,
 				BC02380F2865C6F9005560CA /* RCChatroomLikeCount.m in Sources */,
@@ -7764,7 +7653,6 @@
 				27A2F63027E70E57009E2380 /* UserInfo.m in Sources */,
 				BCEA751A2818D59300886A86 /* BankNameModel.m in Sources */,
 				BC02BCE428B324C9005CB483 /* LiveApplyControlView.m in Sources */,
-				277932E827E310070010E277 /* NSBundle+TZImagePicker.m in Sources */,
 				BC8A2CF828476C3000122BBE /* MusicScoreViewController.m in Sources */,
 				BC0A2282284751DF0065C1AB /* MetronomeAlertView.m in Sources */,
 				BCB9FA1F286D539A005D766B /* ScanNavView.m in Sources */,
@@ -7822,7 +7710,6 @@
 				BCE6A0A427F8517900C97704 /* MineVideoCell.m in Sources */,
 				BC0A22C0284752900065C1AB /* WhiteboardListCell.m in Sources */,
 				BCD457BE2865694B0010B493 /* KSRCPauseLiveMessage.m in Sources */,
-				277932F327E310070010E277 /* TZImageRequestOperation.m in Sources */,
 				BC0A22C1284752900065C1AB /* WhiteboardListView.m in Sources */,
 				BCC9F43B27F69BD200647449 /* AssistantTransferMessage.m in Sources */,
 				BC332DB3284866BE005AEF95 /* KSOrderManager.m in Sources */,
@@ -7895,7 +7782,6 @@
 				BCC9F43E27F69BD200647449 /* AccompanyDownloadMessage.m in Sources */,
 				277D431A27E9991200107DB7 /* ModifyViewController.m in Sources */,
 				BC02BCF528B328AA005CB483 /* RCChatroomSeatsControl.m in Sources */,
-				277932EB27E310070010E277 /* TZProgressView.m in Sources */,
 				27BC3B1B27F2B37500D81E30 /* MyMusicBodyView.m in Sources */,
 				275E3DB027F45CA60010EC30 /* KSLiveChatroomLike.m in Sources */,
 				2773204727EDB670008FAECA /* GroupNoticeEditController.m in Sources */,
@@ -8108,7 +7994,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForTeacher/KulexiuForTeacher.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.3.7;
+				CURRENT_PROJECT_VERSION = 1.3.8;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -8170,7 +8056,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForTeacher/KulexiuForTeacher.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.3.7;
+				CURRENT_PROJECT_VERSION = 1.3.8;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (

BIN
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 86 - 22
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -62,8 +62,8 @@
             filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1682"
-            endingLineNumber = "1682"
+            startingLineNumber = "1681"
+            endingLineNumber = "1681"
             landmarkName = "-pauseLiveActionBack:"
             landmarkType = "7">
          </BreakpointContent>
@@ -94,10 +94,10 @@
             filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1412"
-            endingLineNumber = "1412"
-            landmarkName = "-sendMessage:displayMessage:callback:"
-            landmarkType = "7">
+            startingLineNumber = "1411"
+            endingLineNumber = "1411"
+            landmarkName = "LiveRoomViewController"
+            landmarkType = "3">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -119,22 +119,6 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "56671723-69C7-4135-B645-5BF78E5FCCE3"
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "741"
-            endingLineNumber = "741"
-            landmarkName = "-renderSeatView"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
             uuid = "D730210B-8BDA-4804-AFA5-45F85F31834B"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
@@ -212,5 +196,85 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "A22F89AC-3F4F-4279-8FF2-5360EE8E7A5D"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1051"
+            endingLineNumber = "1051"
+            landmarkName = "-publishLocalStream"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "A38C24DA-7084-4A4F-8D76-C47B630F4221"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "241"
+            endingLineNumber = "241"
+            landmarkName = "-configEngine"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "82430F77-3C0C-4AD8-B2D4-98DD57AF1157"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1718"
+            endingLineNumber = "1718"
+            landmarkName = "-quitRoomBackPreView:"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "82430F77-3C0C-4AD8-B2D4-98DD57AF1157 - 40d998e1bcdf520f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[LiveRoomViewController quitRoomBackPreView:]"
+                  moduleName = "KulexiuForTeacher"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/wangzhi/DayaWorkspace/klx_teacher/KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "1718"
+                  endingLineNumber = "1718"
+                  offsetFromSymbolStart = "376">
+               </Location>
+               <Location
+                  uuid = "82430F77-3C0C-4AD8-B2D4-98DD57AF1157 - b7652eac86fc8bdb"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__46-[LiveRoomViewController quitRoomBackPreView:]_block_invoke"
+                  moduleName = "KulexiuForTeacher"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/wangzhi/DayaWorkspace/klx_teacher/KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "1720"
+                  endingLineNumber = "1720"
+                  offsetFromSymbolStart = "32">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 0 - 19
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/NSBundle+TZImagePicker.h

@@ -1,19 +0,0 @@
-//
-//  NSBundle+TZImagePicker.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 16/08/18.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface NSBundle (TZImagePicker)
-
-+ (NSBundle *)tz_imagePickerBundle;
-
-+ (NSString *)tz_localizedStringForKey:(NSString *)key value:(NSString *)value;
-+ (NSString *)tz_localizedStringForKey:(NSString *)key;
-
-@end
-

+ 0 - 35
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/NSBundle+TZImagePicker.m

@@ -1,35 +0,0 @@
-//
-//  NSBundle+TZImagePicker.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 16/08/18.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import "NSBundle+TZImagePicker.h"
-#import "TZImagePickerController.h"
-
-@implementation NSBundle (TZImagePicker)
-
-+ (NSBundle *)tz_imagePickerBundle {
-#ifdef SWIFT_PACKAGE
-    NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
-#else
-    NSBundle *bundle = [NSBundle bundleForClass:[TZImagePickerController class]];
-#endif
-    NSURL *url = [bundle URLForResource:@"TZImagePickerController" withExtension:@"bundle"];
-    bundle = [NSBundle bundleWithURL:url];
-    return bundle;
-}
-
-+ (NSString *)tz_localizedStringForKey:(NSString *)key {
-    return [self tz_localizedStringForKey:key value:@""];
-}
-
-+ (NSString *)tz_localizedStringForKey:(NSString *)key value:(NSString *)value {
-    NSBundle *bundle = [TZImagePickerConfig sharedInstance].languageBundle;
-    NSString *value1 = [bundle localizedStringForKey:key value:value table:nil];
-    return value1;
-}
-
-@end

+ 0 - 56
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetCell.h

@@ -1,56 +0,0 @@
-//
-//  TZAssetCell.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import <Photos/Photos.h>
-
-typedef enum : NSUInteger {
-    TZAssetCellTypePhoto = 0,
-    TZAssetCellTypeLivePhoto,
-    TZAssetCellTypePhotoGif,
-    TZAssetCellTypeVideo,
-    TZAssetCellTypeAudio,
-} TZAssetCellType;
-
-@class TZAssetModel;
-@interface TZAssetCell : UICollectionViewCell
-@property (weak, nonatomic) UIButton *selectPhotoButton;
-@property (weak, nonatomic) UIButton *cannotSelectLayerButton;
-@property (nonatomic, strong) TZAssetModel *model;
-@property (assign, nonatomic) NSInteger index;
-@property (nonatomic, copy) void (^didSelectPhotoBlock)(BOOL);
-@property (nonatomic, assign) TZAssetCellType type;
-@property (nonatomic, assign) BOOL allowPickingGif;
-@property (nonatomic, assign) BOOL allowPickingMultipleVideo;
-@property (nonatomic, copy) NSString *representedAssetIdentifier;
-@property (nonatomic, assign) int32_t imageRequestID;
-
-@property (nonatomic, strong) UIImage *photoSelImage;
-@property (nonatomic, strong) UIImage *photoDefImage;
-
-@property (nonatomic, assign) BOOL showSelectBtn;
-@property (assign, nonatomic) BOOL allowPreview;
-
-@property (nonatomic, copy) void (^assetCellDidSetModelBlock)(TZAssetCell *cell, UIImageView *imageView, UIImageView *selectImageView, UILabel *indexLabel, UIView *bottomView, UILabel *timeLength, UIImageView *videoImgView);
-@property (nonatomic, copy) void (^assetCellDidLayoutSubviewsBlock)(TZAssetCell *cell, UIImageView *imageView, UIImageView *selectImageView, UILabel *indexLabel, UIView *bottomView, UILabel *timeLength, UIImageView *videoImgView);
-@end
-
-
-@class TZAlbumModel;
-@interface TZAlbumCell : UITableViewCell
-@property (nonatomic, strong) TZAlbumModel *model;
-@property (weak, nonatomic) UIButton *selectedCountButton;
-
-@property (nonatomic, copy) void (^albumCellDidSetModelBlock)(TZAlbumCell *cell, UIImageView *posterImageView, UILabel *titleLabel);
-@property (nonatomic, copy) void (^albumCellDidLayoutSubviewsBlock)(TZAlbumCell *cell, UIImageView *posterImageView, UILabel *titleLabel);
-@end
-
-
-@interface TZAssetCameraCell : UICollectionViewCell
-@property (nonatomic, strong) UIImageView *imageView;
-@end

+ 0 - 521
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetCell.m

@@ -1,521 +0,0 @@
-//
-//  TZAssetCell.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import "TZAssetCell.h"
-#import "TZAssetModel.h"
-#import "UIView+TZLayout.h"
-#import "TZImageManager.h"
-#import "TZImagePickerController.h"
-#import "TZProgressView.h"
-
-@interface TZAssetCell ()
-@property (weak, nonatomic) UIImageView *imageView;       // The photo / 照片
-@property (weak, nonatomic) UIImageView *selectImageView;
-@property (weak, nonatomic) UILabel *indexLabel;
-@property (weak, nonatomic) UIView *bottomView;
-@property (weak, nonatomic) UILabel *timeLength;
-@property (strong, nonatomic) UITapGestureRecognizer *tapGesture;
-
-@property (nonatomic, weak) UIImageView *videoImgView;
-@property (nonatomic, strong) TZProgressView *progressView;
-@property (nonatomic, assign) int32_t bigImageRequestID;
-@end
-
-@implementation TZAssetCell
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reload:) name:@"TZ_PHOTO_PICKER_RELOAD_NOTIFICATION" object:nil];
-    return self;
-}
-
-- (void)setModel:(TZAssetModel *)model {
-    _model = model;
-    self.representedAssetIdentifier = model.asset.localIdentifier;
-    int32_t imageRequestID = [[TZImageManager manager] getPhotoWithAsset:model.asset photoWidth:self.tz_width completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        // Set the cell's thumbnail image if it's still showing the same asset.
-        if ([self.representedAssetIdentifier isEqualToString:model.asset.localIdentifier]) {
-            self.imageView.image = photo;
-            [self setNeedsLayout];
-        } else {
-            // NSLog(@"this cell is showing other asset");
-            [[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID];
-        }
-        if (!isDegraded) {
-            [self hideProgressView];
-            self.imageRequestID = 0;
-        }
-    } progressHandler:nil networkAccessAllowed:NO];
-    if (imageRequestID && self.imageRequestID && imageRequestID != self.imageRequestID) {
-        [[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID];
-        // NSLog(@"cancelImageRequest %d",self.imageRequestID);
-    }
-    self.imageRequestID = imageRequestID;
-    self.selectPhotoButton.selected = model.isSelected;
-    self.selectImageView.image = self.selectPhotoButton.isSelected ? self.photoSelImage : self.photoDefImage;
-    self.indexLabel.hidden = !self.selectPhotoButton.isSelected;
-    
-    self.type = (NSInteger)model.type;
-    // 让宽度/高度小于 最小可选照片尺寸 的图片不能选中
-    if (![[TZImageManager manager] isPhotoSelectableWithAsset:model.asset]) {
-        if (_selectImageView.hidden == NO) {
-            self.selectPhotoButton.hidden = YES;
-            _selectImageView.hidden = YES;
-        }
-    }
-    // 如果用户选中了该图片,提前获取一下大图
-    if (model.isSelected) {
-        [self requestBigImage];
-    } else {
-        [self cancelBigImageRequest];
-    }
-    [self setNeedsLayout];
-    
-    if (self.assetCellDidSetModelBlock) {
-        self.assetCellDidSetModelBlock(self, _imageView, _selectImageView, _indexLabel, _bottomView, _timeLength, _videoImgView);
-    }
-}
-
-- (void)setIndex:(NSInteger)index {
-    _index = index;
-    self.indexLabel.text = [NSString stringWithFormat:@"%zd", index];
-    [self.contentView bringSubviewToFront:self.indexLabel];
-}
-
-- (void)setShowSelectBtn:(BOOL)showSelectBtn {
-    _showSelectBtn = showSelectBtn;
-    BOOL selectable = [[TZImageManager manager] isPhotoSelectableWithAsset:self.model.asset];
-    if (!self.selectPhotoButton.hidden) {
-        self.selectPhotoButton.hidden = !showSelectBtn || !selectable;
-    }
-    if (!self.selectImageView.hidden) {
-        self.selectImageView.hidden = !showSelectBtn || !selectable;
-    }
-}
-
-- (void)setType:(TZAssetCellType)type {
-    _type = type;
-    if (type == TZAssetCellTypePhoto || type == TZAssetCellTypeLivePhoto || (type == TZAssetCellTypePhotoGif && !self.allowPickingGif) || self.allowPickingMultipleVideo) {
-        _selectImageView.hidden = NO;
-        _selectPhotoButton.hidden = NO;
-        _bottomView.hidden = YES;
-    } else { // Video of Gif
-        _selectImageView.hidden = YES;
-        _selectPhotoButton.hidden = YES;
-    }
-    
-    if (type == TZAssetCellTypeVideo) {
-        self.bottomView.hidden = NO;
-        self.timeLength.text = _model.timeLength;
-        self.videoImgView.hidden = NO;
-        _timeLength.tz_left = self.videoImgView.tz_right;
-        _timeLength.textAlignment = NSTextAlignmentRight;
-    } else if (type == TZAssetCellTypePhotoGif && self.allowPickingGif) {
-        self.bottomView.hidden = NO;
-        self.timeLength.text = @"GIF";
-        self.videoImgView.hidden = YES;
-        _timeLength.tz_left = 5;
-        _timeLength.textAlignment = NSTextAlignmentLeft;
-    }
-}
-
-- (void)setAllowPreview:(BOOL)allowPreview {
-    _allowPreview = allowPreview;
-    if (allowPreview) {
-        _imageView.userInteractionEnabled = NO;
-        _tapGesture.enabled = NO;
-    } else {
-        _imageView.userInteractionEnabled = YES;
-        _tapGesture.enabled = YES;
-    }
-}
-
-- (void)selectPhotoButtonClick:(UIButton *)sender {
-    if (self.didSelectPhotoBlock) {
-        self.didSelectPhotoBlock(sender.isSelected);
-    }
-    self.selectImageView.image = sender.isSelected ? self.photoSelImage : self.photoDefImage;
-    if (sender.isSelected) {
-        [UIView showOscillatoryAnimationWithLayer:_selectImageView.layer type:TZOscillatoryAnimationToBigger];
-        // 用户选中了该图片,提前获取一下大图
-        [self requestBigImage];
-    } else { // 取消选中,取消大图的获取
-        [self cancelBigImageRequest];
-    }
-}
-
-/// 只在单选状态且allowPreview为NO时会有该事件
-- (void)didTapImageView {
-    if (self.didSelectPhotoBlock) {
-        self.didSelectPhotoBlock(NO);
-    }
-}
-
-- (void)hideProgressView {
-    if (_progressView) {
-        self.progressView.hidden = YES;
-        self.imageView.alpha = 1.0;
-    }
-}
-
-- (void)requestBigImage {
-    if (_bigImageRequestID) {
-        [[PHImageManager defaultManager] cancelImageRequest:_bigImageRequestID];
-    }
-    
-    _bigImageRequestID = [[TZImageManager manager] requestImageDataForAsset:_model.asset completion:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
-        BOOL iCloudSyncFailed = !imageData && [TZCommonTools isICloudSyncError:info[PHImageErrorKey]];
-        self.model.iCloudFailed = iCloudSyncFailed;
-        if (iCloudSyncFailed && self.didSelectPhotoBlock) {
-            self.didSelectPhotoBlock(YES);
-            self.selectImageView.image = self.photoDefImage;
-        }
-        [self hideProgressView];
-    } progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-        if (self.model.isSelected) {
-            progress = progress > 0.02 ? progress : 0.02;;
-            self.progressView.progress = progress;
-            self.progressView.hidden = NO;
-            self.imageView.alpha = 0.4;
-            if (progress >= 1) {
-                [self hideProgressView];
-            }
-        } else {
-            // 快速连续点几次,会EXC_BAD_ACCESS...
-            // *stop = YES;
-            [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
-            [self cancelBigImageRequest];
-        }
-    }];
-    if (_model.type == TZAssetCellTypeVideo) {
-        [[TZImageManager manager] getVideoWithAsset:_model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
-            BOOL iCloudSyncFailed = !playerItem && [TZCommonTools isICloudSyncError:info[PHImageErrorKey]];
-            self.model.iCloudFailed = iCloudSyncFailed;
-            if (iCloudSyncFailed && self.didSelectPhotoBlock) {
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    self.didSelectPhotoBlock(YES);
-                    self.selectImageView.image = self.photoDefImage;
-                });
-            }
-        }];
-    }
-}
-
-- (void)cancelBigImageRequest {
-    if (_bigImageRequestID) {
-        [[PHImageManager defaultManager] cancelImageRequest:_bigImageRequestID];
-    }
-    [self hideProgressView];
-}
-
-#pragma mark - Notification
-
-- (void)reload:(NSNotification *)noti {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)noti.object;
-    
-    UIViewController *parentViewController = nil;
-    UIResponder *responder = self.nextResponder;
-    do {
-        if ([responder isKindOfClass:[UIViewController class]]) {
-            parentViewController = (UIViewController *)responder;
-            break;
-        }
-        responder = responder.nextResponder;
-    } while (responder);
-    
-    if (parentViewController.navigationController != tzImagePickerVc) {
-        return;
-    }
-    
-    if (self.model.isSelected && tzImagePickerVc.showSelectedIndex) {
-        self.index = [tzImagePickerVc.selectedAssetIds indexOfObject:self.model.asset.localIdentifier] + 1;
-    }
-    self.indexLabel.hidden = !self.selectPhotoButton.isSelected;
-    BOOL notSelectable = [TZCommonTools isAssetNotSelectable:self.model tzImagePickerVc:tzImagePickerVc];
-    if (notSelectable && tzImagePickerVc.showPhotoCannotSelectLayer && !self.model.isSelected) {
-        self.cannotSelectLayerButton.backgroundColor = tzImagePickerVc.cannotSelectLayerColor;
-        self.cannotSelectLayerButton.hidden = NO;
-    } else {
-        self.cannotSelectLayerButton.hidden = YES;
-    }
-}
-
-#pragma mark - Lazy load
-
-- (UIButton *)selectPhotoButton {
-    if (_selectPhotoButton == nil) {
-        UIButton *selectPhotoButton = [[UIButton alloc] init];
-        [selectPhotoButton addTarget:self action:@selector(selectPhotoButtonClick:) forControlEvents:UIControlEventTouchUpInside];
-        [self.contentView addSubview:selectPhotoButton];
-        _selectPhotoButton = selectPhotoButton;
-    }
-    return _selectPhotoButton;
-}
-
-- (UIImageView *)imageView {
-    if (_imageView == nil) {
-        UIImageView *imageView = [[UIImageView alloc] init];
-        imageView.contentMode = UIViewContentModeScaleAspectFill;
-        imageView.clipsToBounds = YES;
-        [self.contentView addSubview:imageView];
-        _imageView = imageView;
-        
-        _tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapImageView)];
-        [_imageView addGestureRecognizer:_tapGesture];
-        self.allowPreview = self.allowPreview;
-    }
-    return _imageView;
-}
-
-- (UIImageView *)selectImageView {
-    if (_selectImageView == nil) {
-        UIImageView *selectImageView = [[UIImageView alloc] init];
-        selectImageView.contentMode = UIViewContentModeCenter;
-        selectImageView.clipsToBounds = YES;
-        [self.contentView addSubview:selectImageView];
-        _selectImageView = selectImageView;
-    }
-    return _selectImageView;
-}
-
-- (UIView *)bottomView {
-    if (_bottomView == nil) {
-        UIView *bottomView = [[UIView alloc] init];
-        static NSInteger rgb = 0;
-        bottomView.userInteractionEnabled = NO;
-        bottomView.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.8];
-        [self.contentView addSubview:bottomView];
-        _bottomView = bottomView;
-    }
-    return _bottomView;
-}
-
-- (UIButton *)cannotSelectLayerButton {
-    if (_cannotSelectLayerButton == nil) {
-        UIButton *cannotSelectLayerButton = [[UIButton alloc] init];
-        [self.contentView addSubview:cannotSelectLayerButton];
-        _cannotSelectLayerButton = cannotSelectLayerButton;
-    }
-    return _cannotSelectLayerButton;
-}
-
-- (UIImageView *)videoImgView {
-    if (_videoImgView == nil) {
-        UIImageView *videoImgView = [[UIImageView alloc] init];
-        [videoImgView setImage:[UIImage tz_imageNamedFromMyBundle:@"VideoSendIcon"]];
-        [self.bottomView addSubview:videoImgView];
-        _videoImgView = videoImgView;
-    }
-    return _videoImgView;
-}
-
-- (UILabel *)timeLength {
-    if (_timeLength == nil) {
-        UILabel *timeLength = [[UILabel alloc] init];
-        timeLength.font = [UIFont boldSystemFontOfSize:11];
-        timeLength.textColor = [UIColor whiteColor];
-        timeLength.textAlignment = NSTextAlignmentRight;
-        [self.bottomView addSubview:timeLength];
-        _timeLength = timeLength;
-    }
-    return _timeLength;
-}
-
-- (UILabel *)indexLabel {
-    if (_indexLabel == nil) {
-        UILabel *indexLabel = [[UILabel alloc] init];
-        indexLabel.font = [UIFont systemFontOfSize:14];
-        indexLabel.adjustsFontSizeToFitWidth = YES;
-        indexLabel.textColor = [UIColor whiteColor];
-        indexLabel.textAlignment = NSTextAlignmentCenter;
-        [self.contentView addSubview:indexLabel];
-        _indexLabel = indexLabel;
-    }
-    return _indexLabel;
-}
-
-- (TZProgressView *)progressView {
-    if (_progressView == nil) {
-        _progressView = [[TZProgressView alloc] init];
-        _progressView.hidden = YES;
-        [self addSubview:_progressView];
-    }
-    return _progressView;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _cannotSelectLayerButton.frame = self.bounds;
-    if (self.allowPreview) {
-        _selectPhotoButton.frame = CGRectMake(self.tz_width - 44, 0, 44, 44);
-    } else {
-        _selectPhotoButton.frame = self.bounds;
-    }
-    _selectImageView.frame = CGRectMake(self.tz_width - 27, 3, 24, 24);
-    if (_selectImageView.image.size.width <= 27) {
-        _selectImageView.contentMode = UIViewContentModeCenter;
-    } else {
-        _selectImageView.contentMode = UIViewContentModeScaleAspectFit;
-    }
-    _indexLabel.frame = _selectImageView.frame;
-    _imageView.frame = self.bounds;
-
-    static CGFloat progressWH = 20;
-    CGFloat progressXY = (self.tz_width - progressWH) / 2;
-    _progressView.frame = CGRectMake(progressXY, progressXY, progressWH, progressWH);
-
-    _bottomView.frame = CGRectMake(0, self.tz_height - 17, self.tz_width, 17);
-    _videoImgView.frame = CGRectMake(8, 0, 17, 17);
-    _timeLength.frame = CGRectMake(self.videoImgView.tz_right, 0, self.tz_width - self.videoImgView.tz_right - 5, 17);
-    
-    self.type = (NSInteger)self.model.type;
-    self.showSelectBtn = self.showSelectBtn;
-    
-    [self.contentView bringSubviewToFront:_bottomView];
-    [self.contentView bringSubviewToFront:_cannotSelectLayerButton];
-    [self.contentView bringSubviewToFront:_selectPhotoButton];
-    [self.contentView bringSubviewToFront:_selectImageView];
-    [self.contentView bringSubviewToFront:_indexLabel];
-    
-    if (self.assetCellDidLayoutSubviewsBlock) {
-        self.assetCellDidLayoutSubviewsBlock(self, _imageView, _selectImageView, _indexLabel, _bottomView, _timeLength, _videoImgView);
-    }
-}
-
-- (void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-@end
-
-@interface TZAlbumCell ()
-@property (weak, nonatomic) UIImageView *posterImageView;
-@property (weak, nonatomic) UILabel *titleLabel;
-@end
-
-@implementation TZAlbumCell
-
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    self.backgroundColor = [UIColor whiteColor];
-    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
-    return self;
-}
-
-- (void)setModel:(TZAlbumModel *)model {
-    _model = model;
-    
-    UIColor *nameColor = UIColor.blackColor;
-    if (@available(iOS 13.0, *)) {
-        nameColor = UIColor.labelColor;
-    }
-    NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:model.name attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:nameColor}];
-    NSAttributedString *countString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"  (%zd)",model.count] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor lightGrayColor]}];
-    [nameString appendAttributedString:countString];
-    self.titleLabel.attributedText = nameString;
-    [[TZImageManager manager] getPostImageWithAlbumModel:model completion:^(UIImage *postImage) {
-        self.posterImageView.image = postImage;
-        [self setNeedsLayout];
-    }];
-    if (model.selectedCount) {
-        self.selectedCountButton.hidden = NO;
-        [self.selectedCountButton setTitle:[NSString stringWithFormat:@"%zd",model.selectedCount] forState:UIControlStateNormal];
-    } else {
-        self.selectedCountButton.hidden = YES;
-    }
-    
-    if (self.albumCellDidSetModelBlock) {
-        self.albumCellDidSetModelBlock(self, _posterImageView, _titleLabel);
-    }
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _selectedCountButton.frame = CGRectMake(self.contentView.tz_width - 24, 23, 24, 24);
-    NSInteger titleHeight = ceil(self.titleLabel.font.lineHeight);
-    self.titleLabel.frame = CGRectMake(80, (self.tz_height - titleHeight) / 2, self.tz_width - 80 - 50, titleHeight);
-    self.posterImageView.frame = CGRectMake(0, 0, 70, 70);
-    
-    if (self.albumCellDidLayoutSubviewsBlock) {
-        self.albumCellDidLayoutSubviewsBlock(self, _posterImageView, _titleLabel);
-    }
-}
-
-- (void)layoutSublayersOfLayer:(CALayer *)layer {
-    [super layoutSublayersOfLayer:layer];
-}
-
-#pragma mark - Lazy load
-
-- (UIImageView *)posterImageView {
-    if (_posterImageView == nil) {
-        UIImageView *posterImageView = [[UIImageView alloc] init];
-        posterImageView.contentMode = UIViewContentModeScaleAspectFill;
-        posterImageView.clipsToBounds = YES;
-        [self.contentView addSubview:posterImageView];
-        _posterImageView = posterImageView;
-    }
-    return _posterImageView;
-}
-
-- (UILabel *)titleLabel {
-    if (_titleLabel == nil) {
-        UILabel *titleLabel = [[UILabel alloc] init];
-        titleLabel.font = [UIFont boldSystemFontOfSize:17];
-        if (@available(iOS 13.0, *)) {
-            titleLabel.textColor = UIColor.labelColor;
-        } else {
-            titleLabel.textColor = [UIColor blackColor];
-        }
-        titleLabel.textAlignment = NSTextAlignmentLeft;
-        [self.contentView addSubview:titleLabel];
-        _titleLabel = titleLabel;
-    }
-    return _titleLabel;
-}
-
-- (UIButton *)selectedCountButton {
-    if (_selectedCountButton == nil) {
-        UIButton *selectedCountButton = [[UIButton alloc] init];
-        selectedCountButton.titleLabel.adjustsFontSizeToFitWidth = YES;
-        selectedCountButton.layer.cornerRadius = 12;
-        selectedCountButton.clipsToBounds = YES;
-        selectedCountButton.backgroundColor = [UIColor redColor];
-        [selectedCountButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-        selectedCountButton.titleLabel.font = [UIFont systemFontOfSize:15];
-        [self.contentView addSubview:selectedCountButton];
-        _selectedCountButton = selectedCountButton;
-    }
-    return _selectedCountButton;
-}
-
-@end
-
-
-
-@implementation TZAssetCameraCell
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        self.backgroundColor = [UIColor whiteColor];
-        _imageView = [[UIImageView alloc] init];
-        _imageView.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.500];
-        _imageView.contentMode = UIViewContentModeScaleAspectFill;
-        [self.contentView addSubview:_imageView];
-        self.clipsToBounds = YES;
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _imageView.frame = self.bounds;
-}
-
-@end

+ 0 - 56
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetModel.h

@@ -1,56 +0,0 @@
-//
-//  TZAssetModel.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-#import <Photos/Photos.h>
-
-typedef enum : NSUInteger {
-    TZAssetModelMediaTypePhoto = 0,
-    TZAssetModelMediaTypeLivePhoto,
-    TZAssetModelMediaTypePhotoGif,
-    TZAssetModelMediaTypeVideo,
-    TZAssetModelMediaTypeAudio
-} TZAssetModelMediaType;
-
-@class PHAsset;
-@interface TZAssetModel : NSObject
-
-@property (nonatomic, strong) PHAsset *asset;
-@property (nonatomic, assign) BOOL isSelected;      ///< The select status of a photo, default is No
-@property (nonatomic, assign) TZAssetModelMediaType type;
-@property (nonatomic, copy) NSString *timeLength;
-@property (nonatomic, assign) BOOL iCloudFailed;
-
-/// Init a photo dataModel With a PHAsset
-/// 用一个PHAsset实例,初始化一个照片模型
-+ (instancetype)modelWithAsset:(PHAsset *)asset type:(TZAssetModelMediaType)type;
-+ (instancetype)modelWithAsset:(PHAsset *)asset type:(TZAssetModelMediaType)type timeLength:(NSString *)timeLength;
-
-@end
-
-
-@class PHFetchResult;
-@interface TZAlbumModel : NSObject
-
-@property (nonatomic, strong) NSString *name;        ///< The album name
-@property (nonatomic, assign) NSInteger count;       ///< Count of photos the album contain
-@property (nonatomic, strong) PHFetchResult *result;
-@property (nonatomic, strong) PHAssetCollection *collection;
-@property (nonatomic, strong) PHFetchOptions *options;
-
-@property (nonatomic, strong) NSArray *models;
-@property (nonatomic, strong) NSArray *selectedModels;
-@property (nonatomic, assign) NSUInteger selectedCount;
-
-@property (nonatomic, assign) BOOL isCameraRoll;
-
-- (void)setResult:(PHFetchResult *)result needFetchAssets:(BOOL)needFetchAssets;
-- (void)refreshFetchResult;
-
-@end

+ 0 - 79
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZAssetModel.m

@@ -1,79 +0,0 @@
-//
-//  TZAssetModel.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import "TZAssetModel.h"
-#import "TZImageManager.h"
-
-@implementation TZAssetModel
-
-+ (instancetype)modelWithAsset:(PHAsset *)asset type:(TZAssetModelMediaType)type{
-    TZAssetModel *model = [[TZAssetModel alloc] init];
-    model.asset = asset;
-    model.isSelected = NO;
-    model.type = type;
-    return model;
-}
-
-+ (instancetype)modelWithAsset:(PHAsset *)asset type:(TZAssetModelMediaType)type timeLength:(NSString *)timeLength {
-    TZAssetModel *model = [self modelWithAsset:asset type:type];
-    model.timeLength = timeLength;
-    return model;
-}
-
-@end
-
-
-
-@implementation TZAlbumModel
-
-- (void)setResult:(PHFetchResult *)result needFetchAssets:(BOOL)needFetchAssets {
-    _result = result;
-    if (needFetchAssets) {
-        [[TZImageManager manager] getAssetsFromFetchResult:result completion:^(NSArray<TZAssetModel *> *models) {
-            self->_models = models;
-            if (self->_selectedModels) {
-                [self checkSelectedModels];
-            }
-        }];
-    }
-}
-
-- (void)refreshFetchResult {
-    PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:self.collection options:self.options];
-    self.count = fetchResult.count;
-    [self setResult:fetchResult];
-}
-
-- (void)setSelectedModels:(NSArray *)selectedModels {
-    _selectedModels = selectedModels;
-    if (_models) {
-        [self checkSelectedModels];
-    }
-}
-
-- (void)checkSelectedModels {
-    self.selectedCount = 0;
-    NSMutableSet *selectedAssets = [NSMutableSet setWithCapacity:_selectedModels.count];
-    for (TZAssetModel *model in _selectedModels) {
-        [selectedAssets addObject:model.asset];
-    }
-    for (TZAssetModel *model in _models) {
-        if ([selectedAssets containsObject:model.asset]) {
-            self.selectedCount ++;
-        }
-    }
-}
-
-- (NSString *)name {
-    if (_name) {
-        return _name;
-    }
-    return @"";
-}
-
-@end

+ 0 - 16
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZGifPhotoPreviewController.h

@@ -1,16 +0,0 @@
-//
-//  TZGifPhotoPreviewController.h
-//  TZImagePickerController
-//
-//  Created by ttouch on 2016/12/13.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@class TZAssetModel;
-@interface TZGifPhotoPreviewController : UIViewController
-
-@property (nonatomic, strong) TZAssetModel *model;
-
-@end

+ 0 - 173
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZGifPhotoPreviewController.m

@@ -1,173 +0,0 @@
-//
-//  TZGifPhotoPreviewController.m
-//  TZImagePickerController
-//
-//  Created by ttouch on 2016/12/13.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import "TZGifPhotoPreviewController.h"
-#import "TZImagePickerController.h"
-#import "TZAssetModel.h"
-#import "UIView+TZLayout.h"
-#import "TZPhotoPreviewCell.h"
-#import "TZImageManager.h"
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-
-@interface TZGifPhotoPreviewController () {
-    UIView *_toolBar;
-    UIButton *_doneButton;
-    UIProgressView *_progress;
-    
-    TZPhotoPreviewView *_previewView;
-    
-    UIStatusBarStyle _originStatusBarStyle;
-}
-@property (assign, nonatomic) BOOL needShowStatusBar;
-@end
-
-@implementation TZGifPhotoPreviewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    self.needShowStatusBar = ![UIApplication sharedApplication].statusBarHidden;
-    self.view.backgroundColor = [UIColor blackColor];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc) {
-        self.navigationItem.title = [NSString stringWithFormat:@"GIF %@",tzImagePickerVc.previewBtnTitleStr];
-    }
-    [self configPreviewView];
-    [self configBottomToolBar];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    _originStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
-    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    if (self.needShowStatusBar) {
-        [UIApplication sharedApplication].statusBarHidden = NO;
-    }
-    [UIApplication sharedApplication].statusBarStyle = _originStatusBarStyle;
-}
-
-- (void)configPreviewView {
-    _previewView = [[TZPhotoPreviewView alloc] initWithFrame:CGRectZero];
-    _previewView.model = self.model;
-    __weak typeof(self) weakSelf = self;
-    [_previewView setSingleTapGestureBlock:^{
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        [strongSelf signleTapAction];
-    }];
-    [self.view addSubview:_previewView];
-}
-
-- (void)configBottomToolBar {
-    _toolBar = [[UIView alloc] initWithFrame:CGRectZero];
-    CGFloat rgb = 34 / 255.0;
-    _toolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.7];
-    
-    _doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    _doneButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc) {
-        [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal];
-        [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal];
-    } else {
-        [_doneButton setTitle:[NSBundle tz_localizedStringForKey:@"Done"] forState:UIControlStateNormal];
-        [_doneButton setTitleColor:[UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0] forState:UIControlStateNormal];
-    }
-    [_toolBar addSubview:_doneButton];
-    
-    UILabel *byteLabel = [[UILabel alloc] init];
-    byteLabel.textColor = [UIColor whiteColor];
-    byteLabel.font = [UIFont systemFontOfSize:13];
-    byteLabel.frame = CGRectMake(10, 0, 100, 44);
-    [[TZImageManager manager] getPhotosBytesWithArray:@[_model] completion:^(NSString *totalBytes) {
-        byteLabel.text = totalBytes;
-    }];
-    [_toolBar addSubview:byteLabel];
-    
-    [self.view addSubview:_toolBar];
-    
-    if (tzImagePickerVc.gifPreviewPageUIConfigBlock) {
-        tzImagePickerVc.gifPreviewPageUIConfigBlock(_toolBar, _doneButton);
-    }
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle {
-    TZImagePickerController *tzImagePicker = (TZImagePickerController *)self.navigationController;
-    if (tzImagePicker && [tzImagePicker isKindOfClass:[TZImagePickerController class]]) {
-        return tzImagePicker.statusBarStyle;
-    }
-    return [super preferredStatusBarStyle];
-}
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-    
-    _previewView.frame = self.view.bounds;
-    _previewView.scrollView.frame = self.view.bounds;
-    CGFloat toolBarHeight = 44 + [TZCommonTools tz_safeAreaInsets].bottom;
-    _toolBar.frame = CGRectMake(0, self.view.tz_height - toolBarHeight, self.view.tz_width, toolBarHeight);
-    [_doneButton sizeToFit];
-    _doneButton.frame = CGRectMake(self.view.tz_width - _doneButton.tz_width - 12, 0, MAX(44, _doneButton.tz_width), 44);
-    
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc.gifPreviewPageDidLayoutSubviewsBlock) {
-        tzImagePickerVc.gifPreviewPageDidLayoutSubviewsBlock(_toolBar, _doneButton);
-    }
-}
-
-#pragma mark - Click Event
-
-- (void)signleTapAction {
-    _toolBar.hidden = !_toolBar.isHidden;
-    [self.navigationController setNavigationBarHidden:_toolBar.isHidden];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (_toolBar.isHidden) {
-        [UIApplication sharedApplication].statusBarHidden = YES;
-    } else if (tzImagePickerVc.needShowStatusBar) {
-        [UIApplication sharedApplication].statusBarHidden = NO;
-    }
-}
-
-- (void)doneButtonClick {
-    if (self.navigationController) {
-        TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-        if (imagePickerVc.autoDismiss) {
-            [self.navigationController dismissViewControllerAnimated:YES completion:^{
-                [self callDelegateMethod];
-            }];
-        } else {
-            [self callDelegateMethod];
-        }
-    } else {
-        [self dismissViewControllerAnimated:YES completion:^{
-            [self callDelegateMethod];
-        }];
-    }
-}
-
-- (void)callDelegateMethod {
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    UIImage *animatedImage = _previewView.imageView.image;
-    if ([imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingGifImage:sourceAssets:)]) {
-        [imagePickerVc.pickerDelegate imagePickerController:imagePickerVc didFinishPickingGifImage:animatedImage sourceAssets:_model.asset];
-    }
-    if (imagePickerVc.didFinishPickingGifImageHandle) {
-        imagePickerVc.didFinishPickingGifImageHandle(animatedImage,_model.asset);
-    }
-}
-
-#pragma clang diagnostic pop
-
-@end

+ 0 - 39
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageCropManager.h

@@ -1,39 +0,0 @@
-//
-//  TZImageCropManager.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 2016/12/5.
-//  Copyright © 2016年 谭真. All rights reserved.
-//  图片裁剪管理类
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-@interface TZImageCropManager : NSObject
-
-/// 裁剪框背景的处理
-+ (void)overlayClippingWithView:(UIView *)view cropRect:(CGRect)cropRect containerView:(UIView *)containerView needCircleCrop:(BOOL)needCircleCrop;
-
-/*
- 1.7.2 为了解决多位同学对于图片裁剪的需求,我这两天有空便在研究图片裁剪
- 幸好有tuyou的PhotoTweaks库做参考,裁剪的功能实现起来简单许多
- 该方法和其内部引用的方法基本来自于tuyou的PhotoTweaks库,我做了稍许删减和修改
- 感谢tuyou同学在github开源了优秀的裁剪库PhotoTweaks,表示感谢
- PhotoTweaks库的github链接:https://github.com/itouch2/PhotoTweaks
- */
-/// 获得裁剪后的图片
-+ (UIImage *)cropImageView:(UIImageView *)imageView toRect:(CGRect)rect zoomScale:(double)zoomScale containerView:(UIView *)containerView;
-
-/// 获取圆形图片
-+ (UIImage *)circularClipImage:(UIImage *)image;
-
-@end
-
-
-/// 该分类的代码来自SDWebImage:https://github.com/rs/SDWebImage
-/// 为了防止冲突,我将分类名字和方法名字做了修改
-@interface UIImage (TZGif)
-
-+ (UIImage *)sd_tz_animatedGIFWithData:(NSData *)data;
-
-@end

+ 0 - 199
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageCropManager.m

@@ -1,199 +0,0 @@
-//
-//  TZImageCropManager.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 2016/12/5.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import "TZImageCropManager.h"
-#import "UIView+TZLayout.h"
-#import <ImageIO/ImageIO.h>
-#import "TZImageManager.h"
-#import "TZImagePickerController.h"
-
-@implementation TZImageCropManager
-
-/// 裁剪框背景的处理
-+ (void)overlayClippingWithView:(UIView *)view cropRect:(CGRect)cropRect containerView:(UIView *)containerView needCircleCrop:(BOOL)needCircleCrop {
-    UIBezierPath *path= [UIBezierPath bezierPathWithRect:[UIScreen mainScreen].bounds];
-    CAShapeLayer *layer = [CAShapeLayer layer];
-    if (needCircleCrop) { // 圆形裁剪框
-        [path appendPath:[UIBezierPath bezierPathWithArcCenter:containerView.center radius:cropRect.size.width / 2 startAngle:0 endAngle: 2 * M_PI clockwise:NO]];
-    } else { // 矩形裁剪框
-        [path appendPath:[UIBezierPath bezierPathWithRect:cropRect]];
-    }
-    layer.path = path.CGPath;
-    layer.fillRule = kCAFillRuleEvenOdd;
-    layer.fillColor = [[UIColor blackColor] CGColor];
-    layer.opacity = 0.5;
-    [view.layer addSublayer:layer];
-}
-
-/// 获得裁剪后的图片
-+ (UIImage *)cropImageView:(UIImageView *)imageView toRect:(CGRect)rect zoomScale:(double)zoomScale containerView:(UIView *)containerView {
-    CGAffineTransform transform = CGAffineTransformIdentity;
-    // 平移的处理
-    CGRect imageViewRect = [imageView convertRect:imageView.bounds toView:containerView];
-    CGPoint point = CGPointMake(imageViewRect.origin.x + imageViewRect.size.width / 2, imageViewRect.origin.y + imageViewRect.size.height / 2);
-    CGFloat xMargin = containerView.tz_width - CGRectGetMaxX(rect) - rect.origin.x;
-    CGPoint zeroPoint = CGPointMake((CGRectGetWidth(containerView.frame) - xMargin) / 2, containerView.center.y);
-    CGPoint translation = CGPointMake(point.x - zeroPoint.x, point.y - zeroPoint.y);
-    transform = CGAffineTransformTranslate(transform, translation.x, translation.y);
-    // 缩放的处理
-    transform = CGAffineTransformScale(transform, zoomScale, zoomScale);
-    
-    CGImageRef imageRef = [self newTransformedImage:transform
-                                        sourceImage:imageView.image.CGImage
-                                         sourceSize:imageView.image.size
-                                        outputWidth:rect.size.width * [UIScreen mainScreen].scale
-                                           cropSize:rect.size
-                                      imageViewSize:imageView.frame.size];
-    UIImage *cropedImage = [UIImage imageWithCGImage:imageRef];
-    cropedImage = [[TZImageManager manager] fixOrientation:cropedImage];
-    CGImageRelease(imageRef);
-    return cropedImage;
-}
-
-+ (CGImageRef)newTransformedImage:(CGAffineTransform)transform sourceImage:(CGImageRef)sourceImage sourceSize:(CGSize)sourceSize  outputWidth:(CGFloat)outputWidth cropSize:(CGSize)cropSize imageViewSize:(CGSize)imageViewSize {
-    CGImageRef source = [self newScaledImage:sourceImage toSize:sourceSize];
-    
-    CGFloat aspect = cropSize.height/cropSize.width;
-    CGSize outputSize = CGSizeMake(outputWidth, outputWidth*aspect);
-    
-    CGContextRef context = CGBitmapContextCreate(NULL, outputSize.width, outputSize.height, CGImageGetBitsPerComponent(source), 0, CGImageGetColorSpace(source), CGImageGetBitmapInfo(source));
-    CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);
-    CGContextFillRect(context, CGRectMake(0, 0, outputSize.width, outputSize.height));
-    
-    CGAffineTransform uiCoords = CGAffineTransformMakeScale(outputSize.width / cropSize.width, outputSize.height / cropSize.height);
-    uiCoords = CGAffineTransformTranslate(uiCoords, cropSize.width/2.0, cropSize.height / 2.0);
-    uiCoords = CGAffineTransformScale(uiCoords, 1.0, -1.0);
-    CGContextConcatCTM(context, uiCoords);
-    
-    CGContextConcatCTM(context, transform);
-    CGContextScaleCTM(context, 1.0, -1.0);
-    
-    CGContextDrawImage(context, CGRectMake(-imageViewSize.width/2, -imageViewSize.height/2.0, imageViewSize.width, imageViewSize.height), source);
-    CGImageRef resultRef = CGBitmapContextCreateImage(context);
-    CGContextRelease(context);
-    CGImageRelease(source);
-    return resultRef;
-}
-
-+ (CGImageRef)newScaledImage:(CGImageRef)source toSize:(CGSize)size {
-    CGSize srcSize = size;
-    CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();
-    CGContextRef context = CGBitmapContextCreate(NULL, size.width, size.height, 8, 0, rgbColorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
-    CGColorSpaceRelease(rgbColorSpace);
-    
-    CGContextSetInterpolationQuality(context, kCGInterpolationNone);
-    CGContextTranslateCTM(context, size.width/2, size.height/2);
-    
-    CGContextDrawImage(context, CGRectMake(-srcSize.width/2, -srcSize.height/2, srcSize.width, srcSize.height), source);
-    
-    CGImageRef resultRef = CGBitmapContextCreateImage(context);
-    CGContextRelease(context);
-    return resultRef;
-}
-
-/// 获取圆形图片
-+ (UIImage *)circularClipImage:(UIImage *)image {
-    UIGraphicsBeginImageContextWithOptions(image.size, NO, [UIScreen mainScreen].scale);
-    
-    CGContextRef ctx = UIGraphicsGetCurrentContext();
-    CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
-    CGContextAddEllipseInRect(ctx, rect);
-    CGContextClip(ctx);
-    
-    [image drawInRect:rect];
-    UIImage *circleImage = UIGraphicsGetImageFromCurrentImageContext();
-    
-    UIGraphicsEndImageContext();
-    return circleImage;
-}
-
-@end
-
-
-@implementation UIImage (TZGif)
-
-+ (UIImage *)sd_tz_animatedGIFWithData:(NSData *)data {
-    if (!data) {
-        return nil;
-    }
-    
-    CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
-    
-    size_t count = CGImageSourceGetCount(source);
-    
-    UIImage *animatedImage;
-    
-    if (count <= 1) {
-        animatedImage = [[UIImage alloc] initWithData:data];
-    }
-    else {
-        // images数组过大时内存会飙升,在这里限制下最大count
-        NSInteger maxCount = [TZImagePickerConfig sharedInstance].gifPreviewMaxImagesCount ?: 50;
-        NSInteger interval = MAX((count + maxCount / 2) / maxCount, 1);
-        
-        NSMutableArray *images = [NSMutableArray array];
-        
-        NSTimeInterval duration = 0.0f;
-        
-        for (size_t i = 0; i < count; i+=interval) {
-            CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
-            if (!image) {
-                continue;
-            }
-            
-            duration += [self sd_frameDurationAtIndex:i source:source] * MIN(interval, 3);
-            
-            [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]];
-            
-            CGImageRelease(image);
-        }
-        
-        if (!duration) {
-            duration = (1.0f / 10.0f) * count;
-        }
-        
-        animatedImage = [UIImage animatedImageWithImages:images duration:duration];
-    }
-    
-    CFRelease(source);
-    
-    return animatedImage;
-}
-
-+ (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
-    float frameDuration = 0.1f;
-    CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
-    NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
-    NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
-    
-    NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
-    if (delayTimeUnclampedProp) {
-        frameDuration = [delayTimeUnclampedProp floatValue];
-    }
-    else {
-        
-        NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
-        if (delayTimeProp) {
-            frameDuration = [delayTimeProp floatValue];
-        }
-    }
-    
-    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
-    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
-    // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.org/b/36082>
-    // for more information.
-    
-    if (frameDuration < 0.011f) {
-        frameDuration = 0.100f;
-    }
-    
-    CFRelease(cfFrameProperties);
-    return frameDuration;
-}
-
-@end

+ 0 - 139
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageManager.h

@@ -1,139 +0,0 @@
-//
-//  TZImageManager.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 16/1/4.
-//  Copyright © 2016年 谭真. All rights reserved.
-//  图片资源获取管理类
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-#import <AVFoundation/AVFoundation.h>
-#import <Photos/Photos.h>
-#import "TZAssetModel.h"
-
-@class TZAlbumModel,TZAssetModel;
-@protocol TZImagePickerControllerDelegate;
-@interface TZImageManager : NSObject
-
-@property (nonatomic, strong) PHCachingImageManager *cachingImageManager;
-
-+ (instancetype)manager NS_SWIFT_NAME(default());
-+ (void)deallocManager;
-
-@property (weak, nonatomic) id<TZImagePickerControllerDelegate> pickerDelegate;
-
-@property (nonatomic, assign) BOOL shouldFixOrientation;
-
-@property (nonatomic, assign) BOOL isPreviewNetworkImage;
-
-/// Default is 600px / 默认600像素宽
-@property (nonatomic, assign) CGFloat photoPreviewMaxWidth;
-/// The pixel width of output image, Default is 828px / 导出图片的宽度,默认828像素宽
-@property (nonatomic, assign) CGFloat photoWidth;
-
-/// Default is 4, Use in photos collectionView in TZPhotoPickerController
-/// 默认4列, TZPhotoPickerController中的照片collectionView
-@property (nonatomic, assign) NSInteger columnNumber;
-
-/// Sort photos ascending by modificationDate,Default is YES
-/// 对照片排序,按修改时间升序,默认是YES。如果设置为NO,最新的照片会显示在最前面,内部的拍照按钮会排在第一个
-@property (nonatomic, assign) BOOL sortAscendingByModificationDate;
-
-/// Minimum selectable photo width, Default is 0
-/// 最小可选中的图片宽度,默认是0,小于这个宽度的图片不可选中
-@property (nonatomic, assign) NSInteger minPhotoWidthSelectable;
-@property (nonatomic, assign) NSInteger minPhotoHeightSelectable;
-@property (nonatomic, assign) BOOL hideWhenCanNotSelect;
-
-/// Return YES if Authorized 返回YES如果得到了授权
-- (BOOL)authorizationStatusAuthorized;
-- (void)requestAuthorizationWithCompletion:(void (^)(void))completion;
-
-/// Get Album 获得相册/相册数组
-- (void)getCameraRollAlbumWithFetchAssets:(BOOL)needFetchAssets completion:(void (^)(TZAlbumModel *model))completion;
-- (void)getCameraRollAlbum:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage needFetchAssets:(BOOL)needFetchAssets completion:(void (^)(TZAlbumModel *model))completion __attribute__((deprecated("Use -getCameraRollAlbumWithFetchAssets:completion:. You can config allowPickingImage、allowPickingVideo by TZImagePickerConfig")));
-- (void)getAllAlbums:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage needFetchAssets:(BOOL)needFetchAssets completion:(void (^)(NSArray<TZAlbumModel *> *models))completion __attribute__((deprecated("Use -getAllAlbumsWithFetchAssets:completion:. You can config allowPickingImage、allowPickingVideo by TZImagePickerConfig")));
-- (void)getAllAlbumsWithFetchAssets:(BOOL)needFetchAssets completion:(void (^)(NSArray<TZAlbumModel *> *models))completion;
-
-/// Get Assets 获得Asset数组
-- (void)getAssetsFromFetchResult:(PHFetchResult *)result completion:(void (^)(NSArray<TZAssetModel *> *models))completion;
-- (void)getAssetsFromFetchResult:(PHFetchResult *)result allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(NSArray<TZAssetModel *> *models))completion __attribute__((deprecated("Use -getAssetsFromFetchResult:completion:. You can config allowPickingImage、allowPickingVideo by TZImagePickerConfig")));
-- (void)getAssetFromFetchResult:(PHFetchResult *)result atIndex:(NSInteger)index allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(TZAssetModel *model))completion __attribute__((deprecated("Use -getAssetFromFetchResult:atIndex:completion:. You can config allowPickingImage、allowPickingVideo by TZImagePickerConfig")));
-- (void)getAssetFromFetchResult:(PHFetchResult *)result atIndex:(NSInteger)index completion:(void (^)(TZAssetModel *model))completion;
-
-/// Get photo 获得照片
-- (PHImageRequestID)getPostImageWithAlbumModel:(TZAlbumModel *)model completion:(void (^)(UIImage *postImage))completion;
-
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion;
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion;
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed;
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed;
-- (PHImageRequestID)requestImageDataForAsset:(PHAsset *)asset completion:(void (^)(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler;
-
-/// Get full Image 获取原图
-/// 如下两个方法completion一般会调多次,一般会先返回缩略图,再返回原图(详见方法内部使用的系统API的说明),如果info[PHImageResultIsDegradedKey] 为 YES,则表明当前返回的是缩略图,否则是原图。
-- (PHImageRequestID)getOriginalPhotoWithAsset:(PHAsset *)asset completion:(void (^)(UIImage *photo,NSDictionary *info))completion;
-- (PHImageRequestID)getOriginalPhotoWithAsset:(PHAsset *)asset newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion;
-- (PHImageRequestID)getOriginalPhotoWithAsset:(PHAsset *)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion;
-// 该方法中,completion只会走一次
-- (PHImageRequestID)getOriginalPhotoDataWithAsset:(PHAsset *)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion;
-- (PHImageRequestID)getOriginalPhotoDataWithAsset:(PHAsset *)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion;
-
-/// Get Image For VideoURL
-- (UIImage *)getImageWithVideoURL:(NSURL *)videoURL;
-
-/// Save photo 保存照片
-- (void)savePhotoWithImage:(UIImage *)image completion:(void (^)(PHAsset *asset, NSError *error))completion;
-- (void)savePhotoWithImage:(UIImage *)image location:(CLLocation *)location completion:(void (^)(PHAsset *asset, NSError *error))completion;
-- (void)savePhotoWithImage:(UIImage *)image meta:(NSDictionary *)meta location:(CLLocation *)location completion:(void (^)(PHAsset *asset, NSError *error))completion;
-
-/// Save video 保存视频
-- (void)saveVideoWithUrl:(NSURL *)url completion:(void (^)(PHAsset *asset, NSError *error))completion;
-- (void)saveVideoWithUrl:(NSURL *)url location:(CLLocation *)location completion:(void (^)(PHAsset *asset, NSError *error))completion;
-
-/// Get video 获得视频
-- (void)getVideoWithAsset:(PHAsset *)asset completion:(void (^)(AVPlayerItem * playerItem, NSDictionary * info))completion;
-- (void)getVideoWithAsset:(PHAsset *)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(AVPlayerItem *, NSDictionary *))completion;
-
-/// Export video 导出视频 presetName: 预设名字,默认值是AVAssetExportPreset640x480
-- (void)getVideoOutputPathWithAsset:(PHAsset *)asset success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure;
-- (void)getVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure;
-- (void)getVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName timeRange:(CMTimeRange)timeRange success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure;
-/// 新的导出视频API,解决iOS14 iCloud视频导出失败的问题,未大量测试,请大家多多测试,有问题群里反馈
-- (void)requestVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure;
-/// 得到视频原始文件地址
-- (void)requestVideoURLWithAsset:(PHAsset *)asset success:(void (^)(NSURL *videoURL))success failure:(void (^)(NSDictionary* info))failure;
-
-/// Get photo bytes 获得一组照片的大小
-- (void)getPhotosBytesWithArray:(NSArray *)photos completion:(void (^)(NSString *totalBytes))completion;
-
-- (BOOL)isCameraRollAlbum:(PHAssetCollection *)metadata;
-
-/// 检查照片大小是否满足最小要求
-- (BOOL)isPhotoSelectableWithAsset:(PHAsset *)asset;
-
-/// 检查照片能否被选中
-- (BOOL)isAssetCannotBeSelected:(PHAsset *)asset;
-
-/// 修正图片转向
-- (UIImage *)fixOrientation:(UIImage *)aImage;
-
-/// 获取asset的资源类型
-- (TZAssetModelMediaType)getAssetType:(PHAsset *)asset;
-/// 缩放图片至新尺寸
-- (UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)size;
-
-/// 判断asset是否是视频
-- (BOOL)isVideo:(PHAsset *)asset;
-
-/// for TZImagePreviewController
-- (NSString *)getNewTimeFromDurationSecond:(NSInteger)duration;
-
-- (TZAssetModel *)createModelWithAsset:(PHAsset *)asset;
-
-@end
-
-//@interface TZSortDescriptor : NSSortDescriptor
-//
-//@end

+ 0 - 1067
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageManager.m

@@ -1,1067 +0,0 @@
-//
-//  TZImageManager.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 16/1/4.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import "TZImageManager.h"
-#import "TZAssetModel.h"
-#import "TZImagePickerController.h"
-#import <MobileCoreServices/MobileCoreServices.h>
-
-@interface TZImageManager ()
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-@end
-
-@implementation TZImageManager
-
-CGSize AssetGridThumbnailSize;
-CGFloat TZScreenWidth;
-CGFloat TZScreenScale;
-
-static TZImageManager *manager;
-static dispatch_once_t onceToken;
-
-+ (instancetype)manager {
-    dispatch_once(&onceToken, ^{
-        manager = [[self alloc] init];
-        // manager.cachingImageManager = [[PHCachingImageManager alloc] init];
-        // manager.cachingImageManager.allowsCachingHighQualityImages = YES;
-        
-        [manager configTZScreenWidth];
-    });
-    return manager;
-}
-
-+ (void)deallocManager {
-    onceToken = 0;
-    manager = nil;
-}
-
-- (void)setPhotoWidth:(CGFloat)photoWidth {
-    _photoWidth = photoWidth;
-    TZScreenWidth = photoWidth / 2;
-}
-
-- (void)setColumnNumber:(NSInteger)columnNumber {
-    [self configTZScreenWidth];
-
-    _columnNumber = columnNumber;
-    CGFloat margin = 4;
-    CGFloat itemWH = (TZScreenWidth - 2 * margin - 4) / columnNumber - margin;
-    AssetGridThumbnailSize = CGSizeMake(itemWH * TZScreenScale, itemWH * TZScreenScale);
-}
-
-- (void)configTZScreenWidth {
-    TZScreenWidth = [UIScreen mainScreen].bounds.size.width;
-    // 测试发现,如果scale在plus真机上取到3.0,内存会增大特别多。故这里写死成2.0
-    TZScreenScale = 2.0;
-    if (TZScreenWidth > 700) {
-        TZScreenScale = 1.5;
-    }
-}
-
-/// Return YES if Authorized 返回YES如果得到了授权
-- (BOOL)authorizationStatusAuthorized {
-    if (self.isPreviewNetworkImage) {
-        return YES;
-    }
-    NSInteger status = [PHPhotoLibrary authorizationStatus];
-    if (status == 0) {
-        /**
-         * 当某些情况下AuthorizationStatus == AuthorizationStatusNotDetermined时,无法弹出系统首次使用的授权alertView,系统应用设置里亦没有相册的设置,此时将无法使用,故作以下操作,弹出系统首次使用的授权alertView
-         */
-        [self requestAuthorizationWithCompletion:nil];
-    }
-    
-    return status == 3;
-}
-
-- (void)requestAuthorizationWithCompletion:(void (^)(void))completion {
-    void (^callCompletionBlock)(void) = ^(){
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (completion) {
-                completion();
-            }
-        });
-    };
-    
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
-            callCompletionBlock();
-        }];
-    });
-}
-
-#pragma mark - Get Album
-
-- (void)getCameraRollAlbum:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage needFetchAssets:(BOOL)needFetchAssets completion:(void (^)(TZAlbumModel *model))completion {
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    config.allowPickingVideo = allowPickingVideo;
-    config.allowPickingImage = allowPickingImage;
-    [self getCameraRollAlbumWithFetchAssets:needFetchAssets completion:completion];
-}
-
-/// Get Album 获得相册/相册数组
-- (void)getCameraRollAlbumWithFetchAssets:(BOOL)needFetchAssets completion:(void (^)(TZAlbumModel *model))completion {
-    __block TZAlbumModel *model;
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    PHFetchOptions *option = [[PHFetchOptions alloc] init];
-    if (!config.allowPickingVideo) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", PHAssetMediaTypeImage];
-    if (!config.allowPickingImage) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld",
-                                                PHAssetMediaTypeVideo];
-    // option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"modificationDate" ascending:self.sortAscendingByModificationDate]];
-    if (!self.sortAscendingByModificationDate) {
-        option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:self.sortAscendingByModificationDate]];
-    }
-    PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil];
-    for (PHAssetCollection *collection in smartAlbums) {
-        // 有可能是PHCollectionList类的的对象,过滤掉
-        if (![collection isKindOfClass:[PHAssetCollection class]]) continue;
-        // 过滤空相册
-        if (collection.estimatedAssetCount <= 0) continue;
-        if ([self isCameraRollAlbum:collection]) {
-            PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:collection options:option];
-            model = [self modelWithResult:fetchResult collection:collection isCameraRoll:YES needFetchAssets:needFetchAssets options:option];
-            if (completion) completion(model);
-            break;
-        }
-    }
-}
-
-- (void)getAllAlbums:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage needFetchAssets:(BOOL)needFetchAssets completion:(void (^)(NSArray<TZAlbumModel *> *))completion {
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    config.allowPickingVideo = allowPickingVideo;
-    config.allowPickingImage = allowPickingImage;
-    [self getAllAlbumsWithFetchAssets:needFetchAssets completion:completion];
-}
-
-- (void)getAllAlbumsWithFetchAssets:(BOOL)needFetchAssets completion:(void (^)(NSArray<TZAlbumModel *> *))completion {
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    NSMutableArray *albumArr = [NSMutableArray array];
-    PHFetchOptions *option = [[PHFetchOptions alloc] init];
-    if (!config.allowPickingVideo) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", PHAssetMediaTypeImage];
-    if (!config.allowPickingImage) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld",
-                                                PHAssetMediaTypeVideo];
-    // option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"modificationDate" ascending:self.sortAscendingByModificationDate]];
-    if (!self.sortAscendingByModificationDate) {
-        option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:self.sortAscendingByModificationDate]];
-    }
-    // 我的照片流 1.6.10重新加入..
-    PHFetchResult *myPhotoStreamAlbum = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumMyPhotoStream options:nil];
-    PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil];
-    PHFetchResult *topLevelUserCollections = [PHCollectionList fetchTopLevelUserCollectionsWithOptions:nil];
-    PHFetchResult *syncedAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumSyncedAlbum options:nil];
-    PHFetchResult *sharedAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumCloudShared options:nil];
-    NSArray *allAlbums = @[myPhotoStreamAlbum,smartAlbums,topLevelUserCollections,syncedAlbums,sharedAlbums];
-    for (PHFetchResult *fetchResult in allAlbums) {
-        for (PHAssetCollection *collection in fetchResult) {
-            // 有可能是PHCollectionList类的的对象,过滤掉
-            if (![collection isKindOfClass:[PHAssetCollection class]]) continue;
-            // 过滤空相册
-            if (collection.estimatedAssetCount <= 0 && ![self isCameraRollAlbum:collection]) continue;
-            PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:collection options:option];
-            if (fetchResult.count < 1 && ![self isCameraRollAlbum:collection]) continue;
-            
-            if ([self.pickerDelegate respondsToSelector:@selector(isAlbumCanSelect:result:)]) {
-                if (![self.pickerDelegate isAlbumCanSelect:collection.localizedTitle result:fetchResult]) {
-                    continue;
-                }
-            }
-            
-            if (collection.assetCollectionSubtype == PHAssetCollectionSubtypeSmartAlbumAllHidden) continue;
-            if (collection.assetCollectionSubtype == 1000000201) continue; //『最近删除』相册
-            if ([self isCameraRollAlbum:collection]) {
-                [albumArr insertObject:[self modelWithResult:fetchResult collection:collection isCameraRoll:YES needFetchAssets:needFetchAssets options:option] atIndex:0];
-            } else {
-                [albumArr addObject:[self modelWithResult:fetchResult collection:collection isCameraRoll:NO needFetchAssets:needFetchAssets options:option]];
-            }
-        }
-    }
-    if (completion) {
-        completion(albumArr);
-    }
-}
-
-#pragma mark - Get Assets
-
-/// Get Assets 获得照片数组
-- (void)getAssetsFromFetchResult:(PHFetchResult *)result allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(NSArray<TZAssetModel *> *))completion {
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    config.allowPickingVideo = allowPickingVideo;
-    config.allowPickingImage = allowPickingImage;
-    return [self getAssetsFromFetchResult:result completion:completion];
-}
-
-- (void)getAssetsFromFetchResult:(PHFetchResult *)result completion:(void (^)(NSArray<TZAssetModel *> *))completion {
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    NSMutableArray *photoArr = [NSMutableArray array];
-    [result enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL * _Nonnull stop) {
-        TZAssetModel *model = [self assetModelWithAsset:asset allowPickingVideo:config.allowPickingVideo allowPickingImage:config.allowPickingImage];
-        if (model) {
-            [photoArr addObject:model];
-        }
-    }];
-    if (completion) completion(photoArr);
-}
-
-///  Get asset at index 获得下标为index的单个照片
-///  if index beyond bounds, return nil in callback 如果索引越界, 在回调中返回 nil
-- (void)getAssetFromFetchResult:(PHFetchResult *)result atIndex:(NSInteger)index allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(TZAssetModel *))completion {
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    config.allowPickingVideo = allowPickingVideo;
-    config.allowPickingImage = allowPickingImage;
-    [self getAssetFromFetchResult:result atIndex:index allowPickingVideo:config.allowPickingVideo allowPickingImage:config.allowPickingImage completion:completion];
-}
-
-- (void)getAssetFromFetchResult:(PHFetchResult *)result atIndex:(NSInteger)index completion:(void (^)(TZAssetModel *))completion {
-    PHAsset *asset;
-    @try {
-        asset = result[index];
-    }
-    @catch (NSException* e) {
-        if (completion) completion(nil);
-        return;
-    }
-    TZImagePickerConfig *config = [TZImagePickerConfig sharedInstance];
-    TZAssetModel *model = [self assetModelWithAsset:asset allowPickingVideo:config.allowPickingVideo allowPickingImage:config.allowPickingImage];
-    if (completion) completion(model);
-}
-
-- (TZAssetModel *)assetModelWithAsset:(PHAsset *)asset allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage {
-    BOOL canSelect = YES;
-    if ([self.pickerDelegate respondsToSelector:@selector(isAssetCanSelect:)]) {
-        canSelect = [self.pickerDelegate isAssetCanSelect:asset];
-    }
-    if ([self.pickerDelegate respondsToSelector:@selector(isAssetCanBeDisplayed:)]){
-        canSelect = [self.pickerDelegate isAssetCanBeDisplayed:asset];
-    }
-    
-    if (!canSelect) return nil;
-    
-    TZAssetModel *model;
-    TZAssetModelMediaType type = [self getAssetType:asset];
-    if (!allowPickingVideo && type == TZAssetModelMediaTypeVideo) return nil;
-    if (!allowPickingImage && type == TZAssetModelMediaTypePhoto) return nil;
-    if (!allowPickingImage && type == TZAssetModelMediaTypePhotoGif) return nil;
-    
-    PHAsset *phAsset = (PHAsset *)asset;
-    if (self.hideWhenCanNotSelect) {
-        // 过滤掉尺寸不满足要求的图片
-        if (![self isPhotoSelectableWithAsset:phAsset]) {
-            return nil;
-        }
-    }
-    NSString *timeLength = type == TZAssetModelMediaTypeVideo ? [NSString stringWithFormat:@"%0.0f",phAsset.duration] : @"";
-    timeLength = [self getNewTimeFromDurationSecond:timeLength.integerValue];
-    model = [TZAssetModel modelWithAsset:asset type:type timeLength:timeLength];
-    return model;
-}
-
-- (TZAssetModelMediaType)getAssetType:(PHAsset *)asset {
-    TZAssetModelMediaType type = TZAssetModelMediaTypePhoto;
-    PHAsset *phAsset = (PHAsset *)asset;
-    if (phAsset.mediaType == PHAssetMediaTypeVideo)      type = TZAssetModelMediaTypeVideo;
-    else if (phAsset.mediaType == PHAssetMediaTypeAudio) type = TZAssetModelMediaTypeAudio;
-    else if (phAsset.mediaType == PHAssetMediaTypeImage) {
-        if (@available(iOS 9.1, *)) {
-            // if (asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive) type = TZAssetModelMediaTypeLivePhoto;
-        }
-        // Gif
-        if ([[phAsset valueForKey:@"filename"] hasSuffix:@"GIF"]) {
-            type = TZAssetModelMediaTypePhotoGif;
-        }
-    }
-    return type;
-}
-
-- (NSString *)getNewTimeFromDurationSecond:(NSInteger)duration {
-    NSString *newTime;
-    if (duration < 10) {
-        newTime = [NSString stringWithFormat:@"0:0%zd",duration];
-    } else if (duration < 60) {
-        newTime = [NSString stringWithFormat:@"0:%zd",duration];
-    } else {
-        NSInteger min = duration / 60;
-        NSInteger sec = duration - (min * 60);
-        if (sec < 10) {
-            newTime = [NSString stringWithFormat:@"%zd:0%zd",min,sec];
-        } else {
-            newTime = [NSString stringWithFormat:@"%zd:%zd",min,sec];
-        }
-    }
-    return newTime;
-}
-
-/// Get photo bytes 获得一组照片的大小
-- (void)getPhotosBytesWithArray:(NSArray *)photos completion:(void (^)(NSString *totalBytes))completion {
-    if (!photos || !photos.count) {
-        if (completion) completion(@"0B");
-        return;
-    }
-    __block NSInteger dataLength = 0;
-    __block NSInteger assetCount = 0;
-    for (NSInteger i = 0; i < photos.count; i++) {
-        TZAssetModel *model = photos[i];
-        PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
-        options.resizeMode = PHImageRequestOptionsResizeModeFast;
-        options.networkAccessAllowed = YES;
-        if (model.type == TZAssetModelMediaTypePhotoGif) {
-            options.version = PHImageRequestOptionsVersionOriginal;
-        }
-        [[PHImageManager defaultManager] requestImageDataForAsset:model.asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
-            if (model.type != TZAssetModelMediaTypeVideo) dataLength += imageData.length;
-            assetCount ++;
-            if (assetCount >= photos.count) {
-                NSString *bytes = [self getBytesFromDataLength:dataLength];
-                if (completion) completion(bytes);
-            }
-        }];
-    }
-}
-
-- (NSString *)getBytesFromDataLength:(NSInteger)dataLength {
-    NSString *bytes;
-    if (dataLength >= 0.1 * (1024 * 1024)) {
-        bytes = [NSString stringWithFormat:@"%0.1fM",dataLength/1024/1024.0];
-    } else if (dataLength >= 1024) {
-        bytes = [NSString stringWithFormat:@"%0.0fK",dataLength/1024.0];
-    } else {
-        bytes = [NSString stringWithFormat:@"%zdB",dataLength];
-    }
-    return bytes;
-}
-
-#pragma mark - Get Photo
-
-/// Get photo 获得照片本身
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset completion:(void (^)(UIImage *, NSDictionary *, BOOL isDegraded))completion {
-    return [self getPhotoWithAsset:asset completion:completion progressHandler:nil networkAccessAllowed:YES];
-}
-
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion {
-    return [self getPhotoWithAsset:asset photoWidth:photoWidth completion:completion progressHandler:nil networkAccessAllowed:YES];
-}
-
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed {
-    CGFloat fullScreenWidth = TZScreenWidth;
-    if (_photoPreviewMaxWidth > 0 && fullScreenWidth > _photoPreviewMaxWidth) {
-        fullScreenWidth = _photoPreviewMaxWidth;
-    }
-    return [self getPhotoWithAsset:asset photoWidth:fullScreenWidth completion:completion progressHandler:progressHandler networkAccessAllowed:networkAccessAllowed];
-}
-
-- (PHImageRequestID)requestImageDataForAsset:(PHAsset *)asset completion:(void (^)(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler {
-    PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
-    options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (progressHandler) {
-                progressHandler(progress, error, stop, info);
-            }
-        });
-    };
-    options.networkAccessAllowed = YES;
-    options.resizeMode = PHImageRequestOptionsResizeModeFast;
-    int32_t imageRequestID = [[PHImageManager defaultManager] requestImageDataForAsset:asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
-        if (completion) completion(imageData,dataUTI,orientation,info);
-    }];
-    return imageRequestID;
-}
-
-- (PHImageRequestID)getPhotoWithAsset:(PHAsset *)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed {
-    CGSize imageSize;
-    if (photoWidth < TZScreenWidth && photoWidth < _photoPreviewMaxWidth) {
-        imageSize = AssetGridThumbnailSize;
-    } else {
-        PHAsset *phAsset = (PHAsset *)asset;
-        CGFloat aspectRatio = phAsset.pixelWidth / (CGFloat)phAsset.pixelHeight;
-        CGFloat pixelWidth = photoWidth * TZScreenScale;
-        // 超宽图片
-        if (aspectRatio > 1.8) {
-            pixelWidth = pixelWidth * aspectRatio;
-        }
-        // 超高图片
-        if (aspectRatio < 0.2) {
-            pixelWidth = pixelWidth * 0.5;
-        }
-        CGFloat pixelHeight = pixelWidth / aspectRatio;
-        imageSize = CGSizeMake(pixelWidth, pixelHeight);
-    }
-    
-    // 修复获取图片时出现的瞬间内存过高问题
-    // 下面两行代码,来自hsjcom,他的github是:https://github.com/hsjcom 表示感谢
-    PHImageRequestOptions *option = [[PHImageRequestOptions alloc] init];
-    option.resizeMode = PHImageRequestOptionsResizeModeFast;
-    int32_t imageRequestID = [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:imageSize contentMode:PHImageContentModeAspectFill options:option resultHandler:^(UIImage *result, NSDictionary *info) {
-        BOOL cancelled = [[info objectForKey:PHImageCancelledKey] boolValue];
-        if (!cancelled && result) {
-            result = [self fixOrientation:result];
-            if (completion) completion(result,info,[[info objectForKey:PHImageResultIsDegradedKey] boolValue]);
-        }
-        // Download image from iCloud / 从iCloud下载图片
-        if ([info objectForKey:PHImageResultIsInCloudKey] && !result && networkAccessAllowed) {
-            PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
-            options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    if (progressHandler) {
-                        progressHandler(progress, error, stop, info);
-                    }
-                });
-            };
-            options.networkAccessAllowed = YES;
-            options.resizeMode = PHImageRequestOptionsResizeModeFast;
-            [[PHImageManager defaultManager] requestImageDataForAsset:asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
-                UIImage *resultImage = [UIImage imageWithData:imageData];
-                if (![TZImagePickerConfig sharedInstance].notScaleImage) {
-                    resultImage = [self scaleImage:resultImage toSize:imageSize];
-                }
-                if (!resultImage && result) {
-                    resultImage = result;
-                }
-                resultImage = [self fixOrientation:resultImage];
-                if (completion) completion(resultImage,info,NO);
-            }];
-        }
-    }];
-    return imageRequestID;
-}
-
-/// Get postImage / 获取封面图
-- (PHImageRequestID)getPostImageWithAlbumModel:(TZAlbumModel *)model completion:(void (^)(UIImage *))completion {
-    id asset = [model.result lastObject];
-    if (!self.sortAscendingByModificationDate) {
-        asset = [model.result firstObject];
-    }
-    if (!asset) {
-        return -1;
-    }
-    return [[TZImageManager manager] getPhotoWithAsset:asset photoWidth:80 completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        if (completion) completion(photo);
-    }];
-}
-
-/// Get Original Photo / 获取原图
-- (PHImageRequestID)getOriginalPhotoWithAsset:(PHAsset *)asset completion:(void (^)(UIImage *photo,NSDictionary *info))completion {
-   return [self getOriginalPhotoWithAsset:asset newCompletion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        if (completion) {
-            completion(photo,info);
-        }
-    }];
-}
-
-- (PHImageRequestID)getOriginalPhotoWithAsset:(PHAsset *)asset newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion {
-    return [self getOriginalPhotoWithAsset:asset progressHandler:nil newCompletion:completion];
-}
-
-- (PHImageRequestID)getOriginalPhotoWithAsset:(PHAsset *)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion {
-    PHImageRequestOptions *option = [[PHImageRequestOptions alloc]init];
-    option.networkAccessAllowed = YES;
-    if (progressHandler) {
-        [option setProgressHandler:progressHandler];
-    }
-    option.resizeMode = PHImageRequestOptionsResizeModeFast;
-    return [[PHImageManager defaultManager] requestImageDataForAsset:asset options:option resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
-        BOOL cancelled = [[info objectForKey:PHImageCancelledKey] boolValue];
-        if (!cancelled && imageData) {
-            UIImage *result = [self fixOrientation:[UIImage imageWithData:imageData]];
-            BOOL isDegraded = [[info objectForKey:PHImageResultIsDegradedKey] boolValue];
-            if (completion) completion(result,info,isDegraded);
-        }
-    }];
-}
-
-- (PHImageRequestID)getOriginalPhotoDataWithAsset:(PHAsset *)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion {
-    return [self getOriginalPhotoDataWithAsset:asset progressHandler:nil completion:completion];
-}
-
-- (PHImageRequestID)getOriginalPhotoDataWithAsset:(PHAsset *)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion {
-    PHImageRequestOptions *option = [[PHImageRequestOptions alloc] init];
-    option.networkAccessAllowed = YES;
-    if ([[asset valueForKey:@"filename"] hasSuffix:@"GIF"]) {
-        // if version isn't PHImageRequestOptionsVersionOriginal, the gif may cann't play
-        option.version = PHImageRequestOptionsVersionOriginal;
-    }
-    [option setProgressHandler:progressHandler];
-    option.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
-    return [[PHImageManager defaultManager] requestImageDataForAsset:asset options:option resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
-        BOOL cancelled = [[info objectForKey:PHImageCancelledKey] boolValue];
-        if (!cancelled && imageData) {
-            if (completion) completion(imageData,info,NO);
-        }
-    }];
-}
-
-- (UIImage *)getImageWithVideoURL:(NSURL *)videoURL {
-    AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoURL options:nil];
-    if (!asset) {
-        return nil;
-    }
-    AVAssetImageGenerator *generator =[[AVAssetImageGenerator alloc] initWithAsset:asset];
-    generator.appliesPreferredTrackTransform = YES;
-    generator.apertureMode = AVAssetImageGeneratorApertureModeEncodedPixels;
-    
-    CFTimeInterval time = 0.1;
-    CGImageRef imageRef = [generator copyCGImageAtTime:CMTimeMake(time, 60) actualTime:NULL error:nil];
-    UIImage *image = [[UIImage alloc] initWithCGImage:imageRef];
-    CGImageRelease(imageRef);
-    return image;
-}
-
-#pragma mark - Save photo
-
-- (void)savePhotoWithImage:(UIImage *)image completion:(void (^)(PHAsset *asset, NSError *error))completion {
-    [self savePhotoWithImage:image location:nil completion:completion];
-}
-
-- (void)savePhotoWithImage:(UIImage *)image location:(CLLocation *)location completion:(void (^)(PHAsset *asset, NSError *error))completion {
-    __block NSString *localIdentifier = nil;
-    [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
-        PHAssetChangeRequest *request = [PHAssetChangeRequest creationRequestForAssetFromImage:image];
-        localIdentifier = request.placeholderForCreatedAsset.localIdentifier;
-        if (location) {
-            request.location = location;
-        }
-        request.creationDate = [NSDate date];
-    } completionHandler:^(BOOL success, NSError *error) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (success && completion && localIdentifier) {
-                [self fetchAssetByIocalIdentifier:localIdentifier retryCount:10 completion:completion];
-            } else {
-                if (error) {
-                    NSLog(@"保存照片出错:%@",error.localizedDescription);
-                }
-                if (completion) {
-                    completion(nil, error);
-                }
-            }
-        });
-    }];
-}
-
-- (void)savePhotoWithImage:(UIImage *)image meta:(NSDictionary *)meta location:(CLLocation *)location completion:(void (^)(PHAsset *asset, NSError *error))completion {
-    NSData *imageData = UIImageJPEGRepresentation(image, 1.0f);
-    CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
-    NSDateFormatter *formater = [[NSDateFormatter alloc] init];
-    [formater setDateFormat:@"yyyy-MM-dd-HH:mm:ss-SSS"];
-    NSString *path = [NSTemporaryDirectory() stringByAppendingFormat:@"image-%@.jpg", [formater stringFromDate:[NSDate date]]];
-    NSURL *tmpURL = [NSURL fileURLWithPath:path];
-    CGImageDestinationRef destination = CGImageDestinationCreateWithURL((__bridge CFURLRef)tmpURL, kUTTypeJPEG, 1, NULL);
-    CGImageDestinationAddImageFromSource(destination, source, 0, (__bridge CFDictionaryRef)meta);
-    CGImageDestinationFinalize(destination);
-    CFRelease(source);
-    CFRelease(destination);
-    
-    __block NSString *localIdentifier = nil;
-    [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
-        PHAssetChangeRequest *request = [PHAssetChangeRequest creationRequestForAssetFromImageAtFileURL:tmpURL];
-        localIdentifier = request.placeholderForCreatedAsset.localIdentifier;
-        if (location) {
-            request.location = location;
-        }
-        request.creationDate = [NSDate date];
-    } completionHandler:^(BOOL success, NSError *error) {
-        [[NSFileManager defaultManager] removeItemAtPath:path error:nil];
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (success && completion && localIdentifier) {
-                [self fetchAssetByIocalIdentifier:localIdentifier retryCount:10 completion:completion];
-            } else {
-                if (error) {
-                    NSLog(@"保存照片出错:%@",error.localizedDescription);
-                }
-                if (completion) {
-                    completion(nil, error);
-                }
-            }
-        });
-    }];
-}
-
-- (void)fetchAssetByIocalIdentifier:(NSString *)localIdentifier retryCount:(NSInteger)retryCount completion:(void (^)(PHAsset *asset, NSError *error))completion {
-    PHAsset *asset = [[PHAsset fetchAssetsWithLocalIdentifiers:@[localIdentifier] options:nil] firstObject];
-    if (asset || retryCount <= 0) {
-        if (completion) {
-            completion(asset, nil);
-        }
-        return;
-    }
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        [self fetchAssetByIocalIdentifier:localIdentifier retryCount:retryCount - 1 completion:completion];
-    });
-}
-
-#pragma mark - Save video
-
-- (void)saveVideoWithUrl:(NSURL *)url completion:(void (^)(PHAsset *asset, NSError *error))completion {
-    [self saveVideoWithUrl:url location:nil completion:completion];
-}
-
-- (void)saveVideoWithUrl:(NSURL *)url location:(CLLocation *)location completion:(void (^)(PHAsset *asset, NSError *error))completion {
-    __block NSString *localIdentifier = nil;
-    [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
-        PHAssetChangeRequest *request = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:url];
-        localIdentifier = request.placeholderForCreatedAsset.localIdentifier;
-        if (location) {
-            request.location = location;
-        }
-        request.creationDate = [NSDate date];
-    } completionHandler:^(BOOL success, NSError *error) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (success && completion && localIdentifier) {
-                [self fetchAssetByIocalIdentifier:localIdentifier retryCount:10 completion:completion];
-            } else {
-                if (error) {
-                    NSLog(@"保存视频出错:%@",error.localizedDescription);
-                }
-                if (completion) {
-                    completion(nil, error);
-                }
-            }
-        });
-    }];
-}
-
-#pragma mark - Get Video
-
-/// Get Video / 获取视频
-- (void)getVideoWithAsset:(PHAsset *)asset completion:(void (^)(AVPlayerItem *, NSDictionary *))completion {
-    [self getVideoWithAsset:asset progressHandler:nil completion:completion];
-}
-
-- (void)getVideoWithAsset:(PHAsset *)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(AVPlayerItem *, NSDictionary *))completion {
-    PHVideoRequestOptions *option = [[PHVideoRequestOptions alloc] init];
-    option.networkAccessAllowed = YES;
-    option.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (progressHandler) {
-                progressHandler(progress, error, stop, info);
-            }
-        });
-    };
-    [[PHImageManager defaultManager] requestPlayerItemForVideo:asset options:option resultHandler:^(AVPlayerItem *playerItem, NSDictionary *info) {
-        if (completion) completion(playerItem,info);
-    }];
-}
-
-#pragma mark - Export video
-
-/// Export Video / 导出视频
-- (void)getVideoOutputPathWithAsset:(PHAsset *)asset success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
-    [self getVideoOutputPathWithAsset:asset presetName:AVAssetExportPresetMediumQuality success:success failure:failure];
-}
-
-- (void)getVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
-    [self getVideoOutputPathWithAsset:asset presetName:presetName timeRange:kCMTimeRangeZero success:success failure:failure];
-}
-
-- (void)startExportVideoWithVideoAsset:(AVURLAsset *)videoAsset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
-    [self startExportVideoWithVideoAsset:videoAsset timeRange:kCMTimeRangeZero presetName:presetName success:success failure:failure];
-}
-
-- (void)getVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName timeRange:(CMTimeRange)timeRange success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
-    if (@available(iOS 14.0, *)) {
-        [self requestVideoOutputPathWithAsset:asset presetName:presetName timeRange:timeRange success:success failure:failure];
-        return;
-    }
-    [[PHImageManager defaultManager] requestAVAssetForVideo:asset options:[self getVideoRequestOptions] resultHandler:^(AVAsset* avasset, AVAudioMix* audioMix, NSDictionary* info){
-        // NSLog(@"Info:\n%@",info);
-        AVURLAsset *videoAsset = (AVURLAsset*)avasset;
-        // NSLog(@"AVAsset URL: %@",myAsset.URL);
-        [self startExportVideoWithVideoAsset:videoAsset timeRange:timeRange presetName:presetName success:success failure:failure];
-    }];
-}
-
-- (void)startExportVideoWithVideoAsset:(AVURLAsset *)videoAsset timeRange:(CMTimeRange)timeRange presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure  {
-    if (!presetName) {
-        presetName = AVAssetExportPresetMediumQuality;
-    }
-    // Find compatible presets by video asset.
-    NSArray *presets = [AVAssetExportSession exportPresetsCompatibleWithAsset:videoAsset];
-    // Begin to compress video
-    // Now we just compress to low resolution if it supports
-    // If you need to upload to the server, but server does't support to upload by streaming,
-    // You can compress the resolution to lower. Or you can support more higher resolution.
-    if ([presets containsObject:presetName]) {
-        AVAssetExportSession *session = [[AVAssetExportSession alloc] initWithAsset:videoAsset presetName:presetName];
-        NSString *outputPath = [self getVideoOutputPath];
-
-        // Optimize for network use.
-        session.shouldOptimizeForNetworkUse = true;
-        if (!CMTimeRangeEqual(timeRange, kCMTimeRangeZero)) {
-            session.timeRange = timeRange;
-        }
-        
-        NSArray *supportedTypeArray = session.supportedFileTypes;
-        if ([supportedTypeArray containsObject:AVFileTypeMPEG4]) {
-            session.outputFileType = AVFileTypeMPEG4;
-        } else if (supportedTypeArray.count == 0) {
-            if (failure) {
-                failure(@"该视频类型暂不支持导出", nil);
-            }
-            NSLog(@"No supported file types 视频类型暂不支持导出");
-            return;
-        } else {
-            session.outputFileType = [supportedTypeArray objectAtIndex:0];
-            if (videoAsset.URL && videoAsset.URL.lastPathComponent) {
-                outputPath = [outputPath stringByReplacingOccurrencesOfString:@".mp4" withString:[NSString stringWithFormat:@"-%@", videoAsset.URL.lastPathComponent]];
-            }
-        }
-        // NSLog(@"video outputPath = %@",outputPath);
-        session.outputURL = [NSURL fileURLWithPath:outputPath];
-        
-        if (![[NSFileManager defaultManager] fileExistsAtPath:[NSHomeDirectory() stringByAppendingFormat:@"/tmp"]]) {
-            [[NSFileManager defaultManager] createDirectoryAtPath:[NSHomeDirectory() stringByAppendingFormat:@"/tmp"] withIntermediateDirectories:YES attributes:nil error:nil];
-        }
-        
-        if ([TZImagePickerConfig sharedInstance].needFixComposition) {
-            AVMutableVideoComposition *videoComposition = [self fixedCompositionWithAsset:videoAsset];
-            if (videoComposition.renderSize.width) {
-                // 修正视频转向
-                session.videoComposition = videoComposition;
-            }
-        }
-
-        // Begin to export video to the output path asynchronously.
-        [session exportAsynchronouslyWithCompletionHandler:^(void) {
-            [self handleVideoExportResult:session outputPath:outputPath success:success failure:failure];
-        }];
-    } else {
-        if (failure) {
-            NSString *errorMessage = [NSString stringWithFormat:@"当前设备不支持该预设:%@", presetName];
-            failure(errorMessage, nil);
-        }
-    }
-}
-
-- (void)requestVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
-    [self requestVideoOutputPathWithAsset:asset presetName:presetName timeRange:kCMTimeRangeZero success:success failure:failure];
-}
-
-- (void)requestVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName timeRange:(CMTimeRange)timeRange success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
-    if (!presetName) {
-        presetName = AVAssetExportPresetMediumQuality;
-    }
-    [[PHImageManager defaultManager] requestExportSessionForVideo:asset options:[self getVideoRequestOptions] exportPreset:presetName resultHandler:^(AVAssetExportSession *_Nullable exportSession, NSDictionary *_Nullable info) {
-        NSString *outputPath = [self getVideoOutputPath];
-        exportSession.outputURL = [NSURL fileURLWithPath:outputPath];
-        exportSession.shouldOptimizeForNetworkUse = NO;
-        exportSession.outputFileType = AVFileTypeMPEG4;
-        if (!CMTimeRangeEqual(timeRange, kCMTimeRangeZero)) {
-            exportSession.timeRange = timeRange;
-        }
-        [exportSession exportAsynchronouslyWithCompletionHandler:^{
-            [self handleVideoExportResult:exportSession outputPath:outputPath success:success failure:failure];
-        }];
-    }];
-}
-
-- (void)requestVideoURLWithAsset:(PHAsset *)asset success:(void (^)(NSURL *videoURL))success failure:(void (^)(NSDictionary* info))failure {
-    [[PHImageManager defaultManager] requestAVAssetForVideo:asset options:[self getVideoRequestOptions] resultHandler:^(AVAsset* avasset, AVAudioMix* audioMix, NSDictionary* info){
-        // NSLog(@"AVAsset URL: %@",myAsset.URL);
-        if ([avasset isKindOfClass:[AVURLAsset class]]) {
-            NSURL *url = [(AVURLAsset *)avasset URL];
-            if (success) {
-                success(url);
-            }
-        } else if (failure) {
-            failure(info);
-        }
-    }];
-}
-
-- (void)handleVideoExportResult:(AVAssetExportSession *)session outputPath:(NSString *)outputPath success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        switch (session.status) {
-            case AVAssetExportSessionStatusUnknown: {
-                NSLog(@"AVAssetExportSessionStatusUnknown");
-            }  break;
-            case AVAssetExportSessionStatusWaiting: {
-                NSLog(@"AVAssetExportSessionStatusWaiting");
-            }  break;
-            case AVAssetExportSessionStatusExporting: {
-                NSLog(@"AVAssetExportSessionStatusExporting");
-            }  break;
-            case AVAssetExportSessionStatusCompleted: {
-                NSLog(@"AVAssetExportSessionStatusCompleted");
-                if (success) {
-                    success(outputPath);
-                }
-            }  break;
-            case AVAssetExportSessionStatusFailed: {
-                NSLog(@"AVAssetExportSessionStatusFailed");
-                if (failure) {
-                    failure(@"视频导出失败", session.error);
-                }
-            }  break;
-            case AVAssetExportSessionStatusCancelled: {
-                NSLog(@"AVAssetExportSessionStatusCancelled");
-                if (failure) {
-                    failure(@"导出任务已被取消", nil);
-                }
-            }  break;
-            default: break;
-        }
-    });
-}
-
-- (PHVideoRequestOptions *)getVideoRequestOptions {
-    PHVideoRequestOptions* options = [[PHVideoRequestOptions alloc] init];
-    options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
-    options.networkAccessAllowed = YES;
-    return options;
-}
-
-- (NSString *)getVideoOutputPath {
-    NSDateFormatter *formater = [[NSDateFormatter alloc] init];
-    [formater setDateFormat:@"yyyy-MM-dd-HH-mm-ss-SSS"];
-    NSString *outputPath = [NSHomeDirectory() stringByAppendingFormat:@"/tmp/video-%@-%d.mp4", [formater stringFromDate:[NSDate date]], arc4random_uniform(10000000)];
-    return outputPath;
-}
-
-- (BOOL)isCameraRollAlbum:(PHAssetCollection *)metadata {
-    NSString *versionStr = [[UIDevice currentDevice].systemVersion stringByReplacingOccurrencesOfString:@"." withString:@""];
-    if (versionStr.length <= 1) {
-        versionStr = [versionStr stringByAppendingString:@"00"];
-    } else if (versionStr.length <= 2) {
-        versionStr = [versionStr stringByAppendingString:@"0"];
-    }
-    CGFloat version = versionStr.floatValue;
-    // 目前已知8.0.0 ~ 8.0.2系统,拍照后的图片会保存在最近添加中
-    if (version >= 800 && version <= 802) {
-        return ((PHAssetCollection *)metadata).assetCollectionSubtype == PHAssetCollectionSubtypeSmartAlbumRecentlyAdded;
-    } else {
-        return ((PHAssetCollection *)metadata).assetCollectionSubtype == PHAssetCollectionSubtypeSmartAlbumUserLibrary;
-    }
-}
-
-/// 检查照片大小是否满足最小要求
-- (BOOL)isPhotoSelectableWithAsset:(PHAsset *)asset {
-    CGSize photoSize = CGSizeMake(asset.pixelWidth, asset.pixelHeight);
-    if (self.minPhotoWidthSelectable > photoSize.width || self.minPhotoHeightSelectable > photoSize.height) {
-        return NO;
-    }
-    return YES;
-}
-
-/// 检查照片能否被选中
-- (BOOL)isAssetCannotBeSelected:(PHAsset *)asset {
-    if ([self.pickerDelegate respondsToSelector:@selector(isAssetCanBeSelected:)]) {
-        BOOL canSelectAsset = [self.pickerDelegate isAssetCanBeSelected:asset];
-        return !canSelectAsset;
-    }
-    return NO;
-}
-
-#pragma mark - Private Method
-
-- (TZAlbumModel *)modelWithResult:(PHFetchResult *)result collection:(PHAssetCollection *)collection isCameraRoll:(BOOL)isCameraRoll needFetchAssets:(BOOL)needFetchAssets options:(PHFetchOptions *)options {
-    TZAlbumModel *model = [[TZAlbumModel alloc] init];
-    [model setResult:result needFetchAssets:needFetchAssets];
-    model.name = collection.localizedTitle;
-    model.collection = collection;
-    model.options = options;
-    model.isCameraRoll = isCameraRoll;
-    model.count = result.count;
-    return model;
-}
-
-/// 缩放图片至新尺寸
-- (UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)size {
-    if (image.size.width > size.width) {
-        UIGraphicsBeginImageContext(size);
-        [image drawInRect:CGRectMake(0, 0, size.width, size.height)];
-        UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
-        UIGraphicsEndImageContext();
-        return newImage;
-        
-        /* 好像不怎么管用:https://mp.weixin.qq.com/s/CiqMlEIp1Ir2EJSDGgMooQ
-        CGFloat maxPixelSize = MAX(size.width, size.height);
-        CGImageSourceRef sourceRef = CGImageSourceCreateWithData((__bridge CFDataRef)UIImageJPEGRepresentation(image, 0.9), nil);
-        NSDictionary *options = @{(__bridge id)kCGImageSourceCreateThumbnailFromImageAlways:(__bridge id)kCFBooleanTrue,
-                                  (__bridge id)kCGImageSourceThumbnailMaxPixelSize:[NSNumber numberWithFloat:maxPixelSize]
-                                  };
-        CGImageRef imageRef = CGImageSourceCreateImageAtIndex(sourceRef, 0, (__bridge CFDictionaryRef)options);
-        UIImage *newImage = [UIImage imageWithCGImage:imageRef scale:2 orientation:image.imageOrientation];
-        CGImageRelease(imageRef);
-        CFRelease(sourceRef);
-        return newImage;
-         */
-    } else {
-        return image;
-    }
-}
-
-/// 判断asset是否是视频
-- (BOOL)isVideo:(PHAsset *)asset {
-    return asset.mediaType == PHAssetMediaTypeVideo;
-}
-
-- (TZAssetModel *)createModelWithAsset:(PHAsset *)asset {
-    TZAssetModelMediaType type = [[TZImageManager manager] getAssetType:asset];
-    NSString *timeLength = type == TZAssetModelMediaTypeVideo ? [NSString stringWithFormat:@"%0.0f",asset.duration] : @"";
-    timeLength = [[TZImageManager manager] getNewTimeFromDurationSecond:timeLength.integerValue];
-    TZAssetModel *model = [TZAssetModel modelWithAsset:asset type:type timeLength:timeLength];
-    return model;
-}
-
-/// 获取优化后的视频转向信息
-- (AVMutableVideoComposition *)fixedCompositionWithAsset:(AVAsset *)videoAsset {
-    AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoComposition];
-    // 视频转向
-    int degrees = [self degressFromVideoFileWithAsset:videoAsset];
-    if (degrees != 0) {
-        CGAffineTransform translateToCenter;
-        CGAffineTransform mixedTransform;
-        videoComposition.frameDuration = CMTimeMake(1, 30);
-        
-        NSArray *tracks = [videoAsset tracksWithMediaType:AVMediaTypeVideo];
-        AVAssetTrack *videoTrack = [tracks objectAtIndex:0];
-        
-        AVMutableVideoCompositionInstruction *roateInstruction = [AVMutableVideoCompositionInstruction videoCompositionInstruction];
-        roateInstruction.timeRange = CMTimeRangeMake(kCMTimeZero, [videoAsset duration]);
-        AVMutableVideoCompositionLayerInstruction *roateLayerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:videoTrack];
-        
-        if (degrees == 90) {
-            // 顺时针旋转90°
-            translateToCenter = CGAffineTransformMakeTranslation(videoTrack.naturalSize.height, 0.0);
-            mixedTransform = CGAffineTransformRotate(translateToCenter,M_PI_2);
-            videoComposition.renderSize = CGSizeMake(videoTrack.naturalSize.height,videoTrack.naturalSize.width);
-            [roateLayerInstruction setTransform:mixedTransform atTime:kCMTimeZero];
-        } else if(degrees == 180){
-            // 顺时针旋转180°
-            translateToCenter = CGAffineTransformMakeTranslation(videoTrack.naturalSize.width, videoTrack.naturalSize.height);
-            mixedTransform = CGAffineTransformRotate(translateToCenter,M_PI);
-            videoComposition.renderSize = CGSizeMake(videoTrack.naturalSize.width,videoTrack.naturalSize.height);
-            [roateLayerInstruction setTransform:mixedTransform atTime:kCMTimeZero];
-        } else if(degrees == 270){
-            // 顺时针旋转270°
-            translateToCenter = CGAffineTransformMakeTranslation(0.0, videoTrack.naturalSize.width);
-            mixedTransform = CGAffineTransformRotate(translateToCenter,M_PI_2*3.0);
-            videoComposition.renderSize = CGSizeMake(videoTrack.naturalSize.height,videoTrack.naturalSize.width);
-            [roateLayerInstruction setTransform:mixedTransform atTime:kCMTimeZero];
-        }
-        
-        roateInstruction.layerInstructions = @[roateLayerInstruction];
-        // 加入视频方向信息
-        videoComposition.instructions = @[roateInstruction];
-    }
-    return videoComposition;
-}
-
-/// 获取视频角度
-- (int)degressFromVideoFileWithAsset:(AVAsset *)asset {
-    int degress = 0;
-    NSArray *tracks = [asset tracksWithMediaType:AVMediaTypeVideo];
-    if([tracks count] > 0) {
-        AVAssetTrack *videoTrack = [tracks objectAtIndex:0];
-        CGAffineTransform t = videoTrack.preferredTransform;
-        if(t.a == 0 && t.b == 1.0 && t.c == -1.0 && t.d == 0){
-            // Portrait
-            degress = 90;
-        } else if(t.a == 0 && t.b == -1.0 && t.c == 1.0 && t.d == 0){
-            // PortraitUpsideDown
-            degress = 270;
-        } else if(t.a == 1.0 && t.b == 0 && t.c == 0 && t.d == 1.0){
-            // LandscapeRight
-            degress = 0;
-        } else if(t.a == -1.0 && t.b == 0 && t.c == 0 && t.d == -1.0){
-            // LandscapeLeft
-            degress = 180;
-        }
-    }
-    return degress;
-}
-
-/// 修正图片转向
-- (UIImage *)fixOrientation:(UIImage *)aImage {
-    if (!self.shouldFixOrientation) return aImage;
-    
-    // No-op if the orientation is already correct
-    if (aImage.imageOrientation == UIImageOrientationUp)
-        return aImage;
-    
-    // We need to calculate the proper transformation to make the image upright.
-    // We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored.
-    CGAffineTransform transform = CGAffineTransformIdentity;
-    
-    switch (aImage.imageOrientation) {
-        case UIImageOrientationDown:
-        case UIImageOrientationDownMirrored:
-            transform = CGAffineTransformTranslate(transform, aImage.size.width, aImage.size.height);
-            transform = CGAffineTransformRotate(transform, M_PI);
-            break;
-            
-        case UIImageOrientationLeft:
-        case UIImageOrientationLeftMirrored:
-            transform = CGAffineTransformTranslate(transform, aImage.size.width, 0);
-            transform = CGAffineTransformRotate(transform, M_PI_2);
-            break;
-            
-        case UIImageOrientationRight:
-        case UIImageOrientationRightMirrored:
-            transform = CGAffineTransformTranslate(transform, 0, aImage.size.height);
-            transform = CGAffineTransformRotate(transform, -M_PI_2);
-            break;
-        default:
-            break;
-    }
-    
-    switch (aImage.imageOrientation) {
-        case UIImageOrientationUpMirrored:
-        case UIImageOrientationDownMirrored:
-            transform = CGAffineTransformTranslate(transform, aImage.size.width, 0);
-            transform = CGAffineTransformScale(transform, -1, 1);
-            break;
-            
-        case UIImageOrientationLeftMirrored:
-        case UIImageOrientationRightMirrored:
-            transform = CGAffineTransformTranslate(transform, aImage.size.height, 0);
-            transform = CGAffineTransformScale(transform, -1, 1);
-            break;
-        default:
-            break;
-    }
-    
-    // Now we draw the underlying CGImage into a new context, applying the transform
-    // calculated above.
-    CGContextRef ctx = CGBitmapContextCreate(NULL, aImage.size.width, aImage.size.height,
-                                             CGImageGetBitsPerComponent(aImage.CGImage), 0,
-                                             CGImageGetColorSpace(aImage.CGImage),
-                                             CGImageGetBitmapInfo(aImage.CGImage));
-    CGContextConcatCTM(ctx, transform);
-    switch (aImage.imageOrientation) {
-        case UIImageOrientationLeft:
-        case UIImageOrientationLeftMirrored:
-        case UIImageOrientationRight:
-        case UIImageOrientationRightMirrored:
-            // Grr...
-            CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.height,aImage.size.width), aImage.CGImage);
-            break;
-            
-        default:
-            CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.width,aImage.size.height), aImage.CGImage);
-            break;
-    }
-    
-    // And now we just create a new UIImage from the drawing context
-    CGImageRef cgimg = CGBitmapContextCreateImage(ctx);
-    UIImage *img = [UIImage imageWithCGImage:cgimg];
-    CGContextRelease(ctx);
-    CGImageRelease(cgimg);
-    return img;
-}
-
-#pragma clang diagnostic pop
-
-@end
-
-
-//@implementation TZSortDescriptor
-//
-//- (id)reversedSortDescriptor {
-//    return [NSNumber numberWithBool:![TZImageManager manager].sortAscendingByModificationDate];
-//}
-//
-//@end

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlay@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlayHL@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/VideoSendIcon@2x.png


+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ar.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "阿拉伯语";
-"OK"                      = "حسنا";
-"Back"                    = "الى الخلف";
-"Done"                    = "فعله";
-"Edit"                    = "تعديل";
-"Sorry"                   = "آسف";
-"Cancel"                  = "إلغاء";
-"Setting"                 = "ضبط";
-"Photos"                  = "الصور";
-"Videos"                  = "أشرطة فيديو";
-"Preview"                 = "معاينة";
-"Full image"              = "الصورة كاملة";
-"Processing..."           = "معالجة...";
-"No Photos or Videos"     = "لا توجد صور أو مقاطع فيديو";
-"Synchronizing photos from iCloud" = "مزامنة الصور من iCloud";
-"iCloud sync failed"    = "iCloud فشلت المزامنة";
-"Can not use camera"      = "لا يمكن استخدام الكاميرا";
-"Can not choose both video and photo" = "لا يمكن اختيار كل من الفيديو والصور";
-"Can not choose both photo and GIF" = "لا يمكن اختيار كل من الصور و GIF";
-"Select the video when in multi state, we will handle the video as a photo" = "حدد مقطع الفيديو عندما يكون في حالة متعددة، وسنعمل على معالجة مقطع الفيديو كصورة";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "إذا تعذّر الانتقال إلى صفحة "إعدادات الخصوصية"، فيرجى الانتقال إلى صفحة "الإعدادات" بنفسك، شكرًا لك";
-"Select a maximum of %zd photos" = "حدد فقط ما يصل إلى %zd صورة";
-"Select a minimum of %zd photos" = "الرجاء تحديد %zd صورة على الأقل";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "السماح لـ %@ بالوصول إلى الألبوم في \"الإعدادات > الخصوصية > الصور\"";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "الرجاء السماح لـ %@ بالوصول إلى الكاميرا في \"الإعدادات > الخصوصية > الكاميرا\"";
-"Selected for %ld seconds" = "محدد لمدة %ld ثانية";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/bg.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "保加利亚语";
-"OK"                      = "Добре";
-"Back"                    = "обратно";
-"Done"                    = "Свършен";
-"Edit"                    = "редактиране";
-"Sorry"                   = "съжалявам";
-"Cancel"                  = "Отказ";
-"Setting"                 = "обстановка";
-"Photos"                  = "Снимки";
-"Videos"                  = "Видео";
-"Preview"                 = "предварителен преглед";
-"Full image"              = "Пълно изображение";
-"Processing..."           = "Обработка ...";
-"No Photos or Videos"     = "Няма снимки или видеоклипове";
-"Synchronizing photos from iCloud" = "Синхронизиране на снимки от iCloud";
-"iCloud sync failed"    = "iCloud синхронизирането не бе успешно";
-"Can not use camera"      = "Не може да се използва камера";
-"Can not choose both video and photo" = "Не можете да изберете видео и снимка";
-"Can not choose both photo and GIF" = "Не може да се избере снимка и GIF";
-"Selected for %ld seconds" = "Избрано за %ld секунди";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/cs-CZ.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "捷克语";
-"OK"                      = "OK";
-"Back"                    = "Zadní";
-"Done"                    = "Hotovo";
-"Edit"                    = "Upravit";
-"Sorry"                   = "Promiňte";
-"Cancel"                  = "zrušení";
-"Setting"                 = "Nastavení";
-"Photos"                  = "Fotky";
-"Videos"                  = "Videa";
-"Preview"                 = "Náhled";
-"Full image"              = "Celý obrázek";
-"Processing..."           = "Zpracovává se...";
-"No Photos or Videos"     = "Žádné fotky nebo videa";
-"Synchronizing photos from iCloud" = "Synchronizace fotografií z iCloud";
-"iCloud sync failed"    = "iCloud synchronizace selhala";
-"Can not use camera"      = "Nelze použít fotoaparát";
-"Can not choose both video and photo" = "Nelze vybrat video ani fotografii";
-"Can not choose both photo and GIF" = "Nelze vybrat fotografie a GIF";
-"Selected for %ld seconds" = "Vybráno na %ld sekund";

+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/de.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "德语";
-"OK"                      = "OK";
-"Back"                    = "Zurück";
-"Done"                    = "Erledigt";
-"Edit"                    = "Bearbeiten";
-"Sorry"                   = "Es tut uns leid";
-"Cancel"                  = "Stornieren";
-"Setting"                 = "Rahmen";
-"Photos"                  = "Fotos";
-"Videos"                  = "Videos";
-"Preview"                 = "Vorschau";
-"Full image"              = "Vollbild";
-"Processing..."           = "Wird bearbeitet...";
-"No Photos or Videos"     = "Keine Fotos oder Videos";
-"Synchronizing photos from iCloud" = "Fotos aus iCloud synchronisieren";
-"iCloud sync failed"    = "iCloud Synchronisierung fehlgeschlagen";
-"Can not use camera"      = "Kann die Kamera nicht benutzen";
-"Can not choose both video and photo" = "Video und Foto können nicht ausgewählt werden";
-"Can not choose both photo and GIF" = "Foto und GIF können nicht ausgewählt werden";
-"Select the video when in multi state, we will handle the video as a photo" = "Wenn Sie das Video im Multi-Status auswählen, wird es als Foto behandelt";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "Sie können nicht zur Seite mit den Datenschutz-Einstellungen springen; bitte navigieren Sie selbst zur Einstellungsseite. Vielen Dank.";
-"Select a maximum of %zd photos" = "Wählen Sie maximal %zd Bilder aus";
-"Select a minimum of %zd photos" = "Bitte wählen Sie mindestens %zd Fotos aus";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "Erlauben Sie %@ den Zugriff auf Ihr Album unter: „Einstellungen > Datenschutz > Fotos“";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "Erlauben Sie %@ den Zugriff auf Ihre Kamera unter: „Einstellungen > Datenschutz > Kamera“";
-"Selected for %ld seconds" = "Ausgewählt für %ld Sekunden";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/el.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "希腊语";
-"OK"                      = "Εντάξει";
-"Back"                    = "Πίσω";
-"Done"                    = "Εγινε";
-"Edit"                    = "επεξεργασία";
-"Sorry"                   = "Συγνώμη";
-"Cancel"                  = "Ματαίωση";
-"Setting"                 = "Σύνθεση";
-"Photos"                  = "Φωτογραφίες";
-"Videos"                  = "Βίντεο";
-"Preview"                 = "Προεπισκόπηση";
-"Full image"              = "Πλήρης εικόνα";
-"Processing..."           = "Επεξεργασία...";
-"No Photos or Videos"     = "Δεν υπάρχουν φωτογραφίες ή βίντεο";
-"Synchronizing photos from iCloud" = "Συγχρονισμός φωτογραφιών από το iCloud";
-"iCloud sync failed"    = "iCloud Ο συγχρονισμός απέτυχε";
-"Can not use camera"      = "Δεν είναι δυνατή η χρήση της κάμερας";
-"Can not choose both video and photo" = "Δεν είναι δυνατή η επιλογή του βίντεο και της φωτογραφίας";
-"Can not choose both photo and GIF" = "Δεν είναι δυνατή η επιλογή φωτογραφίας και GIF";
-"Selected for %ld seconds" = "Selected for %ld seconds";

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/en.lproj/Localizable.strings


+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/es.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "西班牙语";
-"OK"                      = "DE ACUERDO";
-"Back"                    = "Espalda";
-"Done"                    = "Hecho";
-"Edit"                    = "επεξεργασία";
-"Sorry"                   = "Lo siento";
-"Cancel"                  = "Cancelar";
-"Setting"                 = "Ajuste";
-"Photos"                  = "Las fotos";
-"Videos"                  = "Videos";
-"Preview"                 = "Avance";
-"Full image"              = "Imagen completa";
-"Processing..."           = "Tratamiento...";
-"No Photos or Videos"     = "No hay fotos o videos";
-"Synchronizing photos from iCloud" = "Sincronizando fotos desde iCloud";
-"iCloud sync failed"    = "la sincronización falló";
-"Can not use camera"      = "No puedo usar la camara";
-"Can not choose both video and photo" = "No se puede elegir tanto el video como la foto.";
-"Can not choose both photo and GIF" = "No se puede elegir tanto foto como GIF";
-"Select the video when in multi state, we will handle the video as a photo" = "Seleccione el vídeo en estado múltiple, trataremos el vídeo como una fotografía";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "No se puede saltar a la página de ajustes de privacidad, vaya a la página de ajustes manualmente, muchas gracias";
-"Select a maximum of %zd photos" = "Seleccione solamente hasta %zd imágenes";
-"Select a minimum of %zd photos" = "Seleccione al menos %zd fotografías";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "Permita que %@ acceda a su galería en \"Ajustes > Privacidad > Fotografías\"";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "Permita que %@ acceda a su cámara en \"Ajustes > Privacidad > Cámara\"";
-"Selected for %ld seconds" = "Seleccionado para %ld segundos";

+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/fr.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "法语";
-"OK"                      = "D'accord";
-"Back"                    = "Retour";
-"Done"                    = "Terminé";
-"Edit"                    = "Éditer";
-"Sorry"                   = "Pardon";
-"Cancel"                  = "Annuler";
-"Setting"                 = "Réglage";
-"Photos"                  = "Photos";
-"Videos"                  = "Vidéos";
-"Preview"                 = "Aperçu";
-"Full image"              = "Image complète";
-"Processing..."           = "En traitement...";
-"No Photos or Videos"     = "Aucune photo ou vidéo";
-"Synchronizing photos from iCloud" = "Synchroniser des photos depuis iCloud";
-"iCloud sync failed"    = "iCloud échec de la synchronisation";
-"Can not use camera"      = "Impossible d'utiliser la caméra";
-"Can not choose both video and photo" = "Impossible de choisir à la fois la vidéo et la photo";
-"Can not choose both photo and GIF" = "Impossible de choisir à la fois photo et GIF";
-"Select the video when in multi state, we will handle the video as a photo" = "Sélectionnez la vidéo lorsqu’elle est en état multiple, nous la traiterons comme une photo";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "Impossible d'ouvrir la page des paramètres de confidentialité, veuillez accéder vous-même à la page des paramètres, merci";
-"Select a maximum of %zd photos" = "Vous pouvez uniquement sélectionner un maximum de %zd images";
-"Select a minimum of %zd photos" = "Veuillez sélectionner un minimum de %zd photos";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "Autorisez %@ à accéder à votre album dans « Paramètres > Confidentialité > Photos »";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "Autorisez %@ à accéder à votre appareil photo dans « Paramètres > Confidentialité > Appareil photo »";
-"Selected for %ld seconds" = "Sélectionné pendant %ld secondes";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/he.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "希伯来语";
-"OK"                      = "בסדר";
-"Back"                    = "חזור";
-"Done"                    = "בוצע";
-"Edit"                    = "לַעֲרוֹך"
-"Sorry"                   = "מצטער";
-"Cancel"                  = "בטל";
-"Setting"                 = "הגדרה";
-"Photos"                  = "תמונות";
-"Videos"                  = "סרטונים";
-"Preview"                 = "תצוגה מקדימה";
-"Full image"              = "תמונה מלאה";
-"Processing..."           = "מעבד...";
-"No Photos or Videos"     = "אין תמונות או סרטונים";
-"Synchronizing photos from iCloud" = "סנכרון תמונות מ - iCloud";
-"iCloud sync failed"    = "iCloud הסנכרון נכשל";
-"Can not use camera"      = "לא ניתן להשתמש במצלמה";
-"Can not choose both video and photo" = "לא ניתן לבחור הן בסרטון והן בתמונה";
-"Can not choose both photo and GIF" = "לא ניתן לבחור גם תמונה וגם קובץ GIF";
-"Selected for %ld seconds" = "נבחר למשך %ld שניות";

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/iCloudError@2x.png


+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/it.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "意大利语";
-"OK"                      = "ok";
-"Back"                    = "Indietro";
-"Done"                    = "Fatto";
-"Edit"                    = "modificare";
-"Sorry"                   = "scusate";
-"Cancel"                  = "Annulla";
-"Setting"                 = "Ambientazione";
-"Photos"                  = "Fotografie";
-"Videos"                  = "video";
-"Preview"                 = "Anteprima";
-"Full image"              = "Immagine completa";
-"Processing..."           = "In lavorazione...";
-"No Photos or Videos"     = "Nessuna foto o video";
-"Synchronizing photos from iCloud" = "Sincronizzazione delle foto da iCloud";
-"iCloud sync failed"    = "iCloud sincronizzazione non riuscita";
-"Can not use camera"      = "Non è possibile utilizzare la fotocamera";
-"Can not choose both video and photo" = "Non è possibile scegliere sia video che foto";
-"Can not choose both photo and GIF" = "Non è possibile scegliere sia foto che GIF";
-"Selected for %ld seconds" = "Selezionato per %ld secondi";

+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ja.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "日语";
-"OK"                      = "OK";
-"Back"                    = "バック";
-"Done"                    = "完了";
-"Edit"                    = "編集する";
-"Sorry"                   = "ごめんなさい";
-"Cancel"                  = "キャンセル";
-"Setting"                 = "設定";
-"Photos"                  = "写真";
-"Videos"                  = "動画";
-"Preview"                 = "プレビュー";
-"Full image"              = "フルイメージ";
-"Processing..."           = "処理...";
-"No Photos or Videos"     = "写真やビデオはありません";
-"Synchronizing photos from iCloud" = "iCloudから写真を同期する";
-"iCloud sync failed"    = "iCloud同期に失敗しました";
-"Can not use camera"      = "カメラが使えない";
-"Can not choose both video and photo" = "ビデオと写真の両方を選択することはできません";
-"Can not choose both photo and GIF" = "写真とGIFの両方を選択することはできません";
-"Select the video when in multi state, we will handle the video as a photo" = "多肢選択の状態で、ビデオを選択すると、ビデオをデフォルトに画像として送信します。";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "プライバシー設定画面にジャンプできません。手動で設定画面を表示してください。";
-"Select a maximum of %zd photos" = "写真は多くとも%zd 枚選択できます。";
-"Select a minimum of %zd photos" = "少なくとも %zd 枚の写真を選択してください。";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "iPhoneの「設定-プライバシー-写真」のオプションで、r%@の携帯電話のアルバムへのアクセス権限を許可してください。";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "iPhoneの「設定-プライバシー-カメラ」で、%@のカメラへのアクセス権限を許可してください。";
-"Selected for %ld seconds" = "%ld 秒間選択されました";

+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ko-KP.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "朝鲜语";
-"OK"                      = "그래";
-"Back"                    = "뒤로";
-"Done"                    = "완료";
-"Edit"                    = "편집하다";
-"Sorry"                   = "미안해요";
-"Cancel"                  = "취소";
-"Setting"                 = "설정";
-"Photos"                  = "사진";
-"Videos"                  = "동영상";
-"Preview"                 = "미리 보기";
-"Full image"              = "전체 이미지";
-"Processing..."           = "처리...";
-"No Photos or Videos"     = "아무 사진이 나 동영상";
-"Synchronizing photos from iCloud" = "ICloud에서 사진을 동기화";
-"iCloud sync failed"    = "iCloud동기화 실패";
-"Can not use camera"      = "카메라를 사용할 수 없습니다.";
-"Can not choose both video and photo" = "비디오와 사진 둘 다를 선택할 수 없습니다.";
-"Can not choose both photo and GIF" = "사진 및 GIF를 선택할 수 없습니다.";
-"Select the video when in multi state, we will handle the video as a photo" = "다중 선택 모드에서 비디오를 선택하면 비디오를 사진으로 처리합니다.";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "개인 정보 보호 설정 페이지로 바로 이동할 수 없습니다. 설정 페이지로 직접 이동해 주세요. 감사합니다.";
-"Select a maximum of %zd photos" = "최대 %zd장의 이미지만 선택할 수 있습니다.";
-"Select a minimum of %zd photos" = "최소 %zd장의 사진을 선택해 주세요.";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "\"설정 > 개인 정보 보호 > 사진\"에서 %@이(가) 앨범에 접근할 수 있도록 허용하세요.";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "\"설정 > 개인 정보 보호 > 카메라\"에서 %@이(가) 카메라에 접근할 수 있도록 허용하세요.";
-"Selected for %ld seconds" = "%ld 초 동안 선택됨";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ko.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "韩语";
-"OK"                      = "승인";
-"Back"                    = "뒤로";
-"Done"                    = "끝난";
-"Edit"                    = "편집하다";
-"Sorry"                   = "죄송합니다";
-"Cancel"                  = "취소";
-"Setting"                 = "환경";
-"Photos"                  = "사진들";
-"Videos"                  = "비디오";
-"Preview"                 = "시사";
-"Full image"              = "전체 이미지";
-"Processing..."           = "처리 중 ...";
-"No Photos or Videos"     = "사진이나 동영상 없음";
-"Synchronizing photos from iCloud" = "iCloud에서 사진 동기화";
-"iCloud sync failed"    = "iCloud동기화 실패";
-"Can not use camera"      = "카메라를 사용할 수 없습니다.";
-"Can not choose both video and photo" = "동영상과 사진을 모두 선택할 수 없습니다.";
-"Can not choose both photo and GIF" = "사진과 GIF를 모두 선택할 수 없습니다.";
-"Selected for %ld seconds" = "%ld 초 동안 선택됨";

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/navi_back@2x.png


+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/nl.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "荷兰语";
-"OK"                      = "OK";
-"Back"                    = "Terug";
-"Done"                    = "Gedaan";
-"Edit"                    = "Bewerk";
-"Sorry"                   = "Sorry";
-"Cancel"                  = "annuleren";
-"Setting"                 = "omgeving";
-"Photos"                  = "foto's";
-"Videos"                  = "Videos";
-"Preview"                 = "Voorbeeld";
-"Full image"              = "Volledig beeld";
-"Processing..."           = "Verwerken...";
-"No Photos or Videos"     = "Geen foto's of video's";
-"Synchronizing photos from iCloud" = "Foto's synchroniseren vanuit iCloud";
-"iCloud sync failed"    = "iCloud synchronisatie is mislukt";
-"Can not use camera"      = "Kan de camera niet gebruiken";
-"Can not choose both video and photo" = "Kan niet zowel video als foto kiezen";
-"Can not choose both photo and GIF" = "Kan niet zowel foto als GIF kiezen";
-"Selected for %ld seconds" = "Geselecteerd voor %ld seconden";

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_def_photoPickerVc@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_def_previewVc@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_number_icon@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_original_def@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_original_sel@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_sel_photoPickerVc@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/photo_sel_previewVc@2x.png


+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/pl.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "波兰语";
-"OK"                      = "dobrze";
-"Back"                    = "Z powrotem";
-"Done"                    = "Gotowe";
-"Edit"                    = "edytować";
-"Sorry"                   = "Przepraszam";
-"Cancel"                  = "Anuluj";
-"Setting"                 = "Oprawa";
-"Photos"                  = "Zdjęcia";
-"Videos"                  = "Filmy";
-"Preview"                 = "Zapowiedź";
-"Full image"              = "Pełny obraz";
-"Processing..."           = "Przetwarzanie...";
-"No Photos or Videos"     = "Brak zdjęć lub filmów";
-"Synchronizing photos from iCloud" = "Synchronizowanie zdjęć z iCloud";
-"iCloud sync failed"    = "iCloud synchronizacja nie powiodła się";
-"Can not use camera"      = "Nie można używać aparatu";
-"Can not choose both video and photo" = "Nie można wybrać zarówno wideo,jak i zdjęcia";
-"Can not choose both photo and GIF" = "Nie można wybrać zarówno zdjęcia,jak i GIF";
-"Selected for %ld seconds" = "Wybrany przez %ld sekund";

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/preview_number_icon@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/preview_original_def@2x.png


+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/pt.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "葡萄牙语";
-"OK"                      = "Está bem";
-"Back"                    = "De volta";
-"Done"                    = "Feito";
-"Edit"                    = "editar";
-"Sorry"                   = "Desculpa";
-"Cancel"                  = "Cancelar";
-"Setting"                 = "Configuração";
-"Photos"                  = "Fotos";
-"Videos"                  = "Vídeos";
-"Preview"                 = "Visualizar";
-"Full image"              = "Imagem Completa";
-"Processing..."           = "Em processamento...";
-"No Photos or Videos"     = "Sem fotos ou vídeos";
-"Synchronizing photos from iCloud" = "Sincronizando fotos do iCloud";
-"iCloud sync failed"    = "iCloud falha na sincronização";
-"Can not use camera"      = "Não pode usar a câmera";
-"Can not choose both video and photo" = "Não é possível escolher vídeo e foto";
-"Can not choose both photo and GIF" = "Não é possível escolher foto e GIF";
-"Select the video when in multi state, we will handle the video as a photo" = "Se estiver em estado múltiplo, selecione a opção vídeo; iremos utilizar o vídeo como uma foto";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "Não é possível avançar para a página de definições de privacidade, aceda à página de definições você mesmo, obrigado";
-"Select a maximum of %zd photos" = "Selecione apenas %zd imagens,no máximo";
-"Select a minimum of %zd photos" = "Selecione %zd fotos,no mínimo";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "Permita a %@ aceder ao seu álbum em “Definições > Privacidade > Fotos”";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "Permita a %@ aceder à sua câmara em “Definições > Privacidade > Câmara”";
-"Selected for %ld seconds" = "Selecionado por %ld segundos";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ro.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "罗马尼亚语";
-"OK"                      = "O.K";
-"Back"                    = "Înapoi";
-"Done"                    = "Terminat";
-"Edit"                    = "Editați | ×";
-"Sorry"                   = "scuze";
-"Cancel"                  = "Anulare";
-"Setting"                 = "reglaj";
-"Photos"                  = "Fotografii";
-"Videos"                  = "Videoclipuri";
-"Preview"                 = "previzualizare";
-"Full image"              = "Imagine completă";
-"Processing..."           = "Prelucrare...";
-"No Photos or Videos"     = "Nu există fotografii sau videoclipuri";
-"Synchronizing photos from iCloud" = "Sincronizarea fotografiilor cu iCloud";
-"iCloud sync failed"    = "iCloud sincronizarea a eșuat";
-"Can not use camera"      = "Nu pot folosi camera";
-"Can not choose both video and photo" = "Nu puteți alege atât videoclipul,cât și fotografia";
-"Can not choose both photo and GIF" = "Nu puteți alege atât fotografia,cât și GIF";
-"Selected for %ld seconds" = "Selectat pentru %ld secunde";

+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/ru.lproj/Localizable.strings

@@ -1,26 +0,0 @@
-"KEY"                     = "俄语";
-"OK"                      = "Хорошо";
-"Back"                    = "назад";
-"Done"                    = "Готово";
-"Edit"                    = "редактировать";
-"Sorry"                   = "сожалею";
-"Cancel"                  = "отменить";
-"Setting"                 = "настройка";
-"Photos"                  = "Фото";
-"Videos"                  = "Видео";
-"Preview"                 = "предварительный просмотр";
-"Full image"              = "Полное изображение";
-"Processing..."           = "Обработка ...";
-"No Photos or Videos"     = "Нет фото или видео";
-"Synchronizing photos from iCloud" = "Синхронизация фотографий из iCloud";
-"iCloud sync failed"    = "iCloud сбой синхронизации";
-"Can not use camera"      = "Не могу использовать камеру";
-"Can not choose both video and photo" = "Не могу выбрать как видео,так и фото";
-"Can not choose both photo and GIF" = "Не могу выбрать фото и GIF";
-"Select the video when in multi state, we will handle the video as a photo" = "В случае выбора видео при нахождении в мультирежиме видео будет обработано как фотография";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "Не удается перейти на страницу настроек конфиденциальности. Перейдите на эту страницу самостоятельно";
-"Select a maximum of %zd photos" = "Вы можете выбрать до %zd изображений";
-"Select a minimum of %zd photos" = "Вы можете выбрать не менее %zd изображений";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "Разрешите доступ %@ к вашему альбому,перейдя в Настройки > Конфиденциальность > Фото";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "Разрешите доступ %@ к камере вашего устройства,перейдя в Настройки > Конфиденциальность > Камера";
-"Selected for %ld seconds" = "Выбрано для %ld секунд";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/sk.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "斯洛伐克语";
-"OK"                      = "OK";
-"Back"                    = "späť";
-"Done"                    = "hotový";
-"Edit"                    = "upraviť";
-"Sorry"                   = "Prepáč";
-"Cancel"                  = "Zrušiť";
-"Setting"                 = "nastavenie";
-"Photos"                  = "fotografie";
-"Videos"                  = "videá";
-"Preview"                 = "Náhľad";
-"Full image"              = "Celý obrázok";
-"Processing..."           = "Spracovanie ...";
-"No Photos or Videos"     = "Žiadne fotografie alebo videá";
-"Synchronizing photos from iCloud" = "Synchronizácia fotografií z iCloud";
-"iCloud sync failed"    = "iCloud synchronizácia zlyhala";
-"Can not use camera"      = "Fotoaparát nie je možné používať";
-"Can not choose both video and photo" = "Nie je možné vybrať video aj fotografiu";
-"Can not choose both photo and GIF" = "Nie je možné vybrať fotografie a obrázky GIF";
-"Selected for %ld seconds" = "Vybraté na %ld sekundy";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/sv.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "瑞典语";
-"OK"                      = "ok";
-"Back"                    = "Tillbaka";
-"Done"                    = "Gjort";
-"Edit"                    = "redigera";
-"Sorry"                   = "Förlåt";
-"Cancel"                  = "Annullera";
-"Setting"                 = "Miljö";
-"Photos"                  = "foton";
-"Videos"                  = "videoklipp";
-"Preview"                 = "Förhandsvisning";
-"Full image"              = "Fullbild";
-"Processing..."           = "Bearbetning ...";
-"No Photos or Videos"     = "Inga foton eller videor";
-"Synchronizing photos from iCloud" = "Synkronisera foton från iCloud";
-"iCloud sync failed"    = "iCloud synkroniseringen misslyckades";
-"Can not use camera"      = "Kan inte använda kamera";
-"Can not choose both video and photo" = "Kan inte välja både video och foto";
-"Can not choose both photo and GIF" = "Kan inte välja både foto och GIF";
-"Selected for %ld seconds" = "Vald för %ld sekunder";

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/takePicture80@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/takePicture@2x.png


+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/th.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "泰语";
-"OK"                      = "ตกลง";
-"Back"                    = "กลับ";
-"Done"                    = "เสร็จสิ้น";
-"Edit"                    = "แก้ไข";
-"Sorry"                   = "ขอโทษ";
-"Cancel"                  = "ยกเลิก";
-"Setting"                 = "การตั้งค่า";
-"Photos"                  = "ภาพถ่าย";
-"Videos"                  = "วิดีโอ";
-"Preview"                 = "ดูตัวอย่าง";
-"Full image"              = "ภาพเต็ม";
-"Processing..."           = "กำลังประมวลผล ...";
-"No Photos or Videos"     = "ไม่มีรูปภาพหรือวิดีโอ";
-"Synchronizing photos from iCloud" = "การซิงโครไนซ์ภาพถ่ายจาก iCloud";
-"iCloud sync failed"    = "iCloud การซิงค์ล้มเหลว";
-"Can not use camera"      = "ไม่สามารถใช้กล้องถ่ายรูป";
-"Can not choose both video and photo" = "ไม่สามารถเลือกได้ทั้งวิดีโอและภาพถ่าย";
-"Can not choose both photo and GIF" = "ไม่สามารถเลือกได้ทั้งภาพถ่ายและ GIF";
-"Selected for %ld seconds" = "เลือกไว้เป็นเวลา %ld วินาที";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/tr.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "土耳其语";
-"OK"                      = "tamam";
-"Back"                    = "Geri";
-"Done"                    = "tamam";
-"Edit"                    = "Düzenle";
-"Sorry"                   = "Afedersiniz";
-"Cancel"                  = "İptal etmek";
-"Setting"                 = "Ayar";
-"Photos"                  = "Fotoğraflar";
-"Videos"                  = "Videolar";
-"Preview"                 = "Ön izleme";
-"Full image"              = "Tam görüntü";
-"Processing..."           = "İşleme...";
-"No Photos or Videos"     = "Fotoğraf veya Video Yok";
-"Synchronizing photos from iCloud" = "Fotoğrafları iCloud'dan senkronize etme";
-"iCloud sync failed"    = "iCloud senkronizasyon başarısız oldu";
-"Can not use camera"      = "Kamera kullanılamaz";
-"Can not choose both video and photo" = "Hem video hem de fotoğraf seçilemiyor";
-"Can not choose both photo and GIF" = "Hem fotoğraf hem de GIF seçilemiyor";
-"Selected for %ld seconds" = "%ld saniye için seçildi";

+ 0 - 20
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/uk.lproj/Localizable.strings

@@ -1,20 +0,0 @@
-"KEY"                     = "乌克兰语";
-"OK"                      = "в порядку";
-"Back"                    = "Назад";
-"Done"                    = "Виконано";
-"Edit"                    = "редагувати";
-"Sorry"                   = "Вибачте";
-"Cancel"                  = "Скасувати";
-"Setting"                 = "Налаштування";
-"Photos"                  = "Фотографії";
-"Videos"                  = "Відео";
-"Preview"                 = "Попередній перегляд";
-"Full image"              = "Повне зображення";
-"Processing..."           = "Обробка ...";
-"No Photos or Videos"     = "Немає фотографій або відео";
-"Synchronizing photos from iCloud" = "Синхронізація фотографій з iCloud";
-"iCloud sync failed"    = "iCloud помилка синхронізації";
-"Can not use camera"      = "Не можна використовувати камеру";
-"Can not choose both video and photo" = "Неможливо вибрати як відео,так і фото";
-"Can not choose both photo and GIF" = "Неможливо вибрати як фото,так і GIF";
-"Selected for %ld seconds" = "Đã chọn cho %ld giây";

+ 0 - 27
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/vi.lproj/Localizable.strings

@@ -1,27 +0,0 @@
-"KEY"                     = "越南语";
-"OK"                      = "Xác nhận";
-"Back"                    = "Quay lại";
-"Done"                    = "Hoàn thành";
-"Edit"                    = "biên tập";
-"Sorry"                   = "Xin lỗi";
-"Cancel"                  = "Hủy";
-"Setting"                 = "Cài đặt";
-"Photos"                  = "Hình";
-"Videos"                  = "Clip";
-"Preview"                 = "Xem trước";
-"Full image"              = "Hình gốc";
-"Processing..."           = "Đang xử lý...";
-"No Photos or Videos"     = "Không có ảnh hoặc video";
-"Can not use camera" = "Máy chụp hình không khả dụng";
-"Synchronizing photos from iCloud" = "Đang đồng bộ hình ảnh từ ICloud";
-"iCloud sync failed"    = "iCloud đồng bộ hóa không thành công";
-"Can not choose both video and photo" = "Trong lúc chọn hình ảnh không cùng lúc chọn video";
-"Can not choose both photo and GIF" = "Trong lúc chọn hình ảnh không cùng lúc chọn hình GIF";
-"Select the video when in multi state, we will handle the video as a photo" = "Chọn hình ảnh cùng video, video sẽ bị mặc nhận thành hình ảnh và gửi đi.";
-"Can not jump to the privacy settings page, please go to the settings page by self, thank you" = "Không thể chuyển tự động qua trang cài đặt riêng tư, bạn hãy thoát ra cà điều chỉnh lại, cám ơn bạn.";
-
-"Select a maximum of %zd photos" = "Bạn chỉ được chọn nhiều nhất %zd tấm hình";
-"Select a minimum of %zd photos" = "Chọn ít nhất %zd tấm hình";
-"Allow %@ to access your album in \"Settings -> Privacy -> Photos\"" = "Vui lòng tại mục iPhone \" Cài đặt – quyền riêng tư - Ảnh\" mở quyền cho phép %@ truy cập ảnh.";
-"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\"" = "Vui lòng tại mục iPhone \" Cài đặt – quyền riêng tư - Ảnh\" mở quyền cho phép %@ truy cập máy ảnh";
-"Selected for %ld seconds" = "Đã chọn cho %ld giây";

BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/zh-Hans.lproj/Localizable.strings


BIN
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.bundle/zh-Hant.lproj/Localizable.strings


+ 0 - 383
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.h

@@ -1,383 +0,0 @@
-//
-//  TZImagePickerController.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//  version 3.7.2 - 2022.01.12
-//  更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
-
-/*
- 经过测试,比起xib的方式,把TZAssetCell改用纯代码的方式来写,滑动帧数明显提高了(约提高10帧左右)
- 
- 最初发现这个问题并修复的是@小鱼周凌宇同学,她的博客地址: http://zhoulingyu.com/
- 表示感谢~
- 
- 原来xib确实会导致性能问题啊...大家也要注意了...
- */
-
-#import <UIKit/UIKit.h>
-#import "TZAssetModel.h"
-#import "NSBundle+TZImagePicker.h"
-#import "TZImageManager.h"
-#import "TZVideoPlayerController.h"
-#import "TZGifPhotoPreviewController.h"
-#import "TZLocationManager.h"
-#import "TZPhotoPreviewController.h"
-#import "TZPhotoPreviewCell.h"
-
-@class TZAlbumCell, TZAssetCell;
-@protocol TZImagePickerControllerDelegate;
-@interface TZImagePickerController : UINavigationController
-
-#pragma mark -
-/// Use this init method / 用这个初始化方法
-- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount delegate:(id<TZImagePickerControllerDelegate>)delegate;
-- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id<TZImagePickerControllerDelegate>)delegate;
-- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id<TZImagePickerControllerDelegate>)delegate pushPhotoPickerVc:(BOOL)pushPhotoPickerVc;
-/// This init method just for previewing photos / 用这个初始化方法以预览图片
-- (instancetype)initWithSelectedAssets:(NSMutableArray *)selectedAssets selectedPhotos:(NSMutableArray *)selectedPhotos index:(NSInteger)index;
-/// This init method for crop photo / 用这个初始化方法以裁剪图片
-- (instancetype)initCropTypeWithAsset:(PHAsset *)asset photo:(UIImage *)photo completion:(void (^)(UIImage *cropImage,PHAsset *asset))completion;
-
-#pragma mark -
-/// Default is 9 / 默认最大可选9张图片
-@property (nonatomic, assign) NSInteger maxImagesCount;
-
-/// The minimum count photos user must pick, Default is 0
-/// 最小照片必选张数,默认是0
-@property (nonatomic, assign) NSInteger minImagesCount;
-
-/// If the user does not select any pictures, the current picture is automatically selected when the Finish button is clicked,  Default is YES
-/// 如果用户未选择任何图片,在点击完成按钮时自动选中当前图片,默认YES
-@property (nonatomic, assign) BOOL autoSelectCurrentWhenDone;
-
-/// Always enale the done button, not require minimum 1 photo be picked
-/// 让完成按钮一直可以点击,无须最少选择一张图片
-@property (nonatomic, assign) BOOL alwaysEnableDoneBtn;
-
-/// Sort photos ascending by modificationDate,Default is YES
-/// 对照片排序,按修改时间升序,默认是YES。如果设置为NO,最新的照片会显示在最前面,内部的拍照按钮会排在第一个
-@property (nonatomic, assign) BOOL sortAscendingByModificationDate;
-
-/// The pixel width of output image, Default is 828px,you need to set photoPreviewMaxWidth at the same time
-/// 导出图片的宽度,默认828像素宽,你需要同时设置photoPreviewMaxWidth的值
-@property (nonatomic, assign) CGFloat photoWidth;
-
-/// Default is 600px / 默认600像素宽
-@property (nonatomic, assign) CGFloat photoPreviewMaxWidth;
-
-/// Default is 30, While fetching photo, HUD will dismiss automatic if timeout;
-/// 超时时间,默认为30秒,当取图片时间超过30秒还没有取成功时,会自动dismiss HUD;
-@property (nonatomic, assign) NSInteger timeout;
-
-/// Default is YES, if set NO, the original photo button will hide. user can't picking original photo.
-/// 默认为YES,如果设置为NO,原图按钮将隐藏,用户不能选择发送原图
-@property (nonatomic, assign) BOOL allowPickingOriginalPhoto;
-
-/// Default is YES, if set NO, user can't picking video.
-/// 默认为YES,如果设置为NO,用户将不能选择视频
-@property (nonatomic, assign) BOOL allowPickingVideo;
-
-/// Default is NO, if set YES, user can edit video.
-/// 默认为NO,如果设置为YES, 用户能编辑视频
-@property (nonatomic, assign) BOOL allowEditVideo;
-
-/// Export quality of cropped video, Default is AVAssetExportPresetMediumQuality
-/// 裁剪视频的导出质量,默认是 AVAssetExportPresetMediumQuality
-@property (nonatomic, assign) NSString *presetName;
-
-/// Default is 30s. If it exceeds the video duration, it is the video duration.The minimum duration of video crop is 1s.
-/// 默认是30s,如果超过视频时长,则为视频时长,小于1s不裁剪
-@property (nonatomic, assign) NSInteger maxCropVideoDuration;
-
-/// Default is NO, if set YES, The edited video will be automatically saved to the album.
-/// 默认为NO,如果设置为YES,编辑后的视频会自动保存到相册
-@property (nonatomic, assign) BOOL saveEditedVideoToAlbum;
-
-/// Default is NO / 默认为NO,为YES时可以多选视频/gif/图片,和照片共享最大可选张数maxImagesCount的限制
-@property (nonatomic, assign) BOOL allowPickingMultipleVideo;
-
-/// Default is NO, if set YES, user can picking gif image.
-/// 默认为NO,如果设置为YES,用户可以选择gif图片
-@property (nonatomic, assign) BOOL allowPickingGif;
-
-/// Default is YES, if set NO, user can't picking image.
-/// 默认为YES,如果设置为NO,用户将不能选择发送图片
-@property (nonatomic, assign) BOOL allowPickingImage;
-
-/// Default is YES, if set NO, user can't take picture.
-/// 默认为YES,如果设置为NO, 用户将不能拍摄照片
-@property (nonatomic, assign) BOOL allowTakePicture;
-@property (nonatomic, assign) BOOL allowCameraLocation;
-
-/// Default is YES, if set NO, user can't take video.
-/// 默认为YES,如果设置为NO, 用户将不能拍摄视频
-@property(nonatomic, assign) BOOL allowTakeVideo;
-/// Default value is 10 minutes / 视频最大拍摄时间,默认是10分钟,单位是秒
-@property (assign, nonatomic) NSTimeInterval videoMaximumDuration;
-/// Customizing UIImagePickerController's other properties, such as videoQuality / 定制UIImagePickerController的其它属性,比如视频拍摄质量videoQuality
-@property (nonatomic, copy) void(^uiImagePickerControllerSettingBlock)(UIImagePickerController *imagePickerController);
-
-/// 首选语言,如果设置了就用该语言,不设则取当前系统语言。
-/// 支持zh-Hans、zh-Hant、en、vi等值,详见TZImagePickerController.bundle内的语言资源
-@property (copy, nonatomic) NSString *preferredLanguage;
-
-/// 语言bundle,preferredLanguage变化时languageBundle会变化
-/// 可通过手动设置bundle,让选择器支持新的的语言(需要在设置preferredLanguage后设置languageBundle)。欢迎提交PR把语言文件提交上来~
-@property (strong, nonatomic) NSBundle *languageBundle;
-
-/// Default is YES, if set NO, user can't preview photo.
-/// 默认为YES,如果设置为NO,预览按钮将隐藏,用户将不能去预览照片
-@property (nonatomic, assign) BOOL allowPreview;
-
-/// Default is YES, if set NO, the picker don't dismiss itself.
-/// 默认为YES,如果设置为NO, 选择器将不会自己dismiss
-@property(nonatomic, assign) BOOL autoDismiss;
-
-/// Default is NO, if set YES, in the delegate method the photos and infos will be nil, only assets hava value.
-/// 默认为NO,如果设置为YES,代理方法里photos和infos会是nil,只返回assets
-@property (assign, nonatomic) BOOL onlyReturnAsset;
-
-/// Default is NO, if set YES, will show the image's selected index.
-/// 默认为NO,如果设置为YES,会显示照片的选中序号
-@property (assign, nonatomic) BOOL showSelectedIndex;
-
-/// Default is NO, if set YES, when selected photos's count up to maxImagesCount, other photo will show float layer what's color is cannotSelectLayerColor.
-/// 默认是NO,如果设置为YES,当照片选择张数达到maxImagesCount时,其它照片会显示颜色为cannotSelectLayerColor的浮层
-@property (assign, nonatomic) BOOL showPhotoCannotSelectLayer;
-/// Default is white color with 0.8 alpha;
-@property (strong, nonatomic) UIColor *cannotSelectLayerColor;
-
-/// Default is YES, if set NO, the result photo will be scaled to photoWidth pixel width. The photoWidth default is 828px
-/// 默认是YES,如果设置为NO,内部会缩放图片到photoWidth像素宽
-@property (assign, nonatomic) BOOL notScaleImage;
-
-/// 默认是NO,如果设置为YES,导出视频时会修正转向(慎重设为YES,可能导致部分安卓下拍的视频导出失败)
-@property (assign, nonatomic) BOOL needFixComposition;
-
-/// The photos user have selected
-/// 用户选中过的图片数组
-@property (nonatomic, strong) NSMutableArray *selectedAssets;
-@property (nonatomic, strong) NSMutableArray<TZAssetModel *> *selectedModels;
-@property (nonatomic, strong) NSMutableArray *selectedAssetIds;
-- (void)addSelectedModel:(TZAssetModel *)model;
-- (void)removeSelectedModel:(TZAssetModel *)model;
-
-/// Minimum selectable photo width, Default is 0
-/// 最小可选中的图片宽度,默认是0,小于这个宽度的图片不可选中
-@property (nonatomic, assign) NSInteger minPhotoWidthSelectable;
-@property (nonatomic, assign) NSInteger minPhotoHeightSelectable;
-/// Hide the photo what can not be selected, Default is NO
-/// 隐藏不可以选中的图片,默认是NO,不推荐将其设置为YES
-@property (nonatomic, assign) BOOL hideWhenCanNotSelect;
-/// Deprecated, Use statusBarStyle (顶部statusBar 是否为系统默认的黑色,默认为NO)
-@property (nonatomic, assign) BOOL isStatusBarDefault __attribute__((deprecated("Use -statusBarStyle.")));
-/// statusBar的样式,默认为UIStatusBarStyleLightContent
-@property (assign, nonatomic) UIStatusBarStyle statusBarStyle;
-
-#pragma mark -
-/// Single selection mode, valid when maxImagesCount = 1
-/// 单选模式,maxImagesCount为1时才生效
-@property (nonatomic, assign) BOOL showSelectBtn;        ///< 在单选模式下,照片列表页中,显示选择按钮,默认为NO
-@property (nonatomic, assign) BOOL allowCrop;            ///< 允许裁剪,默认为YES,showSelectBtn为NO才生效
-@property (nonatomic, assign) BOOL scaleAspectFillCrop;  ///< 是否图片等比缩放填充cropRect区域,开启后预览页面无法左右滑动切换图片
-@property (nonatomic, assign) CGRect cropRect;           ///< 裁剪框的尺寸
-@property (nonatomic, assign) CGRect cropRectPortrait;   ///< 裁剪框的尺寸(竖屏)
-@property (nonatomic, assign) CGRect cropRectLandscape;  ///< 裁剪框的尺寸(横屏)
-@property (nonatomic, assign) BOOL needCircleCrop;       ///< 需要圆形裁剪框
-@property (nonatomic, assign) NSInteger circleCropRadius;  ///< 圆形裁剪框半径大小
-@property (nonatomic, copy) void (^cropViewSettingBlock)(UIView *cropView);     ///< 自定义裁剪框的其他属性
-@property (nonatomic, copy) void (^navLeftBarButtonSettingBlock)(UIButton *leftButton);     ///< 自定义返回按钮样式及其属性
-
-/// 【自定义各页面/组件的样式】在界面初始化/组件setModel完成后调用,允许外界修改样式等
-@property (nonatomic, copy) void (^photoPickerPageUIConfigBlock)(UICollectionView *collectionView, UIView *bottomToolBar, UIButton *previewButton, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel, UIView *divideLine);
-@property (nonatomic, copy) void (^photoPreviewPageUIConfigBlock)(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel);
-@property (nonatomic, copy) void (^videoPreviewPageUIConfigBlock)(UIButton *playButton, UIView *toolBar, UIButton *editBtn, UIButton *doneButton);
-@property (nonatomic, copy) void (^videoEditViewPageUIConfigBlock)(UIButton *playButton,UILabel *cropVideoDurationLabel, UIButton *editButton, UIButton *doneButton);
-@property (nonatomic, copy) void (^gifPreviewPageUIConfigBlock)(UIView *toolBar, UIButton *doneButton);
-@property (nonatomic, copy) void (^albumPickerPageUIConfigBlock)(UITableView *tableView);
-@property (nonatomic, copy) void (^assetCellDidSetModelBlock)(TZAssetCell *cell, UIImageView *imageView, UIImageView *selectImageView, UILabel *indexLabel, UIView *bottomView, UILabel *timeLength, UIImageView *videoImgView);
-@property (nonatomic, copy) void (^albumCellDidSetModelBlock)(TZAlbumCell *cell, UIImageView *posterImageView, UILabel *titleLabel);
-/// 【自定义各页面/组件的frame】在界面viewDidLayoutSubviews/组件layoutSubviews后调用,允许外界修改frame等
-@property (nonatomic, copy) void (^photoPickerPageDidLayoutSubviewsBlock)(UICollectionView *collectionView, UIView *bottomToolBar, UIButton *previewButton, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel, UIView *divideLine);
-@property (nonatomic, copy) void (^photoPreviewPageDidLayoutSubviewsBlock)(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel);
-@property (nonatomic, copy) void (^videoPreviewPageDidLayoutSubviewsBlock)(UIButton *playButton, UIView *toolBar, UIButton *editButton, UIButton *doneButton);
-@property (nonatomic, copy) void (^videoEditViewPageDidLayoutSubviewsBlock)(UIButton *playButton, UILabel *cropVideoDurationLabel, UIButton *cancelButton, UIButton *doneButton);
-@property (nonatomic, copy) void (^gifPreviewPageDidLayoutSubviewsBlock)(UIView *toolBar, UIButton *doneButton);
-@property (nonatomic, copy) void (^albumPickerPageDidLayoutSubviewsBlock)(UITableView *tableView);
-@property (nonatomic, copy) void (^assetCellDidLayoutSubviewsBlock)(TZAssetCell *cell, UIImageView *imageView, UIImageView *selectImageView, UILabel *indexLabel, UIView *bottomView, UILabel *timeLength, UIImageView *videoImgView);
-@property (nonatomic, copy) void (^albumCellDidLayoutSubviewsBlock)(TZAlbumCell *cell, UIImageView *posterImageView, UILabel *titleLabel);
-/// 自定义各页面/组件的frame】刷新底部状态(refreshNaviBarAndBottomBarState)使用的
-@property (nonatomic, copy) void (^photoPickerPageDidRefreshStateBlock)(UICollectionView *collectionView, UIView *bottomToolBar, UIButton *previewButton, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel, UIView *divideLine);
-
-@property (nonatomic, copy) void (^photoPreviewPageDidRefreshStateBlock)(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel);
-
-#pragma mark -
-- (UIAlertController *)showAlertWithTitle:(NSString *)title;
-- (void)showProgressHUD;
-- (void)hideProgressHUD;
-@property (nonatomic, assign) BOOL isSelectOriginalPhoto;
-@property (assign, nonatomic) BOOL needShowStatusBar;
-
-#pragma mark -
-@property (nonatomic, copy) NSString *takePictureImageName __attribute__((deprecated("Use -takePictureImage.")));
-@property (nonatomic, copy) NSString *photoSelImageName __attribute__((deprecated("Use -photoSelImage.")));
-@property (nonatomic, copy) NSString *photoDefImageName __attribute__((deprecated("Use -photoDefImage.")));
-@property (nonatomic, copy) NSString *photoOriginSelImageName __attribute__((deprecated("Use -photoOriginSelImage.")));
-@property (nonatomic, copy) NSString *photoOriginDefImageName __attribute__((deprecated("Use -photoOriginDefImage.")));
-@property (nonatomic, copy) NSString *photoPreviewOriginDefImageName __attribute__((deprecated("Use -photoPreviewOriginDefImage.")));
-@property (nonatomic, copy) NSString *photoNumberIconImageName __attribute__((deprecated("Use -photoNumberIconImage.")));
-@property (nonatomic, strong) UIImage *takePictureImage;
-@property (nonatomic, strong) UIImage *photoSelImage;
-@property (nonatomic, strong) UIImage *photoDefImage;
-@property (nonatomic, strong) UIImage *photoOriginSelImage;
-@property (nonatomic, strong) UIImage *photoOriginDefImage;
-@property (nonatomic, strong) UIImage *photoPreviewOriginDefImage;
-@property (nonatomic, strong) UIImage *photoNumberIconImage;
-
-#pragma mark -
-/// Appearance / 外观颜色 + 按钮文字
-@property (nonatomic, strong) UIColor *oKButtonTitleColorNormal;
-@property (nonatomic, strong) UIColor *oKButtonTitleColorDisabled;
-@property (nonatomic, strong) UIColor *naviBgColor;
-@property (nonatomic, strong) UIColor *naviTitleColor;
-@property (nonatomic, strong) UIFont *naviTitleFont;
-@property (nonatomic, strong) UIColor *barItemTextColor;
-@property (nonatomic, strong) UIFont *barItemTextFont;
-
-@property (nonatomic, copy) NSString *doneBtnTitleStr;
-@property (nonatomic, copy) NSString *cancelBtnTitleStr;
-@property (nonatomic, copy) NSString *previewBtnTitleStr;
-@property (nonatomic, copy) NSString *fullImageBtnTitleStr;
-@property (nonatomic, copy) NSString *settingBtnTitleStr;
-@property (nonatomic, copy) NSString *processHintStr;
-@property (nonatomic, copy) NSString *editBtnTitleStr;
-@property (nonatomic, copy) NSString *editViewCancelBtnTitleStr;
-
-/// Icon theme color, default is green color like wechat, the value is r:31 g:185 b:34. Currently only support image selection icon when showSelectedIndex is YES. If you need it, please set it as soon as possible
-/// icon主题色,默认是微信的绿色,值是r:31 g:185 b:34。目前仅支持showSelectedIndex为YES时的图片选中icon。如需要,请尽早设置它。
-@property (strong, nonatomic) UIColor *iconThemeColor;
-
-#pragma mark -
-- (void)cancelButtonClick;
-
-// For method annotations, see the corresponding method in TZImagePickerControllerDelegate / 方法注释见TZImagePickerControllerDelegate中对应方法
-@property (nonatomic, copy) void (^didFinishPickingPhotosHandle)(NSArray<UIImage *> *photos,NSArray *assets,BOOL isSelectOriginalPhoto);
-@property (nonatomic, copy) void (^didFinishPickingPhotosWithInfosHandle)(NSArray<UIImage *> *photos,NSArray *assets,BOOL isSelectOriginalPhoto,NSArray<NSDictionary *> *infos);
-@property (nonatomic, copy) void (^imagePickerControllerDidCancelHandle)(void);
-@property (nonatomic, copy) void (^didFinishPickingVideoHandle)(UIImage *coverImage,PHAsset *asset);
-@property (nonatomic, copy) void (^didFinishPickingAndEditingVideoHandle)(UIImage *coverImage,NSString *outputPath,NSString *errorMsg);
-@property (nonatomic, copy) void (^didFinishPickingGifImageHandle)(UIImage *animatedImage,id sourceAssets);
-
-@property (nonatomic, weak) id<TZImagePickerControllerDelegate> pickerDelegate;
-
-@end
-
-
-@protocol TZImagePickerControllerDelegate <NSObject>
-@optional
-// The picker should dismiss itself; when it dismissed these callback will be called.
-// You can also set autoDismiss to NO, then the picker don't dismiss itself.
-// If isOriginalPhoto is YES, user picked the original photo.
-// You can get original photo with asset, by the method [[TZImageManager manager] getOriginalPhotoWithAsset:completion:].
-// The UIImage Object in photos default width is 828px, you can set it by photoWidth property.
-// 这个照片选择器会自己dismiss,当选择器dismiss的时候,会执行下面的代理方法
-// 你也可以设置autoDismiss属性为NO,选择器就不会自己dismis了
-// 如果isSelectOriginalPhoto为YES,表明用户选择了原图
-// 你可以通过一个asset获得原图,通过这个方法:[[TZImageManager manager] getOriginalPhotoWithAsset:completion:]
-// photos数组里的UIImage对象,默认是828像素宽,你可以通过设置photoWidth属性的值来改变它
-- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto;
-- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos;
-- (void)tz_imagePickerControllerDidCancel:(TZImagePickerController *)picker;
-
-/// 如果用户选择了某张照片下面的代理方法会被执行
-/// 如果isSelectOriginalPhoto为YES,表明用户选择了原图
-/// 你可以通过一个asset获得原图,通过这个方法:[[TZImageManager manager] getOriginalPhotoWithAsset:completion:]
-- (void)imagePickerController:(TZImagePickerController *)picker didSelectAsset:(PHAsset *)asset photo:(UIImage *)photo isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto;
-
-/// 如果用户取消选择了某张照片下面的代理方法会被执行
-/// 如果isSelectOriginalPhoto为YES,表明用户选择了原图
-/// 你可以通过一个asset获得原图,通过这个方法:[[TZImageManager manager] getOriginalPhotoWithAsset:completion:]
-- (void)imagePickerController:(TZImagePickerController *)picker didDeselectAsset:(PHAsset *)asset photo:(UIImage *)photo isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto;
-
-// If user picking a video and allowPickingMultipleVideo is NO, this callback will be called.
-// If allowPickingMultipleVideo is YES, will call imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:
-// 如果用户选择了一个视频且allowPickingMultipleVideo是NO,下面的代理方法会被执行
-// 如果allowPickingMultipleVideo是YES,将会调用imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:
-- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingVideo:(UIImage *)coverImage sourceAssets:(PHAsset *)asset;
-
-// If allowEditVideo is YES and allowPickingMultipleVideo is NO, When user picking a video, this callback will be called.
-// If allowPickingMultipleVideo is YES, video editing is not supported, will call imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:
-// 当allowEditVideo是YES且allowPickingMultipleVideo是NO是,如果用户选择了一个视频,下面的代理方法会被执行
-// 如果allowPickingMultipleVideo是YES,则不支持编辑视频,将会调用imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:
-- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingAndEditingVideo:(UIImage *)coverImage outputPath:(NSString *)outputPath error:(NSString *)errorMsg;
-
-// When saving the edited video to the album fails, this callback will be called.
-// 编辑后的视频自动保存到相册失败时,下面的代理方法会被执行
-- (void)imagePickerController:(TZImagePickerController *)picker didFailToSaveEditedVideoWithError:(NSError *)error;
-
-// If user picking a gif image and allowPickingMultipleVideo is NO, this callback will be called.
-// If allowPickingMultipleVideo is YES, will call imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:
-// 如果用户选择了一个gif图片且allowPickingMultipleVideo是NO,下面的代理方法会被执行
-// 如果allowPickingMultipleVideo是YES,将会调用imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:
-- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingGifImage:(UIImage *)animatedImage sourceAssets:(PHAsset *)asset;
-
-// Decide album show or not't
-// 决定相册显示与否 albumName:相册名字 result:相册原始数据
-- (BOOL)isAlbumCanSelect:(NSString *)albumName result:(PHFetchResult *)result;
-
-// Decide asset show or not't
-// 决定照片显示与否
-- (BOOL)isAssetCanSelect:(PHAsset *)asset __attribute__((deprecated("Use -isAssetCanBeDisplayed:.")));
-- (BOOL)isAssetCanBeDisplayed:(PHAsset *)asset;
-
-// Decide asset can be selected
-// 决定照片能否被选中
-- (BOOL)isAssetCanBeSelected:(PHAsset *)asset;
-@end
-
-
-@interface TZAlbumPickerController : UIViewController
-@property (nonatomic, assign) NSInteger columnNumber;
-@property (assign, nonatomic) BOOL isFirstAppear;
-- (void)configTableView;
-@end
-
-
-@interface UIImage (MyBundle)
-+ (UIImage *)tz_imageNamedFromMyBundle:(NSString *)name;
-@end
-
-
-@interface TZCommonTools : NSObject
-+ (UIEdgeInsets)tz_safeAreaInsets;
-+ (BOOL)tz_isIPhoneX;
-+ (BOOL)tz_isLandscape;
-+ (CGFloat)tz_statusBarHeight;
-// 获得Info.plist数据字典
-+ (NSDictionary *)tz_getInfoDictionary;
-+ (NSString *)tz_getAppName;
-+ (BOOL)tz_isRightToLeftLayout;
-+ (void)configBarButtonItem:(UIBarButtonItem *)item tzImagePickerVc:(TZImagePickerController *)tzImagePickerVc;
-+ (BOOL)isICloudSyncError:(NSError *)error;
-+ (BOOL)isAssetNotSelectable:(TZAssetModel *)model tzImagePickerVc:(TZImagePickerController *)tzImagePickerVc;
-@end
-
-
-@interface TZImagePickerConfig : NSObject
-+ (instancetype)sharedInstance;
-@property (copy, nonatomic) NSString *preferredLanguage;
-@property(nonatomic, assign) BOOL allowPickingImage;
-@property (nonatomic, assign) BOOL allowPickingVideo;
-@property (strong, nonatomic) NSBundle *languageBundle;
-@property (assign, nonatomic) BOOL showSelectedIndex;
-@property (assign, nonatomic) BOOL showPhotoCannotSelectLayer;
-@property (assign, nonatomic) BOOL notScaleImage;
-@property (assign, nonatomic) BOOL needFixComposition;
-
-/// 默认是50,如果一个GIF过大,里面图片个数可能超过1000,会导致内存飙升而崩溃
-@property (assign, nonatomic) NSInteger gifPreviewMaxImagesCount;
-/// 【自定义GIF播放方案】为了避免内存过大,内部默认限制只播放50帧(平均取),可通过gifPreviewMaxImagesCount属性调整,若对GIF预览有更好的效果要求,可实现这个block采用FLAnimatedImage等三方库来播放,但注意FLAnimatedImage有播放速度较慢问题,自行取舍下。
-@property (nonatomic, copy) void (^gifImagePlayBlock)(TZPhotoPreviewView *view, UIImageView *imageView, NSData *gifData, NSDictionary *info);
-@end

+ 0 - 1097
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImagePickerController.m

@@ -1,1097 +0,0 @@
-//
-//  TZImagePickerController.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//  version 3.7.2 - 2022.01.12
-//  更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
-
-#import "TZImagePickerController.h"
-#import "TZPhotoPickerController.h"
-#import "TZPhotoPreviewController.h"
-#import "TZAssetModel.h"
-#import "TZAssetCell.h"
-#import "UIView+TZLayout.h"
-#import "TZImageManager.h"
-#import "TZVideoCropController.h"
-
-@interface TZImagePickerController () {
-    NSTimer *_timer;
-    UILabel *_tipLabel;
-    UIButton *_settingBtn;
-    BOOL _pushPhotoPickerVc;
-    BOOL _didPushPhotoPickerVc;
-    CGRect _cropRect;
-    
-    UIButton *_progressHUD;
-    UIView *_HUDContainer;
-    UIActivityIndicatorView *_HUDIndicatorView;
-    UILabel *_HUDLabel;
-    
-    UIStatusBarStyle _originStatusBarStyle;
-}
-/// Default is 4, Use in photos collectionView in TZPhotoPickerController
-/// 默认4列, TZPhotoPickerController中的照片collectionView
-@property (nonatomic, assign) NSInteger columnNumber;
-@property (nonatomic, assign) NSInteger HUDTimeoutCount; ///< 超时隐藏HUD计数
-@end
-
-@implementation TZImagePickerController
-
-- (instancetype)init {
-    self = [super init];
-    if (self) {
-        self = [self initWithMaxImagesCount:9 delegate:nil];
-    }
-    return self;
-}
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    self.needShowStatusBar = ![UIApplication sharedApplication].statusBarHidden;
-    if (@available(iOS 13.0, *)) {
-        self.view.backgroundColor = UIColor.tertiarySystemBackgroundColor;
-    } else {
-        self.view.backgroundColor = [UIColor whiteColor];
-    }
-    self.navigationBar.barStyle = UIBarStyleBlack;
-    self.navigationBar.translucent = NO;
-    [TZImageManager manager].shouldFixOrientation = NO;
-
-    // Default appearance, you can reset these after this method
-    // 默认的外观,你可以在这个方法后重置
-    self.oKButtonTitleColorNormal   = [UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0];
-    self.oKButtonTitleColorDisabled = [UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:0.5];
-    
-    self.navigationBar.barTintColor = [UIColor colorWithRed:(34/255.0) green:(34/255.0)  blue:(34/255.0) alpha:1.0];
-    self.navigationBar.tintColor = [UIColor whiteColor];
-    self.automaticallyAdjustsScrollViewInsets = NO;
-    if (self.needShowStatusBar) [UIApplication sharedApplication].statusBarHidden = NO;
-}
-
-- (void)setNaviBgColor:(UIColor *)naviBgColor {
-    _naviBgColor = naviBgColor;
-    self.navigationBar.barTintColor = naviBgColor;
-    [self configNavigationBarAppearance];
-}
-
-- (void)setNaviTitleColor:(UIColor *)naviTitleColor {
-    _naviTitleColor = naviTitleColor;
-    [self configNaviTitleAppearance];
-}
-
-- (void)setNaviTitleFont:(UIFont *)naviTitleFont {
-    _naviTitleFont = naviTitleFont;
-    [self configNaviTitleAppearance];
-}
-
-- (void)configNaviTitleAppearance {
-    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
-    if (self.naviTitleColor) {
-        textAttrs[NSForegroundColorAttributeName] = self.naviTitleColor;
-    }
-    if (self.naviTitleFont) {
-        textAttrs[NSFontAttributeName] = self.naviTitleFont;
-    }
-    self.navigationBar.titleTextAttributes = textAttrs;
-    [self configNavigationBarAppearance];
-}
-
-- (void)configNavigationBarAppearance {
-    if (@available(iOS 13.0, *)) {
-        UINavigationBarAppearance *barAppearance = [[UINavigationBarAppearance alloc] init];
-        if (self.navigationBar.isTranslucent) {
-            UIColor *barTintColor = self.navigationBar.barTintColor;
-            barAppearance.backgroundColor = [barTintColor colorWithAlphaComponent:0.85];
-        } else {
-            barAppearance.backgroundColor = self.navigationBar.barTintColor;
-        }
-        barAppearance.titleTextAttributes = self.navigationBar.titleTextAttributes;
-        self.navigationBar.standardAppearance = barAppearance;
-        self.navigationBar.scrollEdgeAppearance = barAppearance;
-    }
-}
-
-- (void)setBarItemTextFont:(UIFont *)barItemTextFont {
-    _barItemTextFont = barItemTextFont;
-    [self configBarButtonItemAppearance];
-}
-
-- (void)setBarItemTextColor:(UIColor *)barItemTextColor {
-    _barItemTextColor = barItemTextColor;
-    [self configBarButtonItemAppearance];
-}
-
-- (void)setIsStatusBarDefault:(BOOL)isStatusBarDefault {
-    _isStatusBarDefault = isStatusBarDefault;
-    
-    if (isStatusBarDefault) {
-        self.statusBarStyle = UIStatusBarStyleDefault;
-    } else {
-        self.statusBarStyle = UIStatusBarStyleLightContent;
-    }
-}
-
-- (void)configBarButtonItemAppearance {
-    UIBarButtonItem *barItem;
-    if (@available(iOS 9, *)) {
-        barItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]];
-    } else {
-        barItem = [UIBarButtonItem appearanceWhenContainedIn:[TZImagePickerController class], nil];
-    }
-    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
-    textAttrs[NSForegroundColorAttributeName] = self.barItemTextColor;
-    textAttrs[NSFontAttributeName] = self.barItemTextFont;
-    [barItem setTitleTextAttributes:textAttrs forState:UIControlStateNormal];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    _originStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
-    [UIApplication sharedApplication].statusBarStyle = self.statusBarStyle;
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    [UIApplication sharedApplication].statusBarStyle = _originStatusBarStyle;
-    [self hideProgressHUD];
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle {
-    return self.statusBarStyle;
-}
-
-- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount delegate:(id<TZImagePickerControllerDelegate>)delegate {
-    return [self initWithMaxImagesCount:maxImagesCount columnNumber:4 delegate:delegate pushPhotoPickerVc:YES];
-}
-
-- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id<TZImagePickerControllerDelegate>)delegate {
-    return [self initWithMaxImagesCount:maxImagesCount columnNumber:columnNumber delegate:delegate pushPhotoPickerVc:YES];
-}
-
-- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id<TZImagePickerControllerDelegate>)delegate pushPhotoPickerVc:(BOOL)pushPhotoPickerVc {
-    _pushPhotoPickerVc = pushPhotoPickerVc;
-    TZAlbumPickerController *albumPickerVc = [[TZAlbumPickerController alloc] init];
-    albumPickerVc.isFirstAppear = YES;
-    albumPickerVc.columnNumber = columnNumber;
-    self = [super initWithRootViewController:albumPickerVc];
-    if (self) {
-        self.maxImagesCount = maxImagesCount > 0 ? maxImagesCount : 9; // Default is 9 / 默认最大可选9张图片
-        self.pickerDelegate = delegate;
-        self.selectedAssets = [NSMutableArray array];
-        
-        // Allow user picking original photo and video, you also can set No after this method
-        // 默认准许用户选择原图和视频, 你也可以在这个方法后置为NO
-        self.allowPickingOriginalPhoto = YES;
-        self.allowPickingVideo = YES;
-        self.allowPickingImage = YES;
-        self.allowTakePicture = YES;
-        self.allowTakeVideo = YES;
-        self.videoMaximumDuration = 10 * 60;
-        self.sortAscendingByModificationDate = YES;
-        self.autoDismiss = YES;
-        self.columnNumber = columnNumber;
-        [self configDefaultSetting];
-        
-        if (![[TZImageManager manager] authorizationStatusAuthorized]) {
-            _tipLabel = [[UILabel alloc] init];
-            _tipLabel.frame = CGRectMake(8, 120, self.view.tz_width - 16, 60);
-            _tipLabel.textAlignment = NSTextAlignmentCenter;
-            _tipLabel.numberOfLines = 0;
-            _tipLabel.font = [UIFont systemFontOfSize:16];
-            _tipLabel.textColor = [UIColor blackColor];
-            _tipLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-
-            NSString *appName = [TZCommonTools tz_getAppName];
-            NSString *tipText = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Allow %@ to access your album in \"Settings -> Privacy -> Photos\""],appName];
-            _tipLabel.text = tipText;
-            [self.view addSubview:_tipLabel];
-            
-            _settingBtn = [UIButton buttonWithType:UIButtonTypeSystem];
-            [_settingBtn setTitle:self.settingBtnTitleStr forState:UIControlStateNormal];
-            _settingBtn.frame = CGRectMake(0, 180, self.view.tz_width, 44);
-            _settingBtn.titleLabel.font = [UIFont systemFontOfSize:18];
-            [_settingBtn addTarget:self action:@selector(settingBtnClick) forControlEvents:UIControlEventTouchUpInside];
-            _settingBtn.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-
-            [self.view addSubview:_settingBtn];
-            
-            if ([PHPhotoLibrary authorizationStatus] == 0) {
-                _timer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(observeAuthrizationStatusChange) userInfo:nil repeats:NO];
-            }
-        } else {
-            [self pushPhotoPickerVc];
-        }
-    }
-    return self;
-}
-
-/// This init method just for previewing photos / 用这个初始化方法以预览图片
-- (instancetype)initWithSelectedAssets:(NSMutableArray *)selectedAssets selectedPhotos:(NSMutableArray *)selectedPhotos index:(NSInteger)index{
-    TZPhotoPreviewController *previewVc = [[TZPhotoPreviewController alloc] init];
-    self = [super initWithRootViewController:previewVc];
-    if (self) {
-        self.selectedAssets = [NSMutableArray arrayWithArray:selectedAssets];
-        self.allowPickingOriginalPhoto = self.allowPickingOriginalPhoto;
-        [self configDefaultSetting];
-        
-        previewVc.photos = [NSMutableArray arrayWithArray:selectedPhotos];
-        previewVc.currentIndex = index;
-        __weak typeof(self) weakSelf = self;
-        [previewVc setDoneButtonClickBlockWithPreviewType:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            if (!strongSelf.autoDismiss) {
-                if (strongSelf.didFinishPickingPhotosHandle) {
-                    strongSelf.didFinishPickingPhotosHandle(photos,assets,isSelectOriginalPhoto);
-                }
-                return;
-            }
-            [strongSelf dismissViewControllerAnimated:YES completion:^{
-                if (!strongSelf) return;
-                if (strongSelf.didFinishPickingPhotosHandle) {
-                    strongSelf.didFinishPickingPhotosHandle(photos,assets,isSelectOriginalPhoto);
-                }
-            }];
-        }];
-    }
-    return self;
-}
-
-/// This init method for crop photo / 用这个初始化方法以裁剪图片
-- (instancetype)initCropTypeWithAsset:(PHAsset *)asset photo:(UIImage *)photo completion:(void (^)(UIImage *cropImage,PHAsset *asset))completion {
-    TZPhotoPreviewController *previewVc = [[TZPhotoPreviewController alloc] init];
-    self = [super initWithRootViewController:previewVc];
-    if (self) {
-        self.maxImagesCount = 1;
-        self.allowPickingImage = YES;
-        self.allowCrop = YES;
-        self.selectedAssets = [NSMutableArray arrayWithArray:@[asset]];
-        [self configDefaultSetting];
-        
-        previewVc.photos = [NSMutableArray arrayWithArray:@[photo]];
-        previewVc.isCropImage = YES;
-        previewVc.currentIndex = 0;
-        __weak typeof(self) weakSelf = self;
-        [previewVc setDoneButtonClickBlockCropMode:^(UIImage *cropImage, id asset) {
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            [strongSelf dismissViewControllerAnimated:YES completion:^{
-                if (completion) {
-                    completion(cropImage,asset);
-                }
-            }];
-        }];
-    }
-    return self;
-}
-
-- (void)configDefaultSetting {
-    self.autoSelectCurrentWhenDone = YES;
-    self.timeout = 30;
-    self.photoWidth = 828.0;
-    self.photoPreviewMaxWidth = 600;
-    self.naviTitleColor = [UIColor whiteColor];
-    self.naviTitleFont = [UIFont systemFontOfSize:17];
-    self.barItemTextFont = [UIFont systemFontOfSize:15];
-    self.barItemTextColor = [UIColor whiteColor];
-    self.allowPreview = YES;
-    // 2.2.26版本,不主动缩放图片,降低内存占用
-    self.notScaleImage = YES;
-    self.needFixComposition = NO;
-    self.statusBarStyle = UIStatusBarStyleLightContent;
-    self.cannotSelectLayerColor = [[UIColor whiteColor] colorWithAlphaComponent:0.8];
-    self.allowCameraLocation = YES;
-    self.presetName = AVAssetExportPresetMediumQuality;
-    self.maxCropVideoDuration = 30;
-    
-    self.iconThemeColor = [UIColor colorWithRed:31 / 255.0 green:185 / 255.0 blue:34 / 255.0 alpha:1.0];
-    [self configDefaultBtnTitle];
-    
-    CGFloat cropViewWH = MIN(self.view.tz_width, self.view.tz_height) / 3 * 2;
-    self.cropRect = CGRectMake((self.view.tz_width - cropViewWH) / 2, (self.view.tz_height - cropViewWH) / 2, cropViewWH, cropViewWH);
-}
-
-- (void)configDefaultImageName {
-    self.takePictureImageName = @"takePicture80";
-    self.photoSelImageName = @"photo_sel_photoPickerVc";
-    self.photoDefImageName = @"photo_def_photoPickerVc";
-    self.photoNumberIconImage = [self createImageWithColor:nil size:CGSizeMake(24, 24) radius:12]; // @"photo_number_icon";
-    self.photoPreviewOriginDefImageName = @"preview_original_def";
-    self.photoOriginDefImageName = @"photo_original_def";
-    self.photoOriginSelImageName = @"photo_original_sel";
-}
-
-- (void)setTakePictureImageName:(NSString *)takePictureImageName {
-    _takePictureImageName = takePictureImageName;
-    _takePictureImage = [UIImage tz_imageNamedFromMyBundle:takePictureImageName];
-}
-
-- (void)setPhotoSelImageName:(NSString *)photoSelImageName {
-    _photoSelImageName = photoSelImageName;
-    _photoSelImage = [UIImage tz_imageNamedFromMyBundle:photoSelImageName];
-}
-
-- (void)setPhotoDefImageName:(NSString *)photoDefImageName {
-    _photoDefImageName = photoDefImageName;
-    _photoDefImage = [UIImage tz_imageNamedFromMyBundle:photoDefImageName];
-}
-
-- (void)setPhotoNumberIconImageName:(NSString *)photoNumberIconImageName {
-    _photoNumberIconImageName = photoNumberIconImageName;
-    _photoNumberIconImage = [UIImage tz_imageNamedFromMyBundle:photoNumberIconImageName];
-}
-
-- (void)setPhotoPreviewOriginDefImageName:(NSString *)photoPreviewOriginDefImageName {
-    _photoPreviewOriginDefImageName = photoPreviewOriginDefImageName;
-    _photoPreviewOriginDefImage = [UIImage tz_imageNamedFromMyBundle:photoPreviewOriginDefImageName];
-}
-
-- (void)setPhotoOriginDefImageName:(NSString *)photoOriginDefImageName {
-    _photoOriginDefImageName = photoOriginDefImageName;
-    _photoOriginDefImage = [UIImage tz_imageNamedFromMyBundle:photoOriginDefImageName];
-}
-
-- (void)setPhotoOriginSelImageName:(NSString *)photoOriginSelImageName {
-    _photoOriginSelImageName = photoOriginSelImageName;
-    _photoOriginSelImage = [UIImage tz_imageNamedFromMyBundle:photoOriginSelImageName];
-}
-
-- (void)setTakePictureImage:(UIImage *)takePictureImage {
-    _takePictureImage = takePictureImage;
-    _takePictureImageName = @"";
-}
-
-- (void)setIconThemeColor:(UIColor *)iconThemeColor {
-    _iconThemeColor = iconThemeColor;
-    [self configDefaultImageName];
-}
-
-- (void)configDefaultBtnTitle {
-    self.doneBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Done"];
-    self.cancelBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Cancel"];
-    self.previewBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Preview"];
-    self.fullImageBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Full image"];
-    self.settingBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Setting"];
-    self.processHintStr = [NSBundle tz_localizedStringForKey:@"Processing..."];
-    self.editBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Edit"];
-}
-
-- (void)setShowSelectedIndex:(BOOL)showSelectedIndex {
-    _showSelectedIndex = showSelectedIndex;
-    if (showSelectedIndex) {
-        self.photoSelImage = [self createImageWithColor:nil size:CGSizeMake(24, 24) radius:12];
-    }
-    [TZImagePickerConfig sharedInstance].showSelectedIndex = showSelectedIndex;
-}
-
-- (void)setShowPhotoCannotSelectLayer:(BOOL)showPhotoCannotSelectLayer {
-    _showPhotoCannotSelectLayer = showPhotoCannotSelectLayer;
-    [TZImagePickerConfig sharedInstance].showPhotoCannotSelectLayer = showPhotoCannotSelectLayer;
-}
-
-- (void)setNotScaleImage:(BOOL)notScaleImage {
-    _notScaleImage = notScaleImage;
-    [TZImagePickerConfig sharedInstance].notScaleImage = notScaleImage;
-}
-
-- (void)setNeedFixComposition:(BOOL)needFixComposition {
-    _needFixComposition = needFixComposition;
-    [TZImagePickerConfig sharedInstance].needFixComposition = needFixComposition;
-}
-
-- (void)observeAuthrizationStatusChange {
-    [_timer invalidate];
-    _timer = nil;
-    if ([PHPhotoLibrary authorizationStatus] == 0) {
-        _timer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(observeAuthrizationStatusChange) userInfo:nil repeats:NO];
-    }
-    
-    if ([[TZImageManager manager] authorizationStatusAuthorized]) {
-        [_tipLabel removeFromSuperview];
-        [_settingBtn removeFromSuperview];
-
-        [self pushPhotoPickerVc];
-        
-        TZAlbumPickerController *albumPickerVc = (TZAlbumPickerController *)self.visibleViewController;
-        if ([albumPickerVc isKindOfClass:[TZAlbumPickerController class]]) {
-            [albumPickerVc configTableView];
-        }
-    }
-}
-
-- (void)pushPhotoPickerVc {
-    _didPushPhotoPickerVc = NO;
-    // 1.6.8 判断是否需要push到照片选择页,如果_pushPhotoPickerVc为NO,则不push
-    if (!_didPushPhotoPickerVc && _pushPhotoPickerVc) {
-        TZPhotoPickerController *photoPickerVc = [[TZPhotoPickerController alloc] init];
-        photoPickerVc.isFirstAppear = YES;
-        photoPickerVc.columnNumber = self.columnNumber;
-        [[TZImageManager manager] getCameraRollAlbumWithFetchAssets:NO completion:^(TZAlbumModel *model) {
-            photoPickerVc.model = model;
-            [self pushViewController:photoPickerVc animated:YES];
-            self->_didPushPhotoPickerVc = YES;
-        }];
-    }
-}
-
-- (UIAlertController *)showAlertWithTitle:(NSString *)title {
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert];
-    [alertController addAction:[UIAlertAction actionWithTitle:[NSBundle tz_localizedStringForKey:@"OK"] style:UIAlertActionStyleDefault handler:nil]];
-    [self presentViewController:alertController animated:YES completion:nil];
-    return alertController;
-}
-
-- (void)showProgressHUD {
-    if (!_progressHUD) {
-        _progressHUD = [UIButton buttonWithType:UIButtonTypeCustom];
-        [_progressHUD setBackgroundColor:[UIColor clearColor]];
-        
-        _HUDContainer = [[UIView alloc] init];
-        _HUDContainer.layer.cornerRadius = 8;
-        _HUDContainer.clipsToBounds = YES;
-        _HUDContainer.backgroundColor = [UIColor darkGrayColor];
-        _HUDContainer.alpha = 0.7;
-        
-        _HUDIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
-        
-        _HUDLabel = [[UILabel alloc] init];
-        _HUDLabel.textAlignment = NSTextAlignmentCenter;
-        _HUDLabel.text = self.processHintStr;
-        _HUDLabel.font = [UIFont systemFontOfSize:15];
-        _HUDLabel.textColor = [UIColor whiteColor];
-        
-        [_HUDContainer addSubview:_HUDLabel];
-        [_HUDContainer addSubview:_HUDIndicatorView];
-        [_progressHUD addSubview:_HUDContainer];
-    }
-    [_HUDIndicatorView startAnimating];
-    UIWindow *applicationWindow;
-    if ([[[UIApplication sharedApplication] delegate] respondsToSelector:@selector(window)]) {
-        applicationWindow = [[[UIApplication sharedApplication] delegate] window];
-    } else {
-        applicationWindow = [[UIApplication sharedApplication] keyWindow];
-    }
-    [applicationWindow addSubview:_progressHUD];
-    [self.view setNeedsLayout];
-    
-    // if over time, dismiss HUD automatic
-    self.HUDTimeoutCount++;
-    __weak typeof(self) weakSelf = self;
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.timeout * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        strongSelf.HUDTimeoutCount--;
-        if (strongSelf.HUDTimeoutCount <= 0) {
-            strongSelf.HUDTimeoutCount = 0;
-            [strongSelf hideProgressHUD];
-        }
-    });
-}
-
-- (void)hideProgressHUD {
-    if (_progressHUD) {
-        [_HUDIndicatorView stopAnimating];
-        [_progressHUD removeFromSuperview];
-    }
-}
-
-- (void)setMaxImagesCount:(NSInteger)maxImagesCount {
-    _maxImagesCount = maxImagesCount;
-    if (maxImagesCount > 1) {
-        _showSelectBtn = YES;
-        _allowCrop = NO;
-    }
-}
-
-- (void)setShowSelectBtn:(BOOL)showSelectBtn {
-    _showSelectBtn = showSelectBtn;
-    // 多选模式下,不允许让showSelectBtn为NO
-    if (!showSelectBtn && _maxImagesCount > 1) {
-        _showSelectBtn = YES;
-    }
-}
-
-- (void)setAllowCrop:(BOOL)allowCrop {
-    _allowCrop = _maxImagesCount > 1 ? NO : allowCrop;
-    if (allowCrop) { // 允许裁剪的时候,不能选原图和GIF
-        self.allowPickingOriginalPhoto = NO;
-        self.allowPickingGif = NO;
-    }
-}
-
-- (void)setCircleCropRadius:(NSInteger)circleCropRadius {
-    _circleCropRadius = circleCropRadius;
-    self.cropRect = CGRectMake(self.view.tz_width / 2 - circleCropRadius, self.view.tz_height / 2 - _circleCropRadius, _circleCropRadius * 2, _circleCropRadius * 2);
-}
-
-- (void)setCropRect:(CGRect)cropRect {
-    _cropRect = cropRect;
-    if ([TZCommonTools tz_isLandscape]) {
-        _cropRectLandscape = cropRect;
-        CGFloat widthHeight = cropRect.size.height;
-        _cropRectPortrait = CGRectMake(cropRect.origin.y, (self.view.tz_width - widthHeight) / 2, widthHeight, widthHeight);
-    } else {
-        _cropRectPortrait = cropRect;
-        CGFloat widthHeight = cropRect.size.width;
-        _cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, cropRect.origin.x, widthHeight, widthHeight);
-    }
-}
-
-- (CGRect)cropRect {
-    CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
-    BOOL isFullScreen = self.view.tz_height == screenHeight;
-    if (isFullScreen) {
-        return _cropRect;
-    } else {
-        CGRect newCropRect = _cropRect;
-        newCropRect.origin.y -= ((screenHeight - self.view.tz_height) / 2);
-        return newCropRect;
-    }
-}
-
-- (void)setTimeout:(NSInteger)timeout {
-    _timeout = timeout;
-    if (timeout < 5) {
-        _timeout = 5;
-    } else if (_timeout > 600) {
-        _timeout = 600;
-    }
-}
-
-- (void)setPickerDelegate:(id<TZImagePickerControllerDelegate>)pickerDelegate {
-    _pickerDelegate = pickerDelegate;
-    [TZImageManager manager].pickerDelegate = pickerDelegate;
-}
-
-- (void)setColumnNumber:(NSInteger)columnNumber {
-    _columnNumber = columnNumber;
-    if (columnNumber <= 2) {
-        _columnNumber = 2;
-    } else if (columnNumber >= 6) {
-        _columnNumber = 6;
-    }
-    
-    TZAlbumPickerController *albumPickerVc = [self.childViewControllers firstObject];
-    albumPickerVc.columnNumber = _columnNumber;
-    [TZImageManager manager].columnNumber = _columnNumber;
-}
-
-- (void)setMinPhotoWidthSelectable:(NSInteger)minPhotoWidthSelectable {
-    _minPhotoWidthSelectable = minPhotoWidthSelectable;
-    [TZImageManager manager].minPhotoWidthSelectable = minPhotoWidthSelectable;
-}
-
-- (void)setMinPhotoHeightSelectable:(NSInteger)minPhotoHeightSelectable {
-    _minPhotoHeightSelectable = minPhotoHeightSelectable;
-    [TZImageManager manager].minPhotoHeightSelectable = minPhotoHeightSelectable;
-}
-
-- (void)setHideWhenCanNotSelect:(BOOL)hideWhenCanNotSelect {
-    _hideWhenCanNotSelect = hideWhenCanNotSelect;
-    [TZImageManager manager].hideWhenCanNotSelect = hideWhenCanNotSelect;
-}
-
-- (void)setPhotoPreviewMaxWidth:(CGFloat)photoPreviewMaxWidth {
-    _photoPreviewMaxWidth = photoPreviewMaxWidth;
-    if (photoPreviewMaxWidth > 800) {
-        _photoPreviewMaxWidth = 800;
-    } else if (photoPreviewMaxWidth < 500) {
-        _photoPreviewMaxWidth = 500;
-    }
-    [TZImageManager manager].photoPreviewMaxWidth = _photoPreviewMaxWidth;
-}
-
-- (void)setPhotoWidth:(CGFloat)photoWidth {
-    _photoWidth = photoWidth;
-    [TZImageManager manager].photoWidth = photoWidth;
-}
-
-- (void)setSelectedAssets:(NSMutableArray *)selectedAssets {
-    _selectedAssets = selectedAssets;
-    _selectedModels = [NSMutableArray array];
-    _selectedAssetIds = [NSMutableArray array];
-    for (PHAsset *asset in selectedAssets) {
-        TZAssetModel *model = [TZAssetModel modelWithAsset:asset type:[[TZImageManager manager] getAssetType:asset]];
-        model.isSelected = YES;
-        [self addSelectedModel:model];
-    }
-}
-
-- (void)setAllowPickingImage:(BOOL)allowPickingImage {
-    _allowPickingImage = allowPickingImage;
-    [TZImagePickerConfig sharedInstance].allowPickingImage = allowPickingImage;
-    if (!allowPickingImage) {
-        _allowTakePicture = NO;
-    }
-}
-
-- (void)setAllowPickingVideo:(BOOL)allowPickingVideo {
-    _allowPickingVideo = allowPickingVideo;
-    [TZImagePickerConfig sharedInstance].allowPickingVideo = allowPickingVideo;
-    if (!allowPickingVideo) {
-        _allowTakeVideo = NO;
-    }
-}
-
-- (void)setPreferredLanguage:(NSString *)preferredLanguage {
-    _preferredLanguage = preferredLanguage;
-    [TZImagePickerConfig sharedInstance].preferredLanguage = preferredLanguage;
-    [self configDefaultBtnTitle];
-}
-
-- (void)setLanguageBundle:(NSBundle *)languageBundle {
-    _languageBundle = languageBundle;
-    [TZImagePickerConfig sharedInstance].languageBundle = languageBundle;
-    [self configDefaultBtnTitle];
-}
-
-- (void)setSortAscendingByModificationDate:(BOOL)sortAscendingByModificationDate {
-    _sortAscendingByModificationDate = sortAscendingByModificationDate;
-    [TZImageManager manager].sortAscendingByModificationDate = sortAscendingByModificationDate;
-}
-
-- (void)settingBtnClick {
-    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
-}
-
-- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
-    viewController.automaticallyAdjustsScrollViewInsets = NO;
-    [super pushViewController:viewController animated:animated];
-}
-
-- (void)dealloc {
-    // NSLog(@"%@ dealloc",NSStringFromClass(self.class));
-}
-
-- (void)addSelectedModel:(TZAssetModel *)model {
-    [_selectedModels addObject:model];
-    [_selectedAssetIds addObject:model.asset.localIdentifier];
-}
-
-- (void)removeSelectedModel:(TZAssetModel *)model {
-    [_selectedModels removeObject:model];
-    [_selectedAssetIds removeObject:model.asset.localIdentifier];
-}
-
-- (UIImage *)createImageWithColor:(UIColor *)color size:(CGSize)size radius:(CGFloat)radius {
-    if (!color) {
-        color = self.iconThemeColor;
-    }
-    CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height);
-    UIGraphicsBeginImageContextWithOptions(rect.size, NO, [UIScreen mainScreen].scale);
-    CGContextRef context = UIGraphicsGetCurrentContext();
-    CGContextSetFillColorWithColor(context, [color CGColor]);
-    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:radius];
-    CGContextAddPath(context, path.CGPath);
-    CGContextFillPath(context);
-    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    return image;
-}
-
-#pragma mark - UIContentContainer
-
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.02 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        if (![UIApplication sharedApplication].statusBarHidden) {
-            if (self.needShowStatusBar) [UIApplication sharedApplication].statusBarHidden = NO;
-        }
-    });
-    if (size.width > size.height) {
-        _cropRect = _cropRectLandscape;
-    } else {
-        _cropRect = _cropRectPortrait;
-    }
-}
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-    
-    CGFloat progressHUDY = CGRectGetMaxY(self.navigationBar.frame);
-    _progressHUD.frame = CGRectMake(0, progressHUDY, self.view.tz_width, self.view.tz_height - progressHUDY);
-    _HUDContainer.frame = CGRectMake((self.view.tz_width - 120) / 2, (_progressHUD.tz_height - 90 - progressHUDY) / 2, 120, 90);
-    _HUDIndicatorView.frame = CGRectMake(45, 15, 30, 30);
-    _HUDLabel.frame = CGRectMake(0,40, 120, 50);
-}
-
-#pragma mark - Public
-
-- (void)cancelButtonClick {
-    if (self.autoDismiss) {
-        [self dismissViewControllerAnimated:YES completion:^{
-            [self callDelegateMethod];
-        }];
-    } else {
-        [self callDelegateMethod];
-    }
-}
-
-- (void)callDelegateMethod {
-    if ([self.pickerDelegate respondsToSelector:@selector(tz_imagePickerControllerDidCancel:)]) {
-        [self.pickerDelegate tz_imagePickerControllerDidCancel:self];
-    }
-    if (self.imagePickerControllerDidCancelHandle) {
-        self.imagePickerControllerDidCancelHandle();
-    }
-}
-
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
-    if ([self.topViewController isKindOfClass:TZVideoPlayerController.class] && self.topViewController.presentedViewController) {
-        return UIInterfaceOrientationMaskPortrait;
-    }
-    return UIInterfaceOrientationMaskAll;
-}
-
-@end
-
-
-@interface TZAlbumPickerController ()<UITableViewDataSource, UITableViewDelegate, PHPhotoLibraryChangeObserver> {
-    UITableView *_tableView;
-}
-@property (nonatomic, strong) NSMutableArray *albumArr;
-@end
-
-@implementation TZAlbumPickerController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    if ([[TZImageManager manager] authorizationStatusAuthorized]) {
-        [[PHPhotoLibrary sharedPhotoLibrary] registerChangeObserver:self];
-    }
-    self.isFirstAppear = YES;
-    if (@available(iOS 13.0, *)) {
-        self.view.backgroundColor = UIColor.tertiarySystemBackgroundColor;
-    } else {
-        self.view.backgroundColor = [UIColor whiteColor];
-    }
-    
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    UIBarButtonItem *cancelItem = [[UIBarButtonItem alloc] initWithTitle:imagePickerVc.cancelBtnTitleStr style:UIBarButtonItemStylePlain target:imagePickerVc action:@selector(cancelButtonClick)];
-    [TZCommonTools configBarButtonItem:cancelItem tzImagePickerVc:imagePickerVc];
-    self.navigationItem.rightBarButtonItem = cancelItem;
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    [imagePickerVc hideProgressHUD];
-    if (imagePickerVc.allowPickingImage) {
-        self.navigationItem.title = [NSBundle tz_localizedStringForKey:@"Photos"];
-    } else if (imagePickerVc.allowPickingVideo) {
-        self.navigationItem.title = [NSBundle tz_localizedStringForKey:@"Videos"];
-    }
-    
-    if (self.isFirstAppear && !imagePickerVc.navLeftBarButtonSettingBlock) {
-        self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:[NSBundle tz_localizedStringForKey:@"Back"] style:UIBarButtonItemStylePlain target:nil action:nil];
-    }
-    
-    [self configTableView];
-}
-
-- (void)configTableView {
-    if (![[TZImageManager manager] authorizationStatusAuthorized]) {
-        return;
-    }
-
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (self.isFirstAppear) {
-        [imagePickerVc showProgressHUD];
-    }
-
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        [[TZImageManager manager] getAllAlbumsWithFetchAssets:!self.isFirstAppear completion:^(NSArray<TZAlbumModel *> *models) {
-            dispatch_async(dispatch_get_main_queue(), ^{
-                self->_albumArr = [NSMutableArray arrayWithArray:models];
-                for (TZAlbumModel *albumModel in self->_albumArr) {
-                    albumModel.selectedModels = imagePickerVc.selectedModels;
-                }
-                [imagePickerVc hideProgressHUD];
-                
-                if (self.isFirstAppear) {
-                    self.isFirstAppear = NO;
-                    [self configTableView];
-                }
-                
-                if (!self->_tableView) {
-                    self->_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
-                    self->_tableView.rowHeight = 70;
-                    if (@available(iOS 13.0, *)) {
-                        self->_tableView.backgroundColor = [UIColor tertiarySystemBackgroundColor];
-                    } else {
-                        self->_tableView.backgroundColor = [UIColor whiteColor];
-                    }
-                    self->_tableView.tableFooterView = [[UIView alloc] init];
-                    self->_tableView.dataSource = self;
-                    self->_tableView.delegate = self;
-                    [self->_tableView registerClass:[TZAlbumCell class] forCellReuseIdentifier:@"TZAlbumCell"];
-                    [self.view addSubview:self->_tableView];
-                    if (imagePickerVc.albumPickerPageUIConfigBlock) {
-                        imagePickerVc.albumPickerPageUIConfigBlock(self->_tableView);
-                    }
-                } else {
-                    [self->_tableView reloadData];
-                }
-            });
-        }];
-    });
-}
-
-- (void)dealloc {
-    [[PHPhotoLibrary sharedPhotoLibrary] unregisterChangeObserver:self];
-    // NSLog(@"%@ dealloc",NSStringFromClass(self.class));
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle {
-    TZImagePickerController *tzImagePicker = (TZImagePickerController *)self.navigationController;
-    if (tzImagePicker && [tzImagePicker isKindOfClass:[TZImagePickerController class]]) {
-        return tzImagePicker.statusBarStyle;
-    }
-    return [super preferredStatusBarStyle];
-}
-
-#pragma mark - PHPhotoLibraryChangeObserver
-
-- (void)photoLibraryDidChange:(PHChange *)changeInstance {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self configTableView];
-    });
-}
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-    
-    CGFloat top = 0;
-    CGFloat tableViewHeight = 0;
-    CGFloat naviBarHeight = self.navigationController.navigationBar.tz_height;
-    BOOL isStatusBarHidden = [UIApplication sharedApplication].isStatusBarHidden;
-    BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
-    if (self.navigationController.navigationBar.isTranslucent) {
-        top = naviBarHeight;
-        if (!isStatusBarHidden && isFullScreen) top += [TZCommonTools tz_statusBarHeight];
-        tableViewHeight = self.view.tz_height - top;
-    } else {
-        tableViewHeight = self.view.tz_height;
-    }
-    _tableView.frame = CGRectMake(0, top, self.view.tz_width, tableViewHeight);
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (imagePickerVc.albumPickerPageDidLayoutSubviewsBlock) {
-        imagePickerVc.albumPickerPageDidLayoutSubviewsBlock(_tableView);
-    }
-}
-
-#pragma mark - UITableViewDataSource && Delegate
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return _albumArr.count;
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    TZAlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TZAlbumCell"];
-    if (@available(iOS 13.0, *)) {
-        cell.backgroundColor = UIColor.tertiarySystemBackgroundColor;
-    }
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    cell.albumCellDidLayoutSubviewsBlock = imagePickerVc.albumCellDidLayoutSubviewsBlock;
-    cell.albumCellDidSetModelBlock = imagePickerVc.albumCellDidSetModelBlock;
-    cell.selectedCountButton.backgroundColor = imagePickerVc.iconThemeColor;
-    cell.model = _albumArr[indexPath.row];
-    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
-    return cell;
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    TZPhotoPickerController *photoPickerVc = [[TZPhotoPickerController alloc] init];
-    photoPickerVc.columnNumber = self.columnNumber;
-    TZAlbumModel *model = _albumArr[indexPath.row];
-    photoPickerVc.model = model;
-    [self.navigationController pushViewController:photoPickerVc animated:YES];
-    [tableView deselectRowAtIndexPath:indexPath animated:NO];
-}
-
-#pragma clang diagnostic pop
-
-@end
-
-
-@implementation UIImage (MyBundle)
-
-+ (UIImage *)tz_imageNamedFromMyBundle:(NSString *)name {
-    NSBundle *imageBundle = [NSBundle tz_imagePickerBundle];
-    name = [name stringByAppendingString:@"@2x"];
-    NSString *imagePath = [imageBundle pathForResource:name ofType:@"png"];
-    UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
-    if (!image) {
-        // 兼容业务方自己设置图片的方式
-        name = [name stringByReplacingOccurrencesOfString:@"@2x" withString:@""];
-        image = [UIImage imageNamed:name];
-    }
-    return image;
-}
-
-@end
-
-
-@implementation TZCommonTools
-
-+ (UIEdgeInsets)tz_safeAreaInsets {
-    UIWindow *window = [UIApplication sharedApplication].windows.firstObject;
-    if (![window isKeyWindow]) {
-        UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
-        if (CGRectEqualToRect(keyWindow.bounds, [UIScreen mainScreen].bounds)) {
-            window = keyWindow;
-        }
-    }
-    if (@available(iOS 11.0, *)) {
-        UIEdgeInsets insets = [window safeAreaInsets];
-        return insets;
-    }
-    return UIEdgeInsetsZero;
-}
-
-+ (BOOL)tz_isIPhoneX {
-    if ([UIWindow instancesRespondToSelector:@selector(safeAreaInsets)]) {
-        return [self tz_safeAreaInsets].bottom > 0;
-    }
-    return (CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(375, 812)) ||
-            CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(812, 375)) ||
-            CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(414, 896)) ||
-            CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(896, 414)) ||
-            CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(390, 844)) ||
-            CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(844, 390)) ||
-            CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(428, 926)) ||
-            CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(926, 428)));
-}
-
-+ (BOOL)tz_isLandscape {
-    if ([UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeRight ||
-        [UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeLeft) {
-        return true;
-    }
-    return false;
-}
-
-+ (CGFloat)tz_statusBarHeight {
-    if ([UIWindow instancesRespondToSelector:@selector(safeAreaInsets)]) {
-        return [self tz_safeAreaInsets].top ?: 20;
-    }
-    return 20;
-}
-
-// 获得Info.plist数据字典
-+ (NSDictionary *)tz_getInfoDictionary {
-    NSDictionary *infoDict = [NSBundle mainBundle].localizedInfoDictionary;
-    if (!infoDict || !infoDict.count) {
-        infoDict = [NSBundle mainBundle].infoDictionary;
-    }
-    if (!infoDict || !infoDict.count) {
-        NSString *path = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
-        infoDict = [NSDictionary dictionaryWithContentsOfFile:path];
-    }
-    return infoDict ? infoDict : @{};
-}
-
-+ (NSString *)tz_getAppName {
-    NSDictionary *infoDict = [self tz_getInfoDictionary];
-    NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"];
-    if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
-    if (!appName) appName = [infoDict valueForKey:@"CFBundleExecutable"];
-    if (!appName) {
-        infoDict = [NSBundle mainBundle].infoDictionary;
-        appName = [infoDict valueForKey:@"CFBundleDisplayName"];
-        if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
-        if (!appName) appName = [infoDict valueForKey:@"CFBundleExecutable"];
-    }
-    return appName;
-}
-
-+ (BOOL)tz_isRightToLeftLayout {
-    if (@available(iOS 9.0, *)) {
-        if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:UISemanticContentAttributeUnspecified] == UIUserInterfaceLayoutDirectionRightToLeft) {
-            return YES;
-        }
-    } else {
-        NSString *preferredLanguage = [NSLocale preferredLanguages].firstObject;
-        if ([preferredLanguage hasPrefix:@"ar-"]) {
-            return YES;
-        }
-    }
-    return NO;
-}
-
-+ (void)configBarButtonItem:(UIBarButtonItem *)item tzImagePickerVc:(TZImagePickerController *)tzImagePickerVc {
-    item.tintColor = tzImagePickerVc.barItemTextColor;
-    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
-    textAttrs[NSForegroundColorAttributeName] = tzImagePickerVc.barItemTextColor;
-    textAttrs[NSFontAttributeName] = tzImagePickerVc.barItemTextFont;
-    [item setTitleTextAttributes:textAttrs forState:UIControlStateNormal];
-    
-    NSMutableDictionary *textAttrsHighlighted = [NSMutableDictionary dictionary];
-    textAttrsHighlighted[NSFontAttributeName] = tzImagePickerVc.barItemTextFont;
-    [item setTitleTextAttributes:textAttrsHighlighted forState:UIControlStateHighlighted];
-}
-
-+ (BOOL)isICloudSyncError:(NSError *)error {
-    if (!error) return NO;
-    if ([error.domain isEqualToString:@"CKErrorDomain"] || [error.domain isEqualToString:@"CloudPhotoLibraryErrorDomain"]) {
-        return YES;
-    }
-    return NO;
-}
-
-+ (BOOL)isAssetNotSelectable:(TZAssetModel *)model tzImagePickerVc:(TZImagePickerController *)tzImagePickerVc {
-    BOOL notSelectable = tzImagePickerVc.selectedModels.count >= tzImagePickerVc.maxImagesCount;
-    if (tzImagePickerVc.selectedModels && tzImagePickerVc.selectedModels.count > 0 && !tzImagePickerVc.allowPickingMultipleVideo) {
-        if (model.asset.mediaType == PHAssetMediaTypeVideo) {
-            notSelectable = true;
-        }
-    }
-    return notSelectable;
-}
-
-@end
-
-
-@interface TZImagePickerConfig ()
-@property (strong, nonatomic) NSSet *supportedLanguages;
-@end
-
-@implementation TZImagePickerConfig
-
-+ (instancetype)sharedInstance {
-    static dispatch_once_t onceToken;
-    static TZImagePickerConfig *config = nil;
-    dispatch_once(&onceToken, ^{
-        if (config == nil) {
-            config = [[TZImagePickerConfig alloc] init];
-            config.supportedLanguages = [NSSet setWithObjects:@"zh-Hans", @"zh-Hant", @"en", @"ar", @"bg", @"cs-CZ", @"de", @"el", @"es", @"fr", @"he", @"it", @"ja", @"ko-KP", @"ko", @"nl", @"pl", @"pt", @"ro", @"ru", @"sk", @"sv", @"th", @"tr", @"uk", @"vi", nil];
-            config.preferredLanguage = nil;
-            config.gifPreviewMaxImagesCount = 50;
-        }
-    });
-    return config;
-}
-
-- (void)setPreferredLanguage:(NSString *)preferredLanguage {
-    _preferredLanguage = preferredLanguage;
-    
-    if (!preferredLanguage || !preferredLanguage.length) {
-        preferredLanguage = [NSLocale preferredLanguages].firstObject;
-    }
-
-    NSString *usedLanguage = @"en";
-    for (NSString *language in self.supportedLanguages) {
-        if ([preferredLanguage hasPrefix:language]) {
-            usedLanguage = language;
-            break;
-        }
-    }
-    _languageBundle = [NSBundle bundleWithPath:[[NSBundle tz_imagePickerBundle] pathForResource:usedLanguage ofType:@"lproj"]];
-
-}
-
-@end

+ 0 - 30
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageRequestOperation.h

@@ -1,30 +0,0 @@
-//
-//  TZImageRequestOperation.h
-//  TZImagePickerControllerFramework
-//
-//  Created by 谭真 on 2018/12/20.
-//  Copyright © 2018 谭真. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <Photos/Photos.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface TZImageRequestOperation : NSOperation
-
-typedef void(^TZImageRequestCompletedBlock)(UIImage *photo, NSDictionary *info, BOOL isDegraded);
-typedef void(^TZImageRequestProgressBlock)(double progress, NSError *error, BOOL *stop, NSDictionary *info);
-
-@property (nonatomic, copy, nullable) TZImageRequestCompletedBlock completedBlock;
-@property (nonatomic, copy, nullable) TZImageRequestProgressBlock progressBlock;
-@property (nonatomic, strong, nullable) PHAsset *asset;
-
-@property (assign, nonatomic, getter = isExecuting) BOOL executing;
-@property (assign, nonatomic, getter = isFinished) BOOL finished;
-
-- (instancetype)initWithAsset:(PHAsset *)asset completion:(TZImageRequestCompletedBlock)completionBlock progressHandler:(TZImageRequestProgressBlock)progressHandler;
-- (void)done;
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 77
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZImageRequestOperation.m

@@ -1,77 +0,0 @@
-//
-//  TZImageRequestOperation.m
-//  TZImagePickerControllerFramework
-//
-//  Created by 谭真 on 2018/12/20.
-//  Copyright © 2018 谭真. All rights reserved.
-//
-
-#import "TZImageRequestOperation.h"
-#import "TZImageManager.h"
-
-@implementation TZImageRequestOperation
-
-@synthesize executing = _executing;
-@synthesize finished = _finished;
-
-- (instancetype)initWithAsset:(PHAsset *)asset completion:(TZImageRequestCompletedBlock)completionBlock progressHandler:(TZImageRequestProgressBlock)progressHandler {
-    self = [super init];
-    self.asset = asset;
-    self.completedBlock = completionBlock;
-    self.progressBlock = progressHandler;
-    _executing = NO;
-    _finished = NO;
-    return self;
-}
-
-- (void)start {
-    self.executing = YES;
-    [[TZImageManager manager] getPhotoWithAsset:self.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (!isDegraded) {
-                if (self.completedBlock) {
-                    self.completedBlock(photo, info, isDegraded);
-                }
-                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-                    [self done];
-                });
-            }
-        });
-    } progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (self.progressBlock) {
-                self.progressBlock(progress, error, stop, info);
-            }
-        });
-    } networkAccessAllowed:YES];
-}
-
-- (void)done {
-    self.finished = YES;
-    self.executing = NO;
-    [self reset];
-}
-
-- (void)reset {
-    self.asset = nil;
-    self.completedBlock = nil;
-    self.progressBlock = nil;
-}
-
-- (void)setFinished:(BOOL)finished {
-    [self willChangeValueForKey:@"isFinished"];
-    _finished = finished;
-    [self didChangeValueForKey:@"isFinished"];
-}
-
-- (void)setExecuting:(BOOL)executing {
-    [self willChangeValueForKey:@"isExecuting"];
-    _executing = executing;
-    [self didChangeValueForKey:@"isExecuting"];
-}
-
-- (BOOL)isAsynchronous {
-    return YES;
-}
-
-@end

+ 0 - 27
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZLocationManager.h

@@ -1,27 +0,0 @@
-//
-//  TZLocationManager.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 2017/06/03.
-//  Copyright © 2017年 谭真. All rights reserved.
-//  定位管理类
-
-
-#import <Foundation/Foundation.h>
-#import <CoreLocation/CoreLocation.h>
-
-@interface TZLocationManager : NSObject
-
-+ (instancetype)manager NS_SWIFT_NAME(default());
-
-/// 开始定位
-- (void)startLocation;
-- (void)startLocationWithSuccessBlock:(void (^)(NSArray<CLLocation *> *))successBlock failureBlock:(void (^)(NSError *error))failureBlock;
-- (void)startLocationWithGeocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock;
-- (void)startLocationWithSuccessBlock:(void (^)(NSArray<CLLocation *> *))successBlock failureBlock:(void (^)(NSError *error))failureBlock geocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock;
-
-/// 结束定位
-- (void)stopUpdatingLocation;
-
-@end
-

+ 0 - 91
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZLocationManager.m

@@ -1,91 +0,0 @@
-//
-//  TZLocationManager.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 2017/06/03.
-//  Copyright © 2017年 谭真. All rights reserved.
-//  定位管理类
-
-#import "TZLocationManager.h"
-#import "TZImagePickerController.h"
-
-@interface TZLocationManager ()<CLLocationManagerDelegate>
-@property (nonatomic, strong) CLLocationManager *locationManager;
-/// 定位成功的回调block
-@property (nonatomic, copy) void (^successBlock)(NSArray<CLLocation *> *);
-/// 编码成功的回调block
-@property (nonatomic, copy) void (^geocodeBlock)(NSArray *geocodeArray);
-/// 定位失败的回调block
-@property (nonatomic, copy) void (^failureBlock)(NSError *error);
-@end
-
-@implementation TZLocationManager
-
-+ (instancetype)manager {
-    static TZLocationManager *manager;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        manager = [[self alloc] init];
-        manager.locationManager = [[CLLocationManager alloc] init];
-        manager.locationManager.delegate = manager;
-        [manager.locationManager requestWhenInUseAuthorization];
-    });
-    return manager;
-}
-
-- (void)startLocation {
-    [self startLocationWithSuccessBlock:nil failureBlock:nil geocoderBlock:nil];
-}
-
-- (void)startLocationWithSuccessBlock:(void (^)(NSArray<CLLocation *> *))successBlock failureBlock:(void (^)(NSError *error))failureBlock {
-    [self startLocationWithSuccessBlock:successBlock failureBlock:failureBlock geocoderBlock:nil];
-}
-
-- (void)startLocationWithGeocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock {
-    [self startLocationWithSuccessBlock:nil failureBlock:nil geocoderBlock:geocoderBlock];
-}
-
-- (void)startLocationWithSuccessBlock:(void (^)(NSArray<CLLocation *> *))successBlock failureBlock:(void (^)(NSError *error))failureBlock geocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock {
-    [self.locationManager startUpdatingLocation];
-    _successBlock = successBlock;
-    _geocodeBlock = geocoderBlock;
-    _failureBlock = failureBlock;
-}
-
-- (void)stopUpdatingLocation {
-    [self.locationManager stopUpdatingLocation];
-}
-
-#pragma mark - CLLocationManagerDelegate
-
-/// 地理位置发生改变时触发
-- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations {
-    [manager stopUpdatingLocation];
-    
-    if (_successBlock) {
-        _successBlock(locations);
-    }
-    
-    if (_geocodeBlock && locations.count) {
-        CLGeocoder *geocoder = [[CLGeocoder alloc] init];
-        [geocoder reverseGeocodeLocation:[locations firstObject] completionHandler:^(NSArray *array, NSError *error) {
-            self->_geocodeBlock(array);
-        }];
-    }
-}
-
-/// 定位失败回调方法
-- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
-    NSLog(@"定位失败, 错误: %@",error);
-    switch([error code]) {
-        case kCLErrorDenied: { // 用户禁止了定位权限
-            
-        } break;
-        default: break;
-    }
-    if (_failureBlock) {
-        _failureBlock(error);
-    }
-}
-
-@end

+ 0 - 22
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPickerController.h

@@ -1,22 +0,0 @@
-//
-//  TZPhotoPickerController.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@class TZAlbumModel;
-@interface TZPhotoPickerController : UIViewController
-
-@property (nonatomic, assign) BOOL isFirstAppear;
-@property (nonatomic, assign) NSInteger columnNumber;
-@property (nonatomic, strong) TZAlbumModel *model;
-@end
-
-
-@interface TZCollectionView : UICollectionView
-
-@end

+ 0 - 1160
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPickerController.m

@@ -1,1160 +0,0 @@
-//
-//  TZPhotoPickerController.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import "TZPhotoPickerController.h"
-#import "TZImagePickerController.h"
-#import "TZPhotoPreviewController.h"
-#import "TZAssetCell.h"
-#import "TZAssetModel.h"
-#import "UIView+TZLayout.h"
-#import "TZImageManager.h"
-#import "TZVideoPlayerController.h"
-#import "TZGifPhotoPreviewController.h"
-#import "TZLocationManager.h"
-#import <MobileCoreServices/MobileCoreServices.h>
-#import "TZImageRequestOperation.h"
-
-@interface TZPhotoPickerController ()<UICollectionViewDataSource,UICollectionViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate, PHPhotoLibraryChangeObserver> {
-    NSMutableArray *_models;
-    
-    UIView *_bottomToolBar;
-    UIButton *_previewButton;
-    UIButton *_doneButton;
-    UIImageView *_numberImageView;
-    UILabel *_numberLabel;
-    UIButton *_originalPhotoButton;
-    UILabel *_originalPhotoLabel;
-    UIView *_divideLine;
-    
-    BOOL _shouldScrollToBottom;
-    BOOL _showTakePhotoBtn;
-    
-    CGFloat _offsetItemCount;
-}
-@property CGRect previousPreheatRect;
-@property (nonatomic, assign) BOOL isSelectOriginalPhoto;
-@property (nonatomic, strong) TZCollectionView *collectionView;
-@property (nonatomic, strong) UILabel *noDataLabel;
-@property (strong, nonatomic) UICollectionViewFlowLayout *layout;
-@property (nonatomic, strong) UIImagePickerController *imagePickerVc;
-@property (strong, nonatomic) CLLocation *location;
-@property (nonatomic, strong) NSOperationQueue *operationQueue;
-@property (nonatomic, assign) BOOL isSavingMedia;
-@property (nonatomic, assign) BOOL isFetchingMedia;
-@end
-
-static CGSize AssetGridThumbnailSize;
-static CGFloat itemMargin = 5;
-
-@implementation TZPhotoPickerController
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-- (UIImagePickerController *)imagePickerVc {
-    if (_imagePickerVc == nil) {
-        _imagePickerVc = [[UIImagePickerController alloc] init];
-        _imagePickerVc.delegate = self;
-        // set appearance / 改变相册选择页的导航栏外观
-        _imagePickerVc.navigationBar.barTintColor = self.navigationController.navigationBar.barTintColor;
-        _imagePickerVc.navigationBar.tintColor = self.navigationController.navigationBar.tintColor;
-        UIBarButtonItem *tzBarItem, *BarItem;
-        if (@available(iOS 9, *)) {
-            tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]];
-            BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]];
-        } else {
-            tzBarItem = [UIBarButtonItem appearanceWhenContainedIn:[TZImagePickerController class], nil];
-            BarItem = [UIBarButtonItem appearanceWhenContainedIn:[UIImagePickerController class], nil];
-        }
-        NSDictionary *titleTextAttributes = [tzBarItem titleTextAttributesForState:UIControlStateNormal];
-        [BarItem setTitleTextAttributes:titleTextAttributes forState:UIControlStateNormal];
-    }
-    return _imagePickerVc;
-}
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    if ([[TZImageManager manager] authorizationStatusAuthorized]) {
-        [[PHPhotoLibrary sharedPhotoLibrary] registerChangeObserver:self];
-    }
-    self.isFirstAppear = YES;
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    _isSelectOriginalPhoto = tzImagePickerVc.isSelectOriginalPhoto;
-    _shouldScrollToBottom = YES;
-    if (@available(iOS 13.0, *)) {
-        self.view.backgroundColor = UIColor.tertiarySystemBackgroundColor;
-    } else {
-        self.view.backgroundColor = [UIColor whiteColor];
-    }
-    self.navigationItem.title = _model.name;
-    UIBarButtonItem *cancelItem = [[UIBarButtonItem alloc] initWithTitle:tzImagePickerVc.cancelBtnTitleStr style:UIBarButtonItemStylePlain target:tzImagePickerVc action:@selector(cancelButtonClick)];
-    [TZCommonTools configBarButtonItem:cancelItem tzImagePickerVc:tzImagePickerVc];
-    self.navigationItem.rightBarButtonItem = cancelItem;
-    if (tzImagePickerVc.navLeftBarButtonSettingBlock) {
-        UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        leftButton.frame = CGRectMake(0, 0, 44, 44);
-        [leftButton addTarget:self action:@selector(navLeftBarButtonClick) forControlEvents:UIControlEventTouchUpInside];
-        tzImagePickerVc.navLeftBarButtonSettingBlock(leftButton);
-        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftButton];
-    } else if (tzImagePickerVc.childViewControllers.count) {
-        UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:[NSBundle tz_localizedStringForKey:@"Back"] style:UIBarButtonItemStylePlain target:self action:@selector(navLeftBarButtonClick)];
-        [TZCommonTools configBarButtonItem:backItem tzImagePickerVc:tzImagePickerVc];
-        [tzImagePickerVc.childViewControllers firstObject].navigationItem.backBarButtonItem = backItem;
-    }
-    _showTakePhotoBtn = _model.isCameraRoll && ((tzImagePickerVc.allowTakePicture && tzImagePickerVc.allowPickingImage) || (tzImagePickerVc.allowTakeVideo && tzImagePickerVc.allowPickingVideo));
-    // [self resetCachedAssets];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeStatusBarOrientationNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
-    
-    self.operationQueue = [[NSOperationQueue alloc] init];
-    self.operationQueue.maxConcurrentOperationCount = 3;
-}
-
-- (void)fetchAssetModels {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (_isFirstAppear && !_model.models.count) {
-        [tzImagePickerVc showProgressHUD];
-    }
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        CGFloat systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
-        if (!tzImagePickerVc.sortAscendingByModificationDate && self->_isFirstAppear && self->_model.isCameraRoll) {
-            [[TZImageManager manager] getCameraRollAlbumWithFetchAssets:YES completion:^(TZAlbumModel *model) {
-                self->_model = model;
-                self->_models = [NSMutableArray arrayWithArray:self->_model.models];
-                [self initSubviews];
-            }];
-        } else if (self->_showTakePhotoBtn || self->_isFirstAppear || !self.model.models || systemVersion >= 14.0) {
-            [[TZImageManager manager] getAssetsFromFetchResult:self->_model.result completion:^(NSArray<TZAssetModel *> *models) {
-                self->_models = [NSMutableArray arrayWithArray:models];
-                [self initSubviews];
-            }];
-        } else {
-            self->_models = [NSMutableArray arrayWithArray:self->_model.models];
-            [self initSubviews];
-        }
-    });
-}
-
-- (void)initSubviews {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-        [tzImagePickerVc hideProgressHUD];
-        
-        [self checkSelectedModels];
-        [self configCollectionView];
-        self->_collectionView.hidden = YES;
-        [self configBottomToolBar];
-        
-        [self prepareScrollCollectionViewToBottom];
-    });
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    tzImagePickerVc.isSelectOriginalPhoto = _isSelectOriginalPhoto;
-}
-
-- (BOOL)prefersStatusBarHidden {
-    return NO;
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle {
-    TZImagePickerController *tzImagePicker = (TZImagePickerController *)self.navigationController;
-    if (tzImagePicker && [tzImagePicker isKindOfClass:[TZImagePickerController class]]) {
-        return tzImagePicker.statusBarStyle;
-    }
-    return [super preferredStatusBarStyle];
-}
-
-- (void)configCollectionView {
-    if (!_collectionView) {
-        _layout = [[UICollectionViewFlowLayout alloc] init];
-        _collectionView = [[TZCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout];
-        if (@available(iOS 13.0, *)) {
-            _collectionView.backgroundColor = UIColor.tertiarySystemBackgroundColor;
-        } else {
-            _collectionView.backgroundColor = [UIColor whiteColor];
-        }
-        _collectionView.dataSource = self;
-        _collectionView.delegate = self;
-        _collectionView.alwaysBounceHorizontal = NO;
-        _collectionView.contentInset = UIEdgeInsetsMake(itemMargin, itemMargin, itemMargin, itemMargin);
-        [self.view addSubview:_collectionView];
-        [_collectionView registerClass:[TZAssetCell class] forCellWithReuseIdentifier:@"TZAssetCell"];
-        [_collectionView registerClass:[TZAssetCameraCell class] forCellWithReuseIdentifier:@"TZAssetCameraCell"];
-    } else {
-        [_collectionView reloadData];
-    }
-
-    
-    if (_showTakePhotoBtn) {
-        _collectionView.contentSize = CGSizeMake(self.view.tz_width, ((_model.count + self.columnNumber) / self.columnNumber) * self.view.tz_width);
-    } else {
-        _collectionView.contentSize = CGSizeMake(self.view.tz_width, ((_model.count + self.columnNumber - 1) / self.columnNumber) * self.view.tz_width);
-        if (_models.count == 0) {
-            _noDataLabel = [UILabel new];
-            _noDataLabel.textAlignment = NSTextAlignmentCenter;
-            _noDataLabel.text = [NSBundle tz_localizedStringForKey:@"No Photos or Videos"];
-            CGFloat rgb = 153 / 256.0;
-            _noDataLabel.textColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0];
-            _noDataLabel.font = [UIFont boldSystemFontOfSize:20];
-            [_collectionView addSubview:_noDataLabel];
-        } else if (_noDataLabel) {
-            [_noDataLabel removeFromSuperview];
-            _noDataLabel = nil;
-        }
-    }
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    // Determine the size of the thumbnails to request from the PHCachingImageManager
-    CGFloat scale = 2.0;
-    if ([UIScreen mainScreen].bounds.size.width > 600) {
-        scale = 1.0;
-    }
-    CGSize cellSize = ((UICollectionViewFlowLayout *)_collectionView.collectionViewLayout).itemSize;
-    AssetGridThumbnailSize = CGSizeMake(cellSize.width * scale, cellSize.height * scale);
-    
-    if (!_models) {
-        [self fetchAssetModels];
-    }
-}
-
-- (void)viewDidAppear:(BOOL)animated {
-    [super viewDidAppear:animated];
-    self.isFirstAppear = NO;
-    // [self updateCachedAssets];
-}
-
-- (void)configBottomToolBar {
-    if (_bottomToolBar) return;
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (!tzImagePickerVc.showSelectBtn) return;
-    
-    _bottomToolBar = [[UIView alloc] initWithFrame:CGRectZero];
-    CGFloat rgb = 253 / 255.0;
-    if (@available(iOS 13.0, *)) {
-        _bottomToolBar.backgroundColor = UIColor.tertiarySystemBackgroundColor;
-    } else {
-        _bottomToolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0];
-    }
-    
-    _previewButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [_previewButton addTarget:self action:@selector(previewButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    _previewButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    [_previewButton setTitle:tzImagePickerVc.previewBtnTitleStr forState:UIControlStateNormal];
-    [_previewButton setTitle:tzImagePickerVc.previewBtnTitleStr forState:UIControlStateDisabled];
-    if (@available(iOS 13.0, *)) {
-        [_previewButton setTitleColor:UIColor.labelColor forState:UIControlStateNormal];
-    } else {
-        [_previewButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-    }
-    [_previewButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
-    _previewButton.enabled = tzImagePickerVc.selectedModels.count;
-    
-    if (tzImagePickerVc.allowPickingOriginalPhoto) {
-        _originalPhotoButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        _originalPhotoButton.imageEdgeInsets = UIEdgeInsetsMake(0, [TZCommonTools tz_isRightToLeftLayout] ? 10 : -10, 0, 0);
-        [_originalPhotoButton addTarget:self action:@selector(originalPhotoButtonClick) forControlEvents:UIControlEventTouchUpInside];
-        _originalPhotoButton.titleLabel.font = [UIFont systemFontOfSize:16];
-        [_originalPhotoButton setTitle:tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateNormal];
-        [_originalPhotoButton setTitle:tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateSelected];
-        [_originalPhotoButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
-        if (@available(iOS 13.0, *)) {
-            [_originalPhotoButton setTitleColor:[UIColor labelColor] forState:UIControlStateSelected];
-        } else {
-            [_originalPhotoButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
-        }
-        [_originalPhotoButton setImage:tzImagePickerVc.photoOriginDefImage forState:UIControlStateNormal];
-        [_originalPhotoButton setImage:tzImagePickerVc.photoOriginSelImage forState:UIControlStateSelected];
-        _originalPhotoButton.imageView.clipsToBounds = YES;
-        _originalPhotoButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
-        _originalPhotoButton.selected = _isSelectOriginalPhoto;
-        _originalPhotoButton.enabled = tzImagePickerVc.selectedModels.count > 0;
-        
-        _originalPhotoLabel = [[UILabel alloc] init];
-        _originalPhotoLabel.textAlignment = NSTextAlignmentLeft;
-        _originalPhotoLabel.font = [UIFont systemFontOfSize:16];
-        if (@available(iOS 13.0, *)) {
-            _originalPhotoLabel.textColor = [UIColor labelColor];
-        } else {
-            _originalPhotoLabel.textColor = [UIColor blackColor];
-        }
-        if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes];
-    }
-    
-    _doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    _doneButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal];
-    [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateDisabled];
-    [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal];
-    [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorDisabled forState:UIControlStateDisabled];
-    _doneButton.enabled = tzImagePickerVc.selectedModels.count || tzImagePickerVc.alwaysEnableDoneBtn;
-    
-    _numberImageView = [[UIImageView alloc] initWithImage:tzImagePickerVc.photoNumberIconImage];
-    _numberImageView.hidden = tzImagePickerVc.selectedModels.count <= 0;
-    _numberImageView.clipsToBounds = YES;
-    _numberImageView.contentMode = UIViewContentModeScaleAspectFit;
-    _numberImageView.backgroundColor = [UIColor clearColor];
-    
-    _numberLabel = [[UILabel alloc] init];
-    _numberLabel.font = [UIFont systemFontOfSize:15];
-    _numberLabel.adjustsFontSizeToFitWidth = YES;
-    _numberLabel.textColor = [UIColor whiteColor];
-    _numberLabel.textAlignment = NSTextAlignmentCenter;
-    _numberLabel.text = [NSString stringWithFormat:@"%zd",tzImagePickerVc.selectedModels.count];
-    _numberLabel.hidden = tzImagePickerVc.selectedModels.count <= 0;
-    _numberLabel.backgroundColor = [UIColor clearColor];
-    _numberLabel.userInteractionEnabled = YES;
-
-    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doneButtonClick)];
-    [_numberLabel addGestureRecognizer:tapGesture];
-    
-    _divideLine = [[UIView alloc] init];
-    CGFloat rgb2 = 222 / 255.0;
-    if (@available(iOS 13.0, *)) {
-        UIColor *divideLineDyColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull trainCollection) {
-            if ([trainCollection userInterfaceStyle] == UIUserInterfaceStyleLight) {
-                return [UIColor colorWithRed:rgb2 green:rgb2 blue:rgb2 alpha:1.0];
-            } else {
-                CGFloat lineDarkRgb = 100 / 255.0;
-                return [UIColor colorWithRed:lineDarkRgb green:lineDarkRgb blue:lineDarkRgb alpha:1.0];
-            }
-        }];
-        _divideLine.backgroundColor = divideLineDyColor;
-    } else {
-        _divideLine.backgroundColor = [UIColor colorWithRed:rgb2 green:rgb2 blue:rgb2 alpha:1.0];
-    }
-    
-    [_bottomToolBar addSubview:_divideLine];
-    [_bottomToolBar addSubview:_previewButton];
-    [_bottomToolBar addSubview:_doneButton];
-    [_bottomToolBar addSubview:_numberImageView];
-    [_bottomToolBar addSubview:_numberLabel];
-    [_bottomToolBar addSubview:_originalPhotoButton];
-    [self.view addSubview:_bottomToolBar];
-    [_originalPhotoButton addSubview:_originalPhotoLabel];
-    
-    if (tzImagePickerVc.photoPickerPageUIConfigBlock) {
-        tzImagePickerVc.photoPickerPageUIConfigBlock(_collectionView, _bottomToolBar, _previewButton, _originalPhotoButton, _originalPhotoLabel, _doneButton, _numberImageView, _numberLabel, _divideLine);
-    }
-}
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-    
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    
-    CGFloat top = 0;
-    CGFloat collectionViewHeight = 0;
-    CGFloat naviBarHeight = self.navigationController.navigationBar.tz_height;
-    BOOL isStatusBarHidden = [UIApplication sharedApplication].isStatusBarHidden;
-    BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
-    CGFloat toolBarHeight = 50 + [TZCommonTools tz_safeAreaInsets].bottom;
-    if (self.navigationController.navigationBar.isTranslucent) {
-        top = naviBarHeight;
-        if (!isStatusBarHidden && isFullScreen) top += [TZCommonTools tz_statusBarHeight];
-        collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - toolBarHeight - top : self.view.tz_height - top;;
-    } else {
-        collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - toolBarHeight : self.view.tz_height;
-    }
-    _collectionView.frame = CGRectMake(0, top, self.view.tz_width, collectionViewHeight);
-    _noDataLabel.frame = _collectionView.bounds;
-    CGFloat itemWH = (self.view.tz_width - (self.columnNumber + 1) * itemMargin) / self.columnNumber;
-    _layout.itemSize = CGSizeMake(itemWH, itemWH);
-    _layout.minimumInteritemSpacing = itemMargin;
-    _layout.minimumLineSpacing = itemMargin;
-    [_collectionView setCollectionViewLayout:_layout];
-    if (_offsetItemCount > 0) {
-        CGFloat offsetY = _offsetItemCount * (_layout.itemSize.height + _layout.minimumLineSpacing);
-        [_collectionView setContentOffset:CGPointMake(0, offsetY)];
-    }
-    
-    CGFloat toolBarTop = 0;
-    if (!self.navigationController.navigationBar.isHidden) {
-        toolBarTop = self.view.tz_height - toolBarHeight;
-    } else {
-        CGFloat navigationHeight = naviBarHeight + [TZCommonTools tz_statusBarHeight];
-        toolBarTop = self.view.tz_height - toolBarHeight - navigationHeight;
-    }
-    _bottomToolBar.frame = CGRectMake(0, toolBarTop, self.view.tz_width, toolBarHeight);
-    
-    CGFloat previewWidth = [tzImagePickerVc.previewBtnTitleStr boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} context:nil].size.width + 2;
-    if (!tzImagePickerVc.allowPreview) {
-        previewWidth = 0.0;
-    }
-    _previewButton.frame = CGRectMake(10, 3, previewWidth, 44);
-    _previewButton.tz_width = !tzImagePickerVc.showSelectBtn ? 0 : previewWidth;
-    if (tzImagePickerVc.allowPickingOriginalPhoto) {
-        CGFloat fullImageWidth = [tzImagePickerVc.fullImageBtnTitleStr boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size.width;
-        _originalPhotoButton.frame = CGRectMake(CGRectGetMaxX(_previewButton.frame), 0, fullImageWidth + 56, 50);
-        _originalPhotoLabel.frame = CGRectMake(fullImageWidth + 46, 0, 80, 50);
-    }
-    [_doneButton sizeToFit];
-    _doneButton.frame = CGRectMake(self.view.tz_width - _doneButton.tz_width - 12, 0, MAX(44, _doneButton.tz_width), 50);
-    _numberImageView.frame = CGRectMake(_doneButton.tz_left - 24 - 5, 13, 24, 24);
-    _numberLabel.frame = _numberImageView.frame;
-    _divideLine.frame = CGRectMake(0, 0, self.view.tz_width, 1);
-    
-    [TZImageManager manager].columnNumber = [TZImageManager manager].columnNumber;
-    [TZImageManager manager].photoWidth = tzImagePickerVc.photoWidth;
-    [self.collectionView reloadData];
-    
-    if (tzImagePickerVc.photoPickerPageDidLayoutSubviewsBlock) {
-        tzImagePickerVc.photoPickerPageDidLayoutSubviewsBlock(_collectionView, _bottomToolBar, _previewButton, _originalPhotoButton, _originalPhotoLabel, _doneButton, _numberImageView, _numberLabel, _divideLine);
-    }
-}
-
-#pragma mark - Notification
-
-- (void)didChangeStatusBarOrientationNotification:(NSNotification *)noti {
-    _offsetItemCount = _collectionView.contentOffset.y / (_layout.itemSize.height + _layout.minimumLineSpacing);
-}
-
-#pragma mark - Click Event
-- (void)navLeftBarButtonClick{
-    [self.navigationController popViewControllerAnimated:YES];
-}
-- (void)previewButtonClick {
-    TZPhotoPreviewController *photoPreviewVc = [[TZPhotoPreviewController alloc] init];
-    [self pushPhotoPrevireViewController:photoPreviewVc needCheckSelectedModels:YES];
-}
-
-- (void)originalPhotoButtonClick {
-    _originalPhotoButton.selected = !_originalPhotoButton.isSelected;
-    _isSelectOriginalPhoto = _originalPhotoButton.isSelected;
-    _originalPhotoLabel.hidden = !_originalPhotoButton.isSelected;
-    if (_isSelectOriginalPhoto) {
-        [self getSelectedPhotoBytes];
-    }
-}
-
-- (void)doneButtonClick {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    // 1.6.8 判断是否满足最小必选张数的限制
-    if (tzImagePickerVc.minImagesCount && tzImagePickerVc.selectedModels.count < tzImagePickerVc.minImagesCount) {
-        NSString *title = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Select a minimum of %zd photos"], tzImagePickerVc.minImagesCount];
-        [tzImagePickerVc showAlertWithTitle:title];
-        return;
-    }
-    
-    [tzImagePickerVc showProgressHUD];
-    _doneButton.enabled = NO;
-    self.isFetchingMedia = YES;
-    NSMutableArray *assets = [NSMutableArray array];
-    NSMutableArray *photos;
-    NSMutableArray *infoArr;
-    if (tzImagePickerVc.onlyReturnAsset) { // not fetch image
-        for (NSInteger i = 0; i < tzImagePickerVc.selectedModels.count; i++) {
-            TZAssetModel *model = tzImagePickerVc.selectedModels[i];
-            [assets addObject:model.asset];
-        }
-    } else { // fetch image
-        photos = [NSMutableArray array];
-        infoArr = [NSMutableArray array];
-        for (NSInteger i = 0; i < tzImagePickerVc.selectedModels.count; i++) { [photos addObject:@1];[assets addObject:@1];[infoArr addObject:@1]; }
-        
-        __block BOOL havenotShowAlert = YES;
-        [TZImageManager manager].shouldFixOrientation = YES;
-        __block UIAlertController *alertView;
-        for (NSInteger i = 0; i < tzImagePickerVc.selectedModels.count; i++) {
-            TZAssetModel *model = tzImagePickerVc.selectedModels[i];
-            TZImageRequestOperation *operation = [[TZImageRequestOperation alloc] initWithAsset:model.asset completion:^(UIImage * _Nonnull photo, NSDictionary * _Nonnull info, BOOL isDegraded) {
-                if (isDegraded) return;
-                if (photo) {
-                    if (![TZImagePickerConfig sharedInstance].notScaleImage) {
-                        photo = [[TZImageManager manager] scaleImage:photo toSize:CGSizeMake(tzImagePickerVc.photoWidth, (int)(tzImagePickerVc.photoWidth * photo.size.height / photo.size.width))];
-                    }
-                    [photos replaceObjectAtIndex:i withObject:photo];
-                }
-                if (info)  [infoArr replaceObjectAtIndex:i withObject:info];
-                [assets replaceObjectAtIndex:i withObject:model.asset];
-                
-                for (id item in photos) { if ([item isKindOfClass:[NSNumber class]]) return; }
-                
-                if (havenotShowAlert && alertView) {
-                    [alertView dismissViewControllerAnimated:YES completion:^{
-                        alertView = nil;
-                        [self didGetAllPhotos:photos assets:assets infoArr:infoArr];
-                    }];
-                } else {
-                    [self didGetAllPhotos:photos assets:assets infoArr:infoArr];
-                }
-            } progressHandler:^(double progress, NSError * _Nonnull error, BOOL * _Nonnull stop, NSDictionary * _Nonnull info) {
-                // 如果图片正在从iCloud同步中,提醒用户
-                if (progress < 1 && havenotShowAlert && !alertView) {
-                    alertView = [tzImagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Synchronizing photos from iCloud"]];
-                    havenotShowAlert = NO;
-                    return;
-                }
-                if (progress >= 1) {
-                    havenotShowAlert = YES;
-                }
-            }];
-            [self.operationQueue addOperation:operation];
-        }
-    }
-    if (tzImagePickerVc.selectedModels.count <= 0 || tzImagePickerVc.onlyReturnAsset) {
-        [self didGetAllPhotos:photos assets:assets infoArr:infoArr];
-    }
-}
-
-- (void)didGetAllPhotos:(NSArray *)photos assets:(NSArray *)assets infoArr:(NSArray *)infoArr {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    [tzImagePickerVc hideProgressHUD];
-    _doneButton.enabled = YES;
-    self.isFetchingMedia = NO;
-
-    if (tzImagePickerVc.autoDismiss) {
-        [self.navigationController dismissViewControllerAnimated:YES completion:^{
-            [self callDelegateMethodWithPhotos:photos assets:assets infoArr:infoArr];
-        }];
-    } else {
-        [self callDelegateMethodWithPhotos:photos assets:assets infoArr:infoArr];
-    }
-}
-
-- (void)callDelegateMethodWithPhotos:(NSArray *)photos assets:(NSArray *)assets infoArr:(NSArray *)infoArr {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc.allowPickingVideo && tzImagePickerVc.maxImagesCount == 1) {
-        if ([[TZImageManager manager] isVideo:[assets firstObject]]) {
-            if ([tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingVideo:sourceAssets:)]) {
-                [tzImagePickerVc.pickerDelegate imagePickerController:tzImagePickerVc didFinishPickingVideo:[photos firstObject] sourceAssets:[assets firstObject]];
-            }
-            if (tzImagePickerVc.didFinishPickingVideoHandle) {
-                tzImagePickerVc.didFinishPickingVideoHandle([photos firstObject], [assets firstObject]);
-            }
-            return;
-        }
-    }
-    
-    if ([tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:)]) {
-        [tzImagePickerVc.pickerDelegate imagePickerController:tzImagePickerVc didFinishPickingPhotos:photos sourceAssets:assets isSelectOriginalPhoto:_isSelectOriginalPhoto];
-    }
-    if ([tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:infos:)]) {
-        [tzImagePickerVc.pickerDelegate imagePickerController:tzImagePickerVc didFinishPickingPhotos:photos sourceAssets:assets isSelectOriginalPhoto:_isSelectOriginalPhoto infos:infoArr];
-    }
-    if (tzImagePickerVc.didFinishPickingPhotosHandle) {
-        tzImagePickerVc.didFinishPickingPhotosHandle(photos,assets,_isSelectOriginalPhoto);
-    }
-    if (tzImagePickerVc.didFinishPickingPhotosWithInfosHandle) {
-        tzImagePickerVc.didFinishPickingPhotosWithInfosHandle(photos,assets,_isSelectOriginalPhoto,infoArr);
-    }
-}
-
-#pragma mark - UICollectionViewDataSource && Delegate
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
-    if (_showTakePhotoBtn) {
-        return _models.count + 1;
-    }
-    return _models.count;
-}
-
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
-    // the cell lead to take a picture / 去拍照的cell
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (((tzImagePickerVc.sortAscendingByModificationDate && indexPath.item >= _models.count) || (!tzImagePickerVc.sortAscendingByModificationDate && indexPath.item == 0)) && _showTakePhotoBtn) {
-        TZAssetCameraCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZAssetCameraCell" forIndexPath:indexPath];
-        cell.imageView.image = tzImagePickerVc.takePictureImage;
-        if ([tzImagePickerVc.takePictureImageName isEqualToString:@"takePicture80"]) {
-            cell.imageView.contentMode = UIViewContentModeCenter;
-            CGFloat rgb = 223 / 255.0;
-            cell.imageView.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0];
-        } else {
-            cell.imageView.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.500];
-        }
-        return cell;
-    }
-    // the cell dipaly photo or video / 展示照片或视频的cell
-    TZAssetCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZAssetCell" forIndexPath:indexPath];
-    cell.allowPickingMultipleVideo = tzImagePickerVc.allowPickingMultipleVideo;
-    cell.photoDefImage = tzImagePickerVc.photoDefImage;
-    cell.photoSelImage = tzImagePickerVc.photoSelImage;
-    cell.assetCellDidSetModelBlock = tzImagePickerVc.assetCellDidSetModelBlock;
-    cell.assetCellDidLayoutSubviewsBlock = tzImagePickerVc.assetCellDidLayoutSubviewsBlock;
-    TZAssetModel *model;
-    if (tzImagePickerVc.sortAscendingByModificationDate || !_showTakePhotoBtn) {
-        model = _models[indexPath.item];
-    } else {
-        model = _models[indexPath.item - 1];
-    }
-    cell.allowPickingGif = tzImagePickerVc.allowPickingGif;
-    cell.model = model;
-    if (model.isSelected && tzImagePickerVc.showSelectedIndex) {
-        cell.index = [tzImagePickerVc.selectedAssetIds indexOfObject:model.asset.localIdentifier] + 1;
-    }
-    cell.showSelectBtn = tzImagePickerVc.showSelectBtn;
-    cell.allowPreview = tzImagePickerVc.allowPreview;
-    
-    BOOL notSelectable = [TZCommonTools isAssetNotSelectable:model tzImagePickerVc:tzImagePickerVc];
-    if (notSelectable && tzImagePickerVc.showPhotoCannotSelectLayer && !model.isSelected) {
-        cell.cannotSelectLayerButton.backgroundColor = tzImagePickerVc.cannotSelectLayerColor;
-        cell.cannotSelectLayerButton.hidden = NO;
-    } else {
-        cell.cannotSelectLayerButton.hidden = YES;
-    }
-    
-    __weak typeof(cell) weakCell = cell;
-    __weak typeof(self) weakSelf = self;
-    __weak typeof(_numberImageView.layer) weakLayer = _numberImageView.layer;
-    cell.didSelectPhotoBlock = ^(BOOL isSelected) {
-        __strong typeof(weakCell) strongCell = weakCell;
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        __strong typeof(weakLayer) strongLayer = weakLayer;
-        TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)strongSelf.navigationController;
-        // 1. cancel select / 取消选择
-        if (isSelected) {
-            strongCell.selectPhotoButton.selected = NO;
-            model.isSelected = NO;
-            NSArray *selectedModels = [NSArray arrayWithArray:tzImagePickerVc.selectedModels];
-            for (TZAssetModel *model_item in selectedModels) {
-                if ([model.asset.localIdentifier isEqualToString:model_item.asset.localIdentifier]) {
-                    [tzImagePickerVc removeSelectedModel:model_item];
-                    [strongSelf setAsset:model_item.asset isSelect:NO];
-                    break;
-                }
-            }
-            [strongSelf refreshBottomToolBarStatus];
-            if (tzImagePickerVc.showSelectedIndex || tzImagePickerVc.showPhotoCannotSelectLayer) {
-                [[NSNotificationCenter defaultCenter] postNotificationName:@"TZ_PHOTO_PICKER_RELOAD_NOTIFICATION" object:strongSelf.navigationController];
-            }
-            [UIView showOscillatoryAnimationWithLayer:strongLayer type:TZOscillatoryAnimationToSmaller];
-            if (strongCell.model.iCloudFailed) {
-                NSString *title = [NSBundle tz_localizedStringForKey:@"iCloud sync failed"];
-                [tzImagePickerVc showAlertWithTitle:title];
-            }
-        } else {
-            // 2. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制
-            if (tzImagePickerVc.selectedModels.count < tzImagePickerVc.maxImagesCount) {
-                if ([[TZImageManager manager] isAssetCannotBeSelected:model.asset]) {
-                    return;
-                }
-                if (!tzImagePickerVc.allowPreview) {
-                    BOOL shouldDone = tzImagePickerVc.maxImagesCount == 1;
-                    if (!tzImagePickerVc.allowPickingMultipleVideo && (model.type == TZAssetModelMediaTypeVideo || model.type == TZAssetModelMediaTypePhotoGif)) {
-                        shouldDone = YES;
-                    }
-                    if (shouldDone) {
-                        model.isSelected = YES;
-                        [tzImagePickerVc addSelectedModel:model];
-                        [strongSelf doneButtonClick];
-                        return;
-                    }
-                }
-                strongCell.selectPhotoButton.selected = YES;
-                model.isSelected = YES;
-                [tzImagePickerVc addSelectedModel:model];
-                if (tzImagePickerVc.showSelectedIndex || tzImagePickerVc.showPhotoCannotSelectLayer) {
-                    [[NSNotificationCenter defaultCenter] postNotificationName:@"TZ_PHOTO_PICKER_RELOAD_NOTIFICATION" object:strongSelf.navigationController];
-                }
-                [strongSelf setAsset:model.asset isSelect:YES];
-                [strongSelf refreshBottomToolBarStatus];
-                [UIView showOscillatoryAnimationWithLayer:strongLayer type:TZOscillatoryAnimationToSmaller];
-            } else {
-                NSString *title = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Select a maximum of %zd photos"], tzImagePickerVc.maxImagesCount];
-                [tzImagePickerVc showAlertWithTitle:title];
-            }
-        }
-    };
-    return cell;
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
-    // take a photo / 去拍照
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (((tzImagePickerVc.sortAscendingByModificationDate && indexPath.item >= _models.count) || (!tzImagePickerVc.sortAscendingByModificationDate && indexPath.item == 0)) && _showTakePhotoBtn)  {
-        [self takePhoto]; return;
-    }
-    // preview phote or video / 预览照片或视频
-    NSInteger index = indexPath.item;
-    if (!tzImagePickerVc.sortAscendingByModificationDate && _showTakePhotoBtn) {
-        index = indexPath.item - 1;
-    }
-    TZAssetModel *model = _models[index];
-    if (model.type == TZAssetModelMediaTypeVideo && !tzImagePickerVc.allowPickingMultipleVideo) {
-        if (tzImagePickerVc.selectedModels.count > 0) {
-            TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-            [imagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Can not choose both video and photo"]];
-        } else {
-            TZVideoPlayerController *videoPlayerVc = [[TZVideoPlayerController alloc] init];
-            videoPlayerVc.model = model;
-            [self.navigationController pushViewController:videoPlayerVc animated:YES];
-        }
-    } else if (model.type == TZAssetModelMediaTypePhotoGif && tzImagePickerVc.allowPickingGif && !tzImagePickerVc.allowPickingMultipleVideo) {
-        if (tzImagePickerVc.selectedModels.count > 0) {
-            TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-            [imagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Can not choose both photo and GIF"]];
-        } else {
-            TZGifPhotoPreviewController *gifPreviewVc = [[TZGifPhotoPreviewController alloc] init];
-            gifPreviewVc.model = model;
-            [self.navigationController pushViewController:gifPreviewVc animated:YES];
-        }
-    } else {
-        TZPhotoPreviewController *photoPreviewVc = [[TZPhotoPreviewController alloc] init];
-        photoPreviewVc.currentIndex = index;
-        photoPreviewVc.models = _models;
-        [self pushPhotoPrevireViewController:photoPreviewVc];
-    }
-}
-
-#pragma mark - UIScrollViewDelegate
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
-    // [self updateCachedAssets];
-}
-
-#pragma mark - Private Method
-
-/// 拍照按钮点击事件
-- (void)takePhoto {
-    AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
-    if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied)) {
-        
-        // 无权限 做一个友好的提示
-        NSString *appName = [TZCommonTools tz_getAppName];
-
-        NSString *title = [NSBundle tz_localizedStringForKey:@"Can not use camera"];
-        NSString *message = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\""],appName];
-        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
-        UIAlertAction *cancelAct = [UIAlertAction actionWithTitle:[NSBundle tz_localizedStringForKey:@"Cancel"] style:UIAlertActionStyleCancel handler:nil];
-        [alertController addAction:cancelAct];
-        UIAlertAction *settingAct = [UIAlertAction actionWithTitle:[NSBundle tz_localizedStringForKey:@"Setting"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
-        }];
-        [alertController addAction:settingAct];
-        [self.navigationController presentViewController:alertController animated:YES completion:nil];
-    } else if (authStatus == AVAuthorizationStatusNotDetermined) {
-        // fix issue 466, 防止用户首次拍照拒绝授权时相机页黑屏
-        [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
-            if (granted) {
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    [self pushImagePickerController];
-                });
-            }
-        }];
-    } else {
-        [self pushImagePickerController];
-    }
-}
-
-// 调用相机
-- (void)pushImagePickerController {
-    // 提前定位
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc.allowCameraLocation) {
-        __weak typeof(self) weakSelf = self;
-        [[TZLocationManager manager] startLocationWithSuccessBlock:^(NSArray<CLLocation *> *locations) {
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            strongSelf.location = [locations firstObject];
-        } failureBlock:^(NSError *error) {
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            strongSelf.location = nil;
-        }];
-    }
-    
-    UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;
-    if ([UIImagePickerController isSourceTypeAvailable: sourceType]) {
-        self.imagePickerVc.sourceType = sourceType;
-        NSMutableArray *mediaTypes = [NSMutableArray array];
-        if (tzImagePickerVc.allowTakePicture) {
-            [mediaTypes addObject:(NSString *)kUTTypeImage];
-        }
-        if (tzImagePickerVc.allowTakeVideo) {
-            [mediaTypes addObject:(NSString *)kUTTypeMovie];
-            self.imagePickerVc.videoMaximumDuration = tzImagePickerVc.videoMaximumDuration;
-        }
-        self.imagePickerVc.mediaTypes= mediaTypes;
-        if (tzImagePickerVc.uiImagePickerControllerSettingBlock) {
-            tzImagePickerVc.uiImagePickerControllerSettingBlock(_imagePickerVc);
-        }
-        [self presentViewController:_imagePickerVc animated:YES completion:nil];
-    } else {
-        NSLog(@"模拟器中无法打开照相机,请在真机中使用");
-    }
-}
-
-- (void)refreshBottomToolBarStatus {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    
-    _previewButton.enabled = tzImagePickerVc.selectedModels.count > 0;
-    _doneButton.enabled = tzImagePickerVc.selectedModels.count > 0 || tzImagePickerVc.alwaysEnableDoneBtn;
-    
-    _numberImageView.hidden = tzImagePickerVc.selectedModels.count <= 0;
-    _numberLabel.hidden = tzImagePickerVc.selectedModels.count <= 0;
-    _numberLabel.text = [NSString stringWithFormat:@"%zd",tzImagePickerVc.selectedModels.count];
-    
-    _originalPhotoButton.enabled = tzImagePickerVc.selectedModels.count > 0;
-    _originalPhotoButton.selected = (_isSelectOriginalPhoto && _originalPhotoButton.enabled);
-    _originalPhotoLabel.hidden = (!_originalPhotoButton.isSelected);
-    if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes];
-    
-    if (tzImagePickerVc.photoPickerPageDidRefreshStateBlock) {
-        tzImagePickerVc.photoPickerPageDidRefreshStateBlock(_collectionView, _bottomToolBar, _previewButton, _originalPhotoButton, _originalPhotoLabel, _doneButton, _numberImageView, _numberLabel, _divideLine);;
-    }
-}
-
-- (void)pushPhotoPrevireViewController:(TZPhotoPreviewController *)photoPreviewVc {
-    [self pushPhotoPrevireViewController:photoPreviewVc needCheckSelectedModels:NO];
-}
-
-- (void)pushPhotoPrevireViewController:(TZPhotoPreviewController *)photoPreviewVc needCheckSelectedModels:(BOOL)needCheckSelectedModels {
-    __weak typeof(self) weakSelf = self;
-    photoPreviewVc.isSelectOriginalPhoto = _isSelectOriginalPhoto;
-    [photoPreviewVc setBackButtonClickBlock:^(BOOL isSelectOriginalPhoto) {
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        strongSelf.isSelectOriginalPhoto = isSelectOriginalPhoto;
-        if (needCheckSelectedModels) {
-            [strongSelf checkSelectedModels];
-        }
-        [strongSelf.collectionView reloadData];
-        [strongSelf refreshBottomToolBarStatus];
-    }];
-    [photoPreviewVc setDoneButtonClickBlock:^(BOOL isSelectOriginalPhoto) {
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        strongSelf.isSelectOriginalPhoto = isSelectOriginalPhoto;
-        [strongSelf doneButtonClick];
-    }];
-    [photoPreviewVc setDoneButtonClickBlockCropMode:^(UIImage *cropedImage, id asset) {
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        NSArray *assets = @[];
-        if (asset) {
-            assets = @[asset];
-        }
-        NSArray *photos = @[];
-        if (cropedImage) {
-            photos = @[cropedImage];
-        }
-        [strongSelf didGetAllPhotos:photos assets:assets infoArr:nil];
-    }];
-    [self.navigationController pushViewController:photoPreviewVc animated:YES];
-}
-
-- (void)getSelectedPhotoBytes {
-    // 越南语 && 5屏幕时会显示不下,暂时这样处理
-    if ([[TZImagePickerConfig sharedInstance].preferredLanguage isEqualToString:@"vi"] && self.view.tz_width <= 320) {
-        return;
-    }
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    [[TZImageManager manager] getPhotosBytesWithArray:imagePickerVc.selectedModels completion:^(NSString *totalBytes) {
-        self->_originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes];
-    }];
-}
-
-- (void)prepareScrollCollectionViewToBottom {
-    if (_shouldScrollToBottom && _models.count > 0) {
-        // try fix #1562:https://github.com/banchichen/TZImagePickerController/issues/1562
-        if (@available(iOS 15.0, *)) {
-            [_collectionView performBatchUpdates:^{} completion:^(BOOL finished) {
-                [self scrollCollectionViewToBottom];
-            }];
-        } else {
-            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-                [self scrollCollectionViewToBottom];
-            });
-        }
-    } else {
-        _collectionView.hidden = NO;
-    }
-}
-
-- (void)scrollCollectionViewToBottom {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    NSInteger item = 0;
-    if (tzImagePickerVc.sortAscendingByModificationDate) {
-        item = _models.count - 1;
-        if (_showTakePhotoBtn) {
-            item += 1;
-        }
-    }
-    [self->_collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:item inSection:0] atScrollPosition:UICollectionViewScrollPositionBottom animated:NO];
-    self->_shouldScrollToBottom = NO;
-    self->_collectionView.hidden = NO;
-}
-
-- (void)checkSelectedModels {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    NSArray *selectedModels = tzImagePickerVc.selectedModels;
-    NSMutableSet *selectedAssets = [NSMutableSet setWithCapacity:selectedModels.count];
-    for (TZAssetModel *model in selectedModels) {
-        [selectedAssets addObject:model.asset];
-    }
-    for (TZAssetModel *model in _models) {
-        model.isSelected = NO;
-        if ([selectedAssets containsObject:model.asset]) {
-            model.isSelected = YES;
-        }
-    }
-}
-
-/// 选中/取消选中某张照片
-- (void)setAsset:(PHAsset *)asset isSelect:(BOOL)isSelect {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (isSelect && [tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didSelectAsset:photo:isSelectOriginalPhoto:)]) {
-        [self callDelegate:asset isSelect:YES];
-    }
-    if (!isSelect && [tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didDeselectAsset:photo:isSelectOriginalPhoto:)]) {
-        [self callDelegate:asset isSelect:NO];
-    }
-}
-
-/// 调用选中/取消选中某张照片的代理方法
-- (void)callDelegate:(PHAsset *)asset isSelect:(BOOL)isSelect {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    __weak typeof(self) weakSelf = self;
-    __weak typeof(tzImagePickerVc) weakImagePickerVc= tzImagePickerVc;
-    [[TZImageManager manager] getPhotoWithAsset:asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        if (isDegraded) return;
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        __strong typeof(weakImagePickerVc) strongImagePickerVc = weakImagePickerVc;
-        if (isSelect) {
-            [strongImagePickerVc.pickerDelegate imagePickerController:strongImagePickerVc didSelectAsset:asset photo:photo isSelectOriginalPhoto:strongSelf.isSelectOriginalPhoto];
-        } else {
-            [strongImagePickerVc.pickerDelegate imagePickerController:strongImagePickerVc didDeselectAsset:asset photo:photo isSelectOriginalPhoto:strongSelf.isSelectOriginalPhoto];
-        }
-    }];
-}
-
-#pragma mark - UIImagePickerControllerDelegate
-
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
-    [picker dismissViewControllerAnimated:YES completion:nil];
-    NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
-    if ([type isEqualToString:@"public.image"]) {
-        TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-        [imagePickerVc showProgressHUD];
-        UIImage *photo = [info objectForKey:UIImagePickerControllerOriginalImage];
-        NSDictionary *meta = [info objectForKey:UIImagePickerControllerMediaMetadata];
-        if (photo) {
-            self.isSavingMedia = YES;
-            [[TZImageManager manager] savePhotoWithImage:photo meta:meta location:self.location completion:^(PHAsset *asset, NSError *error){
-                self.isSavingMedia = NO;
-                if (!error && asset) {
-                    [self addPHAsset:asset];
-                } else {
-                    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-                    [tzImagePickerVc hideProgressHUD];
-                }
-            }];
-            self.location = nil;
-        }
-    } else if ([type isEqualToString:@"public.movie"]) {
-        TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-        [imagePickerVc showProgressHUD];
-        NSURL *videoUrl = [info objectForKey:UIImagePickerControllerMediaURL];
-        if (videoUrl) {
-            self.isSavingMedia = YES;
-            [[TZImageManager manager] saveVideoWithUrl:videoUrl location:self.location completion:^(PHAsset *asset, NSError *error) {
-                self.isSavingMedia = NO;
-                if (!error && asset) {
-                    [self addPHAsset:asset];
-                } else {
-                    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-                    [tzImagePickerVc hideProgressHUD];
-                }
-            }];
-            self.location = nil;
-        }
-    }
-}
-
-- (void)addPHAsset:(PHAsset *)asset {
-    TZAssetModel *assetModel = [[TZImageManager manager] createModelWithAsset:asset];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    [tzImagePickerVc hideProgressHUD];
-    if (tzImagePickerVc.sortAscendingByModificationDate) {
-        [_models addObject:assetModel];
-    } else {
-        [_models insertObject:assetModel atIndex:0];
-    }
-    
-    if (tzImagePickerVc.maxImagesCount <= 1) {
-        if (tzImagePickerVc.allowCrop && asset.mediaType == PHAssetMediaTypeImage) {
-            TZPhotoPreviewController *photoPreviewVc = [[TZPhotoPreviewController alloc] init];
-            if (tzImagePickerVc.sortAscendingByModificationDate) {
-                photoPreviewVc.currentIndex = _models.count - 1;
-            } else {
-                photoPreviewVc.currentIndex = 0;
-            }
-            photoPreviewVc.models = _models;
-            [self pushPhotoPrevireViewController:photoPreviewVc];
-        } else if (tzImagePickerVc.selectedModels.count < 1) {
-            [tzImagePickerVc addSelectedModel:assetModel];
-            [self doneButtonClick];
-        }
-        return;
-    }
-    
-    if (tzImagePickerVc.selectedModels.count < tzImagePickerVc.maxImagesCount) {
-        if (assetModel.type == TZAssetModelMediaTypeVideo && !tzImagePickerVc.allowPickingMultipleVideo) {
-            // 不能多选视频的情况下,不选中拍摄的视频
-        } else {
-            if ([[TZImageManager manager] isAssetCannotBeSelected:assetModel.asset]) {
-                return;
-            }
-            assetModel.isSelected = YES;
-            [tzImagePickerVc addSelectedModel:assetModel];
-            [self refreshBottomToolBarStatus];
-        }
-    }
-    _collectionView.hidden = YES;
-    [_collectionView reloadData];
-    
-    _shouldScrollToBottom = YES;
-    [self prepareScrollCollectionViewToBottom];
-}
-
-- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
-    [picker dismissViewControllerAnimated:YES completion:nil];
-}
-
-- (void)dealloc {
-    [[PHPhotoLibrary sharedPhotoLibrary] unregisterChangeObserver:self];
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-    // NSLog(@"%@ dealloc",NSStringFromClass(self.class));
-}
-
-#pragma mark - PHPhotoLibraryChangeObserver
-
-- (void)photoLibraryDidChange:(PHChange *)changeInstance {
-    if (self.isSavingMedia || self.isFetchingMedia) {
-        return;
-    }
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self.model refreshFetchResult];
-        [self fetchAssetModels];
-    });
-}
-
-#pragma mark - Asset Caching
-
-- (void)resetCachedAssets {
-    [[TZImageManager manager].cachingImageManager stopCachingImagesForAllAssets];
-    self.previousPreheatRect = CGRectZero;
-}
-
-- (void)updateCachedAssets {
-    BOOL isViewVisible = [self isViewLoaded] && [[self view] window] != nil;
-    if (!isViewVisible) { return; }
-    
-    // The preheat window is twice the height of the visible rect.
-    CGRect preheatRect = _collectionView.bounds;
-    preheatRect = CGRectInset(preheatRect, 0.0f, -0.5f * CGRectGetHeight(preheatRect));
-    
-    /*
-     Check if the collection view is showing an area that is significantly
-     different to the last preheated area.
-     */
-    CGFloat delta = ABS(CGRectGetMidY(preheatRect) - CGRectGetMidY(self.previousPreheatRect));
-    if (delta > CGRectGetHeight(_collectionView.bounds) / 3.0f) {
-        
-        // Compute the assets to start caching and to stop caching.
-        NSMutableArray *addedIndexPaths = [NSMutableArray array];
-        NSMutableArray *removedIndexPaths = [NSMutableArray array];
-        
-        [self computeDifferenceBetweenRect:self.previousPreheatRect andRect:preheatRect removedHandler:^(CGRect removedRect) {
-            NSArray *indexPaths = [self aapl_indexPathsForElementsInRect:removedRect];
-            [removedIndexPaths addObjectsFromArray:indexPaths];
-        } addedHandler:^(CGRect addedRect) {
-            NSArray *indexPaths = [self aapl_indexPathsForElementsInRect:addedRect];
-            [addedIndexPaths addObjectsFromArray:indexPaths];
-        }];
-        
-        NSArray *assetsToStartCaching = [self assetsAtIndexPaths:addedIndexPaths];
-        NSArray *assetsToStopCaching = [self assetsAtIndexPaths:removedIndexPaths];
-        
-        // Update the assets the PHCachingImageManager is caching.
-        [[TZImageManager manager].cachingImageManager startCachingImagesForAssets:assetsToStartCaching
-                                                                       targetSize:AssetGridThumbnailSize
-                                                                      contentMode:PHImageContentModeAspectFill
-                                                                          options:nil];
-        [[TZImageManager manager].cachingImageManager stopCachingImagesForAssets:assetsToStopCaching
-                                                                      targetSize:AssetGridThumbnailSize
-                                                                     contentMode:PHImageContentModeAspectFill
-                                                                         options:nil];
-        
-        // Store the preheat rect to compare against in the future.
-        self.previousPreheatRect = preheatRect;
-    }
-}
-
-- (void)computeDifferenceBetweenRect:(CGRect)oldRect andRect:(CGRect)newRect removedHandler:(void (^)(CGRect removedRect))removedHandler addedHandler:(void (^)(CGRect addedRect))addedHandler {
-    if (CGRectIntersectsRect(newRect, oldRect)) {
-        CGFloat oldMaxY = CGRectGetMaxY(oldRect);
-        CGFloat oldMinY = CGRectGetMinY(oldRect);
-        CGFloat newMaxY = CGRectGetMaxY(newRect);
-        CGFloat newMinY = CGRectGetMinY(newRect);
-        
-        if (newMaxY > oldMaxY) {
-            CGRect rectToAdd = CGRectMake(newRect.origin.x, oldMaxY, newRect.size.width, (newMaxY - oldMaxY));
-            addedHandler(rectToAdd);
-        }
-        
-        if (oldMinY > newMinY) {
-            CGRect rectToAdd = CGRectMake(newRect.origin.x, newMinY, newRect.size.width, (oldMinY - newMinY));
-            addedHandler(rectToAdd);
-        }
-        
-        if (newMaxY < oldMaxY) {
-            CGRect rectToRemove = CGRectMake(newRect.origin.x, newMaxY, newRect.size.width, (oldMaxY - newMaxY));
-            removedHandler(rectToRemove);
-        }
-        
-        if (oldMinY < newMinY) {
-            CGRect rectToRemove = CGRectMake(newRect.origin.x, oldMinY, newRect.size.width, (newMinY - oldMinY));
-            removedHandler(rectToRemove);
-        }
-    } else {
-        addedHandler(newRect);
-        removedHandler(oldRect);
-    }
-}
-
-- (NSArray *)assetsAtIndexPaths:(NSArray *)indexPaths {
-    if (indexPaths.count == 0) { return nil; }
-    
-    NSMutableArray *assets = [NSMutableArray arrayWithCapacity:indexPaths.count];
-    for (NSIndexPath *indexPath in indexPaths) {
-        if (indexPath.item < _models.count) {
-            TZAssetModel *model = _models[indexPath.item];
-            [assets addObject:model.asset];
-        }
-    }
-    
-    return assets;
-}
-
-- (NSArray *)aapl_indexPathsForElementsInRect:(CGRect)rect {
-    NSArray *allLayoutAttributes = [_collectionView.collectionViewLayout layoutAttributesForElementsInRect:rect];
-    if (allLayoutAttributes.count == 0) { return nil; }
-    NSMutableArray *indexPaths = [NSMutableArray arrayWithCapacity:allLayoutAttributes.count];
-    for (UICollectionViewLayoutAttributes *layoutAttributes in allLayoutAttributes) {
-        NSIndexPath *indexPath = layoutAttributes.indexPath;
-        [indexPaths addObject:indexPath];
-    }
-    return indexPaths;
-}
-#pragma clang diagnostic pop
-
-@end
-
-
-
-@implementation TZCollectionView
-
-- (BOOL)touchesShouldCancelInContentView:(UIView *)view {
-    if ([view isKindOfClass:[UIControl class]]) {
-        return YES;
-    }
-    return [super touchesShouldCancelInContentView:view];
-}
-
-@end

+ 0 - 76
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewCell.h

@@ -1,76 +0,0 @@
-//
-//  TZPhotoPreviewCell.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@class TZAssetModel;
-@interface TZAssetPreviewCell : UICollectionViewCell
-@property (nonatomic, strong) TZAssetModel *model;
-@property (nonatomic, copy) void (^singleTapGestureBlock)(void);
-- (void)configSubviews;
-- (void)photoPreviewCollectionViewDidScroll;
-@end
-
-
-@class TZAssetModel,TZProgressView,TZPhotoPreviewView;
-@interface TZPhotoPreviewCell : TZAssetPreviewCell
-
-@property (nonatomic, copy) void (^imageProgressUpdateBlock)(double progress);
-
-@property (nonatomic, strong) TZPhotoPreviewView *previewView;
-
-@property (nonatomic, assign) BOOL allowCrop;
-@property (nonatomic, assign) CGRect cropRect;
-@property (nonatomic, assign) BOOL scaleAspectFillCrop;
-
-- (void)recoverSubviews;
-
-@end
-
-
-@interface TZPhotoPreviewView : UIView
-@property (nonatomic, strong) UIImageView *imageView;
-@property (nonatomic, strong) UIScrollView *scrollView;
-@property (nonatomic, strong) UIView *imageContainerView;
-@property (nonatomic, strong) TZProgressView *progressView;
-@property (nonatomic, strong) UIImageView *iCloudErrorIcon;
-@property (nonatomic, strong) UILabel *iCloudErrorLabel;
-@property (nonatomic, copy) void (^iCloudSyncFailedHandle)(id asset, BOOL isSyncFailed);
-
-
-@property (nonatomic, assign) BOOL allowCrop;
-@property (nonatomic, assign) CGRect cropRect;
-@property (nonatomic, assign) BOOL scaleAspectFillCrop;
-@property (nonatomic, strong) TZAssetModel *model;
-@property (nonatomic, strong) id asset;
-@property (nonatomic, copy) void (^singleTapGestureBlock)(void);
-@property (nonatomic, copy) void (^imageProgressUpdateBlock)(double progress);
-
-@property (nonatomic, assign) int32_t imageRequestID;
-
-- (void)recoverSubviews;
-@end
-
-
-@class AVPlayer, AVPlayerLayer;
-@interface TZVideoPreviewCell : TZAssetPreviewCell
-@property (strong, nonatomic) AVPlayer *player;
-@property (strong, nonatomic) AVPlayerLayer *playerLayer;
-@property (strong, nonatomic) UIButton *playButton;
-@property (strong, nonatomic) UIImage *cover;
-@property (nonatomic, strong) NSURL *videoURL;
-@property (nonatomic, strong) UIImageView *iCloudErrorIcon;
-@property (nonatomic, strong) UILabel *iCloudErrorLabel;
-@property (nonatomic, copy) void (^iCloudSyncFailedHandle)(id asset, BOOL isSyncFailed);
-- (void)pausePlayerAndShowNaviBar;
-@end
-
-
-@interface TZGifPreviewCell : TZAssetPreviewCell
-@property (strong, nonatomic) TZPhotoPreviewView *previewView;
-@end

+ 0 - 576
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewCell.m

@@ -1,576 +0,0 @@
-//
-//  TZPhotoPreviewCell.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import "TZPhotoPreviewCell.h"
-#import "TZAssetModel.h"
-#import "UIView+TZLayout.h"
-#import "TZImageManager.h"
-#import "TZProgressView.h"
-#import "TZImageCropManager.h"
-#import <MediaPlayer/MediaPlayer.h>
-#import "TZImagePickerController.h"
-
-@implementation TZAssetPreviewCell
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        self.backgroundColor = [UIColor blackColor];
-        [self configSubviews];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(photoPreviewCollectionViewDidScroll) name:@"photoPreviewCollectionViewDidScroll" object:nil];
-    }
-    return self;
-}
-
-- (void)configSubviews {
-    
-}
-
-#pragma mark - Notification
-
-- (void)photoPreviewCollectionViewDidScroll {
-    
-}
-
-- (void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-@end
-
-
-@implementation TZPhotoPreviewCell
-
-- (void)configSubviews {
-    self.previewView = [[TZPhotoPreviewView alloc] initWithFrame:CGRectZero];
-    __weak typeof(self) weakSelf = self;
-    [self.previewView setSingleTapGestureBlock:^{
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        if (strongSelf.singleTapGestureBlock) {
-            strongSelf.singleTapGestureBlock();
-        }
-    }];
-    [self.previewView setImageProgressUpdateBlock:^(double progress) {
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        if (strongSelf.imageProgressUpdateBlock) {
-            strongSelf.imageProgressUpdateBlock(progress);
-        }
-    }];
-    [self.contentView addSubview:self.previewView];
-}
-
-- (void)setModel:(TZAssetModel *)model {
-    [super setModel:model];
-    _previewView.model = model;
-}
-
-- (void)recoverSubviews {
-    [_previewView recoverSubviews];
-}
-
-- (void)setAllowCrop:(BOOL)allowCrop {
-    _allowCrop = allowCrop;
-    _previewView.allowCrop = allowCrop;
-}
-
-- (void)setScaleAspectFillCrop:(BOOL)scaleAspectFillCrop {
-    _scaleAspectFillCrop = scaleAspectFillCrop;
-    _previewView.scaleAspectFillCrop = scaleAspectFillCrop;
-}
-
-- (void)setCropRect:(CGRect)cropRect {
-    _cropRect = cropRect;
-    _previewView.cropRect = cropRect;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    self.previewView.frame = self.bounds;
-}
-
-@end
-
-
-@interface TZPhotoPreviewView ()<UIScrollViewDelegate>
-@property (assign, nonatomic) BOOL isRequestingGIF;
-@end
-
-@implementation TZPhotoPreviewView
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        _scrollView = [[UIScrollView alloc] init];
-        _scrollView.bouncesZoom = YES;
-        _scrollView.maximumZoomScale = 2.5;
-        _scrollView.minimumZoomScale = 1.0;
-        _scrollView.multipleTouchEnabled = YES;
-        _scrollView.delegate = self;
-        _scrollView.scrollsToTop = NO;
-        _scrollView.showsHorizontalScrollIndicator = NO;
-        _scrollView.showsVerticalScrollIndicator = YES;
-        _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        _scrollView.delaysContentTouches = NO;
-        _scrollView.canCancelContentTouches = YES;
-        _scrollView.alwaysBounceVertical = NO;
-        if (@available(iOS 11, *)) {
-            _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
-        }
-        [self addSubview:_scrollView];
-        
-        _imageContainerView = [[UIView alloc] init];
-        _imageContainerView.clipsToBounds = YES;
-        _imageContainerView.contentMode = UIViewContentModeScaleAspectFill;
-        [_scrollView addSubview:_imageContainerView];
-        
-        _imageView = [[UIImageView alloc] init];
-        _imageView.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.500];
-        _imageView.contentMode = UIViewContentModeScaleAspectFill;
-        _imageView.clipsToBounds = YES;
-        [_imageContainerView addSubview:_imageView];
-
-        _iCloudErrorIcon = [[UIImageView alloc] init];
-        _iCloudErrorIcon.image = [UIImage tz_imageNamedFromMyBundle:@"iCloudError"];
-        _iCloudErrorIcon.hidden = YES;
-        [self addSubview:_iCloudErrorIcon];
-        _iCloudErrorLabel = [[UILabel alloc] init];
-        _iCloudErrorLabel.font = [UIFont systemFontOfSize:10];
-        _iCloudErrorLabel.textColor = [UIColor whiteColor];
-        _iCloudErrorLabel.text = [NSBundle tz_localizedStringForKey:@"iCloud sync failed"];
-        _iCloudErrorLabel.hidden = YES;
-        [self addSubview:_iCloudErrorLabel];
-        
-        UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap:)];
-        [self addGestureRecognizer:tap1];
-        UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)];
-        tap2.numberOfTapsRequired = 2;
-        [tap1 requireGestureRecognizerToFail:tap2];
-        [self addGestureRecognizer:tap2];
-        
-        [self configProgressView];
-    }
-    return self;
-}
-
-- (void)configProgressView {
-    _progressView = [[TZProgressView alloc] init];
-    _progressView.hidden = YES;
-    [self addSubview:_progressView];
-}
-
-- (void)setModel:(TZAssetModel *)model {
-    _model = model;
-    self.isRequestingGIF = NO;
-    [_scrollView setZoomScale:1.0 animated:NO];
-    if (model.type == TZAssetModelMediaTypePhotoGif) {
-        // 先显示缩略图
-        [[TZImageManager manager] getPhotoWithAsset:model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-            if (photo) {
-                self.imageView.image = photo;
-            }
-            [self resizeSubviews];
-            if (self.isRequestingGIF) {
-                return;
-            }
-            // 再显示gif动图
-            self.isRequestingGIF = YES;
-            [[TZImageManager manager] getOriginalPhotoDataWithAsset:model.asset progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-                progress = progress > 0.02 ? progress : 0.02;
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    BOOL iCloudSyncFailed = [TZCommonTools isICloudSyncError:error];
-                    self.iCloudErrorLabel.hidden = !iCloudSyncFailed;
-                    self.iCloudErrorIcon.hidden = !iCloudSyncFailed;
-                    if (self.iCloudSyncFailedHandle) {
-                        self.iCloudSyncFailedHandle(model.asset, iCloudSyncFailed);
-                    }
-                    
-                    self.progressView.progress = progress;
-                    if (progress >= 1) {
-                        self.progressView.hidden = YES;
-                    } else {
-                        self.progressView.hidden = NO;
-                    }
-                });
-#ifdef DEBUG
-                NSLog(@"[TZImagePickerController] getOriginalPhotoDataWithAsset:%f error:%@", progress, error);
-#endif
-            } completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
-                if (!isDegraded) {
-                    self.isRequestingGIF = NO;
-                    self.progressView.hidden = YES;
-                    if ([TZImagePickerConfig sharedInstance].gifImagePlayBlock) {
-                        [TZImagePickerConfig sharedInstance].gifImagePlayBlock(self, self.imageView, data, info);
-                    } else {
-                        self.imageView.image = [UIImage sd_tz_animatedGIFWithData:data];
-                    }
-                    [self resizeSubviews];
-                }
-            }];
-        } progressHandler:nil networkAccessAllowed:NO];
-    } else {
-        self.asset = model.asset;
-    }
-}
-
-- (void)setAsset:(PHAsset *)asset {
-    if (_asset && self.imageRequestID) {
-        [[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID];
-    }
-    
-    _asset = asset;
-    self.imageRequestID = [[TZImageManager manager] getPhotoWithAsset:asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        BOOL iCloudSyncFailed = !photo && [TZCommonTools isICloudSyncError:info[PHImageErrorKey]];
-        self.iCloudErrorLabel.hidden = !iCloudSyncFailed;
-        self.iCloudErrorIcon.hidden = !iCloudSyncFailed;
-        if (self.iCloudSyncFailedHandle) {
-            self.iCloudSyncFailedHandle(asset, iCloudSyncFailed);
-        }
-        if (![asset isEqual:self->_asset]) return;
-        if (photo) {
-            self.imageView.image = photo;
-        }
-        [self resizeSubviews];
-        if (self.imageView.tz_height && self.allowCrop) {
-            CGFloat scale = MAX(self.cropRect.size.width / self.imageView.tz_width, self.cropRect.size.height / self.imageView.tz_height);
-            if (self.scaleAspectFillCrop && scale > 1) { // 如果设置图片缩放裁剪并且图片需要缩放
-                CGFloat multiple = self.scrollView.maximumZoomScale / self.scrollView.minimumZoomScale;
-                self.scrollView.minimumZoomScale = scale;
-                self.scrollView.maximumZoomScale = scale * MAX(multiple, 2);
-                [self.scrollView setZoomScale:scale animated:YES];
-            }
-        }
-        
-        self->_progressView.hidden = YES;
-        if (self.imageProgressUpdateBlock) {
-            self.imageProgressUpdateBlock(1);
-        }
-        if (!isDegraded) {
-            self.imageRequestID = 0;
-        }
-    } progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-        if (![asset isEqual:self->_asset]) return;
-        self->_progressView.hidden = NO;
-        [self bringSubviewToFront:self->_progressView];
-        progress = progress > 0.02 ? progress : 0.02;
-        self->_progressView.progress = progress;
-        if (self.imageProgressUpdateBlock && progress < 1) {
-            self.imageProgressUpdateBlock(progress);
-        }
-        
-        if (progress >= 1) {
-            self->_progressView.hidden = YES;
-            self.imageRequestID = 0;
-        }
-    } networkAccessAllowed:YES];
-    
-    [self configMaximumZoomScale];
-}
-
-- (void)recoverSubviews {
-    [_scrollView setZoomScale:_scrollView.minimumZoomScale animated:NO];
-    [self resizeSubviews];
-}
-
-- (void)resizeSubviews {
-    _imageContainerView.tz_origin = CGPointZero;
-    _imageContainerView.tz_width = self.scrollView.tz_width;
-    
-    UIImage *image = _imageView.image;
-    if (image.size.height / image.size.width > self.tz_height / self.scrollView.tz_width) {
-        CGFloat width = image.size.width / image.size.height * self.scrollView.tz_height;
-        if (width < 1 || isnan(width)) width = self.tz_width;
-        width = floor(width);
-        
-        _imageContainerView.tz_width = width;
-        _imageContainerView.tz_height = self.tz_height;
-        _imageContainerView.tz_centerX = self.scrollView.tz_width  / 2;
-    } else {
-        CGFloat height = image.size.height / image.size.width * self.scrollView.tz_width;
-        if (height < 1 || isnan(height)) height = self.tz_height;
-        height = floor(height);
-        _imageContainerView.tz_height = height;
-        _imageContainerView.tz_centerY = self.tz_height / 2;
-    }
-    if (_imageContainerView.tz_height > self.tz_height && _imageContainerView.tz_height - self.tz_height <= 1) {
-        _imageContainerView.tz_height = self.tz_height;
-    }
-    CGFloat contentSizeH = MAX(_imageContainerView.tz_height, self.tz_height);
-    _scrollView.contentSize = CGSizeMake(self.scrollView.tz_width, contentSizeH);
-    [_scrollView scrollRectToVisible:self.bounds animated:NO];
-    _scrollView.alwaysBounceVertical = _imageContainerView.tz_height <= self.tz_height ? NO : YES;
-    _imageView.frame = _imageContainerView.bounds;
-    
-    [self refreshScrollViewContentSize];
-}
-
-- (void)configMaximumZoomScale {
-    _scrollView.maximumZoomScale = _allowCrop ? 4.0 : 2.5;
-    
-    if ([self.asset isKindOfClass:[PHAsset class]]) {
-        PHAsset *phAsset = (PHAsset *)self.asset;
-        CGFloat aspectRatio = phAsset.pixelWidth / (CGFloat)phAsset.pixelHeight;
-        // 优化超宽图片的显示
-        if (aspectRatio > 1.5) {
-            self.scrollView.maximumZoomScale *= aspectRatio / 1.5;
-        }
-    }
-}
-
-- (void)refreshScrollViewContentSize {
-    if (_allowCrop) {
-        // 1.7.2 如果允许裁剪,需要让图片的任意部分都能在裁剪框内,于是对_scrollView做了如下处理:
-        // 1.让contentSize增大(裁剪框右下角的图片部分)
-        CGFloat contentWidthAdd = (MIN(_imageContainerView.tz_width, self.scrollView.tz_width) - _cropRect.size.width) / 2;
-        CGFloat contentHeightAdd = (MIN(_imageContainerView.tz_height, self.scrollView.tz_height) - _cropRect.size.height) / 2;
-        CGFloat newSizeW = MAX(self.scrollView.contentSize.width, self.scrollView.tz_width) + contentWidthAdd;
-        CGFloat newSizeH = MAX(self.scrollView.contentSize.height, self.scrollView.tz_height) + contentHeightAdd;
-        _scrollView.contentSize = CGSizeMake(newSizeW, newSizeH);
-        _scrollView.alwaysBounceVertical = YES;
-        // 2.让scrollView新增滑动区域(裁剪框左上角的图片部分)
-        if (contentHeightAdd > 0 || contentWidthAdd > 0) {
-            _scrollView.contentInset = UIEdgeInsetsMake(contentHeightAdd, contentWidthAdd, 0, 0);
-        } else {
-            _scrollView.contentInset = UIEdgeInsetsZero;
-        }
-    }
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _scrollView.frame = CGRectMake(10, 0, self.tz_width - 20, self.tz_height);
-    static CGFloat progressWH = 40;
-    CGFloat progressX = (self.tz_width - progressWH) / 2;
-    CGFloat progressY = (self.tz_height - progressWH) / 2;
-    _progressView.frame = CGRectMake(progressX, progressY, progressWH, progressWH);
-    [self recoverSubviews];
-    _iCloudErrorIcon.frame = CGRectMake(20, [TZCommonTools tz_statusBarHeight] + 44 + 10, 28, 28);
-    _iCloudErrorLabel.frame = CGRectMake(53, [TZCommonTools tz_statusBarHeight] + 44 + 10, self.tz_width - 63, 28);
-}
-
-#pragma mark - UITapGestureRecognizer Event
-
-- (void)doubleTap:(UITapGestureRecognizer *)tap {
-    if (_scrollView.zoomScale > _scrollView.minimumZoomScale) {
-        _scrollView.contentInset = UIEdgeInsetsZero;
-        [_scrollView setZoomScale:_scrollView.minimumZoomScale animated:YES];
-    } else {
-        CGPoint touchPoint = [tap locationInView:self.imageView];
-        CGFloat newZoomScale = _scrollView.maximumZoomScale;
-        CGFloat xsize = self.frame.size.width / newZoomScale;
-        CGFloat ysize = self.frame.size.height / newZoomScale;
-        [_scrollView zoomToRect:CGRectMake(touchPoint.x - xsize/2, touchPoint.y - ysize/2, xsize, ysize) animated:YES];
-    }
-}
-
-- (void)singleTap:(UITapGestureRecognizer *)tap {
-    if (self.singleTapGestureBlock) {
-        self.singleTapGestureBlock();
-    }
-}
-
-#pragma mark - UIScrollViewDelegate
-
-- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
-    return _imageContainerView;
-}
-
-- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view {
-    scrollView.contentInset = UIEdgeInsetsZero;
-}
-
-- (void)scrollViewDidZoom:(UIScrollView *)scrollView {
-    [self refreshImageContainerViewCenter];
-}
-
-- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale {
-    [self refreshScrollViewContentSize];
-}
-
-#pragma mark - Private
-
-- (void)refreshImageContainerViewCenter {
-    CGFloat offsetX = (_scrollView.tz_width > _scrollView.contentSize.width) ? ((_scrollView.tz_width - _scrollView.contentSize.width) * 0.5) : 0.0;
-    CGFloat offsetY = (_scrollView.tz_height > _scrollView.contentSize.height) ? ((_scrollView.tz_height - _scrollView.contentSize.height) * 0.5) : 0.0;
-    self.imageContainerView.center = CGPointMake(_scrollView.contentSize.width * 0.5 + offsetX, _scrollView.contentSize.height * 0.5 + offsetY);
-}
-
-@end
-
-
-@implementation TZVideoPreviewCell
-
-- (void)configSubviews {
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillResignActiveNotification) name:UIApplicationWillResignActiveNotification object:nil];
-    _iCloudErrorIcon = [[UIImageView alloc] init];
-    _iCloudErrorIcon.image = [UIImage tz_imageNamedFromMyBundle:@"iCloudError"];
-    _iCloudErrorIcon.hidden = YES;
-    _iCloudErrorLabel = [[UILabel alloc] init];
-    _iCloudErrorLabel.font = [UIFont systemFontOfSize:10];
-    _iCloudErrorLabel.textColor = [UIColor whiteColor];
-    _iCloudErrorLabel.text = [NSBundle tz_localizedStringForKey:@"iCloud sync failed"];
-    _iCloudErrorLabel.hidden = YES;
-}
-
-- (void)configPlayButton {
-    if (_playButton) {
-        [_playButton removeFromSuperview];
-    }
-    _playButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlayHL"] forState:UIControlStateHighlighted];
-    [_playButton addTarget:self action:@selector(playButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    _playButton.frame = CGRectMake(0, 64, self.tz_width, self.tz_height - 64 - 44);
-    [self.contentView addSubview:_playButton];
-    [self.contentView addSubview:_iCloudErrorIcon];
-    [self.contentView addSubview:_iCloudErrorLabel];
-}
-
-- (void)setModel:(TZAssetModel *)model {
-    [super setModel:model];
-    [self configMoviePlayer];
-}
-
-- (void)setVideoURL:(NSURL *)videoURL {
-    _videoURL = videoURL;
-    [self configMoviePlayer];
-}
-
-- (void)configMoviePlayer {
-    if (_player) {
-        [_playerLayer removeFromSuperlayer];
-        _playerLayer = nil;
-        [_player pause];
-        _player = nil;
-    }
-    
-    if (self.model && self.model.asset) {
-        [[TZImageManager manager] getPhotoWithAsset:self.model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-            BOOL iCloudSyncFailed = !photo && [TZCommonTools isICloudSyncError:info[PHImageErrorKey]];
-            self.iCloudErrorLabel.hidden = !iCloudSyncFailed;
-            self.iCloudErrorIcon.hidden = !iCloudSyncFailed;
-            if (self.iCloudSyncFailedHandle) {
-                self.iCloudSyncFailedHandle(self.model.asset, iCloudSyncFailed);
-            }
-            if (photo) {
-                self.cover = photo;
-            }
-        }];
-        [[TZImageManager manager] getVideoWithAsset:self.model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
-            dispatch_async(dispatch_get_main_queue(), ^{
-                BOOL iCloudSyncFailed = !playerItem && [TZCommonTools isICloudSyncError:info[PHImageErrorKey]];
-                self.iCloudErrorLabel.hidden = !iCloudSyncFailed;
-                self.iCloudErrorIcon.hidden = !iCloudSyncFailed;
-                if (self.iCloudSyncFailedHandle) {
-                    self.iCloudSyncFailedHandle(self.model.asset, iCloudSyncFailed);
-                }
-                [self configPlayerWithItem:playerItem];
-            });
-        }];
-    } else {
-        AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:self.videoURL];
-        [self configPlayerWithItem:playerItem];
-    }
-}
-
-- (void)configPlayerWithItem:(AVPlayerItem *)playerItem {
-    self.player = [AVPlayer playerWithPlayerItem:playerItem];
-    self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
-    self.playerLayer.backgroundColor = [UIColor blackColor].CGColor;
-    self.playerLayer.frame = self.bounds;
-    [self.contentView.layer addSublayer:self.playerLayer];
-    [self configPlayButton];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:self.player.currentItem];
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _playerLayer.frame = self.bounds;
-    _playButton.frame = CGRectMake(0, 64, self.tz_width, self.tz_height - 64 - 44);
-    _iCloudErrorIcon.frame = CGRectMake(20, [TZCommonTools tz_statusBarHeight] + 44 + 10, 28, 28);
-    _iCloudErrorLabel.frame = CGRectMake(53, [TZCommonTools tz_statusBarHeight] + 44 + 10, self.tz_width - 63, 28);
-}
-
-- (void)photoPreviewCollectionViewDidScroll {
-    if (_player && _player.rate != 0.0) {
-        [self pausePlayerAndShowNaviBar];
-    }
-}
-
-#pragma mark - Notification
-
-- (void)appWillResignActiveNotification {
-    if (_player && _player.rate != 0.0) {
-        [self pausePlayerAndShowNaviBar];
-    }
-}
-
-#pragma mark - Click Event
-
-- (void)playButtonClick {
-    CMTime currentTime = _player.currentItem.currentTime;
-    CMTime durationTime = _player.currentItem.duration;
-    if (_player.rate == 0.0f) {
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"TZ_VIDEO_PLAY_NOTIFICATION" object:_player];
-        if (currentTime.value == durationTime.value) [_player.currentItem seekToTime:CMTimeMake(0, 1)];
-        [_player play];
-        [_playButton setImage:nil forState:UIControlStateNormal];
-        [UIApplication sharedApplication].statusBarHidden = YES;
-        if (self.singleTapGestureBlock) {
-            self.singleTapGestureBlock();
-        }
-    } else {
-        [self pausePlayerAndShowNaviBar];
-    }
-}
-
-- (void)pausePlayerAndShowNaviBar {
-    [_player pause];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-    if (self.singleTapGestureBlock) {
-        self.singleTapGestureBlock();
-    }
-}
-
-@end
-
-
-@implementation TZGifPreviewCell
-
-- (void)configSubviews {
-    [self configPreviewView];
-}
-
-- (void)configPreviewView {
-    _previewView = [[TZPhotoPreviewView alloc] initWithFrame:CGRectZero];
-    __weak typeof(self) weakSelf = self;
-    [_previewView setSingleTapGestureBlock:^{
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        [strongSelf signleTapAction];
-    }];
-    [self.contentView addSubview:_previewView];
-}
-
-- (void)setModel:(TZAssetModel *)model {
-    [super setModel:model];
-    _previewView.model = self.model;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _previewView.frame = self.bounds;
-}
-
-#pragma mark - Click Event
-
-- (void)signleTapAction {    
-    if (self.singleTapGestureBlock) {
-        self.singleTapGestureBlock();
-    }
-}
-
-@end

+ 0 - 25
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewController.h

@@ -1,25 +0,0 @@
-//
-//  TZPhotoPreviewController.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface TZPhotoPreviewController : UIViewController
-
-@property (nonatomic, strong) NSMutableArray *models;                  ///< All photo models / 所有图片模型数组
-@property (nonatomic, strong) NSMutableArray *photos;                  ///< All photos  / 所有图片数组
-@property (nonatomic, assign) NSInteger currentIndex;           ///< Index of the photo user click / 用户点击的图片的索引
-@property (nonatomic, assign) BOOL isSelectOriginalPhoto;       ///< If YES,return original photo / 是否返回原图
-@property (nonatomic, assign) BOOL isCropImage;
-
-/// Return the new selected photos / 返回最新的选中图片数组
-@property (nonatomic, copy) void (^backButtonClickBlock)(BOOL isSelectOriginalPhoto);
-@property (nonatomic, copy) void (^doneButtonClickBlock)(BOOL isSelectOriginalPhoto);
-@property (nonatomic, copy) void (^doneButtonClickBlockCropMode)(UIImage *cropedImage,id asset);
-@property (nonatomic, copy) void (^doneButtonClickBlockWithPreviewType)(NSArray<UIImage *> *photos,NSArray *assets,BOOL isSelectOriginalPhoto);
-
-@end

+ 0 - 686
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZPhotoPreviewController.m

@@ -1,686 +0,0 @@
-//
-//  TZPhotoPreviewController.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/12/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import "TZPhotoPreviewController.h"
-#import "TZPhotoPreviewCell.h"
-#import "TZAssetModel.h"
-#import "UIView+TZLayout.h"
-#import "TZImagePickerController.h"
-#import "TZImageManager.h"
-#import "TZImageCropManager.h"
-
-@interface TZPhotoPreviewController ()<UICollectionViewDataSource,UICollectionViewDelegate,UIScrollViewDelegate> {
-    UICollectionView *_collectionView;
-    UICollectionViewFlowLayout *_layout;
-    NSArray *_photosTemp;
-    NSArray *_assetsTemp;
-    
-    UIView *_naviBar;
-    UIButton *_backButton;
-    UIButton *_selectButton;
-    UILabel *_indexLabel;
-    
-    UIView *_toolBar;
-    UIButton *_doneButton;
-    UIImageView *_numberImageView;
-    UILabel *_numberLabel;
-    UIButton *_originalPhotoButton;
-    UILabel *_originalPhotoLabel;
-    
-    CGFloat _offsetItemCount;
-    
-    BOOL _didSetIsSelectOriginalPhoto;
-}
-@property (nonatomic, assign) BOOL isHideNaviBar;
-@property (nonatomic, strong) UIView *cropBgView;
-@property (nonatomic, strong) UIView *cropView;
-
-@property (nonatomic, assign) double progress;
-@property (strong, nonatomic) UIAlertController *alertView;
-@property (nonatomic, strong) UIView *iCloudErrorView;
-@end
-
-@implementation TZPhotoPreviewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    [TZImageManager manager].shouldFixOrientation = YES;
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (!_didSetIsSelectOriginalPhoto) {
-        _isSelectOriginalPhoto = _tzImagePickerVc.isSelectOriginalPhoto;
-    }
-    if (!self.models.count) {
-        self.models = [NSMutableArray arrayWithArray:_tzImagePickerVc.selectedModels];
-        _assetsTemp = [NSMutableArray arrayWithArray:_tzImagePickerVc.selectedAssets];
-    }
-    [self configCollectionView];
-    [self configCustomNaviBar];
-    [self configBottomToolBar];
-    self.view.clipsToBounds = YES;
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeStatusBarOrientationNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
-}
-
-- (void)setIsSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto {
-    _isSelectOriginalPhoto = isSelectOriginalPhoto;
-    _didSetIsSelectOriginalPhoto = YES;
-}
-
-- (void)setPhotos:(NSMutableArray *)photos {
-    _photos = photos;
-    _photosTemp = [NSArray arrayWithArray:photos];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    [self.navigationController setNavigationBarHidden:YES animated:YES];
-    [UIApplication sharedApplication].statusBarHidden = YES;
-    if (_currentIndex) {
-        [_collectionView setContentOffset:CGPointMake((self.view.tz_width + 20) * self.currentIndex, 0) animated:NO];
-    }
-    [self refreshNaviBarAndBottomBarState];
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc.needShowStatusBar) {
-        [UIApplication sharedApplication].statusBarHidden = NO;
-    }
-    [self.navigationController setNavigationBarHidden:NO animated:YES];
-    [TZImageManager manager].shouldFixOrientation = NO;
-}
-
-- (BOOL)prefersStatusBarHidden {
-    return YES;
-}
-
-- (void)configCustomNaviBar {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    
-    _naviBar = [[UIView alloc] initWithFrame:CGRectZero];
-    _naviBar.backgroundColor = [UIColor colorWithRed:(34/255.0) green:(34/255.0)  blue:(34/255.0) alpha:0.7];
-    
-    _backButton = [[UIButton alloc] initWithFrame:CGRectZero];
-    [_backButton setImage:[UIImage tz_imageNamedFromMyBundle:@"navi_back"] forState:UIControlStateNormal];
-    [_backButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    [_backButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    
-    _selectButton = [[UIButton alloc] initWithFrame:CGRectZero];
-    [_selectButton setImage:tzImagePickerVc.photoDefImage forState:UIControlStateNormal];
-    [_selectButton setImage:tzImagePickerVc.photoSelImage forState:UIControlStateSelected];
-    _selectButton.imageView.clipsToBounds = YES;
-    _selectButton.imageEdgeInsets = UIEdgeInsetsMake(10, 0, 10, 0);
-    _selectButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
-    [_selectButton addTarget:self action:@selector(select:) forControlEvents:UIControlEventTouchUpInside];
-    _selectButton.hidden = !tzImagePickerVc.showSelectBtn;
-    
-    _indexLabel = [[UILabel alloc] init];
-    _indexLabel.adjustsFontSizeToFitWidth = YES;
-    _indexLabel.font = [UIFont systemFontOfSize:14];
-    _indexLabel.textColor = [UIColor whiteColor];
-    _indexLabel.textAlignment = NSTextAlignmentCenter;
-    
-    [_naviBar addSubview:_selectButton];
-    [_naviBar addSubview:_indexLabel];
-    [_naviBar addSubview:_backButton];
-    [self.view addSubview:_naviBar];
-}
-
-- (void)configBottomToolBar {
-    _toolBar = [[UIView alloc] initWithFrame:CGRectZero];
-    static CGFloat rgb = 34 / 255.0;
-    _toolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.7];
-    
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (_tzImagePickerVc.allowPickingOriginalPhoto) {
-        _originalPhotoButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        _originalPhotoButton.imageEdgeInsets = UIEdgeInsetsMake(0, [TZCommonTools tz_isRightToLeftLayout] ? 10 : -10, 0, 0);
-        _originalPhotoButton.backgroundColor = [UIColor clearColor];
-        [_originalPhotoButton addTarget:self action:@selector(originalPhotoButtonClick) forControlEvents:UIControlEventTouchUpInside];
-        _originalPhotoButton.titleLabel.font = [UIFont systemFontOfSize:13];
-        [_originalPhotoButton setTitle:_tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateNormal];
-        [_originalPhotoButton setTitle:_tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateSelected];
-        [_originalPhotoButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
-        [_originalPhotoButton setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
-        [_originalPhotoButton setImage:_tzImagePickerVc.photoPreviewOriginDefImage forState:UIControlStateNormal];
-        [_originalPhotoButton setImage:_tzImagePickerVc.photoOriginSelImage forState:UIControlStateSelected];
-        
-        _originalPhotoLabel = [[UILabel alloc] init];
-        _originalPhotoLabel.textAlignment = NSTextAlignmentLeft;
-        _originalPhotoLabel.font = [UIFont systemFontOfSize:13];
-        _originalPhotoLabel.textColor = [UIColor whiteColor];
-        _originalPhotoLabel.backgroundColor = [UIColor clearColor];
-        if (_isSelectOriginalPhoto) [self showPhotoBytes];
-    }
-    
-    _doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    _doneButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    [_doneButton setTitle:_tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal];
-    [_doneButton setTitleColor:_tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal];
-    
-    _numberImageView = [[UIImageView alloc] initWithImage:_tzImagePickerVc.photoNumberIconImage];
-    _numberImageView.backgroundColor = [UIColor clearColor];
-    _numberImageView.clipsToBounds = YES;
-    _numberImageView.contentMode = UIViewContentModeScaleAspectFit;
-    _numberImageView.hidden = _tzImagePickerVc.selectedModels.count <= 0;
-    
-    _numberLabel = [[UILabel alloc] init];
-    _numberLabel.font = [UIFont systemFontOfSize:15];
-    _numberLabel.adjustsFontSizeToFitWidth = YES;
-    _numberLabel.textColor = [UIColor whiteColor];
-    _numberLabel.textAlignment = NSTextAlignmentCenter;
-    _numberLabel.text = [NSString stringWithFormat:@"%zd",_tzImagePickerVc.selectedModels.count];
-    _numberLabel.hidden = _tzImagePickerVc.selectedModels.count <= 0;
-    _numberLabel.backgroundColor = [UIColor clearColor];
-    _numberLabel.userInteractionEnabled = YES;
-    
-    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doneButtonClick)];
-    [_numberLabel addGestureRecognizer:tapGesture];
-    
-    [_originalPhotoButton addSubview:_originalPhotoLabel];
-    [_toolBar addSubview:_doneButton];
-    [_toolBar addSubview:_originalPhotoButton];
-    [_toolBar addSubview:_numberImageView];
-    [_toolBar addSubview:_numberLabel];
-    [self.view addSubview:_toolBar];
-    
-    if (_tzImagePickerVc.photoPreviewPageUIConfigBlock) {
-        _tzImagePickerVc.photoPreviewPageUIConfigBlock(_collectionView, _naviBar, _backButton, _selectButton, _indexLabel, _toolBar, _originalPhotoButton, _originalPhotoLabel, _doneButton, _numberImageView, _numberLabel);
-    }
-}
-
-- (void)configCollectionView {
-    _layout = [[UICollectionViewFlowLayout alloc] init];
-    _layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
-    _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout];
-    _collectionView.backgroundColor = [UIColor blackColor];
-    _collectionView.dataSource = self;
-    _collectionView.delegate = self;
-    _collectionView.pagingEnabled = YES;
-    _collectionView.scrollsToTop = NO;
-    _collectionView.showsHorizontalScrollIndicator = NO;
-    _collectionView.contentOffset = CGPointMake(0, 0);
-    _collectionView.contentSize = CGSizeMake(self.models.count * (self.view.tz_width + 20), 0);
-    if (@available(iOS 11, *)) {
-        _collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
-    }
-    [self.view addSubview:_collectionView];
-    [_collectionView registerClass:[TZPhotoPreviewCell class] forCellWithReuseIdentifier:@"TZPhotoPreviewCell"];
-    [_collectionView registerClass:[TZVideoPreviewCell class] forCellWithReuseIdentifier:@"TZVideoPreviewCell"];
-    [_collectionView registerClass:[TZGifPreviewCell class] forCellWithReuseIdentifier:@"TZGifPreviewCell"];
-    
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (_tzImagePickerVc.scaleAspectFillCrop && _tzImagePickerVc.allowCrop) {
-        _collectionView.scrollEnabled = NO;
-    }
-}
-
-- (void)configCropView {
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (_tzImagePickerVc.maxImagesCount <= 1 && _tzImagePickerVc.allowCrop && _tzImagePickerVc.allowPickingImage) {
-        [_cropView removeFromSuperview];
-        [_cropBgView removeFromSuperview];
-        
-        _cropBgView = [UIView new];
-        _cropBgView.userInteractionEnabled = NO;
-        _cropBgView.frame = self.view.bounds;
-        _cropBgView.backgroundColor = [UIColor clearColor];
-        [self.view addSubview:_cropBgView];
-        [TZImageCropManager overlayClippingWithView:_cropBgView cropRect:_tzImagePickerVc.cropRect containerView:self.view needCircleCrop:_tzImagePickerVc.needCircleCrop];
-        
-        _cropView = [UIView new];
-        _cropView.userInteractionEnabled = NO;
-        _cropView.frame = _tzImagePickerVc.cropRect;
-        _cropView.backgroundColor = [UIColor clearColor];
-        _cropView.layer.borderColor = [UIColor whiteColor].CGColor;
-        _cropView.layer.borderWidth = 1.0;
-        if (_tzImagePickerVc.needCircleCrop) {
-            _cropView.layer.cornerRadius = _tzImagePickerVc.cropRect.size.width / 2;
-            _cropView.clipsToBounds = YES;
-        }
-        [self.view addSubview:_cropView];
-        if (_tzImagePickerVc.cropViewSettingBlock) {
-            _tzImagePickerVc.cropViewSettingBlock(_cropView);
-        }
-        
-        [self.view bringSubviewToFront:_naviBar];
-        [self.view bringSubviewToFront:_toolBar];
-    }
-}
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    
-    BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
-    CGFloat statusBarHeight = isFullScreen ? [TZCommonTools tz_statusBarHeight] : 0;
-    CGFloat statusBarHeightInterval = isFullScreen ? (statusBarHeight - 20) : 0;
-    CGFloat naviBarHeight = statusBarHeight + _tzImagePickerVc.navigationBar.tz_height;
-    _naviBar.frame = CGRectMake(0, 0, self.view.tz_width, naviBarHeight);
-    _backButton.frame = CGRectMake(10, 10 + statusBarHeightInterval, 44, 44);
-    _selectButton.frame = CGRectMake(self.view.tz_width - 56, 10 + statusBarHeightInterval, 44, 44);
-    _indexLabel.frame = _selectButton.frame;
-    
-    _layout.itemSize = CGSizeMake(self.view.tz_width + 20, self.view.tz_height);
-    _layout.minimumInteritemSpacing = 0;
-    _layout.minimumLineSpacing = 0;
-    _collectionView.frame = CGRectMake(-10, 0, self.view.tz_width + 20, self.view.tz_height);
-    [_collectionView setCollectionViewLayout:_layout];
-    if (_offsetItemCount > 0) {
-        CGFloat offsetX = _offsetItemCount * _layout.itemSize.width;
-        [_collectionView setContentOffset:CGPointMake(offsetX, 0)];
-    }
-    if (_tzImagePickerVc.allowCrop) {
-        [_collectionView reloadData];
-    }
-    
-    CGFloat toolBarHeight = 44 + [TZCommonTools tz_safeAreaInsets].bottom;
-    CGFloat toolBarTop = self.view.tz_height - toolBarHeight;
-    _toolBar.frame = CGRectMake(0, toolBarTop, self.view.tz_width, toolBarHeight);
-    if (_tzImagePickerVc.allowPickingOriginalPhoto) {
-        CGFloat fullImageWidth = [_tzImagePickerVc.fullImageBtnTitleStr boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size.width;
-        _originalPhotoButton.frame = CGRectMake(0, 0, fullImageWidth + 56, 44);
-        _originalPhotoLabel.frame = CGRectMake(fullImageWidth + 42, 0, 80, 44);
-    }
-    [_doneButton sizeToFit];
-    _doneButton.frame = CGRectMake(self.view.tz_width - _doneButton.tz_width - 12, 0, MAX(44, _doneButton.tz_width), 44);
-    _numberImageView.frame = CGRectMake(_doneButton.tz_left - 24 - 5, 10, 24, 24);
-    _numberLabel.frame = _numberImageView.frame;
-    
-    [self configCropView];
-    
-    if (_tzImagePickerVc.photoPreviewPageDidLayoutSubviewsBlock) {
-        _tzImagePickerVc.photoPreviewPageDidLayoutSubviewsBlock(_collectionView, _naviBar, _backButton, _selectButton, _indexLabel, _toolBar, _originalPhotoButton, _originalPhotoLabel, _doneButton, _numberImageView, _numberLabel);
-    }
-}
-
-#pragma mark - Notification
-
-- (void)didChangeStatusBarOrientationNotification:(NSNotification *)noti {
-    _offsetItemCount = _collectionView.contentOffset.x / _layout.itemSize.width;
-}
-
-#pragma mark - Click Event
-
-- (void)select:(UIButton *)selectButton {
-    [self select:selectButton refreshCount:YES];
-}
-
-- (void)select:(UIButton *)selectButton refreshCount:(BOOL)refreshCount {
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    TZAssetModel *model = _models[self.currentIndex];
-    if (!selectButton.isSelected) {
-        // 1. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制
-        if (_tzImagePickerVc.selectedModels.count >= _tzImagePickerVc.maxImagesCount) {
-            NSString *title = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Select a maximum of %zd photos"], _tzImagePickerVc.maxImagesCount];
-            [_tzImagePickerVc showAlertWithTitle:title];
-            return;
-            // 2. if not over the maxImagesCount / 如果没有超过最大个数限制
-        } else {
-            if ([[TZImageManager manager] isAssetCannotBeSelected:model.asset]) {
-                return;
-            }
-            [_tzImagePickerVc addSelectedModel:model];
-            [self setAsset:model.asset isSelect:YES];
-            if (self.photos) {
-                [_tzImagePickerVc.selectedAssets addObject:_assetsTemp[self.currentIndex]];
-                [self.photos addObject:_photosTemp[self.currentIndex]];
-            }
-            if (model.type == TZAssetModelMediaTypeVideo && !_tzImagePickerVc.allowPickingMultipleVideo) {
-                [_tzImagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Select the video when in multi state, we will handle the video as a photo"]];
-            }
-        }
-    } else {
-        NSArray *selectedModels = [NSArray arrayWithArray:_tzImagePickerVc.selectedModels];
-        for (TZAssetModel *model_item in selectedModels) {
-            if ([model.asset.localIdentifier isEqualToString:model_item.asset.localIdentifier]) {
-                // 1.6.7版本更新:防止有多个一样的model,一次性被移除了
-                NSArray *selectedModelsTmp = [NSArray arrayWithArray:_tzImagePickerVc.selectedModels];
-                for (NSInteger i = 0; i < selectedModelsTmp.count; i++) {
-                    TZAssetModel *model = selectedModelsTmp[i];
-                    if ([model isEqual:model_item]) {
-                        [_tzImagePickerVc removeSelectedModel:model];
-                        // [_tzImagePickerVc.selectedModels removeObjectAtIndex:i];
-                        break;
-                    }
-                }
-                if (self.photos) {
-                    // 1.6.7版本更新:防止有多个一样的asset,一次性被移除了
-                    NSArray *selectedAssetsTmp = [NSArray arrayWithArray:_tzImagePickerVc.selectedAssets];
-                    for (NSInteger i = 0; i < selectedAssetsTmp.count; i++) {
-                        id asset = selectedAssetsTmp[i];
-                        if ([asset isEqual:_assetsTemp[self.currentIndex]]) {
-                            [_tzImagePickerVc.selectedAssets removeObjectAtIndex:i];
-                            break;
-                        }
-                    }
-                    // [_tzImagePickerVc.selectedAssets removeObject:_assetsTemp[self.currentIndex]];
-                    [self.photos removeObject:_photosTemp[self.currentIndex]];
-                }
-                [self setAsset:model.asset isSelect:NO];
-                break;
-            }
-        }
-    }
-    model.isSelected = !selectButton.isSelected;
-    if (refreshCount) {
-        [self refreshNaviBarAndBottomBarState];
-    }
-    if (model.isSelected) {
-        [UIView showOscillatoryAnimationWithLayer:selectButton.imageView.layer type:TZOscillatoryAnimationToBigger];
-    }
-    [UIView showOscillatoryAnimationWithLayer:_numberImageView.layer type:TZOscillatoryAnimationToSmaller];
-}
-
-- (void)backButtonClick {
-    if (self.navigationController.childViewControllers.count < 2) {
-        [self.navigationController dismissViewControllerAnimated:YES completion:nil];
-        if ([self.navigationController isKindOfClass: [TZImagePickerController class]]) {
-            TZImagePickerController *nav = (TZImagePickerController *)self.navigationController;
-            if (nav.imagePickerControllerDidCancelHandle) {
-                nav.imagePickerControllerDidCancelHandle();
-            }
-        }
-        return;
-    }
-    [self.navigationController popViewControllerAnimated:YES];
-    if (self.backButtonClickBlock) {
-        self.backButtonClickBlock(_isSelectOriginalPhoto);
-    }
-}
-
-- (void)doneButtonClick {
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    // 如果图片正在从iCloud同步中,提醒用户
-    if (_progress > 0 && _progress < 1 && (_selectButton.isSelected || !_tzImagePickerVc.selectedModels.count )) {
-        _alertView = [_tzImagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Synchronizing photos from iCloud"]];
-        return;
-    }
-    
-    // 如果没有选中过照片 点击确定时选中当前预览的照片
-    if (_tzImagePickerVc.selectedModels.count == 0 && _tzImagePickerVc.minImagesCount <= 0 && _tzImagePickerVc.autoSelectCurrentWhenDone) {
-        TZAssetModel *model = _models[self.currentIndex];
-        if ([[TZImageManager manager] isAssetCannotBeSelected:model.asset]) {
-            return;
-        }
-        [self select:_selectButton refreshCount:NO];
-    }
-    NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.currentIndex inSection:0];
-    TZPhotoPreviewCell *cell = (TZPhotoPreviewCell *)[_collectionView cellForItemAtIndexPath:indexPath];
-    if (_tzImagePickerVc.allowCrop && [cell isKindOfClass:[TZPhotoPreviewCell class]]) { // 裁剪状态
-        _doneButton.enabled = NO;
-        [_tzImagePickerVc showProgressHUD];
-        UIImage *cropedImage = [TZImageCropManager cropImageView:cell.previewView.imageView toRect:_tzImagePickerVc.cropRect zoomScale:cell.previewView.scrollView.zoomScale containerView:self.view];
-        if (_tzImagePickerVc.needCircleCrop) {
-            cropedImage = [TZImageCropManager circularClipImage:cropedImage];
-        }
-        _doneButton.enabled = YES;
-        [_tzImagePickerVc hideProgressHUD];
-        if (self.doneButtonClickBlockCropMode) {
-            TZAssetModel *model = _models[self.currentIndex];
-            self.doneButtonClickBlockCropMode(cropedImage,model.asset);
-        }
-    } else if (self.doneButtonClickBlock) { // 非裁剪状态
-        self.doneButtonClickBlock(_isSelectOriginalPhoto);
-    }
-    if (self.doneButtonClickBlockWithPreviewType) {
-        self.doneButtonClickBlockWithPreviewType(self.photos,_tzImagePickerVc.selectedAssets,self.isSelectOriginalPhoto);
-    }
-}
-
-- (void)originalPhotoButtonClick {
-    TZAssetModel *model = _models[self.currentIndex];
-    if ([[TZImageManager manager] isAssetCannotBeSelected:model.asset]) {
-        return;
-    }
-    _originalPhotoButton.selected = !_originalPhotoButton.isSelected;
-    _isSelectOriginalPhoto = _originalPhotoButton.isSelected;
-    _originalPhotoLabel.hidden = !_originalPhotoButton.isSelected;
-    if (_isSelectOriginalPhoto) {
-        [self showPhotoBytes];
-        if (!_selectButton.isSelected) {
-            // 如果当前已选择照片张数 < 最大可选张数 && 最大可选张数大于1,就选中该张图
-            TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-            if (_tzImagePickerVc.selectedModels.count < _tzImagePickerVc.maxImagesCount && _tzImagePickerVc.showSelectBtn) {
-                [self select:_selectButton];
-            }
-        }
-    }
-}
-
-- (void)didTapPreviewCell {
-    self.isHideNaviBar = !self.isHideNaviBar;
-    _naviBar.hidden = self.isHideNaviBar;
-    _toolBar.hidden = self.isHideNaviBar;
-}
-
-#pragma mark - UIScrollViewDelegate
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
-    CGFloat offSetWidth = scrollView.contentOffset.x;
-    offSetWidth = offSetWidth +  ((self.view.tz_width + 20) * 0.5);
-    
-    NSInteger currentIndex = offSetWidth / (self.view.tz_width + 20);
-    if (currentIndex < _models.count && _currentIndex != currentIndex) {
-        _currentIndex = currentIndex;
-        [self refreshNaviBarAndBottomBarState];
-    }
-    [[NSNotificationCenter defaultCenter] postNotificationName:@"photoPreviewCollectionViewDidScroll" object:nil];
-}
-
-#pragma mark - UICollectionViewDataSource && Delegate
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
-    return _models.count;
-}
-
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    TZAssetModel *model = _models[indexPath.item];
-    
-    TZAssetPreviewCell *cell;
-    __weak typeof(self) weakSelf = self;
-    if (_tzImagePickerVc.allowPickingMultipleVideo && model.type == TZAssetModelMediaTypeVideo) {
-        cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZVideoPreviewCell" forIndexPath:indexPath];
-        TZVideoPreviewCell *currentCell = (TZVideoPreviewCell *)cell;
-        currentCell.iCloudSyncFailedHandle = ^(id asset, BOOL isSyncFailed) {
-            model.iCloudFailed = isSyncFailed;
-            [weakSelf didICloudSyncStatusChanged:model];
-        };
-    } else if (_tzImagePickerVc.allowPickingMultipleVideo && model.type == TZAssetModelMediaTypePhotoGif && _tzImagePickerVc.allowPickingGif) {
-        cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZGifPreviewCell" forIndexPath:indexPath];
-        TZGifPreviewCell *currentCell = (TZGifPreviewCell *)cell;
-        currentCell.previewView.iCloudSyncFailedHandle = ^(id asset, BOOL isSyncFailed) {
-            model.iCloudFailed = isSyncFailed;
-            [weakSelf didICloudSyncStatusChanged:model];
-        };
-    } else {
-        cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZPhotoPreviewCell" forIndexPath:indexPath];
-        TZPhotoPreviewCell *photoPreviewCell = (TZPhotoPreviewCell *)cell;
-        photoPreviewCell.cropRect = _tzImagePickerVc.cropRect;
-        photoPreviewCell.allowCrop = _tzImagePickerVc.allowCrop;
-        photoPreviewCell.scaleAspectFillCrop = _tzImagePickerVc.scaleAspectFillCrop;
-        __weak typeof(_collectionView) weakCollectionView = _collectionView;
-        __weak typeof(photoPreviewCell) weakCell = photoPreviewCell;
-        [photoPreviewCell setImageProgressUpdateBlock:^(double progress) {
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            __strong typeof(weakCollectionView) strongCollectionView = weakCollectionView;
-            __strong typeof(weakCell) strongCell = weakCell;
-            strongSelf.progress = progress;
-            if (progress >= 1) {
-                if (strongSelf.isSelectOriginalPhoto) [strongSelf showPhotoBytes];
-                if (strongSelf.alertView && [strongCollectionView.visibleCells containsObject:strongCell]) {
-                    [strongSelf.alertView dismissViewControllerAnimated:YES completion:^{
-                        strongSelf.alertView = nil;
-                        [strongSelf doneButtonClick];
-                    }];
-                }
-            }
-        }];
-        photoPreviewCell.previewView.iCloudSyncFailedHandle = ^(id asset, BOOL isSyncFailed) {
-            model.iCloudFailed = isSyncFailed;
-            [weakSelf didICloudSyncStatusChanged:model];
-        };
-    }
-    
-    cell.model = model;
-    [cell setSingleTapGestureBlock:^{
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        [strongSelf didTapPreviewCell];
-    }];
-
-    return cell;
-}
-
-- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
-    if ([cell isKindOfClass:[TZPhotoPreviewCell class]]) {
-        [(TZPhotoPreviewCell *)cell recoverSubviews];
-    }
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
-    if ([cell isKindOfClass:[TZPhotoPreviewCell class]]) {
-        [(TZPhotoPreviewCell *)cell recoverSubviews];
-    } else if ([cell isKindOfClass:[TZVideoPreviewCell class]]) {
-        TZVideoPreviewCell *videoCell = (TZVideoPreviewCell *)cell;
-        if (videoCell.player && videoCell.player.rate != 0.0) {
-            [videoCell pausePlayerAndShowNaviBar];
-        }
-    }
-}
-
-#pragma mark - Private Method
-
-- (void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-    // NSLog(@"%@ dealloc",NSStringFromClass(self.class));
-}
-
-- (void)refreshNaviBarAndBottomBarState {
-    TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    TZAssetModel *model = _models[self.currentIndex];
-    _selectButton.selected = model.isSelected;
-    [self refreshSelectButtonImageViewContentMode];
-    if (_selectButton.isSelected && _tzImagePickerVc.showSelectedIndex && _tzImagePickerVc.showSelectBtn) {
-        NSString *index = [NSString stringWithFormat:@"%d", (int)([_tzImagePickerVc.selectedAssetIds indexOfObject:model.asset.localIdentifier] + 1)];
-        _indexLabel.text = index;
-        _indexLabel.hidden = NO;
-    } else {
-        _indexLabel.hidden = YES;
-    }
-    _numberLabel.text = [NSString stringWithFormat:@"%zd",_tzImagePickerVc.selectedModels.count];
-    _numberImageView.hidden = (_tzImagePickerVc.selectedModels.count <= 0 || _isHideNaviBar || _isCropImage);
-    _numberLabel.hidden = (_tzImagePickerVc.selectedModels.count <= 0 || _isHideNaviBar || _isCropImage);
-    
-    _originalPhotoButton.selected = _isSelectOriginalPhoto;
-    _originalPhotoLabel.hidden = !_originalPhotoButton.isSelected;
-    if (_isSelectOriginalPhoto) [self showPhotoBytes];
-    
-    // If is previewing video, hide original photo button
-    // 如果正在预览的是视频,隐藏原图按钮
-    if (!_isHideNaviBar) {
-        if (model.type == TZAssetModelMediaTypeVideo) {
-            _originalPhotoButton.hidden = YES;
-            _originalPhotoLabel.hidden = YES;
-        } else {
-            _originalPhotoButton.hidden = NO;
-            if (_isSelectOriginalPhoto) _originalPhotoLabel.hidden = NO;
-        }
-    }
-    
-    _doneButton.hidden = NO;
-    _selectButton.hidden = !_tzImagePickerVc.showSelectBtn;
-    // 让宽度/高度小于 最小可选照片尺寸 的图片不能选中
-    if (![[TZImageManager manager] isPhotoSelectableWithAsset:model.asset]) {
-        _numberLabel.hidden = YES;
-        _numberImageView.hidden = YES;
-        _selectButton.hidden = YES;
-        _originalPhotoButton.hidden = YES;
-        _originalPhotoLabel.hidden = YES;
-        _doneButton.hidden = YES;
-    }
-    // iCloud同步失败的UI刷新
-    [self didICloudSyncStatusChanged:model];
-    if (_tzImagePickerVc.photoPreviewPageDidRefreshStateBlock) {
-        _tzImagePickerVc.photoPreviewPageDidRefreshStateBlock(_collectionView, _naviBar, _backButton, _selectButton, _indexLabel, _toolBar, _originalPhotoButton, _originalPhotoLabel, _doneButton, _numberImageView, _numberLabel);
-    }
-}
-
-- (void)refreshSelectButtonImageViewContentMode {
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        if (self->_selectButton.imageView.image.size.width <= 27) {
-            self->_selectButton.imageView.contentMode = UIViewContentModeCenter;
-        } else {
-            self->_selectButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
-        }
-    });
-}
-
-- (void)didICloudSyncStatusChanged:(TZAssetModel *)model{
-    dispatch_async(dispatch_get_main_queue(), ^{
-        TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-        // onlyReturnAsset为NO时,依赖TZ返回大图,所以需要有iCloud同步失败的提示,并且不能选择,
-        if (_tzImagePickerVc.onlyReturnAsset) {
-            return;
-        }
-        TZAssetModel *currentModel = self.models[self.currentIndex];
-        if (_tzImagePickerVc.selectedModels.count <= 0) {
-            self->_doneButton.enabled = !currentModel.iCloudFailed;
-        } else {
-            self->_doneButton.enabled = YES;
-        }
-        self->_selectButton.hidden = currentModel.iCloudFailed || !_tzImagePickerVc.showSelectBtn;
-        if (currentModel.iCloudFailed) {
-            self->_originalPhotoButton.hidden = YES;
-            self->_originalPhotoLabel.hidden = YES;
-        }
-    });
-}
-
-- (void)showPhotoBytes {
-    [[TZImageManager manager] getPhotosBytesWithArray:@[_models[self.currentIndex]] completion:^(NSString *totalBytes) {
-        self->_originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes];
-    }];
-}
-
-- (NSInteger)currentIndex {
-    return [TZCommonTools tz_isRightToLeftLayout] ? self.models.count - _currentIndex - 1 : _currentIndex;
-}
-
-/// 选中/取消选中某张照片
-- (void)setAsset:(PHAsset *)asset isSelect:(BOOL)isSelect {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (isSelect && [tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didSelectAsset:photo:isSelectOriginalPhoto:)]) {
-        [self callDelegate:asset isSelect:YES];
-    }
-    if (!isSelect && [tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didDeselectAsset:photo:isSelectOriginalPhoto:)]) {
-        [self callDelegate:asset isSelect:NO];
-    }
-}
-
-/// 调用选中/取消选中某张照片的代理方法
-- (void)callDelegate:(PHAsset *)asset isSelect:(BOOL)isSelect {
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    __weak typeof(self) weakSelf = self;
-    __weak typeof(tzImagePickerVc) weakImagePickerVc= tzImagePickerVc;
-    [[TZImageManager manager] getPhotoWithAsset:asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        if (isDegraded) return;
-        __strong typeof(weakSelf) strongSelf = weakSelf;
-        __strong typeof(weakImagePickerVc) strongImagePickerVc = weakImagePickerVc;
-        if (isSelect) {
-            [strongImagePickerVc.pickerDelegate imagePickerController:strongImagePickerVc didSelectAsset:asset photo:photo isSelectOriginalPhoto:strongSelf.isSelectOriginalPhoto];
-        } else {
-            [strongImagePickerVc.pickerDelegate imagePickerController:strongImagePickerVc didDeselectAsset:asset photo:photo isSelectOriginalPhoto:strongSelf.isSelectOriginalPhoto];
-        }
-    }];
-}
-
-@end

+ 0 - 15
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZProgressView.h

@@ -1,15 +0,0 @@
-//
-//  TZProgressView.h
-//  TZImagePickerController
-//
-//  Created by ttouch on 2016/12/6.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface TZProgressView : UIView
-
-@property (nonatomic, assign) double progress;
-
-@end

+ 0 - 55
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZProgressView.m

@@ -1,55 +0,0 @@
-//
-//  TZProgressView.m
-//  TZImagePickerController
-//
-//  Created by ttouch on 2016/12/6.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import "TZProgressView.h"
-
-@interface TZProgressView ()
-@property (nonatomic, strong) CAShapeLayer *progressLayer;
-@end
-
-@implementation TZProgressView
-
-- (instancetype)init {
-    self = [super init];
-    if (self) {
-        self.backgroundColor = [UIColor clearColor];
-        
-        _progressLayer = [CAShapeLayer layer];
-        _progressLayer.fillColor = [[UIColor clearColor] CGColor];
-        _progressLayer.strokeColor = [[UIColor whiteColor] CGColor];
-        _progressLayer.opacity = 1;
-        _progressLayer.lineCap = kCALineCapRound;
-        _progressLayer.lineWidth = 5;
-        
-        [_progressLayer setShadowColor:[UIColor blackColor].CGColor];
-        [_progressLayer setShadowOffset:CGSizeMake(1, 1)];
-        [_progressLayer setShadowOpacity:0.5];
-        [_progressLayer setShadowRadius:2];
-    }
-    return self;
-}
-
-- (void)drawRect:(CGRect)rect {
-    CGPoint center = CGPointMake(rect.size.width / 2, rect.size.height / 2);
-    CGFloat radius = rect.size.width / 2;
-    CGFloat startA = - M_PI_2;
-    CGFloat endA = - M_PI_2 + M_PI * 2 * _progress;
-    _progressLayer.frame = self.bounds;
-    UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startA endAngle:endA clockwise:YES];
-    _progressLayer.path =[path CGPath];
-    
-    [_progressLayer removeFromSuperlayer];
-    [self.layer addSublayer:_progressLayer];
-}
-
-- (void)setProgress:(double)progress {
-    _progress = progress;
-    [self setNeedsDisplay];
-}
-
-@end

+ 0 - 47
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoCropController.h

@@ -1,47 +0,0 @@
-//
-//  TZVideoCropController.h
-//  TZImagePickerController
-//
-//  Created by 肖兰月 on 2021/5/27.
-//  Copyright © 2021 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class TZAssetModel,TZImagePickerController;
-
-@interface TZVideoCropController : UIViewController<UIViewControllerTransitioningDelegate>
-@property (nonatomic, strong) TZAssetModel *model;
-@property (nonatomic, weak) TZImagePickerController *imagePickerVc;
-@end
-
-@protocol TZVideoEditViewDelegate <NSObject>
-- (void)editViewCropRectBeginChange;
-- (void)editViewCropRectEndChange;
-@end
-
-@interface TZVideoEditView : UIView
-@property (strong, nonatomic) UIImageView *beginImgView;
-@property (strong, nonatomic) UIImageView *endImgView;
-@property (strong, nonatomic) UIView *indicatorLine;
-@property (assign, nonatomic) CGFloat videoDuration;
-@property (assign, nonatomic) NSInteger maxCropVideoDuration;
-@property (assign, nonatomic) CGRect cropRect;
-@property (assign, nonatomic) CGFloat allImgWidth;
-@property (assign, nonatomic) CGFloat minCropRectWidth;
-
-@property (nonatomic, weak) id<TZVideoEditViewDelegate> delegate;
-
-- (void)resetIndicatorLine;
-- (void)indicatorLineAnimateWithDuration:(NSTimeInterval)duration cropRect:(CGRect)cropRect;
-@end
-
-
-
-@interface TZVideoPictureCell : UICollectionViewCell
-@property (strong, nonatomic) UIImageView *imgView;
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 673
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoCropController.m

@@ -1,673 +0,0 @@
-//
-//  TZVideoCropController.m
-//  TZImagePickerController
-//
-//  Created by 肖兰月 on 2021/5/27.
-//  Copyright © 2021 谭真. All rights reserved.
-//
-
-#import "TZVideoCropController.h"
-#import <MediaPlayer/MediaPlayer.h>
-#import "UIView+TZLayout.h"
-#import "TZImageManager.h"
-#import "TZAssetModel.h"
-#import "TZImagePickerController.h"
-
-@interface TZVideoCropController ()<TZVideoEditViewDelegate,UICollectionViewDelegate, UICollectionViewDataSource> {
-    AVPlayer *_player;
-    AVPlayerLayer *_playerLayer;
-    UIButton *_playButton;
-    UIImage *_cover;
-    NSString *_outputPath;
-    NSString *_errorMsg;
-    
-    UIButton *_cancelButton;
-    UIButton *_doneButton;
-    UIProgressView *_progress;
-    UILabel *_cropVideoDurationLabel;
-    
-    AVAssetImageGenerator *_imageGenerator;
-    AVAsset *_asset;
-    
-    CGFloat _collectionViewBeginOffsetX;
-    BOOL _isPlayed;
-    CGFloat _itemW;
-    BOOL _isDraging;
-    
-    UIStatusBarStyle _originStatusBarStyle;
-}
-
-// iCloud无法同步提示UI
-@property (nonatomic, strong) UIView *iCloudErrorView;
-@property (strong, nonatomic) UICollectionView *collectionView;
-@property (strong, nonatomic) TZVideoEditView *videoEditView;
-@property (strong, nonatomic) NSMutableArray *videoImgArray;
-@property (strong, nonatomic) NSArray *imageTimes;
-@property (strong, nonatomic) NSTimer *timer;
-
-@end
-
-@implementation TZVideoCropController
-
-#define VideoEditLeftMargin 40
-#define PanImageWidth 10
-#define MinCropVideoDuration 1
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    self.view.backgroundColor = [UIColor blackColor];
-    [self configMoviePlayer];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayer) name:UIApplicationWillResignActiveNotification object:nil];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    [self stopTimer];
-}
-
-- (void)configMoviePlayer {
-    [[TZImageManager manager] getPhotoWithAsset:_model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        BOOL iCloudSyncFailed = !photo && [TZCommonTools isICloudSyncError:info[PHImageErrorKey]];
-        self.iCloudErrorView.hidden = !iCloudSyncFailed;
-        self->_doneButton.enabled = !iCloudSyncFailed;
-    }];
-    [[TZImageManager manager] getVideoWithAsset:_model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            self->_asset = playerItem.asset;
-            self->_player = [AVPlayer playerWithPlayerItem:playerItem];
-            self->_playerLayer = [AVPlayerLayer playerLayerWithPlayer:self->_player];
-            self->_playerLayer.frame = self.view.bounds;
-            [self.view.layer addSublayer:self->_playerLayer];
-            [self configPlayButton];
-            [self configBottomToolBar];
-            if (self.imagePickerVc.allowEditVideo) {
-                [self configVideoImageCollectionView];
-                [self configVideoEditView];
-                [self generateVideoImage];
-            }
-            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayer) name:AVPlayerItemDidPlayToEndTimeNotification object:self->_player.currentItem];
-        });
-    }];
-}
-
-- (void)configPlayButton {
-    _playButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlayHL"] forState:UIControlStateHighlighted];
-    [_playButton addTarget:self action:@selector(playButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:_playButton];
-}
-
-- (void)configBottomToolBar {
-    _cropVideoDurationLabel = UILabel.new;
-    _cropVideoDurationLabel.textAlignment = NSTextAlignmentCenter;
-    _cropVideoDurationLabel.textColor = UIColor.whiteColor;
-    _cropVideoDurationLabel.font = [UIFont systemFontOfSize:12];
-    [self.view addSubview:_cropVideoDurationLabel];
-    
-    _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    _cancelButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    [_cancelButton setTitle:[NSBundle tz_localizedStringForKey:@"Cancel"] forState:0];
-    [_cancelButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
-    [_cancelButton addTarget:self action:@selector(cancelButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:_cancelButton];
-    
-    _doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    _doneButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    [_doneButton setTitle:self.imagePickerVc.doneBtnTitleStr forState:UIControlStateNormal];
-    [_doneButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
-    [_doneButton setTitleColor:self.imagePickerVc.oKButtonTitleColorDisabled forState:UIControlStateDisabled];
-    [self.view addSubview:_doneButton];
-    
-    if (self.imagePickerVc.videoEditViewPageUIConfigBlock) {
-        self.imagePickerVc.videoEditViewPageUIConfigBlock(_playButton, _cropVideoDurationLabel, _cancelButton, _doneButton);
-    }
-}
-
-- (void)configVideoImageCollectionView {
-    _itemW = (self.view.tz_width - VideoEditLeftMargin * 2 - 2 * PanImageWidth) / 10.0;
-    UICollectionViewFlowLayout *layout = UICollectionViewFlowLayout.new;
-    layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
-    layout.itemSize = CGSizeMake(_itemW, _itemW * 2);
-    layout.minimumLineSpacing = 0;
-    layout.minimumInteritemSpacing = 0;
-    _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
-    _collectionView.dataSource = self;
-    _collectionView.delegate = self;
-    _collectionView.contentInset = UIEdgeInsetsMake(0, VideoEditLeftMargin + PanImageWidth, 0, VideoEditLeftMargin + PanImageWidth);
-    _collectionView.clipsToBounds = NO;
-    _collectionView.showsHorizontalScrollIndicator = NO;
-    _collectionView.alwaysBounceHorizontal = YES;
-    [_collectionView registerClass:TZVideoPictureCell.class forCellWithReuseIdentifier:@"TZVideoPictureCell"];
-    [self.view addSubview:_collectionView];
-}
-
-- (void)configVideoEditView {
-    _videoEditView = TZVideoEditView.new;
-    _videoEditView.backgroundColor = UIColor.clearColor;
-    _videoEditView.delegate = self;
-    _videoEditView.maxCropVideoDuration = self.imagePickerVc.maxCropVideoDuration;
-    [self.view addSubview:_videoEditView];
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle {
-    if (self.imagePickerVc && [self.imagePickerVc isKindOfClass:[TZImagePickerController class]]) {
-        return self.imagePickerVc.statusBarStyle;
-    }
-    return [super preferredStatusBarStyle];
-}
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-
-    BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
-    CGFloat statusBarHeight = isFullScreen ? [TZCommonTools tz_statusBarHeight] : 0;
-    CGFloat statusBarAndNaviBarHeight = statusBarHeight + self.navigationController.navigationBar.tz_height;
-    
-    CGFloat toolBarHeight = 44 + [TZCommonTools tz_safeAreaInsets].bottom;
-    CGFloat doneButtonWidth = [_doneButton.currentTitle boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} context:nil].size.width;
-    doneButtonWidth = MAX(44, doneButtonWidth);
-    _cancelButton.frame = CGRectMake(12, self.view.tz_height - toolBarHeight, 44, 44);
-    [_cancelButton sizeToFit];
-    _cancelButton.tz_height = 44;
-    _doneButton.frame = CGRectMake(self.view.tz_width - doneButtonWidth - 12, self.view.tz_height - toolBarHeight, doneButtonWidth, 44);
-    _playButton.frame = CGRectMake(0, statusBarAndNaviBarHeight, self.view.tz_width, self.view.tz_height - statusBarAndNaviBarHeight - toolBarHeight);
-    
-    CGFloat collectionViewH = (self.view.tz_width - VideoEditLeftMargin * 2 - 2 * PanImageWidth) / 10.0 * 2;
-    _collectionView.frame = CGRectMake(0, self.view.tz_height - collectionViewH - toolBarHeight - statusBarHeight, self.view.tz_width, collectionViewH);
-    _videoEditView.frame = _collectionView.frame;
-    _cropVideoDurationLabel.frame = CGRectMake(0, _videoEditView.tz_bottom, self.view.tz_width, 20);
-    
-    CGFloat playerLayerHeight = CGRectGetMinY(_collectionView.frame) - statusBarHeight * 2;
-    CGFloat playerLayerWidth = self.view.tz_width/self.view.tz_height * playerLayerHeight;
-    CGFloat playerLayerLeft = (self.view.tz_width - playerLayerWidth) / 2.0;
-    CGRect playerLayerFrame = CGRectMake(playerLayerLeft, statusBarHeight, playerLayerWidth, playerLayerHeight);
-    _playerLayer.frame = playerLayerFrame;
-    _playButton.frame = CGRectMake(0, statusBarAndNaviBarHeight, self.view.tz_width, playerLayerHeight - statusBarAndNaviBarHeight);
-   
-    if (self.imagePickerVc.videoEditViewPageDidLayoutSubviewsBlock) {
-        self.imagePickerVc.videoEditViewPageDidLayoutSubviewsBlock(_playButton, _cropVideoDurationLabel, _cancelButton, _doneButton);
-    }
-}
-
-- (void)generateVideoImage {
-    _imageGenerator = [[AVAssetImageGenerator alloc] initWithAsset:_asset];
-    _imageGenerator.appliesPreferredTrackTransform = YES;
-    _imageGenerator.requestedTimeToleranceBefore = kCMTimeZero;
-    _imageGenerator.requestedTimeToleranceAfter = kCMTimeZero;
-    _imageGenerator.maximumSize = CGSizeMake(100, 100);
-    
-    NSTimeInterval durationSeconds = self.model.asset.duration;
-    self.videoEditView.videoDuration = durationSeconds;
-    
-    NSUInteger imageCount = 10;
-    CGFloat maxCropWidth = self.view.tz_width - (VideoEditLeftMargin + PanImageWidth) * 2;
-    if (durationSeconds <= MinCropVideoDuration) return;
-    if (durationSeconds <= self.imagePickerVc.maxCropVideoDuration) {
-        imageCount = 10;
-        self.videoEditView.allImgWidth = maxCropWidth;
-        _cropVideoDurationLabel.text = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Selected for %ld seconds"], (NSInteger)durationSeconds];
-    } else {
-        CGFloat singleWidthSecond = maxCropWidth / self.imagePickerVc.maxCropVideoDuration;
-        CGFloat allImgWidth = singleWidthSecond * durationSeconds;
-        self.videoEditView.allImgWidth = allImgWidth;
-        imageCount = allImgWidth / _itemW;
-        _cropVideoDurationLabel.text = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Selected for %ld seconds"],(long)self.imagePickerVc.maxCropVideoDuration];
-    }
-    NSArray *assetTracks = [_asset tracksWithMediaType:AVMediaTypeVideo];
-    if (!assetTracks.count) {
-        self.iCloudErrorView.hidden = NO;
-        _doneButton.enabled = NO;
-        _cropVideoDurationLabel.hidden = YES;
-        return;
-    };
-    Float64 frameRate = [[_asset tracksWithMediaType:AVMediaTypeVideo][0] nominalFrameRate];;
-    NSMutableArray *times = NSMutableArray.array;
-    NSTimeInterval intervalSecond = durationSeconds/imageCount;
-    CMTime timeFrame;
-    for (NSInteger i = 0; i < imageCount; i++) {
-        timeFrame = CMTimeMake(intervalSecond * i *frameRate, frameRate);
-        NSValue *timeValue = [NSValue valueWithCMTime:timeFrame];
-        [times addObject:timeValue];
-    }
-    self.videoImgArray = NSMutableArray.new;
-    self.imageTimes = times;
-    typeof(self) weakSelf = self;
-    [_imageGenerator generateCGImagesAsynchronouslyForTimes:times completionHandler:^(CMTime requestedTime, CGImageRef  _Nullable image, CMTime actualTime, AVAssetImageGeneratorResult result, NSError * _Nullable error) {
-        if (image) {
-            UIImage *img = [[UIImage alloc] initWithCGImage:image];
-            [weakSelf.videoImgArray addObject:img];
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [weakSelf.collectionView reloadData];
-            });
-        }
-    }];
-}
-
-#pragma mark - UICollectiobViewDataSource & UIcollectionViewDelegate
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
-    return self.videoImgArray.count;
-}
-
-- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
-    TZVideoPictureCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZVideoPictureCell" forIndexPath:indexPath];
-    cell.imgView.image = self.videoImgArray[indexPath.item];
-    return cell;
-}
-
-#pragma mark - UIScrollViewDelegate
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
-    if (!_isDraging) return;
-    CGFloat offsetX = scrollView.contentOffset.x;
-    if (offsetX - _collectionViewBeginOffsetX >= self.view.tz_width) {
-        [self.collectionView setContentOffset:CGPointMake(self.view.tz_width + _collectionViewBeginOffsetX, 0) animated:NO];
-    } else if (_collectionViewBeginOffsetX - offsetX >= self.view.tz_width) {
-        [self.collectionView setContentOffset:CGPointMake(_collectionViewBeginOffsetX - self.view.tz_width, 0) animated:NO];
-    }
-    
-    [self editViewCropRectBeginChange];
-}
-
-- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
-    _isDraging = YES;
-    _collectionViewBeginOffsetX = scrollView.contentOffset.x;
-}
-
-- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
-    _isDraging = NO;
-    [self editViewCropRectEndChange];
-}
-
-#pragma mark - TZVideoEditViewDelegate
-
-- (void)editViewCropRectBeginChange {
-    [self stopTimer];
-    [_playerLayer.player seekToTime:[self getCropStartTime] toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
-    
-    NSTimeInterval second = [self getCropVideoDuration];
-    _cropVideoDurationLabel.text = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Selected for %ld seconds"], (NSInteger)second];
-}
-
-- (void)editViewCropRectEndChange {
-    if (_isPlayed) {
-        [self starTimer];
-    }
-}
-
-#pragma mark - Click Event
-
-- (void)playButtonClick {
-    CMTime currentTime = _player.currentItem.currentTime;
-    CMTime durationTime = _player.currentItem.duration;
-    if (_player.rate == 0.0f) {
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"TZ_VIDEO_PLAY_NOTIFICATION" object:_player];
-        if (currentTime.value == durationTime.value) [_player.currentItem seekToTime:CMTimeMake(0, 1)];
-        _isPlayed = YES;
-        [self starTimer];
-        [_playButton setImage:nil forState:UIControlStateNormal];
-    } else {
-        _isPlayed = NO;
-        [self stopTimer];
-        [self pausePlayer];
-    }
-}
-
-- (void)cancelButtonClick {
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-
-- (void)doneButtonClick {
-    if ([[TZImageManager manager] isAssetCannotBeSelected:_model.asset]) {
-        return;
-    }
-    [self stopTimer];
-    
-    TZImagePickerController *imagePickerVc = self.imagePickerVc;
-    [imagePickerVc showProgressHUD];
-    [[TZImageManager manager] getVideoOutputPathWithAsset:_model.asset presetName:imagePickerVc.presetName timeRange:[self getCropVideoTimeRange] success:^(NSString *outputPath) {
-        [imagePickerVc hideProgressHUD];
-        self->_outputPath = outputPath;
-        [self dismissAndCallDelegateMethod];
-    } failure:^(NSString *errorMessage, NSError *error) {
-        [imagePickerVc hideProgressHUD];
-        self->_errorMsg = errorMessage;
-        [self dismissAndCallDelegateMethod];
-    }];
-}
-
-- (void)dismissAndCallDelegateMethod {
-    [self dismissViewControllerAnimated:NO completion:^{
-        [self callDelegateMethod];
-    }];
-    [self.imagePickerVc dismissViewControllerAnimated:YES completion:nil];
-}
-
-- (void)callDelegateMethod {
-    if (_outputPath) {
-        NSURL *videoURL = [NSURL fileURLWithPath:_outputPath];
-        if (self.imagePickerVc.saveEditedVideoToAlbum) {
-            [[TZImageManager manager] saveVideoWithUrl:videoURL completion:^(PHAsset *asset, NSError *error) {
-                if (error) { // 视频保存失败
-                    if ([self.imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFailToSaveEditedVideoWithError:)]) {
-                        [self.imagePickerVc.pickerDelegate imagePickerController:self.imagePickerVc didFailToSaveEditedVideoWithError:error];
-                    }
-                }
-            }];
-        }
-        UIImage *coverImage = [[TZImageManager manager] getImageWithVideoURL:videoURL];
-        if ([self.imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingAndEditingVideo:outputPath:error:)]) {
-            [self.imagePickerVc.pickerDelegate imagePickerController:self.imagePickerVc didFinishPickingAndEditingVideo:coverImage outputPath:_outputPath error:nil];
-        }
-        if (self.imagePickerVc.didFinishPickingAndEditingVideoHandle) {
-            self.imagePickerVc.didFinishPickingAndEditingVideoHandle(coverImage, _outputPath, nil);
-        }
-    } else {
-        if ([self.imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingAndEditingVideo:outputPath:error:)]) {
-            [self.imagePickerVc.pickerDelegate imagePickerController:self.imagePickerVc didFinishPickingAndEditingVideo:nil outputPath:nil error:_errorMsg];
-        }
-        if (self.imagePickerVc.didFinishPickingAndEditingVideoHandle) {
-            self.imagePickerVc.didFinishPickingAndEditingVideoHandle(nil, nil, _errorMsg);
-        }
-    }
-}
-
-#pragma mark - private method
-
-- (CMTime)getCropStartTime {
-    NSTimeInterval second = [self getCropVideoStartSecond];
-    if (second > self.model.asset.duration) {
-        second = roundf(self.model.asset.duration);
-    }
-    return CMTimeMakeWithSeconds(second, _playerLayer.player.currentTime.timescale);
-}
-
-- (CMTimeRange)getCropVideoTimeRange {
-    NSTimeInterval startSecond = [self getCropVideoStartSecond];
-    CMTime start = CMTimeMakeWithSeconds(startSecond, _playerLayer.player.currentTime.timescale);
-    NSTimeInterval second = [self getCropVideoDuration];
-    CMTime duration = CMTimeMakeWithSeconds(second, _playerLayer.player.currentTime.timescale);
-    return CMTimeRangeMake(start, duration);
-}
-
-- (NSTimeInterval)getCropVideoDuration {
-    CGFloat rectW = self.videoEditView.cropRect.size.width;
-    CGFloat contentW = self.videoEditView.allImgWidth;
-    CGFloat second = rectW / contentW * roundf(self.model.asset.duration);
-    return roundf(second);
-}
-
-- (NSTimeInterval)getCropVideoStartSecond {
-    CGFloat offsetX = self.collectionView.contentOffset.x;
-    CGFloat contentW = self.videoEditView.allImgWidth;
-    CGFloat cropRectX = self.videoEditView.cropRect.origin.x - VideoEditLeftMargin - PanImageWidth;
-    NSTimeInterval second = (offsetX + cropRectX) / contentW * roundf(self.model.asset.duration);
-    if (second < 0) second = 0;
-    return roundf(second);
-}
-
-- (CMTime)getTimeOfSeek {
-    NSTimeInterval second = [self getCropVideoStartSecond];
-    if (second > self.model.asset.duration) {
-        second = roundf(self.model.asset.duration);
-    }
-    return CMTimeMakeWithSeconds(second, _playerLayer.player.currentTime.timescale);
-}
-
-- (void)starTimer {
-    [self stopTimer];
-    NSTimeInterval timeInterval = [self getCropVideoDuration];
-    self.timer = [NSTimer scheduledTimerWithTimeInterval:timeInterval target:self selector:@selector(playCropVideo) userInfo:nil repeats:YES];
-    [self.timer fire];
-}
-
-- (void)stopTimer {
-    if (self.timer) {
-        [self.videoEditView resetIndicatorLine];
-        [_player pause];
-        [self.timer invalidate];
-        self.timer = nil;
-    }
-}
-
-- (void)playCropVideo {
-    [_player seekToTime:[self getCropStartTime] toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
-    [_player play];
-    [self.videoEditView indicatorLineAnimateWithDuration:[self getCropVideoDuration] cropRect:self.videoEditView.cropRect];
-}
-
-#pragma mark - Notification Method
-
-- (void)pausePlayer {
-    [_player pause];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-}
-
-#pragma mark - lazy
-- (UIView *)iCloudErrorView{
-    if (!_iCloudErrorView) {
-        _iCloudErrorView = [[UIView alloc] initWithFrame:CGRectMake(0, [TZCommonTools tz_statusBarHeight] + 44 + 10, self.view.tz_width, 28)];
-        UIImageView *icloud = [[UIImageView alloc] init];
-        icloud.image = [UIImage tz_imageNamedFromMyBundle:@"iCloudError"];
-        icloud.frame = CGRectMake(20, 0, 28, 28);
-        [_iCloudErrorView addSubview:icloud];
-        UILabel *label = [[UILabel alloc] init];
-        label.frame = CGRectMake(53, 0, self.view.tz_width - 63, 28);
-        label.font = [UIFont systemFontOfSize:10];
-        label.textColor = [UIColor whiteColor];
-        label.text = [NSBundle tz_localizedStringForKey:@"iCloud sync failed"];
-        [_iCloudErrorView addSubview:label];
-        [self.view addSubview:_iCloudErrorView];
-        _iCloudErrorView.hidden = YES;
-    }
-    return _iCloudErrorView;
-}
-
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
-    return UIInterfaceOrientationMaskPortrait;
-}
-
-- (void)dealloc {
-    NSLog(@"%s",__func__);
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-#pragma clang diagnostic pop
-
-@end
-
-
-@implementation TZVideoEditView {
-    UILabel *_dragingLabel;
-    CGFloat _itemWidth;
-    CGFloat _beginOffsetX;
-    CGFloat _endOffsetX;
-}
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self =  [super initWithFrame:frame];
-    if (self) {
-        [self initSubViews];
-    }
-    return self;
-}
-
-- (void)initSubViews {
-    _indicatorLine = UIView.new;
-    _indicatorLine.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.7];
-    [self addSubview:_indicatorLine];
-    
-    _beginImgView = UIImageView.new;
-    _beginImgView.image = [UIImage imageNamed:@"leftVideoEdit"];
-    _beginImgView.userInteractionEnabled = YES;
-    _beginImgView.tag = 0;
-    UIPanGestureRecognizer *beginPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)];
-    [_beginImgView addGestureRecognizer:beginPanGesture];
-    [self addSubview:_beginImgView];
-    
-    _endImgView = UIImageView.new;
-    _endImgView.image = [UIImage imageNamed:@"rightVideoEdit"];
-    _endImgView.userInteractionEnabled = YES;
-    _endImgView.tag = 1;
-    UIPanGestureRecognizer *endPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)];
-    [_endImgView addGestureRecognizer:endPanGesture];
-    [self addSubview:_endImgView];
-}
-
-- (void)layoutSubviews {
-    _beginImgView.frame = CGRectMake(VideoEditLeftMargin, 0, PanImageWidth, self.tz_height);
-    _indicatorLine.frame = CGRectMake(_beginImgView.tz_right - 2, 2, 2, self.tz_height - 4);
-    _endImgView.frame = CGRectMake(self.tz_width - PanImageWidth - VideoEditLeftMargin, 0, PanImageWidth, self.tz_height);
-    
-    self.cropRect =  CGRectMake(VideoEditLeftMargin + PanImageWidth, 0, self.tz_width - VideoEditLeftMargin * 2 - PanImageWidth * 2, self.tz_height);
-}
-
-- (void)setAllImgWidth:(CGFloat)allImgWidth {
-    _allImgWidth = allImgWidth;
-    if ((NSInteger)roundf(self.videoDuration) <= 0) {
-        self.minCropRectWidth = allImgWidth;
-        return;
-    }
-    
-    CGFloat scale = MinCropVideoDuration / self.videoDuration;
-    self.minCropRectWidth = scale * allImgWidth;
-}
-
-- (void)setCropRect:(CGRect)cropRect {
-    _cropRect = cropRect;
-    self.beginImgView.tz_left = cropRect.origin.x - PanImageWidth;
-    self.indicatorLine.tz_left = cropRect.origin.x - self.indicatorLine.tz_width;
-    self.endImgView.tz_left = CGRectGetMaxX(cropRect);
-
-    [self setNeedsDisplay];
-}
-
-- (void)drawRect:(CGRect)rect {
-    CGContextRef context = UIGraphicsGetCurrentContext();
-    CGContextClearRect(context, rect);
-    
-    CGPoint topPoints[] = {
-        CGPointMake(self.cropRect.origin.x, 0),
-        CGPointMake(CGRectGetMaxX(self.cropRect), 0)
-    };
-    CGPoint bottomPoints[] = {
-        CGPointMake(self.cropRect.origin.x, self.tz_height),
-        CGPointMake(CGRectGetMaxX(self.cropRect), self.tz_height)
-    };
-
-    CGContextAddLines(context, topPoints, 2);
-    CGContextAddLines(context, bottomPoints, 2);
-    CGContextSetStrokeColorWithColor(context, [UIColor whiteColor].CGColor);
-    CGContextSetLineWidth(context, 4.0);
-    CGContextDrawPath(context, kCGPathStroke);
-}
-
-- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
-    CGRect beginImgViewFrame = self.beginImgView.frame;
-    beginImgViewFrame.origin.x -= PanImageWidth;
-    beginImgViewFrame.size.width += PanImageWidth * 2;
-    if (CGRectContainsPoint(beginImgViewFrame, point)) return self.beginImgView;
-    
-    CGRect endImgViewFrame = self.endImgView.frame;
-    endImgViewFrame.origin.x -= PanImageWidth;
-    endImgViewFrame.size.width += PanImageWidth * 2;
-    if (CGRectContainsPoint(endImgViewFrame, point)) return self.endImgView;
-    
-    return nil;
-}
-
-#pragma mark - private
-
-- (void)indicatorLineAnimateWithDuration:(NSTimeInterval)duration cropRect:(CGRect)cropRect {
-    [self resetIndicatorLine];
-    [UIView animateWithDuration:duration delay:.0 options:UIViewAnimationOptionCurveLinear animations:^{
-        self.indicatorLine.tz_left = CGRectGetMaxX(cropRect);
-    } completion:nil];
-}
-
-- (void)resetIndicatorLine {
-    [self.indicatorLine.layer removeAllAnimations];
-    self.indicatorLine.tz_left = CGRectGetMinX(self.cropRect) - self.indicatorLine.tz_width;
-}
-
-- (void)panGestureAction:(UIGestureRecognizer *)gesture {
-    CGPoint point = [gesture locationInView:self];
-    CGRect rect = self.cropRect;
-    CGFloat minCropRectLeft = VideoEditLeftMargin + PanImageWidth;
-
-    switch (gesture.view.tag) {
-        case 0: { // 左边拖拽
-            CGFloat maxX = self.endImgView.tz_left - self.minCropRectWidth;
-            point.x = MAX(minCropRectLeft, MIN(point.x, maxX));
-            point.y = 0;
-            
-            rect.size.width = CGRectGetMaxX(rect) - point.x;
-            rect.origin.x = point.x;
-        } break;
-        case 1: { // 右边拖拽
-            minCropRectLeft = CGRectGetMaxX(self.beginImgView.frame) + self.minCropRectWidth;
-            CGFloat  maxX = self.tz_width - VideoEditLeftMargin - PanImageWidth;
-
-            point.x = MAX(minCropRectLeft, MIN(point.x, maxX));
-            point.y = 0;
-
-            rect.size.width = (point.x - rect.origin.x);
-        } break;
-        default:break;
-    }
-    
-    self.cropRect = rect;
-    
-    switch (gesture.state) {
-        case UIGestureRecognizerStateBegan:
-        case UIGestureRecognizerStateChanged: {
-            if (self.delegate && [self.delegate respondsToSelector:@selector(editViewCropRectBeginChange)]) {
-                [self.delegate editViewCropRectBeginChange];
-            }
-        } break;
-        case UIGestureRecognizerStateEnded:
-        case UIGestureRecognizerStateCancelled: {
-            if (self.delegate && [self.delegate respondsToSelector:@selector(editViewCropRectEndChange)]) {
-                [self.delegate editViewCropRectEndChange];
-            }
-        } break;
-        default: break;
-    }
-}
-
-@end
-
-
-
-@implementation TZVideoPictureCell
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        [self initSubViews];
-    }
-    return self;
-}
-
-- (void)initSubViews {
-    _imgView = [[UIImageView alloc] initWithFrame:self.bounds];
-    _imgView.contentMode = UIViewContentModeScaleAspectFill;
-    _imgView.clipsToBounds = YES;
-    [self.contentView addSubview:_imgView];
-}
-
-@end

+ 0 - 17
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoEditedPreviewController.h

@@ -1,17 +0,0 @@
-//
-//  TZVideoEditedPreviewController.h
-//  TZImagePickerController
-//
-//  Created by 肖兰月 on 2021/5/29.
-//  Copyright © 2021 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface TZVideoEditedPreviewController : UIViewController
-@property (nonatomic, copy) NSURL *videoURL;
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 129
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoEditedPreviewController.m

@@ -1,129 +0,0 @@
-//
-//  TZVideoEditedPreviewController.m
-//  TZImagePickerController
-//
-//  Created by 肖兰月 on 2021/5/29.
-//  Copyright © 2021 谭真. All rights reserved.
-//
-
-#import "TZVideoEditedPreviewController.h"
-#import <MediaPlayer/MediaPlayer.h>
-#import "TZImageManager.h"
-#import "TZImagePickerController.h"
-#import "UIView+TZLayout.h"
-
-@interface TZVideoEditedPreviewController () {
-    AVPlayer *_player;
-    AVPlayerLayer *_playerLayer;
-    UIButton *_playButton;
-    UIImage *_cover;
-    
-    UIView *_toolBar;
-    UIButton *_doneButton;
-    UIProgressView *_progress;
-    
-    UIStatusBarStyle _originStatusBarStyle;
-}
-
-@end
-
-@implementation TZVideoEditedPreviewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    self.view.backgroundColor = [UIColor blackColor];
-    [self configMoviePlayer];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:UIApplicationWillResignActiveNotification object:nil];
-}
-
-- (void)configMoviePlayer {
-    _player = [AVPlayer playerWithURL:self.videoURL];
-    _playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player];
-    [self.view.layer addSublayer:_playerLayer];
-    
-    [self configPlayButton];
-    [self configBottomToolBar];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:self->_player.currentItem];
-}
-
-- (void)configPlayButton {
-    _playButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlayHL"] forState:UIControlStateHighlighted];
-    [_playButton addTarget:self action:@selector(playButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:_playButton];
-}
-
-- (void)configBottomToolBar {
-    _toolBar = [[UIView alloc] initWithFrame:CGRectZero];
-    CGFloat rgb = 34 / 255.0;
-    _toolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.7];
-    
-    _doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    _doneButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc) {
-        [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal];
-        [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal];
-    } else {
-        [_doneButton setTitle:[NSBundle tz_localizedStringForKey:@"Done"] forState:UIControlStateNormal];
-        [_doneButton setTitleColor:[UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0] forState:UIControlStateNormal];
-    }
-    [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorDisabled forState:UIControlStateDisabled];
-    [_toolBar addSubview:_doneButton];
-    [self.view addSubview:_toolBar];
-}
-
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-
-    BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
-    CGFloat statusBarHeight = isFullScreen ? [TZCommonTools tz_statusBarHeight] : 0;
-    CGFloat statusBarAndNaviBarHeight = statusBarHeight + self.navigationController.navigationBar.tz_height;
-    
-    CGFloat toolBarHeight = 44 + [TZCommonTools tz_safeAreaInsets].bottom;
-    _toolBar.frame = CGRectMake(0, self.view.tz_height - toolBarHeight, self.view.tz_width, toolBarHeight);
-    [_doneButton sizeToFit];
-    _doneButton.frame = CGRectMake(self.view.tz_width - _doneButton.tz_width - 12, 0, MAX(44, _doneButton.tz_width), 44);
-    _playButton.frame = CGRectMake(0, statusBarAndNaviBarHeight, self.view.tz_width, self.view.tz_height - statusBarAndNaviBarHeight - toolBarHeight);
-    _playerLayer.frame = self.view.bounds;
-}
-
-#pragma mark - Click Event
-
-- (void)playButtonClick {
-    CMTime currentTime = _player.currentItem.currentTime;
-    CMTime durationTime = _player.currentItem.duration;
-    if (_player.rate == 0.0f) {
-        if (currentTime.value == durationTime.value) [_player.currentItem seekToTime:CMTimeMake(0, 1)];
-        [_player play];
-        _toolBar.hidden = YES;
-        [_playButton setImage:nil forState:UIControlStateNormal];
-    } else {
-        [self pausePlayerAndShowNaviBar];
-    }
-}
-
-- (void)doneButtonClick {
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-#pragma mark - Notification Method
-
-- (void)pausePlayerAndShowNaviBar {
-    [_player pause];
-    _toolBar.hidden = NO;
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-}
-
-- (void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-#pragma clang diagnostic pop
-
-@end

+ 0 - 17
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoPlayerController.h

@@ -1,17 +0,0 @@
-//
-//  TZVideoPlayerController.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 16/1/5.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@class TZAssetModel;
-@interface TZVideoPlayerController : UIViewController
-
-@property (nonatomic, strong) TZAssetModel *model;
-
-@end
-

+ 0 - 322
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/TZVideoPlayerController.m

@@ -1,322 +0,0 @@
-//
-//  TZVideoPlayerController.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 16/1/5.
-//  Copyright © 2016年 谭真. All rights reserved.
-//
-
-#import "TZVideoPlayerController.h"
-#import <MediaPlayer/MediaPlayer.h>
-#import "UIView+TZLayout.h"
-#import "TZImageManager.h"
-#import "TZAssetModel.h"
-#import "TZImagePickerController.h"
-#import "TZPhotoPreviewController.h"
-#import "TZVideoCropController.h"
-
-@interface TZVideoPlayerController () {
-    AVPlayer *_player;
-    AVPlayerLayer *_playerLayer;
-    UIButton *_playButton;
-    UIImage *_cover;
-    NSString *_outputPath;
-    NSString *_errorMsg;
-    
-    UIView *_toolBar;
-    UIButton *_doneButton;
-    UIButton *_editButton;
-    UIProgressView *_progress;
-    
-    UIStatusBarStyle _originStatusBarStyle;
-}
-@property (assign, nonatomic) BOOL needShowStatusBar;
-
-// iCloud无法同步提示UI
-@property (nonatomic, strong) UIView *iCloudErrorView;
-
-@end
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-
-@implementation TZVideoPlayerController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    self.needShowStatusBar = ![UIApplication sharedApplication].statusBarHidden;
-    self.view.backgroundColor = [UIColor blackColor];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc) {
-        self.navigationItem.title = tzImagePickerVc.previewBtnTitleStr;
-    }
-    [self configMoviePlayer];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:UIApplicationWillResignActiveNotification object:nil];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    _originStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
-    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    if (self.needShowStatusBar) {
-        [UIApplication sharedApplication].statusBarHidden = NO;
-    }
-    [UIApplication sharedApplication].statusBarStyle = _originStatusBarStyle;
-}
-
-- (void)configMoviePlayer {
-    [[TZImageManager manager] getPhotoWithAsset:_model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
-        BOOL iCloudSyncFailed = !photo && [TZCommonTools isICloudSyncError:info[PHImageErrorKey]];
-        self.iCloudErrorView.hidden = !iCloudSyncFailed;
-        if (!isDegraded && photo) {
-            self->_cover = photo;
-            self->_doneButton.enabled = YES;
-            self->_editButton.enabled = YES;
-        }
-    }];
-    [[TZImageManager manager] getVideoWithAsset:_model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            self->_player = [AVPlayer playerWithPlayerItem:playerItem];
-            self->_playerLayer = [AVPlayerLayer playerLayerWithPlayer:self->_player];
-            self->_playerLayer.frame = self.view.bounds;
-            [self.view.layer addSublayer:self->_playerLayer];
-            [self addProgressObserver];
-            [self configPlayButton];
-            [self configBottomToolBar];
-            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:self->_player.currentItem];
-        });
-    }];
-}
-
-/// Show progress,do it next time / 给播放器添加进度更新,下次加上
-- (void)addProgressObserver{
-    AVPlayerItem *playerItem = _player.currentItem;
-    UIProgressView *progress = _progress;
-    [_player addPeriodicTimeObserverForInterval:CMTimeMake(1.0, 1.0) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
-        float current = CMTimeGetSeconds(time);
-        float total = CMTimeGetSeconds([playerItem duration]);
-        if (current) {
-            [progress setProgress:(current/total) animated:YES];
-        }
-    }];
-}
-
-- (void)configPlayButton {
-    _playButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlayHL"] forState:UIControlStateHighlighted];
-    [_playButton addTarget:self action:@selector(playButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:_playButton];
-}
-
-- (void)configBottomToolBar {
-    _toolBar = [[UIView alloc] initWithFrame:CGRectZero];
-    CGFloat rgb = 34 / 255.0;
-    _toolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.7];
-    
-    _doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    _doneButton.titleLabel.font = [UIFont systemFontOfSize:16];
-    if (!_cover) {
-        _doneButton.enabled = NO;
-    }
-    [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (tzImagePickerVc) {
-        [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal];
-        [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal];
-    } else {
-        [_doneButton setTitle:[NSBundle tz_localizedStringForKey:@"Done"] forState:UIControlStateNormal];
-        [_doneButton setTitleColor:[UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0] forState:UIControlStateNormal];
-    }
-    [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorDisabled forState:UIControlStateDisabled];
-    [_toolBar addSubview:_doneButton];
-    [self.view addSubview:_toolBar];
-    
-    if (tzImagePickerVc && tzImagePickerVc.allowEditVideo && roundf(self.model.asset.duration) > 1) {
-        _editButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        _editButton.titleLabel.font = [UIFont systemFontOfSize:16];
-        if (!_cover) {
-            _editButton.enabled = NO;
-        }
-        [_editButton addTarget:self action:@selector(editButtonClick) forControlEvents:UIControlEventTouchUpInside];
-        [_editButton setTitle:tzImagePickerVc.editBtnTitleStr forState:UIControlStateNormal];
-        [_editButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal];
-        [_editButton setTitleColor:tzImagePickerVc.oKButtonTitleColorDisabled forState:UIControlStateDisabled];
-        [_toolBar addSubview:_editButton];
-    }
-    
-    if (tzImagePickerVc.videoPreviewPageUIConfigBlock) {
-        tzImagePickerVc.videoPreviewPageUIConfigBlock(_playButton, _toolBar, _editButton, _doneButton);
-    }
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle {
-    TZImagePickerController *tzImagePicker = (TZImagePickerController *)self.navigationController;
-    if (tzImagePicker && [tzImagePicker isKindOfClass:[TZImagePickerController class]]) {
-        return tzImagePicker.statusBarStyle;
-    }
-    return [super preferredStatusBarStyle];
-}
-
-#pragma mark - Layout
-
-- (void)viewDidLayoutSubviews {
-    [super viewDidLayoutSubviews];
-    TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
-    
-    BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
-    CGFloat statusBarHeight = isFullScreen ? [TZCommonTools tz_statusBarHeight] : 0;
-    CGFloat statusBarAndNaviBarHeight = statusBarHeight + self.navigationController.navigationBar.tz_height;
-    _playerLayer.frame = self.view.bounds;
-    CGFloat toolBarHeight = 44 + [TZCommonTools tz_safeAreaInsets].bottom;
-    _toolBar.frame = CGRectMake(0, self.view.tz_height - toolBarHeight, self.view.tz_width, toolBarHeight);
-    [_doneButton sizeToFit];
-    _doneButton.frame = CGRectMake(self.view.tz_width - _doneButton.tz_width - 12, 0, MAX(44, _doneButton.tz_width), 44);
-    _playButton.frame = CGRectMake(0, statusBarAndNaviBarHeight, self.view.tz_width, self.view.tz_height - statusBarAndNaviBarHeight - toolBarHeight);
-    if (tzImagePickerVc.allowEditVideo) {
-        _editButton.frame = CGRectMake(12, 0, 44, 44);
-        [_editButton sizeToFit];
-        _editButton.tz_height = 44;
-    }
-    if (tzImagePickerVc.videoPreviewPageDidLayoutSubviewsBlock) {
-        tzImagePickerVc.videoPreviewPageDidLayoutSubviewsBlock(_playButton, _toolBar, _editButton, _doneButton);
-    }
-}
-
-#pragma mark - Click Event
-
-- (void)playButtonClick {
-    CMTime currentTime = _player.currentItem.currentTime;
-    CMTime durationTime = _player.currentItem.duration;
-    if (_player.rate == 0.0f) {
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"TZ_VIDEO_PLAY_NOTIFICATION" object:_player];
-        if (currentTime.value == durationTime.value) [_player.currentItem seekToTime:CMTimeMake(0, 1)];
-        [_player play];
-        [self.navigationController setNavigationBarHidden:YES];
-        _toolBar.hidden = YES;
-        [_playButton setImage:nil forState:UIControlStateNormal];
-        [UIApplication sharedApplication].statusBarHidden = YES;
-    } else {
-        [self pausePlayerAndShowNaviBar];
-    }
-}
-
-- (void)editButtonClick {
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    TZVideoCropController *videoCropVc = [[TZVideoCropController alloc] init];
-    videoCropVc.model = self.model;
-    videoCropVc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
-    videoCropVc.modalPresentationStyle = UIModalPresentationFullScreen;
-    videoCropVc.modalPresentationCapturesStatusBarAppearance = YES;
-    videoCropVc.imagePickerVc = imagePickerVc;
-    [self presentViewController:videoCropVc animated:YES completion:nil];
-}
-
-- (void)doneButtonClick {
-    if ([[TZImageManager manager] isAssetCannotBeSelected:_model.asset]) {
-        return;
-    }
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (imagePickerVc.allowEditVideo) {
-        [imagePickerVc showProgressHUD];
-        [[TZImageManager manager] getVideoOutputPathWithAsset:_model.asset presetName:imagePickerVc.presetName success:^(NSString *outputPath) {
-            [imagePickerVc hideProgressHUD];
-            self->_outputPath = outputPath;
-            [self dismissAndCallDelegateMethod];
-        } failure:^(NSString *errorMessage, NSError *error) {
-            [imagePickerVc hideProgressHUD];
-            self->_errorMsg = errorMessage;
-            [self dismissAndCallDelegateMethod];
-        }];
-    } else {
-        [self dismissAndCallDelegateMethod];
-    }
-}
-
-- (void)dismissAndCallDelegateMethod {
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (!imagePickerVc) {
-        [self dismissViewControllerAnimated:YES completion:nil];
-        return;
-    }
-    if (imagePickerVc.autoDismiss) {
-        [imagePickerVc dismissViewControllerAnimated:YES completion:^{
-            [self callDelegateMethod];
-        }];
-    } else {
-        [self callDelegateMethod];
-    }
-}
-
-- (void)callDelegateMethod {
-    TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
-    if (imagePickerVc.allowEditVideo) {
-        if (_outputPath) {
-            if ([imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingAndEditingVideo:outputPath:error:)]) {
-                [imagePickerVc.pickerDelegate imagePickerController:imagePickerVc didFinishPickingAndEditingVideo:self->_cover outputPath:self->_outputPath error:nil];
-            }
-            if (imagePickerVc.didFinishPickingAndEditingVideoHandle) {
-                imagePickerVc.didFinishPickingAndEditingVideoHandle(self->_cover, self->_outputPath, nil);
-            }
-        } else {
-            if ([imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingAndEditingVideo:outputPath:error:)]) {
-                [imagePickerVc.pickerDelegate imagePickerController:imagePickerVc didFinishPickingAndEditingVideo:nil outputPath:nil error:self->_errorMsg];
-            }
-            if (imagePickerVc.didFinishPickingAndEditingVideoHandle) {
-                imagePickerVc.didFinishPickingAndEditingVideoHandle(nil, nil, self->_errorMsg);
-            }
-        }
-    } else {
-        if ([imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingVideo:sourceAssets:)]) {
-            [imagePickerVc.pickerDelegate imagePickerController:imagePickerVc didFinishPickingVideo:_cover sourceAssets:_model.asset];
-        }
-        if (imagePickerVc.didFinishPickingVideoHandle) {
-            imagePickerVc.didFinishPickingVideoHandle(_cover,_model.asset);
-        }
-    }
-}
-
-#pragma mark - Notification Method
-
-- (void)pausePlayerAndShowNaviBar {
-    [_player pause];
-    _toolBar.hidden = NO;
-    [self.navigationController setNavigationBarHidden:NO];
-    [_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
-    
-    if (self.needShowStatusBar) {
-        [UIApplication sharedApplication].statusBarHidden = NO;
-    }
-}
-
-#pragma mark - lazy
-- (UIView *)iCloudErrorView{
-    if (!_iCloudErrorView) {
-        _iCloudErrorView = [[UIView alloc] initWithFrame:CGRectMake(0, [TZCommonTools tz_statusBarHeight] + 44 + 10, self.view.tz_width, 28)];
-        UIImageView *icloud = [[UIImageView alloc] init];
-        icloud.image = [UIImage tz_imageNamedFromMyBundle:@"iCloudError"];
-        icloud.frame = CGRectMake(20, 0, 28, 28);
-        [_iCloudErrorView addSubview:icloud];
-        UILabel *label = [[UILabel alloc] init];
-        label.frame = CGRectMake(53, 0, self.view.tz_width - 63, 28);
-        label.font = [UIFont systemFontOfSize:10];
-        label.textColor = [UIColor whiteColor];
-        label.text = [NSBundle tz_localizedStringForKey:@"iCloud sync failed"];
-        [_iCloudErrorView addSubview:label];
-        [self.view addSubview:_iCloudErrorView];
-        _iCloudErrorView.hidden = YES;
-    }
-    return _iCloudErrorView;
-}
-
-- (void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-#pragma clang diagnostic pop
-
-@end

+ 0 - 31
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/UIView+TZLayout.h

@@ -1,31 +0,0 @@
-//
-//  UIView+TZLayout.h
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/2/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-typedef enum : NSUInteger {
-    TZOscillatoryAnimationToBigger,
-    TZOscillatoryAnimationToSmaller,
-} TZOscillatoryAnimationType;
-
-@interface UIView (TZLayout)
-
-@property (nonatomic) CGFloat tz_left;        ///< Shortcut for frame.origin.x.
-@property (nonatomic) CGFloat tz_top;         ///< Shortcut for frame.origin.y
-@property (nonatomic) CGFloat tz_right;       ///< Shortcut for frame.origin.x + frame.size.width
-@property (nonatomic) CGFloat tz_bottom;      ///< Shortcut for frame.origin.y + frame.size.height
-@property (nonatomic) CGFloat tz_width;       ///< Shortcut for frame.size.width.
-@property (nonatomic) CGFloat tz_height;      ///< Shortcut for frame.size.height.
-@property (nonatomic) CGFloat tz_centerX;     ///< Shortcut for center.x
-@property (nonatomic) CGFloat tz_centerY;     ///< Shortcut for center.y
-@property (nonatomic) CGPoint tz_origin;      ///< Shortcut for frame.origin.
-@property (nonatomic) CGSize  tz_size;        ///< Shortcut for frame.size.
-
-+ (void)showOscillatoryAnimationWithLayer:(CALayer *)layer type:(TZOscillatoryAnimationType)type;
-
-@end

+ 0 - 126
KulexiuForTeacher/KulexiuForTeacher/Common/ThirdPart/TZImagePickerController/UIView+TZLayout.m

@@ -1,126 +0,0 @@
-//
-//  UIView+TZLayout.m
-//  TZImagePickerController
-//
-//  Created by 谭真 on 15/2/24.
-//  Copyright © 2015年 谭真. All rights reserved.
-//
-
-#import "UIView+TZLayout.h"
-
-@implementation UIView (TZLayout)
-
-- (CGFloat)tz_left {
-    return self.frame.origin.x;
-}
-
-- (void)setTz_left:(CGFloat)x {
-    CGRect frame = self.frame;
-    frame.origin.x = x;
-    self.frame = frame;
-}
-
-- (CGFloat)tz_top {
-    return self.frame.origin.y;
-}
-
-- (void)setTz_top:(CGFloat)y {
-    CGRect frame = self.frame;
-    frame.origin.y = y;
-    self.frame = frame;
-}
-
-- (CGFloat)tz_right {
-    return self.frame.origin.x + self.frame.size.width;
-}
-
-- (void)setTz_right:(CGFloat)right {
-    CGRect frame = self.frame;
-    frame.origin.x = right - frame.size.width;
-    self.frame = frame;
-}
-
-- (CGFloat)tz_bottom {
-    return self.frame.origin.y + self.frame.size.height;
-}
-
-- (void)setTz_bottom:(CGFloat)bottom {
-    CGRect frame = self.frame;
-    frame.origin.y = bottom - frame.size.height;
-    self.frame = frame;
-}
-
-- (CGFloat)tz_width {
-    return self.frame.size.width;
-}
-
-- (void)setTz_width:(CGFloat)width {
-    CGRect frame = self.frame;
-    frame.size.width = width;
-    self.frame = frame;
-}
-
-- (CGFloat)tz_height {
-    return self.frame.size.height;
-}
-
-- (void)setTz_height:(CGFloat)height {
-    CGRect frame = self.frame;
-    frame.size.height = height;
-    self.frame = frame;
-}
-
-- (CGFloat)tz_centerX {
-    return self.center.x;
-}
-
-- (void)setTz_centerX:(CGFloat)centerX {
-    self.center = CGPointMake(centerX, self.center.y);
-}
-
-- (CGFloat)tz_centerY {
-    return self.center.y;
-}
-
-- (void)setTz_centerY:(CGFloat)centerY {
-    self.center = CGPointMake(self.center.x, centerY);
-}
-
-- (CGPoint)tz_origin {
-    return self.frame.origin;
-}
-
-- (void)setTz_origin:(CGPoint)origin {
-    CGRect frame = self.frame;
-    frame.origin = origin;
-    self.frame = frame;
-}
-
-- (CGSize)tz_size {
-    return self.frame.size;
-}
-
-- (void)setTz_size:(CGSize)size {
-    CGRect frame = self.frame;
-    frame.size = size;
-    self.frame = frame;
-}
-
-+ (void)showOscillatoryAnimationWithLayer:(CALayer *)layer type:(TZOscillatoryAnimationType)type{
-    NSNumber *animationScale1 = type == TZOscillatoryAnimationToBigger ? @(1.15) : @(0.5);
-    NSNumber *animationScale2 = type == TZOscillatoryAnimationToBigger ? @(0.92) : @(1.15);
-    
-    [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{
-        [layer setValue:animationScale1 forKeyPath:@"transform.scale"];
-    } completion:^(BOOL finished) {
-        [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{
-            [layer setValue:animationScale2 forKeyPath:@"transform.scale"];
-        } completion:^(BOOL finished) {
-            [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{
-                [layer setValue:@(1.0) forKeyPath:@"transform.scale"];
-            } completion:nil];
-        }];
-    }];
-}
-
-@end

+ 0 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m

@@ -1071,7 +1071,6 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
     MJWeakSelf;
     [[RCRTCEngine sharedInstance] leaveRoom:^(BOOL isSuccess, RCRTCCode code) {
         NSLog(@"----- leave code -----%zd",code);
-        [weakSelf uninitEngine];
         dispatch_main_async_safe(^{
             [weakSelf sendLeaveMessageCallback:^(BOOL success) {
                 callback(success);

+ 22 - 4
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/CreateStyle/Controller/MyStyleViewController.m

@@ -68,6 +68,8 @@
 /// 提示窗
 @property (nonatomic, strong) LiveRoomAlertView *alertView;
 
+@property (nonatomic, assign) BOOL isModifyAvatal;
+
 @end
 
 @implementation MyStyleViewController
@@ -666,7 +668,14 @@
             MJWeakSelf;
             [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
                 UIImage *sendImg = [imageArray lastObject];
-                [weakSelf updateWithUserLogo:sendImg];
+                weakSelf.isModifyAvatal = YES;
+                // 跳转到裁剪功能
+                RSKImageCropViewController *imageCropVC = [[RSKImageCropViewController alloc] initWithImage:sendImg cropMode:RSKImageCropModeSquare];
+                imageCropVC.rotationEnabled = YES;
+                imageCropVC.delegate = weakSelf;
+                CustomNavViewController *navCtrl = [[CustomNavViewController alloc] initWithRootViewController:imageCropVC];
+                navCtrl.modalPresentationStyle = UIModalPresentationFullScreen;
+                [weakSelf.navigationController presentViewController:navCtrl animated:YES completion:nil];
             }];
             [self.mediaManager pushImagePickerController];
         }
@@ -781,7 +790,9 @@
  通知 delegate 取消裁剪图像。
  */
 - (void)imageCropViewControllerDidCancelCrop:(RSKImageCropViewController *)controller {
-    
+    if (self.isModifyAvatal) {
+        self.isModifyAvatal = NO;
+    }
     [controller.navigationController dismissViewControllerAnimated:YES completion:nil];
 }
 
@@ -790,8 +801,15 @@
  */
 - (void)imageCropViewController:(RSKImageCropViewController *)controller didCropImage:(UIImage *)croppedImage usingCropRect:(CGRect)cropRect rotationAngle:(CGFloat)rotationAngle {
 //    croppedImage
-    self.hasModify = YES;
-    [self uploadImage:croppedImage index:self.chooseFileIndex];
+    if (self.isModifyAvatal) {
+        self.isModifyAvatal = NO;
+        [self updateWithUserLogo:croppedImage];
+    }
+    else {
+        self.hasModify = YES;
+        [self uploadImage:croppedImage index:self.chooseFileIndex];
+    }
+    
     [controller.navigationController dismissViewControllerAnimated:YES completion:nil];
 }
 /*

+ 28 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/Setting/Controller/UserSettingViewController.m

@@ -20,8 +20,9 @@
 #import "KSMediaManager.h"
 #import "UserAuthViewController.h"
 #import "UserInfoManager.h"
+#import <RSKImageCropper/RSKImageCropper.h>
 
-@interface UserSettingViewController ()
+@interface UserSettingViewController ()<RSKImageCropViewControllerDelegate>
 
 @property (nonatomic, strong) UseBodyView *bodyView;
 
@@ -163,11 +164,17 @@
     self.mediaManager.mediaType = MEDIATYPE_PHOTO;
     self.mediaManager.maxPhotoNumber = 1;
     self.mediaManager.baseCtrl = self;
-    self.mediaManager.needCropImage = YES;
+    self.mediaManager.needCropImage = NO;
     MJWeakSelf;
     [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
         UIImage *sendImg = [imageArray lastObject];
-        [weakSelf updateWithUserLogo:sendImg];
+        // 跳转到裁剪功能
+        RSKImageCropViewController *imageCropVC = [[RSKImageCropViewController alloc] initWithImage:sendImg cropMode:RSKImageCropModeSquare];
+        imageCropVC.rotationEnabled = YES;
+        imageCropVC.delegate = weakSelf;
+        CustomNavViewController *navCtrl = [[CustomNavViewController alloc] initWithRootViewController:imageCropVC];
+        navCtrl.modalPresentationStyle = UIModalPresentationFullScreen;
+        [weakSelf.navigationController presentViewController:navCtrl animated:YES completion:nil];
     }];
     [self.mediaManager pushImagePickerController];
 }
@@ -280,6 +287,24 @@
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     appDelegate.window.rootViewController = navCtrl;
 }
+
+#pragma mark --- RSKImageCropViewControllerDelegate
+/**
+ 通知 delegate 取消裁剪图像。
+ */
+- (void)imageCropViewControllerDidCancelCrop:(RSKImageCropViewController *)controller {
+
+    [controller.navigationController dismissViewControllerAnimated:YES completion:nil];
+}
+
+/**
+ 通知 delegate 原始图像已经被裁剪。此外,还提供了一个裁剪矩形和用于生成图像的旋转角度。
+ */
+- (void)imageCropViewController:(RSKImageCropViewController *)controller didCropImage:(UIImage *)croppedImage usingCropRect:(CGRect)cropRect rotationAngle:(CGFloat)rotationAngle {
+//    croppedImage
+    [self updateWithUserLogo:croppedImage];
+    [controller.navigationController dismissViewControllerAnimated:YES completion:nil];
+}
 /*
 #pragma mark - Navigation
 

+ 4 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/SealClass/Services/RTC/RTCService.m

@@ -64,6 +64,7 @@
     [self.capturer stopCapture];
     self.localView = nil;
     _capturer = nil;
+    _captureParam = nil;
     _audioCapturer = nil;
     [[RCRTCEngine sharedInstance] leaveRoom:^(BOOL isSuccess, RCRTCCode code) {
         dispatch_async(dispatch_get_main_queue(), ^{
@@ -520,6 +521,7 @@
 - (RCRTCCameraOutputStream *)capturer {
     if(!_capturer) {
         _capturer = [RCRTCEngine sharedInstance].defaultVideoStream;
+        [_capturer setVideoConfig:self.captureParam];
         _capturer.videoOrientation = AVCaptureVideoOrientationLandscapeRight;
         _capturer.streamEventDelegate = self;
 //        _capturer.isPreviewMirror = YES;
@@ -539,8 +541,8 @@
     if (!_captureParam) {
         _captureParam = [[RCRTCVideoStreamConfig alloc] init];
         _captureParam.videoSizePreset = RCRTCVideoSizePreset640x480;
-        _captureParam.maxBitrate = 1000;
-        _captureParam.minBitrate = 500;
+        _captureParam.maxBitrate = 900;
+        _captureParam.minBitrate = 200;
     }
     return _captureParam;
 }

+ 1 - 0
KulexiuForTeacher/Podfile

@@ -25,6 +25,7 @@
   pod 'RSKImageCropper'
   pod 'TYCyclePagerView'
   
+  pod 'TZImagePickerController'
   #lottie 动画库
   pod 'lottie-ios', '~> 2.5'
 #  友盟

+ 9 - 1
KulexiuForTeacher/Podfile.lock

@@ -60,6 +60,11 @@ PODS:
   - SocketRocket (0.6.0)
   - SSZipArchive (2.4.3)
   - TYCyclePagerView (1.2.0)
+  - TZImagePickerController (3.8.3):
+    - TZImagePickerController/Basic (= 3.8.3)
+    - TZImagePickerController/Location (= 3.8.3)
+  - TZImagePickerController/Basic (3.8.3)
+  - TZImagePickerController/Location (3.8.3)
   - Whiteboard (2.16.39):
     - Whiteboard/Whiteboard-YYModel (= 2.16.39)
   - Whiteboard/Base (2.16.39):
@@ -111,6 +116,7 @@ DEPENDENCIES:
   - SocketRocket
   - SSZipArchive
   - TYCyclePagerView
+  - TZImagePickerController
   - Whiteboard
 
 SPEC REPOS:
@@ -138,6 +144,7 @@ SPEC REPOS:
     - SocketRocket
     - SSZipArchive
     - TYCyclePagerView
+    - TZImagePickerController
     - Whiteboard
     - YYModel
 
@@ -165,9 +172,10 @@ SPEC CHECKSUMS:
   SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
   SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
   TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344
+  TZImagePickerController: e9909edbadf7381140efc5b5c9f5bdbfd630f7d4
   Whiteboard: 4622f3866b7c35a9c757955619ba0a2b26d968f5
   YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
 
-PODFILE CHECKSUM: a520ff64fea337dfa85d00561e36446ee3feb62a
+PODFILE CHECKSUM: c99ef45436f8305193cf0d3f6f80e59afa547a5f
 
 COCOAPODS: 1.11.3

+ 9 - 1
KulexiuForTeacher/Pods/Manifest.lock

@@ -60,6 +60,11 @@ PODS:
   - SocketRocket (0.6.0)
   - SSZipArchive (2.4.3)
   - TYCyclePagerView (1.2.0)
+  - TZImagePickerController (3.8.3):
+    - TZImagePickerController/Basic (= 3.8.3)
+    - TZImagePickerController/Location (= 3.8.3)
+  - TZImagePickerController/Basic (3.8.3)
+  - TZImagePickerController/Location (3.8.3)
   - Whiteboard (2.16.39):
     - Whiteboard/Whiteboard-YYModel (= 2.16.39)
   - Whiteboard/Base (2.16.39):
@@ -111,6 +116,7 @@ DEPENDENCIES:
   - SocketRocket
   - SSZipArchive
   - TYCyclePagerView
+  - TZImagePickerController
   - Whiteboard
 
 SPEC REPOS:
@@ -138,6 +144,7 @@ SPEC REPOS:
     - SocketRocket
     - SSZipArchive
     - TYCyclePagerView
+    - TZImagePickerController
     - Whiteboard
     - YYModel
 
@@ -165,9 +172,10 @@ SPEC CHECKSUMS:
   SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
   SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
   TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344
+  TZImagePickerController: e9909edbadf7381140efc5b5c9f5bdbfd630f7d4
   Whiteboard: 4622f3866b7c35a9c757955619ba0a2b26d968f5
   YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
 
-PODFILE CHECKSUM: a520ff64fea337dfa85d00561e36446ee3feb62a
+PODFILE CHECKSUM: c99ef45436f8305193cf0d3f6f80e59afa547a5f
 
 COCOAPODS: 1.11.3

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2203 - 2117
KulexiuForTeacher/Pods/Pods.xcodeproj/project.pbxproj


+ 5 - 0
KulexiuForTeacher/Pods/Pods.xcodeproj/xcuserdata/wangzhi.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -114,6 +114,11 @@
 			<key>isShown</key>
 			<false/>
 		</dict>
+		<key>TZImagePickerController.xcscheme</key>
+		<dict>
+			<key>isShown</key>
+			<false/>
+		</dict>
 		<key>Whiteboard-Whiteboard.xcscheme</key>
 		<dict>
 			<key>isShown</key>

+ 26 - 0
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-acknowledgements.markdown

@@ -403,6 +403,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 
 
+## TZImagePickerController
+
+The MIT License (MIT)
+
+Copyright (c) 2016 Zhen Tan
+
+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:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+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.
+
+
+
 ## Whiteboard
 
 Copyright (c) 2018 leavesster <a412739861@qq.com>

+ 32 - 0
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-acknowledgements.plist

@@ -542,6 +542,38 @@ SOFTWARE.
 		</dict>
 		<dict>
 			<key>FooterText</key>
+			<string>The MIT License (MIT)
+
+Copyright (c) 2016 Zhen Tan
+
+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:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+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.
+
+</string>
+			<key>License</key>
+			<string>MIT</string>
+			<key>Title</key>
+			<string>TZImagePickerController</string>
+			<key>Type</key>
+			<string>PSGroupSpecifier</string>
+		</dict>
+		<dict>
+			<key>FooterText</key>
 			<string>Copyright (c) 2018 leavesster &lt;a412739861@qq.com&gt;
 
 Permission is hereby granted, free of charge, to any person obtaining a copy

+ 1 - 0
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Debug-input-files.xcfilelist

@@ -11,4 +11,5 @@ ${PODS_ROOT}/RongCloudIM/RongCloudIM/RCColor.plist
 ${PODS_ROOT}/RongCloudIM/RongCloudIM/RCConfig.plist
 ${PODS_ROOT}/RongCloudRTC/RongCloudRTC/MHSDK.bundle
 ${PODS_ROOT}/RongCloudRTC/RongCloudRTC/RongRTCLib.bundle
+${PODS_ROOT}/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle
 ${PODS_CONFIGURATION_BUILD_DIR}/Whiteboard/Whiteboard.bundle

+ 1 - 0
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Debug-output-files.xcfilelist

@@ -10,4 +10,5 @@ ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCColor.plist
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCConfig.plist
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MHSDK.bundle
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RongRTCLib.bundle
+${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TZImagePickerController.bundle
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Whiteboard.bundle

+ 1 - 0
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Release-input-files.xcfilelist

@@ -11,4 +11,5 @@ ${PODS_ROOT}/RongCloudIM/RongCloudIM/RCColor.plist
 ${PODS_ROOT}/RongCloudIM/RongCloudIM/RCConfig.plist
 ${PODS_ROOT}/RongCloudRTC/RongCloudRTC/MHSDK.bundle
 ${PODS_ROOT}/RongCloudRTC/RongCloudRTC/RongRTCLib.bundle
+${PODS_ROOT}/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle
 ${PODS_CONFIGURATION_BUILD_DIR}/Whiteboard/Whiteboard.bundle

+ 1 - 0
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources-Release-output-files.xcfilelist

@@ -10,4 +10,5 @@ ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCColor.plist
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCConfig.plist
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MHSDK.bundle
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RongRTCLib.bundle
+${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TZImagePickerController.bundle
 ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Whiteboard.bundle

+ 2 - 0
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher-resources.sh

@@ -109,6 +109,7 @@ if [[ "$CONFIGURATION" == "Debug" ]]; then
   install_resource "${PODS_ROOT}/RongCloudIM/RongCloudIM/RCConfig.plist"
   install_resource "${PODS_ROOT}/RongCloudRTC/RongCloudRTC/MHSDK.bundle"
   install_resource "${PODS_ROOT}/RongCloudRTC/RongCloudRTC/RongRTCLib.bundle"
+  install_resource "${PODS_ROOT}/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle"
   install_resource "${PODS_CONFIGURATION_BUILD_DIR}/Whiteboard/Whiteboard.bundle"
 fi
 if [[ "$CONFIGURATION" == "Release" ]]; then
@@ -124,6 +125,7 @@ if [[ "$CONFIGURATION" == "Release" ]]; then
   install_resource "${PODS_ROOT}/RongCloudIM/RongCloudIM/RCConfig.plist"
   install_resource "${PODS_ROOT}/RongCloudRTC/RongCloudRTC/MHSDK.bundle"
   install_resource "${PODS_ROOT}/RongCloudRTC/RongCloudRTC/RongRTCLib.bundle"
+  install_resource "${PODS_ROOT}/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle"
   install_resource "${PODS_CONFIGURATION_BUILD_DIR}/Whiteboard/Whiteboard.bundle"
 fi
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2 - 4
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher.debug.xcconfig


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2 - 4
KulexiuForTeacher/Pods/Target Support Files/Pods-KulexiuForTeacher/Pods-KulexiuForTeacher.release.xcconfig


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác