Commit 2aeebc6ecc4a382c07f826891e95a6a943289990

Authored by yanglingyu
0 parents

照片修复功能提交

Showing 149 changed files with 6312 additions and 0 deletions
.gitignore 0 → 100755
  1 +++ a/.gitignore
  1 +*~
  2 +.DS_Store
  3 +*.xcuserstate
  4 +*.xcworkspace
  5 +xcuserdata
  6 +Products/
  7 +*.lock
  8 +Pods
  9 +
... ...
CNLiveCPhotoRepairModule.podspec 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule.podspec
  1 +#
  2 +# Be sure to run `pod lib lint CNLiveCPhotoRepairModule.podspec' to ensure this is a
  3 +# valid spec before submitting.
  4 +#
  5 +# Any lines starting with a # are optional, but their use is encouraged
  6 +# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
  7 +#
  8 +
  9 +Pod::Spec.new do |s|
  10 + s.name = 'CNLiveCPhotoRepairModule'
  11 + s.version = '0.1.0'
  12 + s.summary = 'A short description of CNLiveCPhotoRepairModule.'
  13 +
  14 +# This description is used to generate tags and improve search results.
  15 +# * Think: What does it do? Why did you write it? What is the focus?
  16 +# * Try to keep it short, snappy and to the point.
  17 +# * Write the description between the DESC delimiters below.
  18 +# * Finally, don't worry about the indent, CocoaPods strips it!
  19 +
  20 + s.description = <<-DESC
  21 +TODO: Add long description of the pod here.
  22 + DESC
  23 +
  24 + s.homepage = 'https://github.com/杨苓玉/CNLiveCPhotoRepairModule'
  25 + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  26 + s.license = { :type => 'MIT', :file => 'LICENSE' }
  27 + s.author = { '杨苓玉' => 'ios_18710032165@163.com' }
  28 + s.source = { :git => 'https://github.com/杨苓玉/CNLiveCPhotoRepairModule.git', :tag => s.version.to_s }
  29 + # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
  30 +
  31 + s.ios.deployment_target = '10.0'
  32 + s.prefix_header_contents = '#import "CNLiveCPhotoRepairModule.h"'
  33 + s.source_files = 'CNLiveCPhotoRepairModule/Classes/**/*'
  34 +
  35 + s.resource_bundles = {
  36 + 'CNLiveCPhotoRepairModule' => ['CNLiveCPhotoRepairModule/Assets/*']
  37 + }
  38 +
  39 + # s.public_header_files = 'Pod/Classes/**/*.h'
  40 + # s.frameworks = 'UIKit', 'MapKit'
  41 + # s.dependency 'AFNetworking', '~> 2.3'
  42 + s.dependency 'CNLiveBaseClass'
  43 + s.dependency 'CNLiveBaseKit'
  44 + s.dependency 'CNLiveNewTripartiteManagement/YYCategories'
  45 + s.dependency 'CNLiveNewTripartiteManagement/Masonry'
  46 + s.dependency 'CNLiveBusinessBaseModule'
  47 + s.dependency 'DSBaseModule'
  48 + s.dependency 'CNLiveCommonCategory'
  49 + s.dependency 'JXCategoryView'
  50 + s.dependency 'CNLiveUploadManager'
  51 + s.dependency 'CNLivePhotoBrowser'
  52 + s.dependency 'CNLiveNewTripartiteManagement/SDWebImage'
  53 + s.dependency 'CNLiveImagePickerController'
  54 + s.dependency 'CNLiveEnvironment'
  55 + s.dependency 'CNLiveNewTripartiteManagement/QMUIKit'
  56 + s.dependency 'CNLiveBusinessBaseModule'
  57 + s.dependency 'CNLiveNewTripartiteManagement/MJExtension'
  58 + s.dependency 'CNLiveCustomControl'
  59 + s.dependency 'CNLiveBeeHive'
  60 +end
... ...
CNLiveCPhotoRepairModule/Assets/.gitkeep 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/.gitkeep
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/Contents.json
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/default _icon_bg.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/default _icon_bg.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "filename" : "default _icon_bg.png",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "version" : 1,
  19 + "author" : "xcode"
  20 + }
  21 +}
0 22 \ No newline at end of file
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/default _icon_bg.imageset/default _icon_bg.png 0 → 100644

1.13 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovNo.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovNo.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "advancing_grey@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "advancing_grey@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovNo.imageset/advancing_grey@2x.png 0 → 100644

2.3 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovNo.imageset/advancing_grey@3x.png 0 → 100644

4.01 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovYes.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovYes.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "advancing@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "advancing@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovYes.imageset/advancing@2x.png 0 → 100644

2.91 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_recovYes.imageset/advancing@3x.png 0 → 100644

5.06 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeNo.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeNo.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "close@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "close@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeNo.imageset/close@2x.png 0 → 100644

1.56 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeNo.imageset/close@3x.png 0 → 100644

2.6 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeYes.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeYes.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "close@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "close@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeYes.imageset/close@2x.png 0 → 100644

1.5 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_removeYes.imageset/close@3x.png 0 → 100644

2.66 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocNo.imageset/Back_grey@2x.png 0 → 100644

2.36 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocNo.imageset/Back_grey@3x.png 0 → 100644

4.03 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocNo.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocNo.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Back_grey@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Back_grey@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocYes.imageset/Back@2x.png 0 → 100644

2.98 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocYes.imageset/Back@3x.png 0 → 100644

5.22 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocYes.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_revocYes.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Back@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Back@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_save.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_save.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Finish@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Finish@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_save.imageset/Finish@2x.png 0 → 100644

1.33 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/draw_save.imageset/Finish@3x.png 0 → 100644

2.12 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_selected.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_selected.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "evaluate_selected@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "evaluate_selected@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_selected.imageset/evaluate_selected@2x.png 0 → 100644

1.19 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_selected.imageset/evaluate_selected@3x.png 0 → 100644

2.39 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_unselect.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_unselect.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "evaluate_unselect@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "evaluate_unselect@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_unselect.imageset/evaluate_unselect@2x.png 0 → 100644

986 Bytes

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/evaluate_unselect.imageset/evaluate_unselect@3x.png 0 → 100644

1.75 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_close.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_close.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "关闭@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "关闭@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_close.imageset/关闭@2x.png 0 → 100644

1.74 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_close.imageset/关闭@3x.png 0 → 100644

3.26 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_failed.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_failed.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "修复失败@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "修复失败@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_failed.imageset/修复失败@2x.png 0 → 100644

26.5 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_failed.imageset/修复失败@3x.png 0 → 100644

44 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalColor.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalColor.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Photo_coloring@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Photo_coloring@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalColor.imageset/Photo_coloring@2x.png 0 → 100644

25.2 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalColor.imageset/Photo_coloring@3x.png 0 → 100644

49.9 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalRepair.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalRepair.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Photo_restoration@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Photo_restoration@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalRepair.imageset/Photo_restoration@2x.png 0 → 100644

26.5 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_nomalRepair.imageset/Photo_restoration@3x.png 0 → 100644

52.2 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_rapairDrawAndColor.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_rapairDrawAndColor.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Photo_repair_color@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Photo_repair_color@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_rapairDrawAndColor.imageset/Photo_repair_color@2x.png 0 → 100644

29.8 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_rapairDrawAndColor.imageset/Photo_repair_color@3x.png 0 → 100644

60.3 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairAfter.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairAfter.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "修复后@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "修复后@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairAfter.imageset/修复后@2x.png 0 → 100644

8.19 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairAfter.imageset/修复后@3x.png 0 → 100644

17.3 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairBefore.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairBefore.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "修复前@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "修复前@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairBefore.imageset/修复前@2x.png 0 → 100644

8.54 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairBefore.imageset/修复前@3x.png 0 → 100644

20 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairDraw.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairDraw.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "Photo_repair@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "Photo_repair@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairDraw.imageset/Photo_repair@2x.png 0 → 100644

27.3 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairDraw.imageset/Photo_repair@3x.png 0 → 100644

54.7 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairing.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairing.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "照片修复中...@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "照片修复中...@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairing.imageset/照片修复中...@2x.png 0 → 100644

59 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_repairing.imageset/照片修复中...@3x.png 0 → 100644

106 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_shareTip.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_shareTip.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "形状@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "形状@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_shareTip.imageset/形状@2x.png 0 → 100644

6.58 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_shareTip.imageset/形状@3x.png 0 → 100644

9.29 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_succeed.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_succeed.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "修复完成@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "修复完成@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_succeed.imageset/修复完成@2x.png 0 → 100644

28 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_succeed.imageset/修复完成@3x.png 0 → 100644

46.3 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_tipClose.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_tipClose.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "关闭@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "关闭@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_tipClose.imageset/关闭@2x.png 0 → 100644

1.08 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldPho_tipClose.imageset/关闭@3x.png 0 → 100644

1.77 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldpho_tip.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldpho_tip.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "选一张照片修复@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "选一张照片修复@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldpho_tip.imageset/选一张照片修复@2x.png 0 → 100644

6.09 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/oldpho_tip.imageset/选一张照片修复@3x.png 0 → 100644

8.39 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/skill_service_back.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/skill_service_back.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "service_back@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "service_back@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/skill_service_back.imageset/service_back@2x.png 0 → 100644

628 Bytes

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/skill_service_back.imageset/service_back@3x.png 0 → 100644

1.15 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/wufalianjie.imageset/Contents.json 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/wufalianjie.imageset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "idiom" : "universal",
  9 + "filename" : "wufalianjie@2x.png",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "filename" : "wufalianjie@3x.png",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "version" : 1,
  20 + "author" : "xcode"
  21 + }
  22 +}
0 23 \ No newline at end of file
... ...
CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/wufalianjie.imageset/wufalianjie@2x.png 0 → 100644

51.4 KB

CNLiveCPhotoRepairModule/Assets/CNLiveCPhotoRepairAsset.xcassets/wufalianjie.imageset/wufalianjie@3x.png 0 → 100644

116 KB

CNLiveCPhotoRepairModule/Classes/.gitkeep 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/.gitkeep
... ...
CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairImage.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairImage.h
  1 +//
  2 +// CNLiveCPhotoRepairImage.h
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by iOS on 2023/1/3.
  6 +//
  7 +
  8 +#import <Foundation/Foundation.h>
  9 +
  10 +NS_ASSUME_NONNULL_BEGIN
  11 +
  12 +@interface CNLiveCPhotoRepairImage : NSObject
  13 +/// 加载图片
  14 ++ (UIImage *)getImageWithNamed:(NSString *)name;
  15 +@end
  16 +
  17 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairImage.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairImage.m
  1 +//
  2 +// CNLiveCPhotoRepairImage.m
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by iOS on 2023/1/3.
  6 +//
  7 +
  8 +#import "CNLiveCPhotoRepairImage.h"
  9 +
  10 +@implementation CNLiveCPhotoRepairImage
  11 ++ (UIImage *)getImageWithNamed:(NSString *)name{
  12 + NSBundle *bundle = [NSBundle bundleForClass:[CNLiveCPhotoRepairImage class]];
  13 + NSURL *url = [bundle URLForResource:@"CNLiveCPhotoRepairModule.bundle" withExtension:@""];
  14 + if (!url) {
  15 + return [UIImage new];
  16 + }
  17 + NSBundle *targetBundle = [NSBundle bundleWithURL:url];
  18 + return [UIImage imageNamed:name inBundle:targetBundle compatibleWithTraitCollection:NULL];
  19 +}
  20 +@end
... ...
CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairModule.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairModule.h
  1 +//
  2 +// CNLiveCPhotoRepairModule.h
  3 +// Pods
  4 +//
  5 +// Created by iOS on 2022/12/29.
  6 +//
  7 +
  8 +#ifndef CNLiveCPhotoRepairModule_h
  9 +#define CNLiveCPhotoRepairModule_h
  10 +
  11 +////////////////////////////////////////////////////////
  12 +//////////// frame
  13 +////////////////////////////////////////////////////////
  14 +#define CNScaleW(a) a*KScreenWidth/375
  15 +#define CNScaleH(a) a*SCREEN_HEIGHT/667
  16 +
  17 +//协议调取方法
  18 +#define CNMessageSend(instance,protocol,message) [(id<protocol>)(instance) message]
  19 +
  20 +#import <CNLiveBaseKit/CNLiveBaseKit.h>
  21 +#import <Masonry/Masonry.h>
  22 +#import <DSBaseModule/DSBaseModule.h>
  23 +#import <CNLiveCommonCategory/CNLiveCommonCategory.h>
  24 +#import <YYCategories/YYCategories.h>
  25 +#import <CNLivePhotoBrowser/CNLivePhotoBrowser.h>
  26 +#import <SDWebImage/SDWebImage.h>
  27 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
  28 +#import <QMUIKit/QMUIKit.h>
  29 +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h>
  30 +
  31 +#import <MJExtension/MJExtension.h>
  32 +#import <CNLiveCustomControl/CNLiveNavigationBar.h>
  33 +#import "CNLiveCPhotoRepairService.h"
  34 +#import "CNLiveCPhotoRepairImage.h"
  35 +
  36 +#endif /* CNLiveCPhotoRepairModule_h */
... ...
CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairProtocol.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairProtocol.h
  1 +//
  2 +// CNLiveCPhotoRepairProtocol.h
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by iOS on 2022/12/30.
  6 +//
  7 +
  8 +#import <Foundation/Foundation.h>
  9 +#import <CNLiveBeeHive/CNLiveBeeHive.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@protocol CNLiveCPhotoRepairProtocol <NSObject,BHServiceProtocol>
  14 +/**
  15 + *跳转照片修复页面
  16 + */
  17 +- (void)pushPhotoRepair;
  18 +/**
  19 + *跳转修复完成页面
  20 + *contentId:页面id
  21 + *oldStr:旧照片地址
  22 + *newStr:新照片地址
  23 + */
  24 +- (void)pushPhotoRepairWithContentId:(NSString *)contentId oldImage:(NSString *)oldStr newImage:(NSString *)newStr;
  25 +@end
  26 +
  27 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairService.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairService.h
  1 +//
  2 +// CNLiveCPhotoRepairService.h
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by iOS on 2022/12/30.
  6 +//
  7 +
  8 +#import <Foundation/Foundation.h>
  9 +#import "CNLiveCPhotoRepairProtocol.h"
  10 +
  11 +typedef NS_ENUM(NSUInteger, CNLivePhotoShareResultType) {
  12 + CNLivePhotoShareResultTypeStart,
  13 + CNLivePhotoShareResultTypeSucc,
  14 + CNLivePhotoShareResultTypeCanc,
  15 + CNLivePhotoShareResultTypeFail,
  16 + CNLivePhotoShareResultTypeUnKnow,
  17 +};
  18 +typedef NS_ENUM(NSUInteger, CNLivePhotoSharePlatformType) {
  19 + CNLivePhotoSharePlatformTypeAll,
  20 + CNLivePhotoSharePlatformTypeWjjFriend,
  21 + CNLivePhotoSharePlatformTypeWjjLive,
  22 + CNLivePhotoSharePlatformTypeWeChat,
  23 + CNLivePhotoSharePlatformTypeCricle,
  24 + CNLivePhotoSharePlatformTypeQQFriend,
  25 + CNLivePhotoSharePlatformTypeSina,
  26 + CNLivePhotoSharePlatformTypeSafari,
  27 +};
  28 +
  29 +@interface CNLiveCPhotoRepairService : NSObject<CNLiveCPhotoRepairProtocol>
  30 +/**
  31 + 调用分享界面进行分享操作
  32 +
  33 + @param shareTitle 分享标题
  34 + @param shareUrl 分享的链接
  35 + @param shareDesc 分享的描述
  36 + @param shareImage 图片集合,传入参数可以为单张图片信息,也可以为一个NSArray,数组元素可以为UIImage、NSString(图片路径)、NSURL(图片路径)
  37 + @param isFull 是否横屏显示分享界面
  38 + @param isHiddenWjj 是否隐藏网加加
  39 + @param platformType 分享平台调用某个单独方法(CNLiveSharePlatformTypeAll 类型为已实现界面,默认为此类型)
  40 + @param completerBlock 分享结果回调
  41 + */
  42 ++(void)showShareViewWithParamForShareTitle:(NSString *)shareTitle
  43 + ShareUrl:(NSString *)shareUrl
  44 + ShareDesc:(NSString *)shareDesc
  45 + ShareImage:(id)shareImage
  46 + ScreenFull:(BOOL)isFull
  47 + HiddenWjj:(BOOL)isHiddenWjj
  48 + HiddenQQ:(BOOL)isHiddenQQ
  49 + HiddenWB:(BOOL)isHiddenWB
  50 + HiddenLifeCircle:(BOOL)isHiddenLifeCircle
  51 + HiddenWechatCircle:(BOOL)isHiddenWechatCircle
  52 + HiddenWechat:(BOOL)isHiddenWechat
  53 + HiddenSafari:(BOOL)isHiddenSafari
  54 + FormVC:(UIViewController *)formVC
  55 + TopImage:(NSArray<NSString *> *)topImage
  56 + TopTitles:(NSArray<NSString *> *)topTitle
  57 + PlatformType:(CNLivePhotoSharePlatformType)platformType
  58 + CompleterBlock:(void(^)(CNLivePhotoShareResultType resultType,CNLivePhotoSharePlatformType platformType,NSString * typtString))completerBlock;
  59 +@end
  60 +
... ...
CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairService.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/Manager/CNLiveCPhotoRepairService.m
  1 +//
  2 +// CNLiveCPhotoRepairService.m
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by iOS on 2022/12/30.
  6 +//
  7 +
  8 +#import "CNLiveCPhotoRepairService.h"
  9 +#import <CNLiveBeeHive/BHRouter.h>
  10 +#import "CNPhotoRepairManager.h"
  11 +
  12 +static NSString *const CNLiveCPhotoRepairRouterWithMineKey = @"com.cnlive.CNLiveNetAdd://call.service.beehive/CNLiveCPhotoRepairModuleService.CNLiveCPhotoRepairModuleProtocol.";
  13 +
  14 +static NSString *const CNLiveCPhotoRepairShareKey = @"showShareViewWithParam:fromVC:";
  15 +
  16 +@BeeHiveService(CNLiveCPhotoRepairProtocol,CNLiveCPhotoRepairService);
  17 +@implementation CNLiveCPhotoRepairService
  18 +- (void)modSetUp:(BHContext *)context{
  19 + //添加主工程交互类
  20 + [[BHRouter globalRouter] addPathComponent:@"CNLiveCPhotoRepairModuleService" forClass:NSClassFromString(@"CNLiveCPhotoRepairModuleService")];
  21 + //添加组件交互类
  22 + [[BHRouter globalRouter] addPathComponent:@"CNLiveCPhotoRepairService" forClass:NSClassFromString(@"CNLiveCPhotoRepairService")];
  23 +}
  24 +#pragma mark - 家园调主工程方法
  25 +- (void)pushPhotoRepair{
  26 + [CNPhotoRepairManager jumpToRepairPhotoControler];
  27 +}
  28 +- (void)pushPhotoRepairWithContentId:(NSString *)contentId oldImage:(NSString *)oldStr newImage:(NSString *)newStr{
  29 + [CNPhotoRepairManager jumpToPhotoRepairedControlerForContentId:contentId oldImage:oldStr newImage:newStr];
  30 +}
  31 +#pragma mark - 主工程调家园模块方法
  32 ++ (void)showShareViewWithParamForShareTitle:(NSString *)shareTitle ShareUrl:(NSString *)shareUrl ShareDesc:(NSString *)shareDesc ShareImage:(id)shareImage ScreenFull:(BOOL)isFull HiddenWjj:(BOOL)isHiddenWjj HiddenQQ:(BOOL)isHiddenQQ HiddenWB:(BOOL)isHiddenWB HiddenLifeCircle:(BOOL)isHiddenLifeCircle HiddenWechatCircle:(BOOL)isHiddenWechatCircle HiddenWechat:(BOOL)isHiddenWechat HiddenSafari:(BOOL)isHiddenSafari FormVC:(UIViewController *)formVC TopImage:(NSArray<NSString *> *)topImage TopTitles:(NSArray<NSString *> *)topTitle PlatformType:(CNLivePhotoSharePlatformType)platformType CompleterBlock:(void (^)(CNLivePhotoShareResultType, CNLivePhotoSharePlatformType, NSString *))completerBlock{
  33 + NSURL *url = [NSURL URLWithString:[CNLiveCPhotoRepairRouterWithMineKey stringByAppendingString:CNLiveCPhotoRepairShareKey]];
  34 + NSDictionary *param = @{
  35 + @"shareTitle":shareTitle?shareTitle:@"",
  36 + @"shareUrl":shareUrl?shareUrl:@"",
  37 + @"shareDesc":shareDesc?shareDesc:@"",
  38 + @"shareImage":shareImage?shareImage:@"",
  39 + @"isFull":@(isFull),
  40 + @"isHiddenWjj":@(isHiddenWjj),
  41 + @"isHiddenQQ":@(isHiddenQQ),
  42 + @"isHiddenWB":@(isHiddenWB),
  43 + @"isHiddenLifeCircle":@(isHiddenLifeCircle),
  44 + @"isHiddenWechatCircle":@(isHiddenWechatCircle),
  45 + @"isHiddenWechat":@(isHiddenWechat),
  46 + @"isHiddenSafari":@(isHiddenSafari),
  47 + @"topImage":topImage?topImage:@"",
  48 + @"topTitle":topTitle?topTitle:@"",
  49 + @"platformType":@(platformType),
  50 + };
  51 + [BHRouter openURL:url withParams:@{@"CNLiveCPhotoRepairModuleService":@{
  52 + @"param":param,
  53 + @"fromVC":formVC
  54 + }}];
  55 +}
  56 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNDrawViewController.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNDrawViewController.h
  1 +//
  2 +// CNDrawViewController.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <CNLiveBaseClass/CNLiveBaseViewController.h>
  10 +#import "CNPhoPresent.h"
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +
  14 +@interface CNDrawViewController : CNLiveBaseViewController
  15 +-(instancetype)initWithImage:(UIImage *)pcImage withRepairType:(CNLiveRepairType) type;
  16 +@end
  17 +
  18 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNDrawViewController.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNDrawViewController.m
  1 +//
  2 +// CNDrawViewController.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNDrawViewController.h"
  10 +#import "CNDrawView.h"
  11 +#import "CNOperatorView.h"
  12 +#import "CNUploadManager.h"
  13 +#import "CNRepairPhotosViewController.h"
  14 +
  15 +@interface CNDrawViewController ()
  16 +{
  17 + UIImage *_pcImage;
  18 + CGFloat tempWidth,tempHeight,operatorHeight;
  19 + CNLiveRepairType _type;
  20 +}
  21 +@property (nonatomic, strong) CNDrawView *drawView;
  22 +@property (nonatomic, strong) CNOperatorView *operator;
  23 +@property (nonatomic, strong) UIImageView *imageView;
  24 +@property (nonatomic, strong) CNUploadManager *manager;
  25 +@end
  26 +
  27 +@implementation CNDrawViewController
  28 +-(instancetype)initWithImage:(UIImage *)pcImage withRepairType:(CNLiveRepairType) type
  29 +{
  30 + if (self = [super init]) {
  31 + _pcImage = pcImage;
  32 + self.title = @"智能修补";
  33 + _type = type;
  34 + }
  35 + return self;
  36 +}
  37 +
  38 +- (void)viewDidLoad {
  39 + [super viewDidLoad];
  40 + self.view.backgroundColor = kWhiteColor;
  41 + operatorHeight = CNScaleH(110);
  42 + CGFloat imgViewHeight = kScreenHeight - operatorHeight - NavigationContentTop - kVerticalBottomSafeHeight;
  43 + if (_pcImage.size.width/kScreenWidth <= _pcImage.size.height / imgViewHeight) {
  44 + tempHeight = imgViewHeight;
  45 + tempWidth = (_pcImage.size.width/ _pcImage.size.height) *tempHeight;
  46 + }else
  47 + {
  48 + tempWidth = kScreenWidth;
  49 + tempHeight = (_pcImage.size.height / _pcImage.size.width) *tempWidth;
  50 +
  51 + }
  52 + [self.view addSubview:self.imageView];
  53 + [self.view addSubview:self.drawView];
  54 + [self.view addSubview:self.operator];
  55 +
  56 + weakself
  57 + self.operator.actionBlock = ^(NSUInteger tag) {
  58 + strongself
  59 + switch (tag) {
  60 + case 0:
  61 + {
  62 + [weakSelf.drawView undo];
  63 + }
  64 + break;
  65 + case 1:
  66 + {
  67 + [weakSelf.drawView redo];
  68 + }
  69 + break;
  70 + case 2:
  71 + {
  72 + [weakSelf.drawView clear];
  73 + }
  74 + break;
  75 + case 3:
  76 + {
  77 + UIImage *drawImage = nil;
  78 + // 开启位图上下文
  79 + UIGraphicsBeginImageContextWithOptions(weakSelf.drawView.size, NO, 1);
  80 +
  81 + // 取出画板view的layer
  82 + CALayer *layer = weakSelf.drawView.layer;
  83 +
  84 + // 渲染上下文
  85 + [layer renderInContext:UIGraphicsGetCurrentContext()];
  86 +
  87 + // 从上下文中取出图片
  88 + drawImage = UIGraphicsGetImageFromCurrentImageContext();
  89 +
  90 + // 关闭上下文
  91 + UIGraphicsEndImageContext();
  92 + [weakSelf.manager uploadImageManager:self->_pcImage draw:drawImage rect:self->_pcImage.size repairType:self->_type];
  93 + weakSelf.manager.popBlock = ^{
  94 + [weakSelf.navigationController popToViewController:[weakSelf.navigationController.viewControllers objectAtIndex:weakSelf.navigationController.viewControllers.count -5] animated:YES];
  95 + };
  96 + weakSelf.manager.pushBlock = ^(NSString * _Nonnull contentId) {
  97 + strongself
  98 + CNRepairPhotosViewController *photos = [[CNRepairPhotosViewController alloc] initWithRepairType:self->_type];
  99 + photos.contentId = contentId;
  100 + [weakSelf.navigationController pushViewController:photos animated:YES];
  101 + };
  102 + }
  103 + break;
  104 +
  105 + default:
  106 + break;
  107 + }
  108 + };
  109 + self.operator.sliderBlock = ^(CGFloat width) {
  110 + weakSelf.drawView.lineWidth = width;
  111 + };
  112 +}
  113 +
  114 +
  115 +#pragma mark - Getting
  116 +-(CNUploadManager *)manager
  117 +{
  118 + if (!_manager) {
  119 + _manager = [[CNUploadManager alloc] init];
  120 + }
  121 + return _manager;
  122 +}
  123 +- (UIImageView *)imageView
  124 +{
  125 + if (!_imageView) {
  126 + _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, NavigationContentTop, tempWidth, tempHeight)];
  127 + _imageView.center = CGPointMake(kScreenWidth/2, (kScreenHeight - operatorHeight - NavigationContentTop)/2 + NavigationContentTop);
  128 + _imageView.contentMode = UIViewContentModeScaleAspectFit;
  129 + [_imageView setImage:_pcImage];
  130 + }
  131 + return _imageView;
  132 +}
  133 +- (CNOperatorView *)operator
  134 +{
  135 + if (!_operator) {
  136 + _operator = [[CNOperatorView alloc] initWithFrame:CGRectMake(0, kScreenHeight - operatorHeight - kVerticalBottomSafeHeight, kScreenWidth, operatorHeight)];
  137 + }
  138 + return _operator;
  139 +}
  140 + -(CNDrawView *)drawView
  141 +{
  142 + if (!_drawView) {
  143 + _drawView = [[CNDrawView alloc] initWithFrame:self.imageView.frame];
  144 + _drawView.delegate = self.operator;
  145 + }
  146 + return _drawView;
  147 +}
  148 +/*
  149 +#pragma mark - Navigation
  150 +
  151 +// In a storyboard-based application, you will often want to do a little preparation before navigation
  152 +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  153 + // Get the new view controller using [segue destinationViewController].
  154 + // Pass the selected object to the new view controller.
  155 +}
  156 +*/
  157 +
  158 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNOldPhotoVideoViewController.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNOldPhotoVideoViewController.h
  1 +//
  2 +// CNOldPhotoVideoViewController.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/8.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <CNLiveBaseClass/CNLiveBaseViewController.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNOldPhotoVideoViewController : CNLiveBaseViewController
  14 +
  15 +@end
  16 +
  17 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNOldPhotoVideoViewController.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNOldPhotoVideoViewController.m
  1 +//
  2 +// CNOldPhotoVideoViewController.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/8.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNOldPhotoVideoViewController.h"
  10 +#import "CNPhoRepairViewController.h"
  11 +#import "CNPhoPresent.h"
  12 +#import "CNRepairCagegoryCell.h"
  13 +#import "CNRepairCategoryHeaderView.h"
  14 +
  15 +static NSString *cellIdentifer = @"cellIdentifer";
  16 +static NSString *headerIdentifer = @"headerIdentifer";
  17 +
  18 +@interface CNOldPhotoVideoViewController ()<UITableViewDelegate,UITableViewDataSource>
  19 +{
  20 + NSArray<CNRepairCategoryModel *> * _dataList;
  21 +}
  22 +@property (nonatomic, strong)CNPhoPresent *present;
  23 +@property (nonatomic, strong)UITableView *tableView;
  24 +@end
  25 +
  26 +@implementation CNOldPhotoVideoViewController
  27 +-(void)dealloc
  28 +{
  29 + NSLog(@"%@销毁了",[self class]);
  30 +}
  31 +
  32 +- (void)viewDidLoad {
  33 + [super viewDidLoad];
  34 + self.view.backgroundColor = kWhiteColor;
  35 + self.title = @"照片修复";
  36 + [self.view addSubview:self.tableView];
  37 + [self.present responseList:^(NSArray<CNRepairCategoryModel *> * _Nonnull dataList) {
  38 + self->_dataList = dataList;
  39 + [self.tableView reloadData];
  40 + }];
  41 + // Do any additional setup after loading the view.
  42 +}
  43 +-(void)viewWillAppear:(BOOL)animated
  44 +{
  45 + [super viewWillAppear:animated];
  46 +
  47 +}
  48 +-(void)viewDidDisappear:(BOOL)animated
  49 +{
  50 + [super viewDidDisappear:animated];
  51 +}
  52 +
  53 +-(void)viewDidLayoutSubviews
  54 +{
  55 + [super viewDidLayoutSubviews];
  56 + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  57 + make.top.equalTo(self.view).offset(kNavigationBarHeight);
  58 + make.left.right.equalTo(self.view);
  59 + make.bottom.equalTo(self.mas_bottomLayoutGuide);
  60 + }];
  61 +}
  62 +#pragma mark - UITableViewDelegate
  63 +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  64 + return 92*RATIO;
  65 +}
  66 +
  67 +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  68 + return 39*RATIO;
  69 +}
  70 +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
  71 +{
  72 + return 0;
  73 +}
  74 +- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  75 +{
  76 + CNRepairCategoryHeaderView *view = [tableView dequeueReusableHeaderFooterViewWithIdentifier:headerIdentifer];
  77 + if (!view) {
  78 + view = [[CNRepairCategoryHeaderView alloc] initWithReuseIdentifier:headerIdentifer];
  79 + }
  80 + CNRepairCategoryModel *model = _dataList[section];
  81 + view.titleStr = model.title;
  82 + return view;
  83 +}
  84 +
  85 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  86 + CNLiveRepairType type = 0;
  87 + switch (indexPath.section) {
  88 + case 0:
  89 + {
  90 + if (indexPath.row == 0) {
  91 + type = 0;
  92 + }else{
  93 + type = 1;
  94 + }
  95 + }
  96 + break;
  97 + case 1:
  98 + {
  99 + if (indexPath.row == 0) {
  100 + type = 2;
  101 + }else{
  102 + type = 3;
  103 + }
  104 + }
  105 + break;
  106 +
  107 + default:
  108 + break;
  109 + }
  110 +
  111 + CNPhoRepairViewController *repair = [[CNPhoRepairViewController alloc] initWithRepairType:type];
  112 + [[BaseAppDelegate sharedAppDelegate] pushViewController:repair];
  113 +}
  114 +#pragma mark - UITableViewDataSource
  115 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  116 + CNRepairCategoryModel *model = _dataList[section];
  117 + return model.list.count;
  118 +}
  119 +
  120 +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  121 + CNRepairCagegoryCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
  122 + if (!cell) {
  123 + cell = [[CNRepairCagegoryCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifer];
  124 + }
  125 + CNRepairCategoryModel *model = _dataList[indexPath.section];
  126 + CNPhoRepairModel *dataModel = model.list[indexPath.row];
  127 + cell.model = dataModel;
  128 + return cell;
  129 +}
  130 +
  131 +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  132 +{
  133 + return _dataList.count;
  134 +}
  135 +
  136 +#pragma mark - Getting
  137 +-(CNPhoPresent *)present
  138 +{
  139 + if (!_present) {
  140 + _present = [[CNPhoPresent alloc] init];
  141 + }
  142 + return _present;
  143 +}
  144 +
  145 +- (UITableView *)tableView
  146 +{
  147 + if (!_tableView) {
  148 + _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  149 + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  150 + _tableView.backgroundColor = RGB(244, 244, 244);
  151 + _tableView.delegate = self;
  152 + _tableView.dataSource = self;
  153 + }
  154 + return _tableView;
  155 +}
  156 +
  157 +/*
  158 +#pragma mark - Navigation
  159 +
  160 +// In a storyboard-based application, you will often want to do a little preparation before navigation
  161 +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  162 + // Get the new view controller using [segue destinationViewController].
  163 + // Pass the selected object to the new view controller.
  164 +}
  165 +*/
  166 +
  167 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNPhoRepairViewController.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNPhoRepairViewController.h
  1 +//
  2 +// CNPhoRepairViewController.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <CNLiveBaseClass/CNLiveBaseViewController.h>
  10 +#import "CNPhoPresent.h"
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNPhoRepairViewController : CNLiveBaseViewController
  14 +-(instancetype)initWithRepairType:(CNLiveRepairType)type;
  15 +@end
  16 +
  17 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNPhoRepairViewController.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNPhoRepairViewController.m
  1 +//
  2 +// CNPhoRepairViewController.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNPhoRepairViewController.h"
  10 +#import <AssetsLibrary/AssetsLibrary.h>
  11 +#import "CNTailorViewController.h"
  12 +//#import <TZImagePickerController/TZImagePickerController.h>
  13 +#import "CNAuthorizeView.h"
  14 +#import "CNLiveNavigationBar.h"
  15 +#import <CNLiveImagePickerController/CNImagePickerManager.h>
  16 +
  17 +@interface CNPhoRepairViewController ()<UINavigationControllerDelegate,UIImagePickerControllerDelegate,CNTZImagePickerControllerDelegate>
  18 +{
  19 + CNLiveRepairType _type;
  20 +}
  21 +@property (nonatomic, strong)UIImagePickerController *pickerVC;
  22 +@property (nonatomic, strong)UIScrollView *backView;
  23 +@property (nonatomic, strong)UIImageView *phoImageView;
  24 +@property (nonatomic, strong)UIImageView *beforeImage;
  25 +@property (nonatomic, strong)UIImageView *afterImage;
  26 +@property (nonatomic, strong)UILabel *titleLabel;
  27 +@property (nonatomic, strong)UILabel *messageLabel;
  28 +@property (nonatomic, strong)NSArray *chooseTypes;
  29 +@property (nonatomic, strong)UIButton *tipBtnLabel;
  30 +@end
  31 +
  32 +@implementation CNPhoRepairViewController
  33 +
  34 +-(instancetype)initWithRepairType:(CNLiveRepairType)type
  35 +{
  36 + self = [super init];
  37 + if (self) {
  38 + _type = type;
  39 + switch (type) {
  40 + case CNLiveRepairTypeNormal:
  41 + self.title = @"照片修复";
  42 + break;
  43 + case CNLiveRepairTypeAddColor:
  44 + self.title = @"照片上色";
  45 + break;
  46 + case CNLiveRepairTypeDraw:
  47 + self.title = @"照片修补";
  48 + break;
  49 + case CNLiveRepairTypeDrawAddColor:
  50 + self.title = @"照片修补及上色";
  51 + break;
  52 +
  53 + default:
  54 + break;
  55 + }
  56 + }
  57 + return self;
  58 +}
  59 +
  60 +- (void)viewDidLoad {
  61 + [super viewDidLoad];
  62 + self.view.backgroundColor = [UIColor whiteColor];
  63 + [self.view addSubview:self.navigationBar];
  64 + [self.view addSubview:self.backView];
  65 + [self.backView addSubview:self.phoImageView];
  66 + [self.backView addSubview:self.titleLabel];
  67 + [self.backView addSubview:self.messageLabel];
  68 + [self.phoImageView addSubview:self.beforeImage];
  69 + [self.phoImageView addSubview:self.afterImage];
  70 + self.chooseTypes = @[@"拍一张",@"选择照片"];
  71 +
  72 + [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
  73 + make.left.right.equalTo(self.view);
  74 + make.top.offset(NavigationContentTop);
  75 + make.bottom.equalTo(self.mas_bottomLayoutGuide);
  76 + }];
  77 + [self.phoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  78 + make.left.top.equalTo(self.backView).offset(CNScaleW(15));
  79 + make.width.height.offset(kScreenWidth - CNScaleW(15)*2);
  80 + }];
  81 + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  82 + make.left.right.equalTo(self.phoImageView);
  83 + make.top.equalTo(self.phoImageView.mas_bottom).offset(CNScaleH(15));
  84 + make.height.offset(21*RATIO);
  85 + }];
  86 +
  87 + [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  88 + make.left.right.equalTo(self.titleLabel);
  89 + make.top.equalTo(self.titleLabel.mas_bottom).offset(CNScaleH(5));
  90 + }];
  91 + [self.beforeImage mas_makeConstraints:^(MASConstraintMaker *make) {
  92 + make.top.left.equalTo(self.phoImageView);
  93 + make.width.offset(65);
  94 + make.height.offset(30);
  95 + }];
  96 + [self.afterImage mas_makeConstraints:^(MASConstraintMaker *make) {
  97 + make.top.right.equalTo(self.phoImageView);
  98 + make.width.width.equalTo(self.beforeImage);
  99 + }];
  100 + // Do any additional setup after loading the view.
  101 +}
  102 +
  103 +#pragma mark - Action
  104 +-(void)removeTipBtnLabel{
  105 + [self.tipBtnLabel removeFromSuperview];
  106 + self.tipBtnLabel = nil;
  107 +}
  108 +-(void)chooseBtnClick:(UIButton *)sender
  109 +{
  110 + //流程大致介绍:第一步判断是否授权,否则弹出app授权说明,确定授权之后相机判断是否走过授权流程,是则弹窗,否走系统授权方法
  111 + switch (sender.tag-1001) {
  112 + case 0:
  113 + {
  114 + AVAuthorizationStatus videoAuthStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
  115 + if (videoAuthStatus == PHAuthorizationStatusAuthorized) {
  116 + [self ShowphotoTake];
  117 +
  118 + }else{
  119 + weakself
  120 + [CNAuthorizeView setUpAuthorizeViewForTitle:@"网家家需获取以下权限" secondTitle:@"相机、麦克风" mesOne:@"用于拍摄、扫码、语音通话时收集声音和画面。" mesTwo:@"可前往手机自带设置——应用管理——权限管理开启和关闭。" sureTitle:@"开启权限" sureBlock:^{
  121 + //判断是否走过授权流程
  122 + if ([weakSelf checkAuthStatus]) {
  123 + [weakSelf ShowphotoTake];
  124 + }
  125 +
  126 + }];
  127 + }
  128 + }
  129 + break;
  130 + case 1:
  131 + {
  132 + PHAuthorizationStatus authStatus = [PHPhotoLibrary authorizationStatus];
  133 + if (authStatus == PHAuthorizationStatusAuthorized) {
  134 + [self pushTZImagePickerController];
  135 +
  136 + }else{
  137 + weakself
  138 + [CNAuthorizeView setUpAuthorizeViewForTitle:@"网家家需获取以下权限" secondTitle:@"相册(读写手机存储)" mesOne:@"· 用于照片修复、图片发送时能选择手机相册里的照片。" mesTwo:@"可前往手机自带设置——应用管理——权限管理开启和关闭。" sureTitle:@"开启权限" sureBlock:^{
  139 + [weakSelf pushTZImagePickerController];
  140 + }];
  141 + }
  142 + }
  143 + break;
  144 +
  145 + default:
  146 + break;
  147 + }
  148 +}
  149 +-(void)ShowphotoTake
  150 +{
  151 + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
  152 + {
  153 + UIImagePickerController *pickerVC = [[UIImagePickerController alloc] init];
  154 + pickerVC.delegate = self;
  155 + pickerVC.sourceType = UIImagePickerControllerSourceTypeCamera;
  156 + //设置拍照后的图片可被编辑
  157 + pickerVC.allowsEditing = YES;
  158 + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
  159 + if(!granted) //如果不允许
  160 + {
  161 + dispatch_async(dispatch_get_main_queue(), ^{
  162 + [[UIApplication sharedApplication].keyWindow.rootViewController.presentedViewController dismissViewControllerAnimated:YES completion:nil];
  163 + });
  164 +
  165 + }
  166 + }];
  167 +
  168 + [self presentViewController:pickerVC animated:YES completion:nil];
  169 +
  170 + }
  171 +}
  172 +/// 检测已经询问过是否开通权限部分
  173 +- (Boolean)checkAuthStatus {
  174 +
  175 + Boolean checkAuth = YES;
  176 + // 请求相机权限
  177 + AVAuthorizationStatus videoAuthStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
  178 + if (videoAuthStatus == AVAuthorizationStatusDenied)
  179 + {
  180 + checkAuth = NO;
  181 + [self messageVC];
  182 + return checkAuth;
  183 +
  184 + }
  185 +
  186 + return checkAuth;
  187 +}
  188 +
  189 +/// 询问过后本地提示内容
  190 +- (void)messageVC {
  191 + NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
  192 +
  193 + NSString *appName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
  194 + if (appName == nil)
  195 + {
  196 + appName = @"APP";
  197 + }
  198 + NSString *message = [NSString stringWithFormat:@"请在iPhone的“设置-隐私“选项中,允许%@访问你的相机和麦克风。", appName];//[NSString stringWithFormat:@"请在iPhone的““设置-隐私””选项中, 允许%@访问你的麦克风?", appName];
  199 +
  200 + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert];
  201 +
  202 + UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:NULL];
  203 +
  204 + [alertController addAction:okAction];
  205 +
  206 + [self presentViewController:alertController animated:YES completion:nil];
  207 +}
  208 +//调取相册流程方法
  209 +- (void)pushTZImagePickerController {
  210 + CNImagePickerController *imagePickerVc = [[CNImagePickerController alloc] initWithMaxImagesCount:1 delegate:self];
  211 + imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
  212 + imagePickerVc.allowTakePicture = NO; // 在内部显示拍照按钮
  213 + imagePickerVc.allowPickingOriginalPhoto = NO;
  214 + imagePickerVc.allowPickingVideo = NO;
  215 + imagePickerVc.showSelectBtn = YES;
  216 + imagePickerVc.navigationBar.tintColor = kBlackColor;
  217 + imagePickerVc.photoPickerPageDidLayoutSubviewsBlock = ^(UICollectionView *collectionView, UIView *bottomToolBar, UIButton *previewButton, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel, UIView *divideLine) {
  218 + doneButton.width = 60;
  219 + doneButton.titleLabel.textAlignment = NSTextAlignmentRight;
  220 + doneButton.right =kScreenWidth - previewButton.left;
  221 + };
  222 + imagePickerVc.photoPreviewPageDidLayoutSubviewsBlock = ^(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel) {
  223 + naviBar.backgroundColor = kWhiteColor;
  224 + [backButton setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"skill_service_back"] forState:UIControlStateNormal];
  225 + UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
  226 + titleLabel.text = @"预览";
  227 + titleLabel.textColor = kBlackColor;
  228 + titleLabel.textAlignment = NSTextAlignmentCenter;
  229 + titleLabel.centerX =KScreenWidth/2;
  230 + titleLabel.centerY = backButton.centerY;
  231 + [naviBar addSubview:titleLabel];
  232 + doneButton.width = 60;
  233 + doneButton.right =kScreenWidth - 5;
  234 + };
  235 + weakself
  236 + [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
  237 + UIImage *image = photos.firstObject;
  238 + NSData *photoData = UIImageJPEGRepresentation(image,1);
  239 + float length = [photoData length]/1000/1000;
  240 + if (length>50 ) {
  241 + [QMUITips showWithText:@"照片容量不能大于50M,请重选" inView:self.view];
  242 + return;
  243 + }else if (image.size.width/image.size.height >10 || image.size.height/image.size.width >10){
  244 + [QMUITips showWithText:@"暂不支持长图修复" inView:self.view];
  245 + return;
  246 + }
  247 + CNTailorViewController *tailor = [[CNTailorViewController alloc] initWithImage:image withRepairType:self->_type];
  248 + [weakSelf.navigationController pushViewController:tailor animated:YES];
  249 +
  250 + }];
  251 + [self presentViewController:imagePickerVc animated:YES completion:nil];
  252 +}
  253 +
  254 +#pragma mark - UIImagePickerControllerDelegate
  255 +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey, id> *)info{
  256 + //获取图片
  257 + UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
  258 + [picker dismissViewControllerAnimated:YES completion:nil];
  259 + CNTailorViewController *tailor = [[CNTailorViewController alloc] initWithImage:image withRepairType:_type];
  260 + [self.navigationController pushViewController:tailor animated:YES];
  261 +}
  262 +
  263 +#pragma mark - Getting&&Setting
  264 +-(UIScrollView *)backView
  265 +{
  266 + if (!_backView) {
  267 + _backView = [[UIScrollView alloc] init];
  268 + }
  269 + return _backView;
  270 +}
  271 +-(UIImageView *)phoImageView
  272 +{
  273 + if (!_phoImageView) {
  274 + _phoImageView = [[UIImageView alloc] init];
  275 + [_phoImageView sd_setImageWithURL:[NSURL URLWithString:@"https://wjj.ys1.cnliveimg.com/download/ac/img/photo_restoration_image.png"] placeholderImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"default _icon_bg"]];
  276 + _phoImageView.contentMode = UIViewContentModeScaleAspectFit;
  277 + }
  278 + return _phoImageView;
  279 +}
  280 +
  281 +- (UIImageView *)beforeImage
  282 +{
  283 + if (!_beforeImage) {
  284 + _beforeImage = [[UIImageView alloc] init];
  285 + [_beforeImage setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"oldPho_repairBefore"]];
  286 + _beforeImage.contentMode = UIViewContentModeScaleAspectFit;
  287 + }
  288 + return _beforeImage;
  289 +}
  290 +- (UIImageView *)afterImage
  291 +{
  292 + if (!_afterImage) {
  293 + _afterImage = [[UIImageView alloc] init];
  294 + [_afterImage setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"oldPho_repairAfter"]];
  295 + _afterImage.contentMode = UIViewContentModeScaleAspectFit;
  296 + }
  297 + return _afterImage;
  298 +}
  299 +-(UILabel *)titleLabel
  300 +{
  301 + if (!_titleLabel) {
  302 + _titleLabel = [[UILabel alloc] init];
  303 + _titleLabel.textColor = RGB(51, 51, 51);
  304 + _titleLabel.textAlignment = NSTextAlignmentLeft;
  305 + _titleLabel.font = UIFontCNMake(15);
  306 + _titleLabel.text = @"修复范围:";
  307 + }
  308 + return _titleLabel;
  309 +}
  310 +-(UILabel *)messageLabel
  311 +{
  312 + if (!_messageLabel) {
  313 + _messageLabel = [[UILabel alloc] init];
  314 + _messageLabel.numberOfLines = 0;
  315 + _messageLabel.textColor = RGB(153, 153, 153);
  316 + _messageLabel.textAlignment = NSTextAlignmentLeft;
  317 + _messageLabel.font = UIFontCNMake(15);
  318 + _messageLabel.text = @"支持修复照片中的残缺、污点;能增加照片清晰度,增强纹理;减少照片中的噪点,提升画质";
  319 + }
  320 + return _messageLabel;
  321 +}
  322 +-(UIButton *)tipBtnLabel
  323 +{
  324 + if (!_tipBtnLabel) {
  325 + _tipBtnLabel = [UIButton buttonWithType:UIButtonTypeCustom];
  326 + _tipBtnLabel.frame = CGRectMake(0, 0, 151, 64.5);
  327 + [_tipBtnLabel setTitle:@"选一张照片修复" forState:UIControlStateNormal];
  328 + [_tipBtnLabel setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
  329 + _tipBtnLabel.titleLabel.font = UIFontMake(15);
  330 + [_tipBtnLabel setBackgroundImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"oldpho_tip"] forState:UIControlStateNormal];
  331 + _tipBtnLabel.centerX = kScreenWidth *3/4;
  332 + [self performSelector:@selector(removeTipBtnLabel) afterDelay:3];
  333 + }
  334 + return _tipBtnLabel;
  335 +}
  336 +-(void)setChooseTypes:(NSArray *)chooseTypes
  337 +{
  338 + CGFloat btnTop = CNScaleH(560.5);
  339 + CGFloat btnHeight = 35;
  340 + if (btnTop + btnHeight < kScreenHeight - NavigationContentTop) {
  341 + btnTop = kScreenHeight - NavigationContentTop - btnHeight -10 - kVerticalBottomSafeHeight;
  342 + }
  343 + for (int i = 0 ;i<chooseTypes.count;i++) {
  344 + UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  345 + btn.frame = CGRectMake(0, btnTop, CNScaleW(165), btnHeight);
  346 + [btn setTitle:chooseTypes[i] forState:UIControlStateNormal];
  347 + [btn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  348 + btn.titleLabel.font = UIFontCNMake(16);
  349 + if (i == 0) {
  350 + btn.backgroundColor = RGB(254, 160, 25);
  351 + }else{
  352 + btn.backgroundColor = RGB(252, 128, 90);
  353 + }
  354 + btn.tag = 1001 + i;
  355 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, CNScaleW(165), btnHeight) cornerRadius:25];
  356 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  357 + maskLayer.path = path.CGPath;
  358 + btn.layer.mask = maskLayer;
  359 + [btn addTarget:self action:@selector(chooseBtnClick:) forControlEvents:UIControlEventTouchUpInside];
  360 + btn.centerX = SCREEN_WIDTH * (2 * i + 1)/4;
  361 + [_backView addSubview:btn];
  362 + }
  363 + [_backView addSubview:self.tipBtnLabel];
  364 + _tipBtnLabel.bottom = btnTop;
  365 + _backView.contentSize = CGSizeMake(SCREEN_WIDTH, btnTop + btnHeight+5);
  366 +}
  367 +
  368 +
  369 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNRepairPhotosViewController.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNRepairPhotosViewController.h
  1 +//
  2 +// CNRepairPhotosViewController.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/14.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNCommonViewController.h"
  10 +#import "CNPhoPresent.h"
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +
  14 +@interface CNRepairPhotosViewController : CNCommonViewController
  15 +@property (nonatomic, strong) NSString *contentId;//页面id
  16 +@property (nonatomic) BOOL isNotFromTailor; //不是从修图流程进入的
  17 +
  18 +-(instancetype)initWithRepairType:(CNLiveRepairType)type;
  19 +@end
  20 +
  21 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNRepairPhotosViewController.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNRepairPhotosViewController.m
  1 +//
  2 +// CNRepairPhotosViewController.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/14.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNRepairPhotosViewController.h"
  10 +#import "JXCategoryTitleView.h"
  11 +#import "JXCategoryIndicatorLineView.h"
  12 +#import "CNLiveNavigationBar.h"
  13 +#import "CNOldPhotoVideoViewController.h"
  14 +#import "CNPhoRepairModel.h"
  15 +
  16 +@interface CNRepairPhotosViewController ()<UIScrollViewDelegate,JXCategoryViewDelegate,CNPhotoResponseDelegate>
  17 +{
  18 + BOOL _isSavePhoto;
  19 + UIImage *_saveimage;
  20 + BOOL done;
  21 + CNPhoRepairsListModel *dataModel;
  22 + CNLiveRepairType _type;
  23 +}
  24 +@property (nonatomic, strong)CNLiveNavigationBar *navigationBar;
  25 +@property (nonatomic, strong) JXCategoryTitleView *titleCategoryView;
  26 +@property (nonatomic, strong) UIScrollView *scrollView;
  27 +@property (nonatomic, strong) NSArray *titles;
  28 +@property (nonatomic, strong) UIButton *saveBtn;
  29 +@property (nonatomic, strong) UIButton *sharebtn;
  30 +@property (nonatomic, strong)UIButton *tipBtnLabel;
  31 +@property (nonatomic, strong)CNPhoPresent *present;
  32 +@end
  33 +
  34 +@implementation CNRepairPhotosViewController
  35 +static const CGFloat height = 44;
  36 +-(instancetype)initWithRepairType:(CNLiveRepairType)type
  37 +{
  38 + self = [super init];
  39 + if (self) {
  40 + _type = type;
  41 + }
  42 + return self;
  43 +}
  44 +- (void)viewDidLoad {
  45 + [super viewDidLoad];
  46 + [self.present requestRepairedPhotos:_contentId];
  47 + self.view.backgroundColor = kWhiteColor;
  48 + [self.view addSubview:self.navigationBar];
  49 + [self.view addSubview:self.titleCategoryView];
  50 + [self.view addSubview:self.scrollView];
  51 + [self.view addSubview:self.saveBtn];
  52 + [self.view addSubview:self.sharebtn];
  53 + [self.view addSubview:self.tipBtnLabel];
  54 +}
  55 +
  56 +-(void)viewWillAppear:(BOOL)animated
  57 +{
  58 + [super viewWillAppear:animated];
  59 + self.navigationController.navigationBarHidden = YES;
  60 +}
  61 +- (BOOL)prefersStatusBarHidden {
  62 + return self.statusHidenPhotoBrowser;
  63 +}
  64 +#pragma mark - CNPhotoResponseDelegate
  65 +-(void)requestSucceed:(CNPhoRepairsListModel *)model
  66 +{
  67 + [self hideEmptyView];
  68 + dataModel = model;
  69 + if (!dataModel.slimPicture || [dataModel.slimPicture isEqualToString:@""]) {
  70 + dataModel.slimPicture = model.repairedPicture;
  71 + }
  72 + for (UIImageView *view in self.scrollView.subviews) {
  73 + if (view.tag-1001==0) {
  74 + [self addImageView:view image:dataModel.oldPicture];
  75 + }
  76 + if (view.tag-1001==1) {
  77 + [self addImageView:view image:dataModel.slimPicture];
  78 + }
  79 + }
  80 + if (dataModel.repairedPicture&&[[NSUserDefaults standardUserDefaults] objectForKey:dataModel.repairedPicture]) {
  81 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:dataModel.repairedPicture];
  82 + self -> _saveimage = [UIImage imageWithData:data];
  83 + }else if (dataModel.repairedPicture){
  84 + weakself
  85 + [self.present downLoadImage:dataModel.repairedPicture response:^(NSData * _Nonnull data) {
  86 + strongself
  87 + if (self) {
  88 + self -> _saveimage = [UIImage imageWithData:data];
  89 + self-> done = YES;
  90 + }
  91 +
  92 + }];
  93 + }else
  94 + {
  95 + done = YES;
  96 + }
  97 +}
  98 +-(void)addImageView:(UIImageView *)view image:(NSString *)imageUrl
  99 +{
  100 + weakself
  101 + [view sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"default _icon_bg"] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
  102 + if (error) {
  103 + if (view.emptyView) {
  104 + return;
  105 + }
  106 + [view displayEmptyView:[CNLiveCPhotoRepairImage getImageWithNamed:@"wufalianjie"] remind:@"照片加载失败,刷新试试" hint:nil disposeBtnTitle:@" 重试 " inset:UIEdgeInsetsMake(0, 0, 0, 0) tapDisposeBtnCallBack:^{
  107 + [weakSelf addImageView:view image:imageUrl];
  108 + }];
  109 + }else{
  110 + [view removeEmptyView];
  111 + }
  112 + }];
  113 +}
  114 +
  115 +-(void)requstFailed
  116 +{
  117 + [self showEmptyViewWithImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"wufalianjie"] text:@"数据加载失败" detailText:@"别紧张,试试看刷新页面~" buttonTitle:@" 重试 " buttonAction:@selector(loadData)];
  118 + [self setCNNoNetworkingEmptyView];
  119 + self.emptyView.frame = CGRectMake(0, NavigationContentTop, kScreenWidth, kScreenHeight -NavigationContentTop );
  120 +}
  121 +-(void)loadData{
  122 + [self.present requestRepairedPhotos:_contentId];
  123 +}
  124 +#pragma mark - Action
  125 +-(void)removeTipBtnLabel{
  126 + [self.tipBtnLabel removeFromSuperview];
  127 + self.tipBtnLabel = nil;
  128 +}
  129 +-(void)saveBtnClick
  130 +{
  131 + [QMUITips showLoading:@"保存中" inView:self.view];
  132 + do{
  133 + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]];
  134 +
  135 + }while (!done&&!_saveimage);
  136 + weakself
  137 + [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
  138 + strongself
  139 + [PHAssetChangeRequest creationRequestForAssetFromImage:self->_saveimage];
  140 + } completionHandler:^(BOOL success, NSError * _Nullable error) {
  141 + dispatch_async(dispatch_get_main_queue(), ^{
  142 + strongself
  143 + [QMUITips hideAllTips];
  144 + if (success) {
  145 + self->_isSavePhoto = YES;
  146 + [QMUITips showSucceed:@"保存成功" inView:self.view];
  147 + }else
  148 + {
  149 + if (error.code == 2047) {
  150 + NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
  151 +
  152 + NSString *appName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
  153 + if (appName == nil)
  154 + {
  155 + appName = @"APP";
  156 + }
  157 + NSString *message = [NSString stringWithFormat:@"请在iPhone的“设置-隐私“选项中,允许%@访问相册。", appName];
  158 +
  159 + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert];
  160 +
  161 + UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:NULL];
  162 +
  163 + [alertController addAction:okAction];
  164 +
  165 + [self presentViewController:alertController animated:YES completion:nil];
  166 + }else{
  167 + [QMUITips showError:@"保存失败" inView:self.view];
  168 + }
  169 + }
  170 + });
  171 +
  172 + }];
  173 +}
  174 +
  175 +-(void)shareBtnClick
  176 +{
  177 + NSString *urlStr = [NSString stringWithFormat:@"%@%@?contentId=%@",WjjH5_Host,@"/cnPhotoRestoration.html",_contentId];
  178 + [CNLiveCPhotoRepairService showShareViewWithParamForShareTitle:@"我修复了一张照片" ShareUrl:urlStr ShareDesc:@"我在网家家修复了一张照片,快来看看我修的怎么样?" ShareImage:dataModel.slimPicture ScreenFull:NO HiddenWjj:NO HiddenQQ:NO HiddenWB:NO HiddenLifeCircle:NO HiddenWechatCircle:NO HiddenWechat:NO HiddenSafari:NO FormVC:self TopImage:NULL TopTitles:NULL PlatformType:CNLivePhotoSharePlatformTypeAll CompleterBlock:^(CNLivePhotoShareResultType resultType, CNLivePhotoSharePlatformType platformType, NSString *typtString) {
  179 + if (resultType == CNLivePhotoShareResultTypeSucc) {
  180 + [QMUITips showSucceed:@"分享成功" inView:self.view];
  181 + }
  182 + }];
  183 +}
  184 +#pragma mark - Getting
  185 +- (JXCategoryTitleView *)titleCategoryView{
  186 + if (!_titleCategoryView) {
  187 + _titleCategoryView = [[JXCategoryTitleView alloc]initWithFrame:CGRectMake(0, NavigationContentTop, SCREEN_WIDTH, height *RATIO)];
  188 + _titleCategoryView.backgroundColor = [UIColor whiteColor];
  189 + _titleCategoryView.titles = self.titles;
  190 + _titleCategoryView.titleFont = UIFontCNMake(16);
  191 + _titleCategoryView.collectionView.frame = CGRectMake(12, 0, SCREEN_WIDTH , 44);
  192 + _titleCategoryView.collectionView.scrollEnabled = NO;
  193 + _titleCategoryView.delegate = self;
  194 + _titleCategoryView.defaultSelectedIndex = 1;
  195 + _titleCategoryView.titleColor = RGB(153, 153, 153);
  196 + _titleCategoryView.titleSelectedColor = RGB(74, 74, 74);
  197 + _titleCategoryView.titleFont = [UIFont systemFontOfSize:16];
  198 + _titleCategoryView.titleLabelZoomScale = 1.0;
  199 + _titleCategoryView.titleLabelZoomEnabled = YES;
  200 + _titleCategoryView.titleColorGradientEnabled = YES;
  201 +
  202 + JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
  203 + lineView.indicatorColor = RGB(252, 21, 65);
  204 + lineView.indicatorWidth = 20;
  205 + _titleCategoryView.indicators = @[lineView];
  206 + _titleCategoryView.contentScrollView = self.scrollView;
  207 +
  208 + UIView *line = [[UIView alloc] initWithFrame:CGRectMake(KScreenWidth/2-0.2, 14.5*RATIO, 0.5, 13*RATIO)];
  209 + line.backgroundColor = RGB(230, 230, 230);
  210 + [_titleCategoryView addSubview:line];
  211 +
  212 + }
  213 + return _titleCategoryView;
  214 +}
  215 +
  216 +- (UIScrollView *)scrollView {
  217 + if (!_scrollView) {
  218 + CGFloat scrollW = SCREEN_WIDTH;
  219 + CGFloat scrollH = SCREEN_HEIGHT - NavigationContentTop - height - CNScaleH(114) - kVerticalBottomSafeHeight;
  220 + _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, NavigationContentTop + height, scrollW, scrollH)];
  221 + _scrollView.contentSize = CGSizeMake(scrollW * self.titles.count, scrollH);
  222 + _scrollView.pagingEnabled = YES;
  223 + _scrollView.bounces = NO;
  224 + _scrollView.delegate = self;
  225 + _scrollView.showsHorizontalScrollIndicator = NO;
  226 + _scrollView.scrollEnabled = YES;
  227 + _scrollView.backgroundColor = [UIColor whiteColor];
  228 +
  229 + for(int i = 0; i < self.titles.count; i++){
  230 + UIImageView *imageView = [[UIImageView alloc]init];
  231 + imageView.contentMode = UIViewContentModeScaleAspectFit;
  232 + imageView.frame = CGRectMake(i*scrollW +CNScaleW(15), CNScaleH(15), scrollW-CNScaleW(30), scrollH-CNScaleH(15));
  233 + imageView.tag = 1001+ i;
  234 + imageView.userInteractionEnabled = YES;
  235 + [_scrollView addSubview:imageView];
  236 + }
  237 +
  238 + }
  239 + return _scrollView;
  240 +}
  241 +
  242 +- (NSArray *)titles{
  243 + if (!_titles) {
  244 + _titles = [NSArray arrayWithObjects:@"修复前", @"修复后", nil];
  245 + }
  246 + return _titles;
  247 +}
  248 +
  249 +-(UIButton *)saveBtn
  250 +{
  251 + if (!_saveBtn) {
  252 + _saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  253 + _saveBtn.frame = CGRectMake(CNScaleW(15), 0, CNScaleW(100), 35);
  254 + _saveBtn.bottom = kScreenHeight -CNScaleH(10) - kVerticalBottomSafeHeight;
  255 + _saveBtn.backgroundColor = RGB(254, 166, 24);
  256 + _saveBtn.titleLabel.font = UIFontCNMake(16);
  257 + [_saveBtn setTitle:@"保存" forState:UIControlStateNormal];
  258 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, CNScaleW(100), 35) cornerRadius:19];
  259 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  260 + maskLayer.path = path.CGPath;
  261 + _saveBtn.layer.mask = maskLayer;
  262 + [_saveBtn addTarget:self action:@selector(saveBtnClick) forControlEvents:UIControlEventTouchUpInside];
  263 + }
  264 + return _saveBtn;
  265 +}
  266 +-(UIButton *)sharebtn
  267 +{
  268 + if (!_sharebtn) {
  269 + _sharebtn = [UIButton buttonWithType:UIButtonTypeCustom];
  270 + _sharebtn.frame = CGRectMake(0, 0, CNScaleW(230), 35);
  271 + _sharebtn.bottom = kScreenHeight -CNScaleH(10) - kVerticalBottomSafeHeight;
  272 + _sharebtn.right = kScreenWidth - CNScaleW(15);
  273 + _sharebtn.titleLabel.font = UIFontCNMake(16);
  274 + _sharebtn.backgroundColor = RGB(252, 128, 89);
  275 + [_sharebtn setTitle:@"分享给好友 " forState:UIControlStateNormal];
  276 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, CNScaleW(230), 35) cornerRadius:19];
  277 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  278 + maskLayer.path = path.CGPath;
  279 + _sharebtn.layer.mask = maskLayer;
  280 + [_sharebtn addTarget:self action:@selector(shareBtnClick) forControlEvents:UIControlEventTouchUpInside];
  281 + }
  282 + return _sharebtn;
  283 +}
  284 +
  285 +-(UIButton *)tipBtnLabel
  286 +{
  287 + if (!_tipBtnLabel) {
  288 + _tipBtnLabel = [UIButton buttonWithType:UIButtonTypeCustom];
  289 + _tipBtnLabel.frame = CGRectMake(0, 0, 210, 49);
  290 + [_tipBtnLabel setTitle:@"和好友分享你的美好时光吧" forState:UIControlStateNormal];
  291 + [_tipBtnLabel setTitleColor:RGB(102, 102, 102) forState:UIControlStateNormal];
  292 + _tipBtnLabel.titleLabel.font = UIFontMake(15);
  293 + [_tipBtnLabel setBackgroundImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"oldPho_shareTip"] forState:UIControlStateNormal];
  294 + _tipBtnLabel.centerX = _sharebtn.centerX;
  295 + _tipBtnLabel.bottom = _sharebtn.top;
  296 + [self performSelector:@selector(removeTipBtnLabel) afterDelay:3];
  297 + }
  298 + return _tipBtnLabel;
  299 +}
  300 +#pragma mark - Navigation
  301 +
  302 +- (CNLiveNavigationBar *)navigationBar
  303 +{
  304 + if (!_navigationBar) {
  305 + _navigationBar = [CNLiveNavigationBar navigationBar];
  306 + _navigationBar.title.text = @"修复完成";
  307 + _navigationBar.backgroundColor = kWhiteColor;
  308 + _navigationBar.lineHidden = NO;
  309 + _navigationBar.right.hidden = NO;
  310 + _navigationBar.rightTitle = @"再修一张";
  311 + _navigationBar.right.width = 80;
  312 + _navigationBar.right.right = kScreenWidth -12;
  313 + [_navigationBar.right setTitleColor:RGB(0, 145, 255) forState:UIControlStateNormal];
  314 +
  315 + weakself
  316 + _navigationBar.onClickLeftButton = ^{
  317 + if (weakSelf.isNotFromTailor) {
  318 + [weakSelf.navigationController popViewControllerAnimated:YES];
  319 + }else{
  320 + if (self->_type == 0||self->_type == 1) {
  321 + [weakSelf.navigationController popToViewController:[weakSelf.navigationController.viewControllers objectAtIndex:weakSelf.navigationController.viewControllers.count - 5] animated:YES];
  322 + return;
  323 + }
  324 + [weakSelf.navigationController popToViewController:[weakSelf.navigationController.viewControllers objectAtIndex:weakSelf.navigationController.viewControllers.count - 6] animated:YES];
  325 + }
  326 +
  327 + };
  328 + _navigationBar.onClickRightButton = ^{
  329 + strongself
  330 + if (weakSelf.isNotFromTailor) {
  331 + CNOldPhotoVideoViewController *phoRepair = [[CNOldPhotoVideoViewController alloc] init];
  332 + NSMutableArray *controlerArray = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
  333 + [controlerArray replaceObjectAtIndex:self.navigationController.viewControllers.count-1 withObject:phoRepair];
  334 + [self.navigationController setViewControllers:controlerArray animated:YES];
  335 + return;
  336 + }
  337 + if (!self->_isSavePhoto) {
  338 + //选择再修一张则自动保存照片
  339 + [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
  340 + [PHAssetChangeRequest creationRequestForAssetFromImage:self->_saveimage];
  341 + } completionHandler:^(BOOL success, NSError * _Nullable error) {
  342 + }];
  343 + }
  344 + if (self->_type == 0||self->_type == 1) {
  345 + [weakSelf.navigationController popToViewController:[weakSelf.navigationController.viewControllers objectAtIndex:(weakSelf.navigationController.viewControllers.count-4)] animated:YES];
  346 + return;
  347 + }
  348 + [weakSelf.navigationController popToViewController:[weakSelf.navigationController.viewControllers objectAtIndex:(weakSelf.navigationController.viewControllers.count-5)] animated:YES];
  349 + };
  350 + }
  351 + return _navigationBar;
  352 +}
  353 +- (CNPhoPresent *)present
  354 +{
  355 + if (!_present) {
  356 + _present = [[CNPhoPresent alloc] init];
  357 + _present.delegate = self;
  358 + }
  359 + return _present;
  360 +}
  361 +
  362 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNTailorViewController.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNTailorViewController.h
  1 +//
  2 +// CNTailorViewController.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <CNLiveBaseClass/CNLiveBaseViewController.h>
  10 +#import "CNPhoPresent.h"
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNTailorViewController : CNLiveBaseViewController
  14 +//被选中的图片在init里传值
  15 +-(instancetype)initWithImage:(UIImage *)pcImage withRepairType:(CNLiveRepairType) type;
  16 +@end
  17 +
  18 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNTailorViewController.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Controller/CNTailorViewController.m
  1 +//
  2 +// CNTailorViewController.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNTailorViewController.h"
  10 +#import "CNLiveNavigationBar.h"
  11 +#import "CNImageTailorView.h"
  12 +#import "CNHintView.h"
  13 +#import "CNRepairPhotosViewController.h"
  14 +#import "CNDrawViewController.h"
  15 +#import "CNUploadManager.h"
  16 +
  17 +@interface CNTailorViewController ()
  18 +{
  19 + UIImage *_pcImage;
  20 + CNLiveRepairType _type;
  21 +}
  22 +@property (nonatomic, strong)CNImageTailorView *tailorView;
  23 +@property (nonatomic, strong)NSArray *chooseTypes;
  24 +@property (nonatomic, strong)CNHintView *tipView;
  25 +@property (nonatomic, strong) CNUploadManager *manager;
  26 +@end
  27 +
  28 +@implementation CNTailorViewController
  29 +-(void)dealloc
  30 +{
  31 +
  32 +}
  33 +-(instancetype)initWithImage:(UIImage *)pcImage withRepairType:(CNLiveRepairType)type{
  34 + if (self = [super init]) {
  35 + _pcImage = pcImage;
  36 + _type = type;
  37 + }
  38 + return self;
  39 +}
  40 +- (void)viewDidLoad {
  41 + [super viewDidLoad];
  42 + self.title = @"照片裁剪";
  43 + self.view.backgroundColor = kBlackColor;
  44 + [self.view addSubview:self.navigationBar];
  45 + [self.view addSubview:self.tailorView];
  46 + [self.view addSubview:self.tipView];
  47 + self.chooseTypes = @[@"换一张",@"确定"];
  48 +}
  49 +-(void)viewWillAppear:(BOOL)animated
  50 +{
  51 + [super viewWillAppear:animated];
  52 + self.navigationController.navigationBarHidden = YES;
  53 +
  54 +}
  55 +-(void)viewDidDisappear:(BOOL)animated
  56 +{
  57 + [super viewDidDisappear:animated];
  58 +}
  59 +
  60 +#pragma mark - Action
  61 +
  62 +-(void)chooseBtnClick:(UIButton *)sender
  63 +{
  64 + switch (sender.tag - 1001) {
  65 + case 0:
  66 + {
  67 + [self.navigationController popViewControllerAnimated:YES];
  68 + }
  69 + break;
  70 + case 1:
  71 + {
  72 + UIImage *newImage = [_pcImage cropImageToRect:self.tailorView.imageCropFrame];
  73 + if (_type == CNLiveRepairTypeNormal || _type == CNLiveRepairTypeAddColor)
  74 + {
  75 + [self.manager uploadImageManager:newImage draw:NULL rect:self.tailorView.imageCropFrame.size repairType:_type];
  76 + weakself
  77 + self.manager.popBlock = ^{
  78 + [weakSelf.navigationController popToViewController:[weakSelf.navigationController.viewControllers objectAtIndex:weakSelf.navigationController.viewControllers.count -4] animated:YES];
  79 + };
  80 + self.manager.pushBlock = ^(NSString * _Nonnull contentId) {
  81 + strongself
  82 + CNRepairPhotosViewController *photos = [[CNRepairPhotosViewController alloc] initWithRepairType:self->_type];
  83 + photos.contentId = contentId;
  84 + [weakSelf.navigationController pushViewController:photos animated:YES];
  85 + };
  86 +
  87 + }else{
  88 +
  89 + CNDrawViewController *drawVC = [[CNDrawViewController alloc] initWithImage:newImage withRepairType:_type];
  90 + [self.navigationController pushViewController:drawVC animated:YES];
  91 + }
  92 + }
  93 + break;
  94 +
  95 + default:
  96 + break;
  97 + }
  98 +}
  99 +
  100 +
  101 +
  102 +#pragma mark - Getting&&Setting
  103 +-(CNUploadManager *)manager
  104 +{
  105 + if (!_manager) {
  106 + _manager = [[CNUploadManager alloc] init];
  107 + }
  108 + return _manager;
  109 +}
  110 +-(void)setChooseTypes:(NSArray *)chooseTypes
  111 +{
  112 + CGFloat btnHeight = 35;
  113 + for (int i = 0 ;i<chooseTypes.count;i++) {
  114 + UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  115 + btn.frame = CGRectMake(0, kScreenHeight - 45 -kVerticalBottomSafeHeight, CNScaleW(165), btnHeight);
  116 + [btn setTitle:chooseTypes[i] forState:UIControlStateNormal];
  117 + [btn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  118 + btn.titleLabel.font = UIFontCNMake(16);
  119 + if (i == 0) {
  120 + btn.backgroundColor = RGB(254, 160, 25);
  121 + }else{
  122 + btn.backgroundColor = RGB(252, 128, 90);
  123 + }
  124 + btn.tag = 1001 + i;
  125 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, CNScaleW(165), btnHeight) cornerRadius:25];
  126 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  127 + maskLayer.path = path.CGPath;
  128 + btn.layer.mask = maskLayer;
  129 + [btn addTarget:self action:@selector(chooseBtnClick:) forControlEvents:UIControlEventTouchUpInside];
  130 + btn.centerX = SCREEN_WIDTH * (2 * i + 1)/4;
  131 + [self.view addSubview:btn];
  132 + }
  133 +
  134 +}
  135 +- (CNImageTailorView *)tailorView
  136 +{
  137 + if (!_tailorView) {
  138 + _tailorView = [[CNImageTailorView alloc] initWithFrame:CGRectMake(0, NavigationContentTop, KScreenWidth, kScreenHeight -NavigationContentTop- 45- kVerticalBottomSafeHeight -15) withImage:_pcImage];
  139 + }
  140 + return _tailorView;
  141 +}
  142 +-(CNHintView *)tipView
  143 +{
  144 + if (!_tipView) {
  145 + _tipView = [[CNHintView alloc] initWithFrame:CGRectMake(CNScaleW(15), 0, kScreenWidth - CNScaleW(15) *2, 61*RATIO + CNScaleH(38))];
  146 + _tipView.bottom = kScreenHeight - 60 - kVerticalBottomSafeHeight;
  147 + }
  148 + return _tipView;
  149 +}
  150 +
  151 +
  152 +
  153 +/*
  154 +#pragma mark - Navigation
  155 +
  156 +// In a storyboard-based application, you will often want to do a little preparation before navigation
  157 +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  158 + // Get the new view controller using [segue destinationViewController].
  159 + // Pass the selected object to the new view controller.
  160 +}
  161 +*/
  162 +
  163 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Present/CNPhoPresent.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Present/CNPhoPresent.h
  1 +//
  2 +// CNPhoPresent.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/14.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "CNPhoRepairModel.h"
  11 +
  12 +typedef enum : NSUInteger {
  13 + CNLiveRepairTypeNormal = 0, //照片修复
  14 + CNLiveRepairTypeAddColor, //照片上色
  15 + CNLiveRepairTypeDraw, //照片修补
  16 + CNLiveRepairTypeDrawAddColor,//修补+上色
  17 +} CNLiveRepairType;
  18 +
  19 +@protocol CNPhotoResponseDelegate <NSObject>
  20 +/**
  21 + *修复后图片返回
  22 + */
  23 +-(void)requestSucceed:(CNPhoRepairsListModel *_Nullable)model;
  24 +/**
  25 + *请求失败返回
  26 + */
  27 +-(void)requstFailed;
  28 +@end
  29 +
  30 +NS_ASSUME_NONNULL_BEGIN
  31 +typedef void(^CancelBlock)(void);
  32 +
  33 +static NSString *const haveMovieVC = @"haveMovieVC";
  34 +@interface CNPhoPresent : NSObject
  35 +
  36 +@property (nonatomic, weak) id<CNPhotoResponseDelegate> delegate;
  37 +@property (nonatomic, copy) CancelBlock cancel; //取消网络请求调用
  38 +
  39 +/**
  40 + *上传就图片请求
  41 + */
  42 +-(void)repairPhoRequest:(UIImage *)image
  43 + drawImage:(UIImage *_Nullable)drawImage
  44 + height:(CGFloat)height
  45 + width:(CGFloat)width
  46 + repairType:(CNLiveRepairType)type
  47 + succeed:(void(^)(NSString *contentId)) succeedCode
  48 + error:(void(^)(NSError *error))errorCode;
  49 +
  50 +-(void)downLoadImage:(NSString *)urlStr response:(void(^)(NSData *data))block;
  51 +/**
  52 + *请求修复后的图片
  53 + *contentId就是页面标记Id
  54 + */
  55 +-(void)requestRepairedPhotos:(NSString *)contentId;
  56 +/**
  57 + *照片类型修复列表
  58 + */
  59 +-(void)responseList:(void(^)(NSArray<CNRepairCategoryModel *> * dataList))block;
  60 +@end
  61 +
  62 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/Present/CNPhoPresent.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/Present/CNPhoPresent.m
  1 +//
  2 +// CNPhoPresent.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/14.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNPhoPresent.h"
  10 +#import <CNLiveCommonCategory/UIImage+zipData.h>
  11 +#import <CNLiveUploadManager/CNLiveUploadManager.h>
  12 +
  13 +@implementation CNPhoPresent
  14 +
  15 +-(void)repairPhoRequest:(UIImage *)image
  16 + drawImage:(UIImage *_Nullable)drawImage
  17 + height:(CGFloat)height
  18 + width:(CGFloat)width
  19 + repairType:(CNLiveRepairType)type
  20 + succeed:(void(^)(NSString *contentId))succeedCode
  21 + error:(void (^)(NSError *error))errorCode
  22 +{
  23 + NSDictionary *param = @{
  24 + @"appId":AppId,
  25 + @"verb":@"POST",
  26 + @"storageType":@"2",
  27 + @"bucket":API_BucketName
  28 +
  29 + };
  30 + NSMutableArray *imageArr = [NSMutableArray array];
  31 + [imageArr addObject:image];
  32 + if (drawImage) {
  33 + [imageArr addObject:drawImage];
  34 + }
  35 + [CNLiveUploadManager uploadRequestType:CNLiveUploadTypeQN url:CNUploadAuthForApp dic:param imageArray:imageArr assetArray:NULL isOriginal:YES limitType:0 progress:NULL success:^(NSMutableArray *fileArray) {
  36 + CNLiveUploadModel *model1 = fileArray[0];
  37 + CNLiveUploadModel *model2;
  38 + if (drawImage) {
  39 + model2 = fileArray[1];
  40 + }else
  41 + {
  42 + model2 = [CNLiveUploadModel new];
  43 + model2.imageUrl = @"";
  44 + }
  45 + [CNLiveUploadManager shareInsance].qnUploadOption = nil;
  46 + if ([CNLiveUploadManager shareInsance].calcelOption) {
  47 + [CNLiveUploadManager shareInsance].calcelOption = NO;
  48 + return;
  49 + }
  50 + if (!model1.imageUrl||!model2.imageUrl) {
  51 + errorCode(nil);
  52 + NSLog(@"预防七牛上传错误崩溃!!!!!");
  53 + return;
  54 + }
  55 + [self repairPhotoImage:model1.imageUrl restoreImage:model2.imageUrl type:type height:height width:width succeed:^(NSString *contentId) {
  56 + succeedCode(contentId);
  57 + } error:^(NSError *error) {
  58 + errorCode(error);
  59 + }];
  60 + } failure:^(NSMutableArray *errorArray, NSError *error) {
  61 + [CNLiveUploadManager shareInsance].qnUploadOption = nil;
  62 + if ([CNLiveUploadManager shareInsance].calcelOption) {
  63 + [CNLiveUploadManager shareInsance].calcelOption = NO;
  64 + return;
  65 + }
  66 + errorCode(error);
  67 + }];
  68 + self.cancel = ^{
  69 + [CNLiveUploadManager shareInsance].calcelOption = YES;
  70 + if ([CNLiveUploadManager shareInsance].qnUploadOption) {
  71 + [CNLiveUploadManager shareInsance].qnUploadOption.cancellationSignal();
  72 + }
  73 +
  74 + };
  75 +}
  76 +
  77 +-(void)repairPhotoImage:(NSString *)image
  78 + restoreImage:(NSString *)restoreImage
  79 + type:(CNLiveRepairType)type
  80 + height:(CGFloat)height
  81 + width:(CGFloat)width
  82 + succeed:(void(^)(NSString *contentId))succeedCode
  83 + error:(void (^)(NSError *error))errorCode
  84 +{
  85 + NSString *isColorize = @"0";
  86 + NSString *isRestore = @"0";
  87 + if (type == 2 ||type == 3) {
  88 + //修复串
  89 + isRestore = @"1";
  90 + }
  91 + if (type == 1 || type == 3) {
  92 + //上色串赋值
  93 + isColorize = @"1";
  94 + }
  95 + [CNLiveNetworking setAllowRequestDefaultArgument:NO];
  96 + NSDictionary *param = @{
  97 + @"sid":CNUserShareModelUid,
  98 + @"image":image,
  99 + @"restoreImage":restoreImage,
  100 + @"isColorize":isColorize,
  101 + @"isRestore":isRestore,
  102 + @"high":[NSString stringWithFormat:@"%.f",height],
  103 + @"width":[NSString stringWithFormat:@"%.f",width]
  104 + };
  105 + NSURLSessionTask *task = [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:cn_API_Classify(@"/contentApi/repairPictureNew") Param:param CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  106 + if ([error.localizedDescription isEqualToString:@"已取消"]) {
  107 + return;
  108 + }
  109 + NSLog(@"%@",responseObject);
  110 + NSString *code = [NSString stringWithFormat:@"%@",responseObject[@"errorCode"]];
  111 + if ([code isEqualToString:@"0"]) {
  112 + succeedCode(responseObject[@"data"]);
  113 + }else{
  114 + errorCode(error);
  115 + }
  116 +
  117 +
  118 + }];
  119 +
  120 + self.cancel = ^{
  121 + [task cancel];
  122 + };
  123 +}
  124 +
  125 +
  126 +
  127 +-(void)downLoadImage:(NSString *)urlStr response:(nonnull void (^)(NSData * _Nonnull))block
  128 +{
  129 + weakself
  130 + NSURLSessionConfiguration *configuration = [ NSURLSessionConfiguration defaultSessionConfiguration ];
  131 + AFURLSessionManager *manager = [[ AFURLSessionManager alloc ] initWithSessionConfiguration :configuration];
  132 + NSURLRequest *request = [ NSURLRequest requestWithURL :[NSURL URLWithString:urlStr]];
  133 + NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest :request progress : nil destination :^ NSURL *( NSURL *targetPath, NSURLResponse *response) {
  134 +
  135 + NSURL *documentsDirectoryURL = [[ NSFileManager defaultManager ] URLForDirectory : NSDocumentDirectory inDomain : NSUserDomainMask appropriateForURL : nil create : NO error : nil ];
  136 + return [documentsDirectoryURL URLByAppendingPathComponent :[response suggestedFilename ]];
  137 + } completionHandler :^( NSURLResponse *response, NSURL *filePath, NSError *error) {
  138 + NSLog ( @"File downloaded to: %@" , filePath);
  139 + if (error) {
  140 + [weakSelf downLoadImage:urlStr response:^(NSData * _Nonnull data) {
  141 + block(data);
  142 + }];
  143 + }
  144 + if (!filePath) {
  145 + return;
  146 + }
  147 + NSData * image = [NSData dataWithContentsOfURL :filePath];
  148 + [[NSUserDefaults standardUserDefaults] setObject:image forKey:urlStr];
  149 + block(image);
  150 +
  151 + }];
  152 + [downloadTask resume ];
  153 +
  154 +}
  155 +
  156 +-(void)requestRepairedPhotos:(NSString *)contentId
  157 +{
  158 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  159 + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/contentApi/getRepairPicture") Param:@{@"id":contentId} CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  160 + NSDictionary *dic = [NSDictionary dictionaryWithDictionary:responseObject];
  161 + NSString *code = [NSString stringWithFormat:@"%@",dic[@"errorCode"]];
  162 + if (error) {
  163 + [QMUITips showError:error.localizedDescription inView:AppKeyWindow hideAfterDelay:1.5f];
  164 + CNMessageSend(self.delegate, CNPhotoResponseDelegate, requstFailed);
  165 + return;
  166 + }
  167 + CNPhoRepairsListModel *model = [CNPhoRepairsListModel mj_objectWithKeyValues:dic[@"data"]];
  168 + if ([code isEqualToString:@"0"]) {
  169 + CNMessageSend(self.delegate, CNPhotoResponseDelegate, requestSucceed:model);
  170 + }else{
  171 + if (dic) {
  172 + [QMUITips showError:dic[@"errorMessage"] inView:AppKeyWindow hideAfterDelay:1.5];
  173 + }
  174 +
  175 + CNMessageSend(self.delegate, CNPhotoResponseDelegate, requstFailed);
  176 + }
  177 + }];
  178 +}
  179 +
  180 +-(void)responseList:(void (^)(NSArray<CNRepairCategoryModel *> * _Nonnull))block
  181 +{
  182 + NSArray *list1 = @[
  183 + @{
  184 + @"image":@"oldPho_nomalRepair",
  185 + @"title":@"照片修复",
  186 + @"message":@"智能修复模糊照片"
  187 + },
  188 +
  189 + @{
  190 + @"image":@"oldPho_nomalColor",
  191 + @"title":@"照片上色",
  192 + @"message":@"黑白照片智能上色"
  193 + }
  194 +
  195 +];
  196 + NSArray *list2 = @[
  197 + @{
  198 + @"image":@"oldPho_repairDraw",
  199 + @"title":@"照片修补",
  200 + @"message":@"智能修补手绘区域中图像"
  201 + },
  202 +
  203 + @{
  204 + @"image":@"oldPho_rapairDrawAndColor",
  205 + @"title":@"照片修补及上色",
  206 + @"message":@"智能修补手绘区域中图像并对照片上色"
  207 + }
  208 +
  209 +];
  210 + NSMutableArray *dataArr1 = [[NSMutableArray alloc] init];
  211 + for (NSDictionary *dic in list1) {
  212 + CNPhoRepairModel *model = [CNPhoRepairModel mj_objectWithKeyValues:dic];
  213 + [dataArr1 addObject:model];
  214 + }
  215 + NSMutableArray *dataArr2 = [[NSMutableArray alloc] init];
  216 + for (NSDictionary *dic in list2) {
  217 + CNPhoRepairModel *model = [CNPhoRepairModel mj_objectWithKeyValues:dic];
  218 + [dataArr2 addObject:model];
  219 + }
  220 + NSArray *list3 = @[
  221 + @{
  222 + @"title":@"照片修复",
  223 + @"list":dataArr1
  224 + },
  225 + @{
  226 + @"title":@"照片修补",
  227 + @"list":dataArr2
  228 + }
  229 + ];
  230 + NSMutableArray *responsData = [[NSMutableArray alloc] init];
  231 + for (NSDictionary *dic in list3) {
  232 + CNRepairCategoryModel *model = [CNRepairCategoryModel mj_objectWithKeyValues:dic];
  233 + [responsData addObject:model];
  234 + }
  235 +
  236 + block(responsData.copy);
  237 +}
  238 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/AuthreAlertView/CNAuthorizeView.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/AuthreAlertView/CNAuthorizeView.h
  1 +//
  2 +// CNAuthorizeView.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +typedef void(^AuthorizeBlock)(void);
  14 +
  15 +@interface CNAuthorizeView : UIView
  16 +//关闭按钮不在空白区域的类工厂方法
  17 ++(CNAuthorizeView *)setUpAuthorizeViewForTitle:(NSString *)title
  18 + secondTitle:(NSString *)secondTitle
  19 + mesOne:(NSString *)mesOne
  20 + mesTwo:(NSString *)mesTwo
  21 + sureTitle:(NSString *)sureName
  22 + sureBlock:(AuthorizeBlock)sureBlock;
  23 +@end
  24 +
  25 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/AuthreAlertView/CNAuthorizeView.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/AuthreAlertView/CNAuthorizeView.m
  1 +//
  2 +// CNAuthorizeView.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNAuthorizeView.h"
  10 +
  11 +@interface CNAuthorizeView()
  12 +{
  13 + CGFloat _width,_height;
  14 + NSString *_imageStr;
  15 +}
  16 +
  17 +@property (nonatomic, strong)UIView *backView;
  18 +@property (nonatomic, strong)UIView *secondBackView;
  19 +@property (nonatomic, strong)UILabel *titleLabel;
  20 +@property (nonatomic, strong)UILabel *secondTitleLabel;
  21 +@property (nonatomic, strong)UILabel *mesLineOne;
  22 +@property (nonatomic, strong)UILabel *mesLineTwo;
  23 +@property (nonatomic, strong)UIButton *sureBtn;
  24 +@property (nonatomic, strong)UIButton *closeBtn;
  25 +@end
  26 +
  27 +@implementation CNAuthorizeView
  28 ++(CNAuthorizeView *)setUpAuthorizeViewForTitle:(NSString *)title
  29 + secondTitle:(NSString *)secondTitle
  30 + mesOne:(NSString *)mesOne
  31 + mesTwo:(NSString *)mesTwo
  32 + sureTitle:(NSString *)sureName
  33 + sureBlock:(AuthorizeBlock)sureBlock
  34 +{
  35 + CNAuthorizeView *contentView = [[CNAuthorizeView alloc] initWithFrame:CGRectMake(0, 0, 285, 380)];
  36 + contentView.backgroundColor = kClearColor;
  37 +
  38 + [contentView addSubview:contentView.backView];
  39 + [contentView.backView addSubview:contentView.titleLabel];
  40 + [contentView.backView addSubview:contentView.secondBackView];
  41 + [contentView.secondBackView addSubview:contentView.secondTitleLabel];
  42 + [contentView.secondBackView addSubview:contentView.mesLineOne];
  43 + [contentView.secondBackView addSubview:contentView.mesLineTwo];
  44 + [contentView.backView addSubview:contentView.sureBtn];
  45 + [contentView addSubview:contentView.closeBtn];
  46 +
  47 + contentView.backView.layer.cornerRadius = 10;
  48 + [contentView.backView mas_makeConstraints:^(MASConstraintMaker *make) {
  49 + make.top.left.right.equalTo(contentView);
  50 + make.height.offset(295);
  51 + }];
  52 +
  53 + contentView.titleLabel.text = title;
  54 + [contentView.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  55 + make.top.equalTo(contentView).offset(25);
  56 + make.width.offset(190);
  57 + make.height.offset(25);
  58 + make.centerX.equalTo(contentView);
  59 + }];
  60 +
  61 + [contentView.secondBackView mas_makeConstraints:^(MASConstraintMaker *make) {
  62 + make.top.equalTo(contentView.titleLabel.mas_bottom).offset(15);
  63 + make.left.equalTo(contentView).offset(15);
  64 + make.right.equalTo(contentView).offset(-15);
  65 + make.height.offset(145);
  66 + }];
  67 +
  68 + contentView.secondTitleLabel.text = secondTitle;
  69 + [contentView.secondTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  70 + make.top.equalTo(contentView.secondBackView).offset(15);
  71 + make.left.equalTo(contentView.secondBackView).offset(16);
  72 + make.width.offset(160);
  73 + make.height.offset(21);
  74 + }];
  75 + contentView.mesLineOne.text = mesOne;
  76 + contentView.mesLineOne.numberOfLines = 2;
  77 + [contentView.mesLineOne mas_makeConstraints:^(MASConstraintMaker *make) {
  78 + make.top.equalTo(contentView.secondTitleLabel.mas_bottom).offset(5);
  79 + make.left.equalTo(contentView.secondTitleLabel);
  80 + make.width.offset(225);
  81 + make.height.offset(42);
  82 + }];
  83 +
  84 + contentView.mesLineTwo.text = mesTwo;
  85 + contentView.mesLineTwo.numberOfLines = 2;
  86 + [contentView.mesLineTwo mas_makeConstraints:^(MASConstraintMaker *make) {
  87 + make.top.equalTo(contentView.mesLineOne.mas_bottom).offset(5);
  88 + make.left.equalTo(contentView.secondTitleLabel);
  89 + make.width.offset(225);
  90 + make.height.offset(42);
  91 + }];
  92 +
  93 + [contentView.sureBtn setTitle:sureName forState:UIControlStateNormal];
  94 + contentView.sureBtn.layer.cornerRadius = 22.5;
  95 + [contentView.sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  96 + make.top.equalTo(contentView.secondBackView.mas_bottom).offset(20);
  97 + make.width.offset(225);
  98 + make.height.offset(45);
  99 + make.centerX.equalTo(contentView);
  100 + }];
  101 +
  102 + [contentView.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  103 + make.top.equalTo(contentView.backView.mas_bottom).offset(49.5);
  104 + make.width.height.offset(31);
  105 + make.centerX.equalTo(contentView);
  106 + }];
  107 +
  108 + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init];
  109 + modalViewController.contentView = contentView;
  110 + modalViewController.modal = YES;
  111 + [modalViewController showWithAnimated:YES completion:nil];
  112 +
  113 + __weak typeof(modalViewController) weakModalViewController = modalViewController;
  114 + [contentView.closeBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
  115 + [weakModalViewController hideWithAnimated:YES completion:nil];
  116 + }];
  117 +
  118 + [contentView.sureBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
  119 + [weakModalViewController hideWithAnimated:YES completion:^(BOOL finished) {
  120 + if (finished&&sureBlock) {
  121 + sureBlock();
  122 + }
  123 + }];
  124 + }];
  125 + return contentView;
  126 +}
  127 +
  128 +#pragma mark - Getting
  129 +-(UIView *)backView
  130 +{
  131 + if (!_backView) {
  132 + _backView = [[UIView alloc] init];
  133 + _backView.backgroundColor = kWhiteColor;
  134 + }
  135 + return _backView;
  136 +}
  137 +
  138 +-(UIView *)secondBackView
  139 +{
  140 + if (!_secondBackView) {
  141 + _secondBackView = [[UIView alloc] init];
  142 + _secondBackView.backgroundColor = RGB(250, 251, 253);
  143 + }
  144 + return _secondBackView;
  145 +}
  146 +
  147 +-(UILabel *)titleLabel
  148 +{
  149 + if (!_titleLabel) {
  150 + _titleLabel = [[UILabel alloc] init];
  151 + _titleLabel.textColor = RGB(51, 51, 51);
  152 + _titleLabel.textAlignment = NSTextAlignmentCenter;
  153 + _titleLabel.font = UIFontMake(18);
  154 + }
  155 + return _titleLabel;
  156 +}
  157 +-(UILabel *)secondTitleLabel
  158 +{
  159 + if (!_secondTitleLabel) {
  160 + _secondTitleLabel = [[UILabel alloc] init];
  161 + _secondTitleLabel.textAlignment = NSTextAlignmentLeft;
  162 + _secondTitleLabel.textColor = RGB(102, 102, 102);
  163 + _secondTitleLabel.font = UIFontMake(15);
  164 + }
  165 + return _secondTitleLabel;
  166 +}
  167 +
  168 +-(UILabel *)mesLineOne
  169 +{
  170 + if (!_mesLineOne) {
  171 + _mesLineOne = [[UILabel alloc] init];
  172 + _mesLineOne.textAlignment = NSTextAlignmentLeft;
  173 + _mesLineOne.textColor = RGB(102, 102, 102);
  174 + _mesLineOne.font = UIFontMake(15);
  175 + }
  176 + return _mesLineOne;
  177 +}
  178 +-(UILabel *)mesLineTwo
  179 +{
  180 + if (!_mesLineTwo) {
  181 + _mesLineTwo = [[UILabel alloc] init];
  182 + _mesLineTwo.textAlignment = NSTextAlignmentLeft;
  183 + _mesLineTwo.textColor = RGB(102, 102, 102);
  184 + _mesLineTwo.font = UIFontMake(15);
  185 + }
  186 + return _mesLineTwo;
  187 +}
  188 +-(UIButton *)sureBtn
  189 +{
  190 + if (!_sureBtn) {
  191 + _sureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  192 + [_sureBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  193 + _sureBtn.titleLabel.font = UIFontMake(17);
  194 + _sureBtn.backgroundColor = RGB(252, 118, 85);
  195 + }
  196 + return _sureBtn;
  197 +}
  198 +-(UIButton *)closeBtn
  199 +{
  200 + if (!_closeBtn) {
  201 + _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  202 + [_closeBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"oldPho_close"] forState:UIControlStateNormal];
  203 + }
  204 + return _closeBtn;
  205 +}
  206 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNHintView.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNHintView.h
  1 +//
  2 +// CNHintView.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNHintView : UIView
  14 +
  15 +@end
  16 +
  17 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNHintView.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNHintView.m
  1 +//
  2 +// CNHintView.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNHintView.h"
  10 +
  11 +@interface CNHintView ()
  12 +@property (nonatomic, strong)UILabel *titleLabel;
  13 +@property (nonatomic, strong)UILabel *MessageLabel;
  14 +@property (nonatomic, strong)UIButton *closeBtn;
  15 +@end
  16 +
  17 +@implementation CNHintView
  18 +
  19 +- (instancetype)initWithFrame:(CGRect)frame
  20 +{
  21 + if (self = [super initWithFrame:frame]) {
  22 + self.backgroundColor = kWhiteColor;
  23 + self.layer.cornerRadius = 8;
  24 + [self addSubview:self.titleLabel];
  25 + [self addSubview:self.closeBtn];
  26 + [self addSubview:self.MessageLabel];
  27 +
  28 + }
  29 + return self;
  30 +}
  31 +#pragma mark - Action
  32 +-(void)closeBtnClick
  33 +{
  34 + [self removeFromSuperview];
  35 +}
  36 +
  37 +#pragma mark - Getting
  38 +- (UILabel *)titleLabel
  39 +{
  40 + if (!_titleLabel) {
  41 + _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CNScaleW(15), CNScaleW(15), 60*RATIO, 24*RATIO)];
  42 + _titleLabel.text = @"小提示";
  43 + _titleLabel.textColor = RGB(51, 51, 51);
  44 + _titleLabel.font = UIFontCNMake(17);
  45 + _titleLabel.textAlignment = NSTextAlignmentLeft;
  46 + }
  47 + return _titleLabel;
  48 +}
  49 +
  50 +-(UILabel *)MessageLabel
  51 +{
  52 + if (!_MessageLabel) {
  53 + _MessageLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.left, _titleLabel.bottom+CNScaleW(6), _closeBtn.right, 37*RATIO)];
  54 + _MessageLabel.text = @"可以裁剪出人物上半身,脸部不要过小且无遮挡,尺寸请尽量保持4:4或16:9比例,能有效提升修复效果。";
  55 + _MessageLabel.textColor = RGB(51, 51, 51);
  56 + _MessageLabel.textAlignment = NSTextAlignmentLeft;
  57 + _MessageLabel.numberOfLines = 0;
  58 + _MessageLabel.font = UIFontCNMake(13);
  59 + if ([_MessageLabel separatedLines].count >3) {
  60 + _MessageLabel.font = UIFontCNMake(12);
  61 + }
  62 + [_MessageLabel sizeToFit];
  63 + }
  64 + return _MessageLabel;
  65 +}
  66 +- (UIButton *)closeBtn
  67 +{
  68 + if (!_closeBtn) {
  69 + _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  70 + _closeBtn.frame = CGRectMake(self.width - CNScaleW(15) -19*RATIO, _titleLabel.top, 19*RATIO, 19*RATIO);
  71 + [_closeBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"oldPho_tipClose"] forState:UIControlStateNormal];
  72 + [_closeBtn addTarget:self action:@selector(closeBtnClick) forControlEvents:UIControlEventTouchUpInside];
  73 + }
  74 + return _closeBtn;
  75 +}
  76 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCagegoryCell.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCagegoryCell.h
  1 +//
  2 +// CNRepairCagegoryCell.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import "CNPhoRepairModel.h"
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +
  14 +@interface CNRepairCagegoryCell : UITableViewCell
  15 +@property (nonatomic, strong) CNPhoRepairModel *model;
  16 +@end
  17 +
  18 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCagegoryCell.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCagegoryCell.m
  1 +//
  2 +// CNRepairCagegoryCell.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNRepairCagegoryCell.h"
  10 +
  11 +@interface CNRepairCagegoryCell()
  12 +@property (nonatomic, strong)UIView *backView;
  13 +@property (nonatomic, strong)UIImageView *headerImage;
  14 +@property (nonatomic, strong)UILabel *titleLabel;
  15 +@property (nonatomic, strong)UILabel *messageLabel;
  16 +@end
  17 +
  18 +@implementation CNRepairCagegoryCell
  19 +-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  20 +{
  21 + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  22 + if (self) {
  23 + self.contentView.backgroundColor = RGB(244, 244, 244);
  24 + [self.contentView addSubview:self.backView];
  25 + [self.backView addSubview:self.headerImage];
  26 + [self.backView addSubview:self.titleLabel];
  27 + [self.backView addSubview:self.messageLabel];
  28 + }
  29 + return self;
  30 +}
  31 +-(void)layoutSubviews
  32 +{
  33 + [super layoutSubviews];
  34 + [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
  35 + make.top.equalTo(self.contentView).offset(10*RATIO);
  36 + make.left.equalTo(self.contentView).offset(15);
  37 + make.right.equalTo(self.contentView).offset(-15);
  38 + make.bottom.equalTo(self.contentView);
  39 + }];
  40 + [self.headerImage mas_makeConstraints:^(MASConstraintMaker *make) {
  41 + make.top.equalTo(self.backView).offset(12*RATIO);
  42 + make.left.equalTo(self.backView).offset(15*RATIO);
  43 + make.height.width.offset(61*RATIO);
  44 + }];
  45 + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  46 + make.top.equalTo(self.headerImage).offset(7*RATIO);
  47 + make.left.equalTo(self.headerImage.mas_right).offset(15);
  48 + make.height.offset(25*RATIO);
  49 + make.right.equalTo(self.backView);
  50 + }];
  51 + [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  52 + make.top.equalTo(self.titleLabel.mas_bottom).offset(3*RATIO);
  53 + make.left.equalTo(self.titleLabel);
  54 + make.height.offset(20 *[self.messageLabel separatedLines].count *RATIO);
  55 + make.right.equalTo(self.backView);
  56 + }];
  57 + if ([self.titleLabel separatedLines].count>1) {
  58 + self.titleLabel.font = UIFontCNMake(16);
  59 + }
  60 + if ([self.messageLabel separatedLines].count>2) {
  61 + _messageLabel.font = UIFontCNMake(13);
  62 + }
  63 +}
  64 +
  65 +#pragma mark - Setting
  66 +-(void)setModel:(CNPhoRepairModel *)model
  67 +{
  68 + [self.headerImage setImage:[CNLiveCPhotoRepairImage getImageWithNamed:model.image]];
  69 + self.titleLabel.text = model.title;
  70 + self.messageLabel.text = model.message;
  71 + [self setNeedsLayout];
  72 +}
  73 +
  74 +#pragma mark - Getting
  75 +-(UIView *)backView
  76 +{
  77 + if (!_backView) {
  78 + _backView = [[UIView alloc] init];
  79 + _backView.layer.cornerRadius = 6;
  80 + _backView.backgroundColor = kWhiteColor;
  81 + }
  82 + return _backView;
  83 +}
  84 +-(UIImageView *)headerImage
  85 +{
  86 + if (!_headerImage) {
  87 + _headerImage = [[UIImageView alloc] init];
  88 + _headerImage.backgroundColor = kClearColor;
  89 + _headerImage.contentMode = UIViewContentModeScaleAspectFit;
  90 + }
  91 + return _headerImage;
  92 +}
  93 +-(UILabel *)titleLabel
  94 +{
  95 + if (!_titleLabel) {
  96 + _titleLabel = [[UILabel alloc] init];
  97 + _titleLabel.textColor = RGB(51, 51, 51);
  98 + _titleLabel.width = CNScaleW(241);
  99 + _titleLabel.textAlignment = NSTextAlignmentLeft;
  100 + _titleLabel.font = UIFontCNMake(18);
  101 + }
  102 + return _titleLabel;
  103 +}
  104 +-(UILabel *)messageLabel
  105 +{
  106 + if (!_messageLabel) {
  107 + _messageLabel = [[UILabel alloc] init];
  108 + _messageLabel.textColor = RGB(153, 153,153);
  109 + _messageLabel.width = CNScaleW(241);
  110 + _messageLabel.textAlignment = NSTextAlignmentLeft;
  111 + _messageLabel.numberOfLines = 0;
  112 + _messageLabel.font = UIFontCNMake(14);
  113 + }
  114 + return _messageLabel;
  115 +}
  116 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCategoryHeaderView.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCategoryHeaderView.h
  1 +//
  2 +// CNRepairCategoryHeaderView.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNRepairCategoryHeaderView : UITableViewHeaderFooterView
  14 +@property (nonatomic, strong)NSString *titleStr;
  15 +@end
  16 +
  17 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCategoryHeaderView.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/CNRepairCategoryHeaderView.m
  1 +//
  2 +// CNRepairCategoryHeaderView.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNRepairCategoryHeaderView.h"
  10 +
  11 +@interface CNRepairCategoryHeaderView()
  12 +@property (nonatomic, strong)UILabel *titleLabel;
  13 +@end
  14 +
  15 +@implementation CNRepairCategoryHeaderView
  16 +-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
  17 +{
  18 + self = [super initWithReuseIdentifier:reuseIdentifier];
  19 + if (self) {
  20 + self.contentView.backgroundColor = RGB(244, 244, 244);
  21 + [self.contentView addSubview:self.titleLabel];
  22 + }
  23 +
  24 + return self;
  25 +}
  26 +-(void)layoutSubviews
  27 +{
  28 + [super layoutSubviews];
  29 + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  30 + make.left.equalTo(self.contentView).offset(15);
  31 + make.height.offset(24*RATIO);
  32 + make.bottom.equalTo(self.contentView);
  33 + make.right.equalTo(self.contentView).offset(-15);
  34 + }];
  35 +}
  36 +#pragma mark - Setting
  37 +-(void)setTitleStr:(NSString *)titleStr
  38 +{
  39 + self.titleLabel.text = titleStr;
  40 + [self setNeedsLayout];
  41 +}
  42 +#pragma mark - Getting
  43 +-(UILabel *)titleLabel
  44 +{
  45 + if (!_titleLabel) {
  46 + _titleLabel = [[UILabel alloc] init];
  47 + _titleLabel.textColor = RGB(51, 51, 51);
  48 + _titleLabel.textAlignment = NSTextAlignmentLeft;
  49 + _titleLabel.font = UIFontCNMake(17);
  50 + }
  51 + return _titleLabel;
  52 +}
  53 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawPath.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawPath.h
  1 +//
  2 +// CNDrawPath.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNDrawPath : UIBezierPath
  14 +@property (nonatomic, strong) UIColor *lineColor;
  15 +
  16 ++ (instancetype)path;
  17 +@end
  18 +
  19 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawPath.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawPath.m
  1 +//
  2 +// CNDrawPath.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNDrawPath.h"
  10 +
  11 +@implementation CNDrawPath
  12 ++(instancetype)path
  13 +{
  14 + CNDrawPath *path = [[self alloc] init];
  15 + return path;
  16 +}
  17 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawView.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawView.h
  1 +//
  2 +// CNDrawView.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import "CNDrawPath.h"
  11 +
  12 +@protocol DrawViewChangeDelegate <NSObject>
  13 +
  14 +-(void)revocEnabled:(BOOL)revoc recoveEnable:(BOOL)recover removeEnable:(BOOL)remove;
  15 +@end
  16 +NS_ASSUME_NONNULL_BEGIN
  17 +
  18 +@interface CNDrawView : UIView
  19 +@property (nonatomic, assign) CGFloat lineWidth;
  20 +
  21 +// 线段的颜色
  22 +@property (nonatomic, strong) UIColor *lineColor;
  23 +@property (nonatomic, strong)NSMutableArray *paths;
  24 +
  25 +@property (nonatomic, weak) id<DrawViewChangeDelegate> delegate;
  26 +
  27 +// 清屏
  28 +- (void)clear;
  29 +
  30 +// 撤销
  31 +- (void)undo;
  32 +//恢复
  33 +- (void)redo;
  34 +@end
  35 +
  36 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawView.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNDrawView.m
  1 +//
  2 +// CNDrawView.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNDrawView.h"
  10 +
  11 +@interface CNDrawView()
  12 +@property (nonatomic, strong)NSMutableArray *cacelPaths;
  13 +@property (nonatomic, strong)UIBezierPath *path;
  14 +@end
  15 +
  16 +@implementation CNDrawView
  17 +
  18 +-(instancetype)initWithFrame:(CGRect)frame
  19 +{
  20 + if (self = [super initWithFrame:frame]) {
  21 + self.backgroundColor = kClearColor;
  22 + _lineWidth = 1;
  23 + _lineColor = [UIColor blackColor];
  24 + }
  25 + return self;
  26 +}
  27 +
  28 +- (void)clear{
  29 + [self.paths removeAllObjects];
  30 + [self.cacelPaths removeAllObjects];
  31 + [self setNeedsDisplay];
  32 +}
  33 +
  34 +
  35 +- (void)undo{
  36 + [self.cacelPaths addObject:self.paths.lastObject];
  37 + [self.paths removeLastObject];
  38 + [self setNeedsDisplay];
  39 +}
  40 +
  41 +- (void)redo{
  42 + [self.paths addObject:self.cacelPaths.lastObject];
  43 + [self.cacelPaths removeLastObject];
  44 + [self setNeedsDisplay];
  45 +}
  46 +
  47 +-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
  48 +{
  49 + UITouch *touch = [touches anyObject];
  50 + CGPoint currentPoint = [touch locationInView:self];
  51 + CNDrawPath *path = [CNDrawPath path];
  52 + path.lineColor = _lineColor;
  53 + [path moveToPoint:currentPoint];
  54 + path.lineWidth = _lineWidth;
  55 + _path = path;
  56 + [self.paths addObject:path];
  57 + if (self.cacelPaths.count>0) {
  58 + [self.cacelPaths removeAllObjects];
  59 + }
  60 +}
  61 +
  62 +-(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
  63 +{
  64 + UITouch *touch = [touches anyObject];
  65 + CGPoint currentPoint = [touch locationInView:self];
  66 + [_path addLineToPoint:currentPoint];
  67 + [self setNeedsDisplay];
  68 +}
  69 +
  70 +-(void)drawRect:(CGRect)rect
  71 +{
  72 + for (CNDrawPath *path in self.paths) {
  73 + [path.lineColor set];
  74 + [path stroke];
  75 + }
  76 + BOOL revoc = NO;
  77 + BOOL recover = NO;
  78 + BOOL remove = NO;
  79 + if (self.paths.count>0) {
  80 + revoc = YES;
  81 + remove = YES;
  82 + }
  83 + if (self.cacelPaths.count>0) {
  84 + recover = YES;
  85 + }
  86 + CNMessageSend(self.delegate, DrawViewChangeDelegate, revocEnabled:revoc recoveEnable:recover removeEnable:remove);
  87 +}
  88 +#pragma mark - Getting
  89 +- (NSMutableArray *)paths
  90 +{
  91 + if (!_paths) {
  92 + _paths = [[NSMutableArray alloc] init];
  93 + }
  94 + return _paths;
  95 +}
  96 +- (NSMutableArray *)cacelPaths
  97 +{
  98 + if (!_cacelPaths) {
  99 + _cacelPaths = [[NSMutableArray alloc] init];
  100 + }
  101 + return _cacelPaths;
  102 +}
  103 +
  104 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNOperatorView.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNOperatorView.h
  1 +//
  2 +// CNOperatorView.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import "CNDrawView.h"
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +typedef void(^ActionBlock)(NSUInteger tag);
  14 +typedef void(^SliderWidth)(CGFloat width);
  15 +@interface CNOperatorView : UIView<DrawViewChangeDelegate>
  16 +
  17 +@property (nonatomic, copy) ActionBlock actionBlock;
  18 +@property (nonatomic, copy) SliderWidth sliderBlock;
  19 +
  20 +
  21 +@end
  22 +
  23 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNOperatorView.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/DrawView/CNOperatorView.m
  1 +//
  2 +// CNOperatorView.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNOperatorView.h"
  10 +
  11 +@interface CNOperatorView()
  12 +@property (nonatomic, strong)UILabel *widthLabel;
  13 +@property (nonatomic, strong)QMUISlider *slider;
  14 +@property (nonatomic, strong)UIButton *revocBtn;
  15 +@property (nonatomic, strong)UIButton *recoveBtn;
  16 +@property (nonatomic, strong)UIButton *removeBtn;
  17 +@property (nonatomic, strong)UIButton *saveBtn;
  18 +@end
  19 +@implementation CNOperatorView
  20 +
  21 +-(instancetype)initWithFrame:(CGRect)frame
  22 +{
  23 + self = [super initWithFrame:frame];
  24 + if (self) {
  25 + self.backgroundColor = kWhiteColor;
  26 + [self addSubview:self.widthLabel];
  27 + [self addSubview:self.slider];
  28 + [self addSubview:self.revocBtn];
  29 + [self addSubview:self.recoveBtn];
  30 + [self addSubview:self.removeBtn];
  31 + [self addSubview:self.saveBtn];
  32 +
  33 + }
  34 + return self;
  35 +}
  36 +
  37 +-(void)layoutSubviews
  38 +{
  39 + [super layoutSubviews];
  40 + [self.widthLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  41 + make.left.equalTo(self).offset(12);
  42 + make.top.equalTo(self).offset(20);
  43 + make.height.offset(20);
  44 + }];
  45 + [self.slider mas_makeConstraints:^(MASConstraintMaker *make) {
  46 + make.left.equalTo(self.widthLabel.mas_right).offset(10);
  47 + make.centerY.equalTo(self.widthLabel);
  48 + make.height.offset(20);
  49 + make.width.offset(CNScaleW(175));
  50 + }];
  51 + [self.recoveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  52 + make.centerY.equalTo(self.widthLabel);
  53 + make.right.equalTo(self).offset(-12);
  54 + make.width.height.offset(35);
  55 + }];
  56 + [self.revocBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  57 + make.centerY.equalTo(self.widthLabel);
  58 + make.right.equalTo(self.recoveBtn.mas_left).offset(-12);
  59 + make.width.height.offset(35);
  60 + }];
  61 +
  62 + [self.removeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  63 + make.left.equalTo(self.widthLabel);
  64 + make.bottom.equalTo(self).offset(-25);
  65 + make.width.height.offset(25);
  66 +
  67 + }];
  68 + [self.saveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  69 + make.right.equalTo(self.recoveBtn);
  70 + make.bottom.equalTo(self.removeBtn);
  71 + make.width.height.offset(25);
  72 +
  73 + }];
  74 +}
  75 +
  76 +#pragma mark - Action
  77 +-(void)actionClick:(UIButton *)sender
  78 +{
  79 + self.actionBlock(sender.tag-1001);
  80 +}
  81 +-(void)updateProgress:(QMUISlider *)slider
  82 +{
  83 + self.sliderBlock(slider.value);
  84 +}
  85 +//-(void)
  86 +#pragma mark - DrawViewChangeDelegate
  87 +-(void)revocEnabled:(BOOL)revoc recoveEnable:(BOOL)recover removeEnable:(BOOL)remove
  88 +{
  89 + self.revocBtn.enabled = revoc;
  90 + self.recoveBtn.enabled = recover;
  91 + self.removeBtn.enabled = remove;
  92 +}
  93 +#pragma mark - Getting
  94 +- (UILabel *)widthLabel
  95 +{
  96 + if (!_widthLabel) {
  97 + _widthLabel = [[UILabel alloc] init];
  98 + _widthLabel.textColor = RGB(51, 51, 51);
  99 + _widthLabel.textAlignment = NSTextAlignmentLeft;
  100 + _widthLabel.font = UIFontCNMake(14);
  101 + _widthLabel.text = @"画笔粗细";
  102 + }
  103 + return _widthLabel;
  104 +}
  105 +- (QMUISlider *)slider
  106 +{
  107 + if (!_slider) {
  108 + _slider = [[QMUISlider alloc] init];
  109 + _slider.userInteractionEnabled = YES;
  110 + _slider.minimumValue = 1.0;
  111 + _slider.maximumValue = 20.0;
  112 + _slider.trackHeight = 3;
  113 + _slider.thumbSize = CGSizeMake(14, 14);
  114 + _slider.thumbColor = RGB(238, 138, 83);
  115 + [_slider setMinimumTrackTintColor:RGB(238, 138, 83)];
  116 + [_slider setMaximumTrackTintColor:RGB(238, 238, 238)];
  117 + [_slider addTarget:self action:@selector(updateProgress:) forControlEvents:UIControlEventValueChanged];
  118 + }
  119 + return _slider;
  120 +}
  121 +
  122 +-(UIButton *)revocBtn
  123 +{
  124 + if (!_revocBtn) {
  125 + _revocBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  126 + [_revocBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"draw_revocYes"] forState:UIControlStateNormal];
  127 + [_revocBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"draw_revocNo"] forState:UIControlStateDisabled];
  128 + _revocBtn.enabled = NO;
  129 + _revocBtn.tag = 1001;
  130 + [_revocBtn addTarget:self action:@selector(actionClick:) forControlEvents:UIControlEventTouchUpInside];
  131 + }
  132 + return _revocBtn;
  133 +}
  134 +-(UIButton *)recoveBtn
  135 +{
  136 + if (!_recoveBtn) {
  137 + _recoveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  138 + [_recoveBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"draw_recovYes"] forState:UIControlStateNormal];
  139 + [_recoveBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"draw_recovNo"] forState:UIControlStateDisabled];
  140 + _recoveBtn.enabled = NO;
  141 + _recoveBtn.tag = 1002;
  142 + [_recoveBtn addTarget:self action:@selector(actionClick:) forControlEvents:UIControlEventTouchUpInside];
  143 + }
  144 + return _recoveBtn;
  145 +}
  146 +- (UIButton *)removeBtn
  147 +{
  148 + if (!_removeBtn) {
  149 + _removeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  150 + [_removeBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"draw_removeYes"] forState:UIControlStateNormal];
  151 + [_removeBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"draw_removeNo"] forState:UIControlStateDisabled];
  152 + _removeBtn.enabled = NO;
  153 + _removeBtn.tag = 1003;
  154 + [_removeBtn addTarget:self action:@selector(actionClick:) forControlEvents:UIControlEventTouchUpInside];
  155 + }
  156 + return _removeBtn;
  157 +}
  158 +-(UIButton *)saveBtn
  159 +{
  160 + if (!_saveBtn) {
  161 + _saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  162 + [_saveBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"draw_save"] forState:UIControlStateNormal];
  163 + _saveBtn.tag = 1004;
  164 + [_saveBtn addTarget:self action:@selector(actionClick:) forControlEvents:UIControlEventTouchUpInside];
  165 + }
  166 + return _saveBtn;
  167 +}
  168 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNClipAreaLayer.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNClipAreaLayer.h
  1 +//
  2 +// CNClipAreaLayer.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <QuartzCore/QuartzCore.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +
  14 +@interface CNClipAreaLayer : CAShapeLayer
  15 +@property(assign, nonatomic) NSInteger cropAreaLeft;
  16 +@property(assign, nonatomic) NSInteger cropAreaTop;
  17 +@property(assign, nonatomic) NSInteger cropAreaRight;
  18 +@property(assign, nonatomic) NSInteger cropAreaBottom;
  19 +
  20 +//滑动线框时,及时改变位置
  21 +- (void)setCropAreaLeft:(NSInteger)cropAreaLeft CropAreaTop:(NSInteger)cropAreaTop CropAreaRight:(NSInteger)cropAreaRight CropAreaBottom:(NSInteger)cropAreaBottom;
  22 +@end
  23 +
  24 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNClipAreaLayer.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNClipAreaLayer.m
  1 +//
  2 +// CNClipAreaLayer.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNClipAreaLayer.h"
  10 +
  11 +
  12 +@implementation CNClipAreaLayer
  13 +- (instancetype)init
  14 +{
  15 + if (self = [super init]) {
  16 + _cropAreaLeft = 50;
  17 + _cropAreaTop = 50;
  18 + _cropAreaRight = kScreenWidth -self.cropAreaLeft;
  19 + _cropAreaBottom = 400;
  20 + }
  21 + return self;
  22 +}
  23 +
  24 +-(void)drawInContext:(CGContextRef)ctx
  25 +{
  26 + UIGraphicsPushContext(ctx);
  27 + //四个角四个线用一下方法实现
  28 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  29 + CGContextSetLineWidth(ctx, 1);
  30 + CGContextMoveToPoint(ctx, self.cropAreaLeft, self.cropAreaTop);
  31 + CGContextAddLineToPoint(ctx, self.cropAreaLeft, self.cropAreaBottom);
  32 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  33 + CGContextStrokePath(ctx);
  34 +
  35 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  36 + CGContextSetLineWidth(ctx, 1);
  37 + CGContextMoveToPoint(ctx, self.cropAreaLeft, self.cropAreaTop);
  38 + CGContextAddLineToPoint(ctx, self.cropAreaRight, self.cropAreaTop);
  39 + CGContextSetShadow(ctx, CGSizeMake(0, 2), 2.0);
  40 + CGContextStrokePath(ctx);
  41 +
  42 + CGContextSetStrokeColorWithColor(ctx, kWhiteColor.CGColor);
  43 + CGContextSetLineWidth(ctx, 1);
  44 + CGContextMoveToPoint(ctx, self.cropAreaRight, self.cropAreaTop);
  45 + CGContextAddLineToPoint(ctx, self.cropAreaRight, self.cropAreaBottom);
  46 + CGContextSetShadow(ctx, CGSizeMake(-2, 0), 2.0);
  47 + CGContextStrokePath(ctx);
  48 +
  49 + CGContextSetStrokeColorWithColor(ctx, kWhiteColor.CGColor);
  50 + CGContextSetLineWidth(ctx, 1);
  51 + CGContextMoveToPoint(ctx, self.cropAreaRight, self.cropAreaBottom);
  52 + CGContextAddLineToPoint(ctx, self.cropAreaLeft, self.cropAreaBottom);
  53 + CGContextSetShadow(ctx, CGSizeMake(0, -2), 2.0);
  54 + CGContextStrokePath(ctx);
  55 +
  56 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  57 + CGContextSetLineWidth(ctx, 10);
  58 + CGContextMoveToPoint(ctx, self.cropAreaLeft, self.cropAreaTop);
  59 + CGContextAddLineToPoint(ctx, self.cropAreaLeft,self.cropAreaTop + 15);
  60 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  61 + CGContextStrokePath(ctx);
  62 +
  63 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  64 + CGContextSetLineWidth(ctx, 10);
  65 + CGContextMoveToPoint(ctx, self.cropAreaLeft, self.cropAreaTop);
  66 + CGContextAddLineToPoint(ctx, self.cropAreaLeft + 15, self.cropAreaTop);
  67 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  68 + CGContextStrokePath(ctx);
  69 +
  70 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  71 + CGContextSetLineWidth(ctx, 10);
  72 + CGContextMoveToPoint(ctx, self.cropAreaRight, self.cropAreaTop);
  73 + CGContextAddLineToPoint(ctx, self.cropAreaRight - 15, self.cropAreaTop);
  74 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  75 + CGContextStrokePath(ctx);
  76 +
  77 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  78 + CGContextSetLineWidth(ctx, 10);
  79 + CGContextMoveToPoint(ctx, self.cropAreaRight, self.cropAreaTop);
  80 + CGContextAddLineToPoint(ctx, self.cropAreaRight, self.cropAreaTop + 15);
  81 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  82 + CGContextStrokePath(ctx);
  83 +
  84 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  85 + CGContextSetLineWidth(ctx, 10);
  86 + CGContextMoveToPoint(ctx, self.cropAreaLeft, self.cropAreaBottom);
  87 + CGContextAddLineToPoint(ctx, self.cropAreaLeft + 15, self.cropAreaBottom);
  88 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  89 + CGContextStrokePath(ctx);
  90 +
  91 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  92 + CGContextSetLineWidth(ctx, 10);
  93 + CGContextMoveToPoint(ctx, self.cropAreaLeft, self.cropAreaBottom);
  94 + CGContextAddLineToPoint(ctx, self.cropAreaLeft, self.cropAreaBottom -15);
  95 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  96 + CGContextStrokePath(ctx);
  97 +
  98 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  99 + CGContextSetLineWidth(ctx, 10);
  100 + CGContextMoveToPoint(ctx, self.cropAreaRight, self.cropAreaBottom);
  101 + CGContextAddLineToPoint(ctx, self.cropAreaRight, self.cropAreaBottom - 15);
  102 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  103 + CGContextStrokePath(ctx);
  104 +
  105 + CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
  106 + CGContextSetLineWidth(ctx, 10);
  107 + CGContextMoveToPoint(ctx, self.cropAreaRight, self.cropAreaBottom);
  108 + CGContextAddLineToPoint(ctx, self.cropAreaRight - 15, self.cropAreaBottom);
  109 + CGContextSetShadow(ctx, CGSizeMake(2,0), 2.0);
  110 + CGContextStrokePath(ctx);
  111 +
  112 + UIGraphicsPopContext();
  113 +}
  114 +
  115 +-(void)setCropAreaTop:(NSInteger)cropAreaTop
  116 +{
  117 + _cropAreaTop = cropAreaTop;
  118 + [self setNeedsDisplay];
  119 +}
  120 +-(void)setCropAreaLeft:(NSInteger)cropAreaLeft
  121 +{
  122 + _cropAreaLeft = cropAreaLeft;
  123 + [self setNeedsDisplay];
  124 +}
  125 +
  126 +-(void)setCropAreaRight:(NSInteger)cropAreaRight
  127 +{
  128 + _cropAreaRight = cropAreaRight;
  129 + [self setNeedsDisplay];
  130 +}
  131 +- (void)setCropAreaBottom:(NSInteger)cropAreaBottom
  132 +{
  133 + _cropAreaBottom = cropAreaBottom;
  134 + [self setNeedsDisplay];
  135 +}
  136 +
  137 +-(void)setCropAreaLeft:(NSInteger)cropAreaLeft CropAreaTop:(NSInteger)cropAreaTop CropAreaRight:(NSInteger)cropAreaRight CropAreaBottom:(NSInteger)cropAreaBottom{
  138 + _cropAreaLeft = cropAreaLeft;
  139 + _cropAreaRight = cropAreaRight;
  140 + _cropAreaTop = cropAreaTop;
  141 + _cropAreaBottom = cropAreaBottom;
  142 + [self setNeedsDisplay];
  143 +}
  144 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNImageTailorView.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNImageTailorView.h
  1 +//
  2 +// CNImageTailorView.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNImageTailorView : UIView
  14 +@property (nonatomic, assign) CGRect imageCropFrame;
  15 +/**
  16 + *image:待剪切图片
  17 + */
  18 +-(instancetype)initWithFrame:(CGRect)frame withImage:(UIImage *)image;
  19 +@end
  20 +
  21 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNImageTailorView.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNImageTailorView.m
  1 +//
  2 +// CNImageTailorView.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNImageTailorView.h"
  10 +#import "CNClipAreaLayer.h"
  11 +#import "CNYPanGestureRecognizer.h"
  12 +
  13 +//滑动位置与名字相同
  14 +typedef NS_ENUM(NSInteger, ACTIVEGESTUREVIEW) {
  15 + CROPVIEWLEFT,
  16 + CROPVIEWRIGHT,
  17 + CROPVIEWTOP,
  18 + CROPVIEWBOTTOM,
  19 + CROPVIEWLEFTTOP,//左上角,一下为角
  20 + CROPVIEWLEFTBOTTOM,
  21 + CROPVIEWRIGHTTOP,
  22 + CROPVIEWRIGHTBOTTOM,
  23 + BIGIMAGEVIEW //整框滑动
  24 +};
  25 +
  26 +@interface CNImageTailorView ()
  27 +{
  28 + UIImage *_pcImage;
  29 + CGFloat tempWidth,tempHeight;
  30 + CGFloat scale;
  31 +}
  32 +
  33 +@property (nonatomic, strong)UIImageView *imageView;
  34 +@property (nonatomic, strong)UIView*cropView;
  35 +@property (assign, nonatomic) ACTIVEGESTUREVIEW activeGestureView;
  36 +@property (nonatomic , strong) UILabel *tipLabel;
  37 +@property(assign, nonatomic) CGFloat cropAreaX;
  38 +@property(assign, nonatomic) CGFloat cropAreaWidth;
  39 +@property(assign, nonatomic) CGFloat cropAreaY;
  40 +@property(assign, nonatomic) CGFloat cropAreaHeight;
  41 +@end
  42 +
  43 +@implementation CNImageTailorView
  44 +-(instancetype)initWithFrame:(CGRect)frame withImage:(UIImage *)image
  45 +{
  46 + if (self = [super initWithFrame:frame]) {
  47 + _pcImage = image;
  48 + if (_pcImage.size.width/self.width <= _pcImage.size.height / self.height) {
  49 + tempHeight = self.height;
  50 + tempWidth = (_pcImage.size.width/ _pcImage.size.height) *tempHeight;
  51 + }else
  52 + {
  53 + tempWidth = self.width;
  54 + tempHeight = (_pcImage.size.height / _pcImage.size.width) *tempWidth;
  55 +
  56 + }
  57 + [self addSubview:self.imageView];
  58 + [self addSubview:self.cropView];
  59 + [self addSubview:self.tipLabel];
  60 + self.cropAreaX = _imageView.left;
  61 + self.cropAreaY = _imageView.top;
  62 + self.cropAreaWidth = _imageView.width;
  63 + self.cropAreaHeight = tempHeight;
  64 + scale =_pcImage.size.width/self.cropAreaWidth;
  65 + }
  66 + return self;
  67 +}
  68 +-(void)layoutSubviews
  69 +{
  70 + [super layoutSubviews];
  71 + [self setUpCropLayer];
  72 +}
  73 +#pragma mark - Action
  74 +-(void)handleDynamicPanGesture:(CNYPanGestureRecognizer *)panGesture
  75 +{
  76 + self.tipLabel.hidden = YES;
  77 + CGPoint beginPoint = panGesture.beginPoint;
  78 + CGPoint movePoint = panGesture.movePoint;
  79 + CGFloat judgeWidth = 20;
  80 + //确定滑动的是line的哪个位置
  81 + if (panGesture.state == UIGestureRecognizerStateBegan) {
  82 + if (beginPoint.x >= self.cropAreaX - judgeWidth && beginPoint.x <= self.cropAreaX + judgeWidth && beginPoint.y >= self.cropAreaY - judgeWidth && beginPoint.y <= self.cropAreaY + judgeWidth)
  83 + {
  84 + self.activeGestureView = CROPVIEWLEFTTOP;
  85 + }
  86 + else if (beginPoint.x >= self.cropAreaX - judgeWidth && beginPoint.x <= self.cropAreaX + judgeWidth &&beginPoint.y >= self.cropAreaY + self.cropAreaHeight - judgeWidth && beginPoint.y <= self.cropAreaY + self.cropAreaHeight + judgeWidth){
  87 + self.activeGestureView = CROPVIEWLEFTBOTTOM;
  88 + }
  89 + else if (beginPoint.x >= self.cropAreaX + self.cropAreaWidth - judgeWidth && beginPoint.x <= self.cropAreaX + self.cropAreaWidth + judgeWidth && beginPoint.y >= self.cropAreaY && beginPoint.y >= self.cropAreaY - judgeWidth && beginPoint.y <= self.cropAreaY + judgeWidth){
  90 + self.activeGestureView = CROPVIEWRIGHTTOP;
  91 + }else if (beginPoint.x >= self.cropAreaX + self.cropAreaWidth - judgeWidth && beginPoint.x <= self.cropAreaX + self.cropAreaWidth + judgeWidth && beginPoint.y >= self.cropAreaY + self.cropAreaHeight - judgeWidth && beginPoint.y <= self.cropAreaY + self.cropAreaHeight + judgeWidth){
  92 + self.activeGestureView = CROPVIEWRIGHTBOTTOM;
  93 + }
  94 + else if (beginPoint.x >= self.cropAreaX - judgeWidth && beginPoint.x <= self.cropAreaX + judgeWidth && beginPoint.y >= self.cropAreaY && beginPoint.y <= self.cropAreaY + self.cropAreaHeight && self.cropAreaWidth >= 50) {
  95 + self.activeGestureView = CROPVIEWLEFT;
  96 + } else if (beginPoint.x >= self.cropAreaX + self.cropAreaWidth - judgeWidth && beginPoint.x <= self.cropAreaX + self.cropAreaWidth + judgeWidth && beginPoint.y >= self.cropAreaY && beginPoint.y <= self.cropAreaY + self.cropAreaHeight && self.cropAreaWidth >= 50) {
  97 + self.activeGestureView = CROPVIEWRIGHT;
  98 + } else if (beginPoint.y >= self.cropAreaY - judgeWidth && beginPoint.y <= self.cropAreaY + judgeWidth && beginPoint.x >= self.cropAreaX && beginPoint.x <= self.cropAreaX + self.cropAreaWidth && self.cropAreaHeight >= 50) {
  99 + self.activeGestureView = CROPVIEWTOP;
  100 + } else if (beginPoint.y >= self.cropAreaY + self.cropAreaHeight - judgeWidth && beginPoint.y <= self.cropAreaY + self.cropAreaHeight + judgeWidth && beginPoint.x >= self.cropAreaX && beginPoint.x <= self.cropAreaX + self.cropAreaWidth && self.cropAreaHeight >= 50) {
  101 + self.activeGestureView = CROPVIEWBOTTOM;
  102 + }
  103 + else {
  104 + self.activeGestureView = BIGIMAGEVIEW;
  105 + }
  106 + }
  107 +
  108 + // 滑动过程中进行位置改变
  109 + if (panGesture.state == UIGestureRecognizerStateChanged) {
  110 + CGFloat diff = 0;
  111 + CGFloat diffY = 0;
  112 + switch (self.activeGestureView) {
  113 + case CROPVIEWLEFT: {
  114 + diff = movePoint.x - self.cropAreaX;
  115 + if (diff >= 0 && self.cropAreaWidth > 50) {
  116 + self.cropAreaWidth -= diff;
  117 + self.cropAreaX += diff;
  118 + } else if (diff < 0 && self.cropAreaX > self.imageView.frame.origin.x && self.cropAreaX >= 0) {
  119 + self.cropAreaWidth -= diff;
  120 + self.cropAreaX += diff;
  121 + }
  122 + [self setUpCropLayer];
  123 + break;
  124 + }
  125 + case CROPVIEWRIGHT: {
  126 + diff = movePoint.x - self.cropAreaX - self.cropAreaWidth;
  127 + if (diff >= 0 && (self.cropAreaX + self.cropAreaWidth) < MIN(self.imageView.frame.origin.x + self.imageView.frame.size.width, self.cropView.frame.origin.x + self.cropView.frame.size.width)){
  128 + self.cropAreaWidth += diff;
  129 + } else if (diff < 0 && self.cropAreaWidth >= 50) {
  130 + self.cropAreaWidth += diff;
  131 + }
  132 + [self setUpCropLayer];
  133 + break;
  134 + }
  135 + case CROPVIEWTOP: {
  136 + diff = movePoint.y - self.cropAreaY;
  137 + if (diff >= 0 && self.cropAreaHeight > 50) {
  138 + self.cropAreaHeight -= diff;
  139 + self.cropAreaY += diff;
  140 + } else if (diff < 0 && self.cropAreaY > self.imageView.frame.origin.y && self.cropAreaY >= 0) {
  141 + self.cropAreaHeight -= diff;
  142 + self.cropAreaY += diff;
  143 + }
  144 + [self setUpCropLayer];
  145 + break;
  146 + }
  147 + case CROPVIEWBOTTOM: {
  148 + diff = movePoint.y - self.cropAreaY - self.cropAreaHeight;
  149 + if (diff >= 0 && (self.cropAreaY + self.cropAreaHeight) < MIN(self.imageView.frame.origin.y + self.imageView.frame.size.height, self.cropView.frame.origin.y + self.cropView.frame.size.height)){
  150 + self.cropAreaHeight += diff;
  151 + } else if (diff < 0 && self.cropAreaHeight >= 50) {
  152 + self.cropAreaHeight += diff;
  153 + }
  154 + [self setUpCropLayer];
  155 + break;
  156 + }
  157 + case CROPVIEWLEFTTOP: {
  158 + diff = movePoint.x - self.cropAreaX;
  159 + diffY = movePoint.y - self.cropAreaY;
  160 + if(self.cropAreaX>=_imageView.left&&self.cropAreaX+self.cropAreaWidth<=_imageView.right) {
  161 + self.cropAreaWidth -= diff;
  162 + self.cropAreaX += diff;
  163 + }
  164 + if (self.cropAreaY>=_imageView.top && self.cropAreaY+ self.cropAreaHeight<=_imageView.bottom)
  165 + {
  166 + self.cropAreaHeight -= diffY;
  167 + self.cropAreaY += diffY;
  168 + }
  169 +
  170 + [self setUpCropLayer];
  171 + break;
  172 + }
  173 + case CROPVIEWLEFTBOTTOM: {
  174 + diff = movePoint.x - self.cropAreaX;
  175 + diffY = movePoint.y - self.cropAreaY - self.cropAreaHeight;
  176 + if(self.cropAreaX>=_imageView.left&&self.cropAreaX+self.cropAreaWidth<=_imageView.right) {
  177 + self.cropAreaWidth -= diff;
  178 + self.cropAreaX += diff;
  179 + }
  180 + if (self.cropAreaY>=_imageView.top && self.cropAreaY+ self.cropAreaHeight<=_imageView.bottom)
  181 + {
  182 + self.cropAreaHeight += diffY;
  183 + }
  184 +
  185 + [self setUpCropLayer];
  186 + break;
  187 + }
  188 + case CROPVIEWRIGHTTOP: {
  189 + diff = movePoint.x - self.cropAreaX - self.cropAreaWidth;
  190 + diffY = movePoint.y - self.cropAreaY;
  191 + if(self.cropAreaX>=_imageView.left&&self.cropAreaX+self.cropAreaWidth<=_imageView.right) {
  192 + self.cropAreaWidth += diff;
  193 + }
  194 + if (self.cropAreaY>=_imageView.top && self.cropAreaY+ self.cropAreaHeight<=_imageView.bottom)
  195 + {
  196 + self.cropAreaHeight -= diffY;
  197 + self.cropAreaY += diffY;
  198 + }
  199 +
  200 + [self setUpCropLayer];
  201 + break;
  202 + }
  203 + case CROPVIEWRIGHTBOTTOM: {
  204 + diff = movePoint.x - self.cropAreaX - self.cropAreaWidth;
  205 + diffY = movePoint.y - self.cropAreaY - self.cropAreaHeight;
  206 + if(self.cropAreaX>=_imageView.left&&self.cropAreaX+self.cropAreaWidth<=_imageView.right) {
  207 + self.cropAreaWidth += diff;
  208 + }
  209 + if (self.cropAreaY>=_imageView.top && self.cropAreaY+ self.cropAreaHeight<=_imageView.bottom)
  210 + {
  211 + self.cropAreaHeight += diffY;
  212 + }
  213 +
  214 + [self setUpCropLayer];
  215 + break;
  216 + }
  217 + case BIGIMAGEVIEW: {
  218 + diff = movePoint.x - self.cropAreaX- self.cropAreaWidth/2;
  219 + diffY = movePoint.y - self.cropAreaY - self.cropAreaHeight/2;
  220 + if(self.cropAreaX>=_imageView.left&&self.cropAreaX+self.cropAreaWidth<=_imageView.right) {
  221 + self.cropAreaX += diff;
  222 + }
  223 + if (self.cropAreaY>=_imageView.top && self.cropAreaY+ self.cropAreaHeight<=_imageView.bottom)
  224 + {
  225 + self.cropAreaY += diffY;
  226 + }
  227 +
  228 + [self setUpCropLayer];
  229 + break;
  230 + }
  231 + default:
  232 + break;
  233 + }
  234 + }
  235 +
  236 + // 滑动结束后进行位置修正
  237 + if (panGesture.state == UIGestureRecognizerStateEnded) {
  238 + switch (self.activeGestureView) {
  239 + case CROPVIEWLEFT: {
  240 + if (self.cropAreaWidth < 50) {
  241 + self.cropAreaX -= 50 - self.cropAreaWidth;
  242 + self.cropAreaWidth = 50;
  243 + }
  244 + if (self.cropAreaX < MAX(self.imageView.frame.origin.x, 0)) {
  245 + CGFloat temp = self.cropAreaX + self.cropAreaWidth;
  246 + self.cropAreaX = MAX(self.imageView.frame.origin.x, 0);
  247 + self.cropAreaWidth = temp - self.cropAreaX;
  248 + }
  249 + [self setUpCropLayer];
  250 + break;
  251 + }
  252 + case CROPVIEWRIGHT: {
  253 + if (self.cropAreaWidth < 50) {
  254 + self.cropAreaWidth = 50;
  255 + }
  256 + if (self.cropAreaX + self.cropAreaWidth > MIN(self.imageView.frame.origin.x + self.imageView.frame.size.width, self.cropView.frame.origin.x + self.cropView.frame.size.width)) {
  257 + self.cropAreaWidth = MIN(self.imageView.frame.origin.x + self.imageView.frame.size.width, self.cropView.frame.origin.x + self.cropView.frame.size.width) - self.cropAreaX;
  258 + }
  259 + [self setUpCropLayer];
  260 + break;
  261 + }
  262 + case CROPVIEWTOP: {
  263 + if (self.cropAreaHeight < 50) {
  264 + self.cropAreaY -= 50 - self.cropAreaHeight;
  265 + self.cropAreaHeight = 50;
  266 + }
  267 + if (self.cropAreaY < MAX(self.imageView.frame.origin.y, 0)) {
  268 + CGFloat temp = self.cropAreaY + self.cropAreaHeight;
  269 + self.cropAreaY = MAX(self.imageView.frame.origin.y, 0);
  270 + self.cropAreaHeight = temp - self.cropAreaY;
  271 + }
  272 + [self setUpCropLayer];
  273 + break;
  274 + }
  275 + case CROPVIEWBOTTOM: {
  276 + if (self.cropAreaHeight < 50) {
  277 + self.cropAreaHeight = 50;
  278 + }
  279 + if (self.cropAreaY + self.cropAreaHeight > MIN(self.imageView.frame.origin.y + self.imageView.frame.size.height, self.cropView.frame.origin.y + self.cropView.frame.size.height)) {
  280 + self.cropAreaHeight = MIN(self.imageView.frame.origin.y + self.imageView.frame.size.height, self.cropView.frame.origin.y + self.cropView.frame.size.height) - self.cropAreaY;
  281 + }
  282 + [self setUpCropLayer];
  283 + break;
  284 + }
  285 + case CROPVIEWLEFTTOP: {
  286 + if (self.cropAreaWidth < 50) {
  287 + self.cropAreaX -= 50 - self.cropAreaWidth;
  288 + self.cropAreaWidth = 50;
  289 + }
  290 + if (self.cropAreaX < MAX(self.imageView.frame.origin.x, 0)) {
  291 + CGFloat temp = self.cropAreaX + self.cropAreaWidth;
  292 + self.cropAreaX = MAX(self.imageView.frame.origin.x, 0);
  293 + self.cropAreaWidth = temp - self.cropAreaX;
  294 + }
  295 + if (self.cropAreaHeight < 50) {
  296 + self.cropAreaY -= 50 - self.cropAreaHeight;
  297 + self.cropAreaHeight = 50;
  298 + }
  299 + if (self.cropAreaY < MAX(self.imageView.frame.origin.y, 0)) {
  300 + CGFloat temp = self.cropAreaY + self.cropAreaHeight;
  301 + self.cropAreaY = MAX(self.imageView.frame.origin.y, 0);
  302 + self.cropAreaHeight = temp - self.cropAreaY;
  303 + }
  304 + [self setUpCropLayer];
  305 + break;
  306 + }
  307 + case CROPVIEWLEFTBOTTOM: {
  308 + if (self.cropAreaWidth < 50) {
  309 + self.cropAreaX -= 50 - self.cropAreaWidth;
  310 + self.cropAreaWidth = 50;
  311 + }
  312 + if (self.cropAreaX < MAX(self.imageView.frame.origin.x, 0)) {
  313 + CGFloat temp = self.cropAreaX + self.cropAreaWidth;
  314 + self.cropAreaX = MAX(self.imageView.frame.origin.x, 0);
  315 + self.cropAreaWidth = temp - self.cropAreaX;
  316 + }
  317 + if (self.cropAreaHeight < 50) {
  318 + self.cropAreaHeight = 50;
  319 + }
  320 + if (self.cropAreaY + self.cropAreaHeight > MIN(self.imageView.frame.origin.y + self.imageView.frame.size.height, self.cropView.frame.origin.y + self.cropView.frame.size.height)) {
  321 + self.cropAreaHeight = MIN(self.imageView.frame.origin.y + self.imageView.frame.size.height, self.cropView.frame.origin.y + self.cropView.frame.size.height) - self.cropAreaY;
  322 + }
  323 + [self setUpCropLayer];
  324 + break;
  325 + }
  326 + case CROPVIEWRIGHTTOP: {
  327 + if (self.cropAreaWidth < 50) {
  328 + self.cropAreaWidth = 50;
  329 + }
  330 + if (self.cropAreaX + self.cropAreaWidth > MIN(self.imageView.frame.origin.x + self.imageView.frame.size.width, self.cropView.frame.origin.x + self.cropView.frame.size.width)) {
  331 + self.cropAreaWidth = MIN(self.imageView.frame.origin.x + self.imageView.frame.size.width, self.cropView.frame.origin.x + self.cropView.frame.size.width) - self.cropAreaX;
  332 + }
  333 + if (self.cropAreaHeight < 50) {
  334 + self.cropAreaY -= 50 - self.cropAreaHeight;
  335 + self.cropAreaHeight = 50;
  336 + }
  337 + if (self.cropAreaY < MAX(self.imageView.frame.origin.y, 0)) {
  338 + CGFloat temp = self.cropAreaY + self.cropAreaHeight;
  339 + self.cropAreaY = MAX(self.imageView.frame.origin.y, 0);
  340 + self.cropAreaHeight = temp - self.cropAreaY;
  341 + }
  342 + [self setUpCropLayer];
  343 + break;
  344 + }
  345 + case CROPVIEWRIGHTBOTTOM: {
  346 + if (self.cropAreaWidth < 50) {
  347 + self.cropAreaWidth = 50;
  348 + }
  349 + if (self.cropAreaX + self.cropAreaWidth > MIN(self.imageView.frame.origin.x + self.imageView.frame.size.width, self.cropView.frame.origin.x + self.cropView.frame.size.width)) {
  350 + self.cropAreaWidth = MIN(self.imageView.frame.origin.x + self.imageView.frame.size.width, self.cropView.frame.origin.x + self.cropView.frame.size.width) - self.cropAreaX;
  351 + }
  352 + if (self.cropAreaHeight < 50) {
  353 + self.cropAreaHeight = 50;
  354 + }
  355 + if (self.cropAreaY + self.cropAreaHeight > MIN(self.imageView.frame.origin.y + self.imageView.frame.size.height, self.cropView.frame.origin.y + self.cropView.frame.size.height - 15)) {
  356 + self.cropAreaHeight = MIN(self.imageView.frame.origin.y + self.imageView.frame.size.height, self.cropView.frame.origin.y + self.cropView.frame.size.height - 15) - self.cropAreaY;
  357 + }
  358 + [self setUpCropLayer];
  359 + break;
  360 + }
  361 + case BIGIMAGEVIEW: {
  362 + if (self.cropAreaX<_imageView.left) {
  363 + self.cropAreaX = _imageView.left;
  364 + }
  365 + if (self.cropAreaY<_imageView.top) {
  366 + self.cropAreaY = _imageView.top;
  367 + }
  368 + if (self.cropAreaX+self.cropAreaWidth>_imageView.right) {
  369 + self.cropAreaX = _imageView.right-self.cropAreaWidth;
  370 + }
  371 + if (self.cropAreaY+self.cropAreaHeight>_imageView.bottom) {
  372 + self.cropAreaY = _imageView.bottom-self.cropAreaHeight;
  373 + }
  374 + [self setUpCropLayer];
  375 + break;
  376 + }
  377 + default:
  378 + break;
  379 + }
  380 + }
  381 +}
  382 +
  383 +//滑动是随时变化阴影图片截切大小
  384 +-(void)setUpCropLayer
  385 +{
  386 + _cropView.layer.sublayers = nil;
  387 + CNClipAreaLayer *layer = [[CNClipAreaLayer alloc] init];
  388 + CGRect cropFrame = CGRectMake(self.cropAreaX, self.cropAreaY, self.cropAreaWidth, self.cropAreaHeight);
  389 + _imageCropFrame = CGRectMake((self.cropAreaX-_imageView.left)* scale, (self.cropAreaY - _imageView.top)*scale, self.cropAreaWidth*scale, self.cropAreaHeight*scale);
  390 + UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:_cropView.frame cornerRadius:0];
  391 + UIBezierPath * cropPath = [UIBezierPath bezierPathWithRect:cropFrame];
  392 + [path appendPath:cropPath];
  393 + layer.path = path.CGPath;
  394 +
  395 + layer.fillRule = kCAFillRuleEvenOdd;
  396 + layer.fillColor = [[UIColor blackColor] CGColor];
  397 + layer.opacity = 0.5;
  398 +
  399 + layer.frame = _cropView.bounds;
  400 + [layer setCropAreaLeft:self.cropAreaX CropAreaTop:self.cropAreaY CropAreaRight:self.cropAreaWidth + self.cropAreaX CropAreaBottom:self.cropAreaY + self.cropAreaHeight];
  401 + [_cropView.layer addSublayer:layer];
  402 + [self bringSubviewToFront:_cropView];
  403 +}
  404 +#pragma mark - Getting
  405 +- (UIImageView *)imageView
  406 +{
  407 + if (!_imageView) {
  408 + _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, tempWidth, tempHeight)];
  409 + _imageView.center = CGPointMake(self.width/2, self.height/2);
  410 + _imageView.contentMode = UIViewContentModeScaleAspectFit;
  411 + [_imageView setImage:_pcImage];
  412 + }
  413 + return _imageView;
  414 +}
  415 +-(UILabel *)tipLabel
  416 +{
  417 + if (!_tipLabel) {
  418 + _tipLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CNScaleH(60), kScreenWidth, 20*RATIO)];
  419 + _tipLabel.textAlignment = NSTextAlignmentCenter;
  420 + _tipLabel.font = UIFontCNMake(14);
  421 + _tipLabel.textColor = kWhiteColor;
  422 + _tipLabel.text = @"按住选框边角,拖动屏幕裁剪";
  423 + }
  424 + return _tipLabel;
  425 +}
  426 +-(UIView *)cropView
  427 +{
  428 + if (!_cropView) {
  429 + _cropView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
  430 + CNYPanGestureRecognizer *pan = [[CNYPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleDynamicPanGesture:) inview:_cropView];
  431 + [_cropView addGestureRecognizer:pan];
  432 + }
  433 + return _cropView;
  434 +}
  435 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNYPanGestureRecognizer.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNYPanGestureRecognizer.h
  1 +//
  2 +// CNPanGestureRecognizer.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNYPanGestureRecognizer : UIPanGestureRecognizer
  14 +@property(assign, nonatomic) CGPoint beginPoint;
  15 +@property(assign, nonatomic) CGPoint movePoint;
  16 +
  17 +-(instancetype)initWithTarget:(id)target action:(SEL)action inview:(UIView*)view;
  18 +@end
  19 +
  20 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNYPanGestureRecognizer.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/ImageTailor/CNYPanGestureRecognizer.m
  1 +//
  2 +// CNPanGestureRecognizer.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/13.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNYPanGestureRecognizer.h"
  10 +
  11 +@interface CNYPanGestureRecognizer()
  12 +@property(strong, nonatomic) UIView *targetView;
  13 +@end
  14 +
  15 +@implementation CNYPanGestureRecognizer
  16 +-(instancetype)initWithTarget:(id)target action:(SEL)action inview:(UIView*)view{
  17 +
  18 + self = [super initWithTarget:target action:action];
  19 + if(self) {
  20 + self.targetView = view;
  21 + }
  22 + return self;
  23 +}
  24 +
  25 +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event{
  26 +
  27 + [super touchesBegan:touches withEvent:event];
  28 + UITouch *touch = [touches anyObject];
  29 + self.beginPoint = [touch locationInView:self.targetView];
  30 +}
  31 +
  32 +- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
  33 +{
  34 + [super touchesMoved:touches withEvent:event];
  35 + UITouch *touch = [touches anyObject];
  36 + self.movePoint = [touch locationInView:self.targetView];
  37 +}
  38 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/RepairAlertView/CNRepairAlertView.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/RepairAlertView/CNRepairAlertView.h
  1 +//
  2 +// CNRepairAlertView.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/14.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +static NSString *notShowTipView = @"notShowTipView";
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +typedef void(^CancelBlock)(void);
  14 +@interface CNRepairAlertView : UIView
  15 +
  16 +@property (nonatomic, strong)NSString *titleName;
  17 +@property (nonatomic, copy) CancelBlock cancelBlock;
  18 +/**
  19 + *一下为类工厂方法组装的弹窗view,所有按钮都在白色View上
  20 + */
  21 ++(CNRepairAlertView *)setUpShowRepairViewImage:(NSString *)imageStr
  22 + title:(NSString *)title
  23 + message:(NSString *)message
  24 + cancelname:(NSString *)cancelname
  25 + cancelBlock:(void(^)(BOOL succeed))cancelBlock;
  26 +
  27 ++(CNRepairAlertView *)setUpShowRepairFailedImage:(NSString *)imageStr
  28 + title:(NSString *)title
  29 + cancelname:(NSString *)cancelname
  30 + sureName:(NSString *)sureName
  31 + RequestBlock:(void(^)(void))requestBlock;
  32 +
  33 ++(CNRepairAlertView *)setUpShowRepairSucceedImage:(NSString *)imageStr
  34 + title:(NSString *)title;
  35 +
  36 ++(CNRepairAlertView *)setUpShowRepairTipViewForTitle:(NSString *)title
  37 + message:(NSString *)message
  38 + cancelname:(NSString *)cancelname
  39 + sureName:(NSString *)sureName
  40 + sureBlock:(void(^)(void))sureBlock;
  41 +@end
  42 +
  43 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/RepairAlertView/CNRepairAlertView.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/View/RepairAlertView/CNRepairAlertView.m
  1 +//
  2 +// CNRepairAlertView.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/14.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNRepairAlertView.h"
  10 +
  11 +@interface CNRepairAlertView()
  12 +
  13 +@property (nonatomic, strong)UIView *backView;
  14 +@property (nonatomic, strong)UIImageView *headerImage;
  15 +@property (nonatomic, strong)UILabel *titleLabel;
  16 +@property (nonatomic, strong)UILabel *messageLabel;
  17 +@property (nonatomic, strong)UIButton *cancelBtn;
  18 +@property (nonatomic, strong)UIButton *sureBtn;
  19 +@property (nonatomic, strong)UIView *lineYView;
  20 +@property (nonatomic, strong)UIView *lineXView;
  21 +@property (nonatomic, strong)UIButton *notShowBtn;
  22 +@end
  23 +@implementation CNRepairAlertView
  24 +
  25 +-(void)dealloc
  26 +{
  27 + NSLog(@"%@销毁了",[self class]);
  28 +}
  29 ++(CNRepairAlertView *)setUpShowRepairViewImage:(NSString *)imageStr
  30 + title:(NSString *)title
  31 + message:(NSString *)message
  32 + cancelname:(NSString *)cancelname
  33 + cancelBlock:(void(^)(BOOL succeed))cancelBlock
  34 +{
  35 + CNRepairAlertView *contentView = [[CNRepairAlertView alloc] initWithFrame:CGRectMake(0, 0, 245 , 292.5)];
  36 + contentView.backgroundColor = kWhiteColor;
  37 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:contentView.frame cornerRadius:12];
  38 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  39 + maskLayer.path = path.CGPath;
  40 + contentView.layer.mask = maskLayer;
  41 +
  42 + [contentView addSubview:contentView.headerImage];
  43 + [contentView addSubview:contentView.titleLabel];
  44 + [contentView addSubview:contentView.messageLabel];
  45 + [contentView addSubview:contentView.cancelBtn];
  46 +
  47 + [contentView.headerImage setImage:[CNLiveCPhotoRepairImage getImageWithNamed:imageStr]];
  48 + [contentView.headerImage mas_makeConstraints:^(MASConstraintMaker *make) {
  49 + make.top.mas_equalTo(contentView).offset(30);
  50 + make.width.offset(200);
  51 + make.height.offset(140);
  52 + make.centerX.mas_equalTo(contentView);
  53 + }];
  54 + contentView.titleLabel.text = title;
  55 + [contentView.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  56 + make.top.mas_equalTo(contentView.headerImage.mas_bottom).offset(5);
  57 + make.width.mas_equalTo(contentView.headerImage);
  58 + make.height.offset(24);
  59 + make.centerX.mas_equalTo(contentView);
  60 + }];
  61 + contentView.messageLabel.text = message;
  62 + [contentView.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  63 + make.top.mas_equalTo(contentView.titleLabel.mas_bottom).offset(5);
  64 + make.width.mas_equalTo(contentView.headerImage);
  65 + make.height.offset(18.5);
  66 + make.centerX.mas_equalTo(contentView);
  67 + }];
  68 + [contentView.cancelBtn setTitle:cancelname forState:UIControlStateNormal];
  69 + contentView.cancelBtn.layer.cornerRadius = 19.5;
  70 + contentView.cancelBtn.layer.borderWidth = 0.5;
  71 + contentView.cancelBtn.layer.borderColor = RGB(250, 112, 75).CGColor;
  72 + [contentView.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  73 + make.top.mas_equalTo(contentView.messageLabel.mas_bottom).offset(15);
  74 + make.width.offset(105);
  75 + make.height.offset(34);
  76 + make.centerX.mas_equalTo(contentView);
  77 + }];
  78 +
  79 +
  80 + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init];
  81 + modalViewController.contentView = contentView;
  82 + modalViewController.modal = YES;
  83 + [modalViewController showWithAnimated:YES completion:nil];
  84 +
  85 + __weak typeof(modalViewController) weakModalViewController = modalViewController;
  86 + __weak typeof(contentView) weakContenctView = contentView;
  87 + [contentView.cancelBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
  88 + [weakModalViewController hideWithAnimated:YES completion:^(BOOL finished) {
  89 + if (finished &&cancelBlock) {
  90 + if ([weakContenctView.titleLabel.text isEqualToString:title]) {
  91 + cancelBlock(NO);
  92 + }else{
  93 + cancelBlock(YES);
  94 + }
  95 + }
  96 + }];
  97 + }];
  98 +
  99 + contentView.cancelBlock = ^{
  100 + [weakModalViewController hideWithAnimated:YES completion:nil];
  101 + };
  102 + return contentView;
  103 +}
  104 +
  105 ++(CNRepairAlertView *)setUpShowRepairFailedImage:(NSString *)imageStr
  106 + title:(NSString *)title
  107 + cancelname:(nonnull NSString *)cancelname
  108 + sureName:(nonnull NSString *)sureName
  109 + RequestBlock:(nonnull void (^)(void))requestBlock
  110 +
  111 +{
  112 + CNRepairAlertView *contentView = [[CNRepairAlertView alloc] initWithFrame:CGRectMake(0, 0, 245 , 224)];
  113 + contentView.backgroundColor = kWhiteColor;
  114 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:contentView.frame cornerRadius:12];
  115 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  116 + maskLayer.path = path.CGPath;
  117 + contentView.layer.mask = maskLayer;
  118 +
  119 + [contentView addSubview:contentView.headerImage];
  120 + [contentView addSubview:contentView.titleLabel];
  121 + [contentView addSubview:contentView.cancelBtn];
  122 + [contentView addSubview:contentView.sureBtn];
  123 + [contentView.headerImage setImage:[CNLiveCPhotoRepairImage getImageWithNamed:imageStr]];
  124 + [contentView.headerImage mas_makeConstraints:^(MASConstraintMaker *make) {
  125 + make.top.mas_equalTo(contentView).offset(25);
  126 + make.width.offset(90);
  127 + make.height.offset(90);
  128 + make.centerX.mas_equalTo(contentView);
  129 + }];
  130 + contentView.titleLabel.text = title;
  131 + contentView.titleLabel.textColor = RGB(68, 68, 68);
  132 + [contentView.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  133 + make.top.mas_equalTo(contentView.headerImage.mas_bottom).offset(5);
  134 + make.width.offset(200);
  135 + make.height.offset(24);
  136 + make.centerX.mas_equalTo(contentView);
  137 + }];
  138 +
  139 + [contentView.cancelBtn setTitle:cancelname forState:UIControlStateNormal];
  140 + [contentView.cancelBtn setTitleColor:RGB(116, 207, 121) forState:UIControlStateNormal];
  141 + contentView.cancelBtn.layer.cornerRadius = 19;
  142 + contentView.cancelBtn.layer.borderWidth = 0.5;
  143 + contentView.cancelBtn.layer.borderColor = RGB(116, 207, 121).CGColor;
  144 + [contentView.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  145 + make.top.mas_equalTo(contentView.titleLabel.mas_bottom).offset(20);
  146 + make.width.offset(90);
  147 + make.height.offset(35);
  148 + make.left.mas_equalTo(contentView).offset(20);
  149 + }];
  150 +
  151 + [contentView.sureBtn setTitle:sureName forState:UIControlStateNormal];
  152 + [contentView.sureBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  153 + contentView.sureBtn.layer.cornerRadius = 19;
  154 + contentView.sureBtn.backgroundColor = RGB(116, 207, 121);
  155 + [contentView.sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  156 + make.top.mas_equalTo(contentView.cancelBtn);
  157 + make.width.offset(90);
  158 + make.height.offset(35);
  159 + make.right.mas_equalTo(contentView).offset(-20);
  160 + }];
  161 +
  162 + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init];
  163 + modalViewController.contentView = contentView;
  164 + modalViewController.modal = YES;
  165 + [modalViewController showWithAnimated:YES completion:nil];
  166 +
  167 + __weak typeof(modalViewController) weakModalViewController = modalViewController;
  168 + [contentView.cancelBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
  169 + [weakModalViewController hideWithAnimated:YES completion:nil];
  170 + }];
  171 +
  172 + [contentView.sureBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
  173 + [weakModalViewController hideWithAnimated:YES completion:^(BOOL finished) {
  174 + if (finished&&requestBlock) {
  175 + requestBlock();
  176 + }
  177 + }];
  178 + }];
  179 +
  180 + contentView.cancelBlock = ^{
  181 + [weakModalViewController hideWithAnimated:YES completion:nil];
  182 + };
  183 + return contentView;
  184 +}
  185 +
  186 ++(CNRepairAlertView *)setUpShowRepairSucceedImage:(NSString *)imageStr
  187 + title:(NSString *)title
  188 +{
  189 + CNRepairAlertView *contentView = [[CNRepairAlertView alloc] initWithFrame:CGRectMake(0, 0, 245 , 177.5)];
  190 + contentView.backgroundColor = kWhiteColor;
  191 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:contentView.frame cornerRadius:12];
  192 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  193 + maskLayer.path = path.CGPath;
  194 + contentView.layer.mask = maskLayer;
  195 +
  196 + [contentView addSubview:contentView.headerImage];
  197 + [contentView addSubview:contentView.titleLabel];
  198 + [contentView.headerImage setImage:[CNLiveCPhotoRepairImage getImageWithNamed:imageStr]];
  199 + [contentView.headerImage mas_makeConstraints:^(MASConstraintMaker *make) {
  200 + make.top.mas_equalTo(contentView).offset(25);
  201 + make.width.offset(90);
  202 + make.height.offset(90);
  203 + make.centerX.mas_equalTo(contentView);
  204 + }];
  205 + contentView.titleLabel.text = title;
  206 + contentView.titleLabel.textColor = RGB(68, 68, 68);
  207 + [contentView.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  208 + make.top.mas_equalTo(contentView.headerImage.mas_bottom).offset(12.5);
  209 + make.width.offset(200);
  210 + make.height.offset(24);
  211 + make.centerX.mas_equalTo(contentView);
  212 + }];
  213 +
  214 + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init];
  215 + modalViewController.contentView = contentView;
  216 + modalViewController.modal = YES;
  217 + [modalViewController showWithAnimated:YES completion:nil];
  218 + __weak typeof(modalViewController) weakModalViewController = modalViewController;
  219 + contentView.cancelBlock = ^{
  220 + [weakModalViewController hideWithAnimated:YES completion:nil];
  221 + };
  222 + return contentView;
  223 +}
  224 ++(CNRepairAlertView *)setUpShowRepairTipViewForTitle:(NSString *)title
  225 + message:(NSString *)message
  226 + cancelname:(nonnull NSString *)cancelname
  227 + sureName:(nonnull NSString *)sureName
  228 + sureBlock:(nonnull void (^)(void))sureBlock
  229 +{
  230 + CNRepairAlertView *contentView = [[CNRepairAlertView alloc] initWithFrame:CGRectMake(0, 0, 270 , 162.5)];
  231 + contentView.backgroundColor = RGBA(252, 252, 252, 1);
  232 + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:contentView.frame cornerRadius:10];
  233 + CAShapeLayer *maskLayer = [CAShapeLayer layer];
  234 + maskLayer.path = path.CGPath;
  235 + contentView.layer.mask = maskLayer;
  236 +
  237 + [contentView addSubview:contentView.titleLabel];
  238 + [contentView addSubview:contentView.messageLabel];
  239 + [contentView addSubview:contentView.cancelBtn];
  240 + [contentView addSubview:contentView.sureBtn];
  241 + [contentView addSubview:contentView.notShowBtn];
  242 + [contentView addSubview:contentView.lineYView];
  243 + [contentView addSubview:contentView.lineXView];
  244 +
  245 + contentView.titleLabel.font = UIFontMake(18);
  246 + contentView.titleLabel.textColor = RGB(50, 45, 44);
  247 + contentView.titleLabel.numberOfLines = 0;
  248 + contentView.titleLabel.text = title;
  249 + [contentView.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  250 + make.top.equalTo(contentView).offset(25);
  251 + make.width.offset(230);
  252 + make.height.offset(25);
  253 + make.centerX.mas_equalTo(contentView);
  254 + }];
  255 + contentView.messageLabel.font = UIFontMake(18);
  256 + contentView.messageLabel.textColor = RGB(50, 45, 44);
  257 + contentView.messageLabel.numberOfLines = 0;
  258 + contentView.messageLabel.text = message;
  259 + [contentView.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  260 + make.top.equalTo(contentView.titleLabel.mas_bottom);
  261 + make.width.offset(230);
  262 + make.height.offset(25);
  263 + make.centerX.mas_equalTo(contentView);
  264 + }];
  265 +
  266 + [contentView.notShowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  267 + make.top.equalTo(contentView.messageLabel.mas_bottom).offset(10);
  268 + make.width.offset(105);
  269 + make.height.offset(20);
  270 + make.left.equalTo(contentView.titleLabel);
  271 + }];
  272 +
  273 + [contentView.lineYView mas_makeConstraints:^(MASConstraintMaker *make) {
  274 + make.top.equalTo(contentView.notShowBtn.mas_bottom).offset(15);
  275 + make.height.offset(0.5);
  276 + make.left.right.equalTo(contentView);
  277 + }];
  278 +
  279 + [contentView.lineXView mas_makeConstraints:^(MASConstraintMaker *make) {
  280 + make.top.equalTo(contentView.lineYView.mas_bottom);
  281 + make.width.offset(0.5);
  282 + make.bottom.equalTo(contentView);
  283 + make.centerX.mas_equalTo(contentView);
  284 + }];
  285 + [contentView.cancelBtn setTitle:cancelname forState:UIControlStateNormal];
  286 + [contentView.cancelBtn setTitleColor:RGB(0, 118, 255) forState:UIControlStateNormal];
  287 + contentView.cancelBtn.titleLabel.font = UIFontMake(16);
  288 + [contentView.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  289 + make.left.equalTo(contentView);
  290 + make.right.equalTo(contentView.lineXView.mas_left);
  291 + make.top.equalTo(contentView.lineXView);
  292 + make.bottom.equalTo(contentView);
  293 + }];
  294 +
  295 + [contentView.sureBtn setTitle:sureName forState:UIControlStateNormal];
  296 + [contentView.sureBtn setTitleColor:RGB(0, 118, 255) forState:UIControlStateNormal];
  297 + contentView.sureBtn.titleLabel.font = UIFontMake(16);
  298 + [contentView.sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  299 + make.left.equalTo(contentView.lineXView.mas_right);
  300 + make.right.equalTo(contentView);
  301 + make.top.equalTo(contentView.lineXView);
  302 + make.bottom.equalTo(contentView);
  303 + }];
  304 + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init];
  305 + modalViewController.contentView = contentView;
  306 + modalViewController.modal = YES;
  307 + [modalViewController showWithAnimated:YES completion:nil];
  308 +
  309 + __weak typeof(modalViewController) weakModalViewController = modalViewController;
  310 + __weak typeof(contentView) weakContenctView = contentView;
  311 + [contentView.cancelBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
  312 + [weakModalViewController hideWithAnimated:YES completion:nil];
  313 + }];
  314 +
  315 + [contentView.sureBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
  316 + if (weakContenctView.notShowBtn.isSelected) {
  317 + [[NSUserDefaults standardUserDefaults] setBool:weakContenctView.notShowBtn.isSelected forKey:notShowTipView];
  318 + }
  319 + [weakModalViewController hideWithAnimated:YES completion:^(BOOL finished) {
  320 + if (finished&&sureBlock) {
  321 + sureBlock();
  322 + }
  323 + }];
  324 + }];
  325 + return contentView;
  326 +}
  327 +
  328 +#pragma mark - Action
  329 +-(void)notShowBtnClick:(UIButton *)sender{
  330 + sender.selected = !sender.isSelected;
  331 +}
  332 +#pragma mark - Getting&&Setting
  333 +-(void)setTitleName:(NSString *)titleName
  334 +{
  335 + _titleLabel.text = titleName;
  336 +}
  337 +-(UIView *)backView
  338 +{
  339 + if (!_backView) {
  340 + _backView = [[UIView alloc] init];
  341 + _backView.backgroundColor = kWhiteColor;
  342 + }
  343 + return _backView;
  344 +}
  345 +-(UIImageView *)headerImage
  346 +{
  347 + if (!_headerImage) {
  348 + _headerImage = [[UIImageView alloc] init];
  349 + _headerImage.contentMode = UIViewContentModeScaleAspectFit;
  350 + }
  351 + return _headerImage;
  352 +}
  353 +
  354 +- (UILabel *)titleLabel
  355 +{
  356 + if (!_titleLabel) {
  357 + _titleLabel = [[UILabel alloc] init];
  358 + _titleLabel.textAlignment = NSTextAlignmentCenter;
  359 + _titleLabel.textColor = RGB(51, 51, 51);
  360 + _titleLabel.font = UIFontMake(17);
  361 + }
  362 + return _titleLabel;
  363 +}
  364 +-(UILabel *)messageLabel
  365 +{
  366 + if (!_messageLabel) {
  367 + _messageLabel = [[UILabel alloc] init];
  368 + _messageLabel.textAlignment = NSTextAlignmentCenter;
  369 + _messageLabel.textColor = RGB(153, 153, 153);
  370 + _messageLabel.font = UIFontMake(13);
  371 + }
  372 + return _messageLabel;
  373 +}
  374 +-(UIButton *)cancelBtn
  375 +{
  376 + if (!_cancelBtn) {
  377 + _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  378 + [_cancelBtn setTitleColor:RGB(250, 122, 75) forState:UIControlStateNormal];
  379 + }
  380 + return _cancelBtn;
  381 +}
  382 +-(UIButton *)sureBtn
  383 +{
  384 + if (!_sureBtn) {
  385 + _sureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  386 + }
  387 + return _sureBtn;
  388 +}
  389 +
  390 +-(UIView *)lineYView
  391 +{
  392 + if (!_lineYView) {
  393 + _lineYView = [[UIView alloc] init];
  394 + _lineYView.backgroundColor = RGB(214, 214, 214);
  395 + }
  396 + return _lineYView;
  397 +}
  398 +-(UIView *)lineXView
  399 +{
  400 + if (!_lineXView) {
  401 + _lineXView = [[UIView alloc] init];
  402 + _lineXView.backgroundColor = RGB(214, 214, 214);
  403 + }
  404 + return _lineXView;
  405 +}
  406 +
  407 +- (UIButton *)notShowBtn
  408 +{
  409 + if (!_notShowBtn) {
  410 + _notShowBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  411 + [_notShowBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"evaluate_unselect"] forState:UIControlStateNormal];
  412 + [_notShowBtn setImage:[CNLiveCPhotoRepairImage getImageWithNamed:@"evaluate_selected"] forState:UIControlStateSelected];
  413 + _notShowBtn.backgroundColor = kClearColor;
  414 + [_notShowBtn setTitle:@"下次不再提示" forState:UIControlStateNormal];
  415 + [_notShowBtn setTitleColor:RGB(102, 102, 102) forState:UIControlStateNormal];
  416 + [_notShowBtn setTitle:@"下次不再提示" forState:UIControlStateSelected];
  417 + [_notShowBtn setTitleColor:RGB(102, 102, 102) forState:UIControlStateSelected];
  418 + _notShowBtn.titleLabel.font = UIFontMake(14);
  419 + [_notShowBtn addTarget:self action:@selector(notShowBtnClick:) forControlEvents:UIControlEventTouchUpInside];
  420 + }
  421 + return _notShowBtn;
  422 +}
  423 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNPhotoRepairManager.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNPhotoRepairManager.h
  1 +//
  2 +// CNPhotoRepairManager.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/15.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface CNPhotoRepairManager : NSObject
  14 +/**
  15 + *跳转照片修复页面
  16 + */
  17 ++(void)jumpToRepairPhotoControler;
  18 +/**
  19 + *跳转修复完成页面
  20 + *contentId:页面id
  21 + *oldStr:旧照片地址
  22 + *newStr:新照片地址
  23 + */
  24 ++(void)jumpToPhotoRepairedControlerForContentId:(NSString *)contentId
  25 + oldImage:(NSString *)oldStr
  26 + newImage:(NSString *)newStr;
  27 +@end
  28 +
  29 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNPhotoRepairManager.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNPhotoRepairManager.m
  1 +//
  2 +// CNPhotoRepairManager.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/7/15.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNPhotoRepairManager.h"
  10 +#import "CNOldPhotoVideoViewController.h"
  11 +#import "CNPhoRepairViewController.h"
  12 +#import "CNRepairPhotosViewController.h"
  13 +#import "CNPhoPresent.h"
  14 +
  15 +static NSString *const ShowMovie = @"ShowMovie";
  16 +@implementation CNPhotoRepairManager
  17 ++(void)jumpToRepairPhotoControler
  18 +{
  19 + CNOldPhotoVideoViewController * oldPho = [[CNOldPhotoVideoViewController alloc] init];
  20 + [[BaseAppDelegate sharedAppDelegate] pushViewController:oldPho];
  21 +}
  22 +
  23 ++(void)jumpToPhotoRepairedControlerForContentId:(NSString *)contentId
  24 + oldImage:(NSString *)oldStr
  25 + newImage:(NSString *)newStr
  26 +{
  27 + CNRepairPhotosViewController *photos = [[CNRepairPhotosViewController alloc] init];
  28 + photos.contentId = contentId;
  29 + photos.isNotFromTailor = YES;
  30 + [[BaseAppDelegate sharedAppDelegate] pushViewController:photos];
  31 +}
  32 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNUploadManager.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNUploadManager.h
  1 +//
  2 +// CNUploadManager.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "CNPhoPresent.h"
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +
  14 +typedef void(^PushVC)(NSString *contentId);
  15 +typedef void(^PopVC)(void);
  16 +
  17 +@interface CNUploadManager : NSObject
  18 +@property (nonatomic, copy) PushVC pushBlock;
  19 +@property (nonatomic, copy) PopVC popBlock;
  20 +-(void)uploadImageManager:(UIImage *)oldImage draw:(UIImage *_Nullable)drawImage rect:(CGSize )size repairType:(CNLiveRepairType)type;
  21 +@end
  22 +
  23 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNUploadManager.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/manager/CNUploadManager.m
  1 +//
  2 +// CNUploadManager.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/9.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNUploadManager.h"
  10 +#import "CNRepairAlertView.h"
  11 +#import <YYCategories/YYCategories.h>
  12 +
  13 +@interface CNUploadManager()
  14 +{
  15 + UIImage *_pcImage, *_drawImage;
  16 + CGSize _cropSize;
  17 + CNRepairAlertView *repairView;
  18 + CNRepairAlertView *succeedAlert;
  19 + NSString *contentId;
  20 + CNLiveRepairType _type;
  21 +}
  22 +@property (nonatomic, strong)CNPhoPresent *present;
  23 +@end
  24 +
  25 +@implementation CNUploadManager
  26 +-(void)dealloc
  27 +{
  28 + [[NSNotificationCenter defaultCenter] removeObserver:self];
  29 +}
  30 +-(instancetype)init
  31 +{
  32 + if (self = [super init]) {
  33 + //接收im通知,确定是否修复完成
  34 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(repairPhotos:) name:@"kIMAMSG_PhotoFixSuccessNotification" object:nil];
  35 + }
  36 + return self;
  37 +}
  38 +
  39 +#pragma mark - Notification
  40 +-(void)repairPhotos:(NSNotification *)note
  41 +{
  42 + NSDictionary *dic = [note userInfo];
  43 + if ([contentId isEqualToString:dic[@"contentId"]]) {
  44 + if (repairView) {
  45 + self->repairView.cancelBlock();
  46 + }
  47 + succeedAlert = [CNRepairAlertView setUpShowRepairSucceedImage:@"oldPho_succeed" title:@"修复完成"];
  48 + [self performSelector:@selector(removeAlertAndPush) afterDelay:2];
  49 + }
  50 + NSLog(@"%@",dic);
  51 +}
  52 +//移除修复完成弹窗,完成跳转流程
  53 +-(void)removeAlertAndPush
  54 +{
  55 + self->succeedAlert.cancelBlock();
  56 + self.pushBlock(contentId);
  57 +}
  58 +-(void)uploadImageManager:(UIImage *)oldImage draw:(UIImage *_Nullable)drawImage rect:(CGSize )size repairType:(CNLiveRepairType)type
  59 +{
  60 + _pcImage = oldImage;
  61 + _drawImage = drawImage;
  62 + _cropSize = size;
  63 + _type = type;
  64 + if (![[NSUserDefaults standardUserDefaults] boolForKey:notShowTipView]) {
  65 + [CNRepairAlertView setUpShowRepairTipViewForTitle:@"您裁剪的照片需在云端修复" message:@"修复时会处于安全私密状态" cancelname:@"取消" sureName:@"确定修复" sureBlock:^{
  66 + [self uploadRequest];
  67 + }];
  68 + }else{
  69 + [self uploadRequest];
  70 + }
  71 +}
  72 +-(void)uploadRequest
  73 +{
  74 + __weak typeof(self) weakSelf = self;;
  75 + repairView = [CNRepairAlertView setUpShowRepairViewImage:@"oldPho_repairing" title:@"照片修复中..." message:@"请不要锁屏或切换到其他应用程序" cancelname:@"取消修复" cancelBlock:^(BOOL succeed) {
  76 + __strong typeof(weakSelf) strongSelf = weakSelf;
  77 + if (self) {
  78 + self->repairView = nil;
  79 + if (succeed) {
  80 + self.popBlock();
  81 + }else
  82 + {
  83 + if (weakSelf.present.cancel) {
  84 + weakSelf.present.cancel();
  85 + }
  86 +
  87 + }
  88 +
  89 + }
  90 + }];
  91 + //修复图片网络请求,前面是两层弹窗
  92 + [self.present repairPhoRequest:_pcImage drawImage:_drawImage height:_cropSize.height width:_cropSize.width repairType:_type succeed:^(NSString * _Nonnull contentId) {
  93 + __strong typeof(weakSelf) strongSelf = weakSelf;
  94 + if (strongSelf) {
  95 + strongSelf->contentId = contentId;
  96 + strongSelf-> repairView.titleName = @"即将修复美好时光…";
  97 + }
  98 +
  99 + }error:^(NSError * _Nonnull error) {
  100 + __strong typeof(weakSelf) strongSelf = weakSelf;
  101 + if (strongSelf&&strongSelf->repairView) {
  102 + strongSelf->repairView.cancelBlock();
  103 + }
  104 + [CNRepairAlertView setUpShowRepairFailedImage:@"oldPho_failed" title:@"修复失败,请重试" cancelname:@"取消" sureName:@"重试" RequestBlock:^{
  105 + [weakSelf uploadRequest];
  106 + }];
  107 + }];
  108 +}
  109 +
  110 +- (CNPhoPresent *)present
  111 +{
  112 + if (!_present) {
  113 + _present = [[CNPhoPresent alloc] init];
  114 + }
  115 + return _present;
  116 +}
  117 +@end
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/model/CNPhoRepairModel.h 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/model/CNPhoRepairModel.h
  1 +//
  2 +// CNPhoRepairModel.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +//照片修复的model
  14 +@interface CNPhoRepairModel : NSObject
  15 +@property (nonatomic, strong) NSString *image;
  16 +@property (nonatomic, strong) NSString *title;
  17 +@property (nonatomic, strong) NSString *message;
  18 +@end
  19 +@interface CNRepairCategoryModel : NSObject
  20 +@property (nonatomic, strong) NSString *title;
  21 +@property (nonatomic, strong) NSArray<CNPhoRepairModel *> *list;
  22 +@end
  23 +//修复完成model
  24 +@interface CNPhoRepairsListModel : NSObject
  25 +@property (nonatomic, strong) NSString *oldPicture; //修复前
  26 +@property (nonatomic, strong) NSString *repairedPicture; //修复后未压缩
  27 +@property (nonatomic, strong) NSString *slimPicture; //修复后压缩
  28 +@end
  29 +
  30 +NS_ASSUME_NONNULL_END
... ...
CNLiveCPhotoRepairModule/Classes/PhotoRepair/model/CNPhoRepairModel.m 0 → 100644
  1 +++ a/CNLiveCPhotoRepairModule/Classes/PhotoRepair/model/CNPhoRepairModel.m
  1 +//
  2 +// CNPhoRepairModel.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by CNLive on 2021/8/10.
  6 +// Copyright © 2021 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "CNPhoRepairModel.h"
  10 +
  11 +@implementation CNPhoRepairModel
  12 +
  13 +@end
  14 +@implementation CNRepairCategoryModel
  15 +
  16 +@end
  17 +@implementation CNPhoRepairsListModel
  18 +
  19 +@end
... ...
Example/CNLiveCPhotoRepairModule.xcodeproj/project.pbxproj 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule.xcodeproj/project.pbxproj
  1 +// !$*UTF8*$!
  2 +{
  3 + archiveVersion = 1;
  4 + classes = {
  5 + };
  6 + objectVersion = 46;
  7 + objects = {
  8 +
  9 +/* Begin PBXBuildFile section */
  10 + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
  11 + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
  12 + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
  13 + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
  14 + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
  15 + 6003F59E195388D20070C39A /* CNAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* CNAppDelegate.m */; };
  16 + 6003F5A7195388D20070C39A /* CNViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* CNViewController.m */; };
  17 + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
  18 + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
  19 + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
  20 + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
  21 + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
  22 + 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
  23 + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
  24 + 81B99D4D295E92680048659B /* CNLiveCPhotoRepairModuleService.m in Sources */ = {isa = PBXBuildFile; fileRef = 81B99D4C295E92680048659B /* CNLiveCPhotoRepairModuleService.m */; };
  25 + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
  26 + 90A255025A2F86BFDD621585 /* Pods_CNLiveCPhotoRepairModule_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECC6024B6E1D558BAD15DE83 /* Pods_CNLiveCPhotoRepairModule_Example.framework */; };
  27 + 9DFF6E90765903DB990D2335 /* Pods_CNLiveCPhotoRepairModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6480CF1D3F5F5CC5CC5B3599 /* Pods_CNLiveCPhotoRepairModule_Tests.framework */; };
  28 +/* End PBXBuildFile section */
  29 +
  30 +/* Begin PBXContainerItemProxy section */
  31 + 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
  32 + isa = PBXContainerItemProxy;
  33 + containerPortal = 6003F582195388D10070C39A /* Project object */;
  34 + proxyType = 1;
  35 + remoteGlobalIDString = 6003F589195388D20070C39A;
  36 + remoteInfo = CNLiveCPhotoRepairModule;
  37 + };
  38 +/* End PBXContainerItemProxy section */
  39 +
  40 +/* Begin PBXFileReference section */
  41 + 4F1F612C50FAB2330395352B /* CNLiveCPhotoRepairModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveCPhotoRepairModule.podspec; path = ../CNLiveCPhotoRepairModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
  42 + 6003F58A195388D20070C39A /* CNLiveCPhotoRepairModule_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveCPhotoRepairModule_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
  43 + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
  44 + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
  45 + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
  46 + 6003F595195388D20070C39A /* CNLiveCPhotoRepairModule-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CNLiveCPhotoRepairModule-Info.plist"; sourceTree = "<group>"; };
  47 + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
  48 + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
  49 + 6003F59B195388D20070C39A /* CNLiveCPhotoRepairModule-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CNLiveCPhotoRepairModule-Prefix.pch"; sourceTree = "<group>"; };
  50 + 6003F59C195388D20070C39A /* CNAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNAppDelegate.h; sourceTree = "<group>"; };
  51 + 6003F59D195388D20070C39A /* CNAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNAppDelegate.m; sourceTree = "<group>"; };
  52 + 6003F5A5195388D20070C39A /* CNViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNViewController.h; sourceTree = "<group>"; };
  53 + 6003F5A6195388D20070C39A /* CNViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNViewController.m; sourceTree = "<group>"; };
  54 + 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
  55 + 6003F5AE195388D20070C39A /* CNLiveCPhotoRepairModule_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CNLiveCPhotoRepairModule_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
  56 + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
  57 + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
  58 + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
  59 + 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
  60 + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
  61 + 6480CF1D3F5F5CC5CC5B3599 /* Pods_CNLiveCPhotoRepairModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveCPhotoRepairModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
  62 + 64E191C5BAFCCD5AE9796306 /* Pods-CNLiveCPhotoRepairModule_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCPhotoRepairModule_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveCPhotoRepairModule_Tests/Pods-CNLiveCPhotoRepairModule_Tests.debug.xcconfig"; sourceTree = "<group>"; };
  63 + 663F3316E22005A67AE2BFF7 /* Pods-CNLiveCPhotoRepairModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCPhotoRepairModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveCPhotoRepairModule_Tests/Pods-CNLiveCPhotoRepairModule_Tests.release.xcconfig"; sourceTree = "<group>"; };
  64 + 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
  65 + 81B99D4B295E92680048659B /* CNLiveCPhotoRepairModuleService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveCPhotoRepairModuleService.h; sourceTree = "<group>"; };
  66 + 81B99D4C295E92680048659B /* CNLiveCPhotoRepairModuleService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveCPhotoRepairModuleService.m; sourceTree = "<group>"; };
  67 + 81B99D4E295E92E90048659B /* CNLiveCPhotoRepairModuleProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveCPhotoRepairModuleProtocol.h; sourceTree = "<group>"; };
  68 + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
  69 + 89CF3D123E5AA59A42339173 /* Pods-CNLiveCPhotoRepairModule_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCPhotoRepairModule_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveCPhotoRepairModule_Example/Pods-CNLiveCPhotoRepairModule_Example.release.xcconfig"; sourceTree = "<group>"; };
  70 + 93A0424279F616C6446EBDA9 /* Pods-CNLiveCPhotoRepairModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCPhotoRepairModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveCPhotoRepairModule_Example/Pods-CNLiveCPhotoRepairModule_Example.debug.xcconfig"; sourceTree = "<group>"; };
  71 + ABA9C2E3A0ADDBEB08EB3B6C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
  72 + ADF6DCCB40F6B73A2665AF17 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
  73 + ECC6024B6E1D558BAD15DE83 /* Pods_CNLiveCPhotoRepairModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveCPhotoRepairModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
  74 +/* End PBXFileReference section */
  75 +
  76 +/* Begin PBXFrameworksBuildPhase section */
  77 + 6003F587195388D20070C39A /* Frameworks */ = {
  78 + isa = PBXFrameworksBuildPhase;
  79 + buildActionMask = 2147483647;
  80 + files = (
  81 + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
  82 + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
  83 + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
  84 + 90A255025A2F86BFDD621585 /* Pods_CNLiveCPhotoRepairModule_Example.framework in Frameworks */,
  85 + );
  86 + runOnlyForDeploymentPostprocessing = 0;
  87 + };
  88 + 6003F5AB195388D20070C39A /* Frameworks */ = {
  89 + isa = PBXFrameworksBuildPhase;
  90 + buildActionMask = 2147483647;
  91 + files = (
  92 + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
  93 + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
  94 + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
  95 + 9DFF6E90765903DB990D2335 /* Pods_CNLiveCPhotoRepairModule_Tests.framework in Frameworks */,
  96 + );
  97 + runOnlyForDeploymentPostprocessing = 0;
  98 + };
  99 +/* End PBXFrameworksBuildPhase section */
  100 +
  101 +/* Begin PBXGroup section */
  102 + 6003F581195388D10070C39A = {
  103 + isa = PBXGroup;
  104 + children = (
  105 + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
  106 + 6003F593195388D20070C39A /* Example for CNLiveCPhotoRepairModule */,
  107 + 6003F5B5195388D20070C39A /* Tests */,
  108 + 6003F58C195388D20070C39A /* Frameworks */,
  109 + 6003F58B195388D20070C39A /* Products */,
  110 + CDF5B0630A2C13FA33F682BF /* Pods */,
  111 + );
  112 + sourceTree = "<group>";
  113 + };
  114 + 6003F58B195388D20070C39A /* Products */ = {
  115 + isa = PBXGroup;
  116 + children = (
  117 + 6003F58A195388D20070C39A /* CNLiveCPhotoRepairModule_Example.app */,
  118 + 6003F5AE195388D20070C39A /* CNLiveCPhotoRepairModule_Tests.xctest */,
  119 + );
  120 + name = Products;
  121 + sourceTree = "<group>";
  122 + };
  123 + 6003F58C195388D20070C39A /* Frameworks */ = {
  124 + isa = PBXGroup;
  125 + children = (
  126 + 6003F58D195388D20070C39A /* Foundation.framework */,
  127 + 6003F58F195388D20070C39A /* CoreGraphics.framework */,
  128 + 6003F591195388D20070C39A /* UIKit.framework */,
  129 + 6003F5AF195388D20070C39A /* XCTest.framework */,
  130 + ECC6024B6E1D558BAD15DE83 /* Pods_CNLiveCPhotoRepairModule_Example.framework */,
  131 + 6480CF1D3F5F5CC5CC5B3599 /* Pods_CNLiveCPhotoRepairModule_Tests.framework */,
  132 + );
  133 + name = Frameworks;
  134 + sourceTree = "<group>";
  135 + };
  136 + 6003F593195388D20070C39A /* Example for CNLiveCPhotoRepairModule */ = {
  137 + isa = PBXGroup;
  138 + children = (
  139 + 6003F59C195388D20070C39A /* CNAppDelegate.h */,
  140 + 6003F59D195388D20070C39A /* CNAppDelegate.m */,
  141 + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
  142 + 6003F5A5195388D20070C39A /* CNViewController.h */,
  143 + 6003F5A6195388D20070C39A /* CNViewController.m */,
  144 + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
  145 + 6003F5A8195388D20070C39A /* Images.xcassets */,
  146 + 6003F594195388D20070C39A /* Supporting Files */,
  147 + 81B99D4B295E92680048659B /* CNLiveCPhotoRepairModuleService.h */,
  148 + 81B99D4C295E92680048659B /* CNLiveCPhotoRepairModuleService.m */,
  149 + 81B99D4E295E92E90048659B /* CNLiveCPhotoRepairModuleProtocol.h */,
  150 + );
  151 + name = "Example for CNLiveCPhotoRepairModule";
  152 + path = CNLiveCPhotoRepairModule;
  153 + sourceTree = "<group>";
  154 + };
  155 + 6003F594195388D20070C39A /* Supporting Files */ = {
  156 + isa = PBXGroup;
  157 + children = (
  158 + 6003F595195388D20070C39A /* CNLiveCPhotoRepairModule-Info.plist */,
  159 + 6003F596195388D20070C39A /* InfoPlist.strings */,
  160 + 6003F599195388D20070C39A /* main.m */,
  161 + 6003F59B195388D20070C39A /* CNLiveCPhotoRepairModule-Prefix.pch */,
  162 + );
  163 + name = "Supporting Files";
  164 + sourceTree = "<group>";
  165 + };
  166 + 6003F5B5195388D20070C39A /* Tests */ = {
  167 + isa = PBXGroup;
  168 + children = (
  169 + 6003F5BB195388D20070C39A /* Tests.m */,
  170 + 6003F5B6195388D20070C39A /* Supporting Files */,
  171 + );
  172 + path = Tests;
  173 + sourceTree = "<group>";
  174 + };
  175 + 6003F5B6195388D20070C39A /* Supporting Files */ = {
  176 + isa = PBXGroup;
  177 + children = (
  178 + 6003F5B7195388D20070C39A /* Tests-Info.plist */,
  179 + 6003F5B8195388D20070C39A /* InfoPlist.strings */,
  180 + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
  181 + );
  182 + name = "Supporting Files";
  183 + sourceTree = "<group>";
  184 + };
  185 + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
  186 + isa = PBXGroup;
  187 + children = (
  188 + 4F1F612C50FAB2330395352B /* CNLiveCPhotoRepairModule.podspec */,
  189 + ABA9C2E3A0ADDBEB08EB3B6C /* README.md */,
  190 + ADF6DCCB40F6B73A2665AF17 /* LICENSE */,
  191 + );
  192 + name = "Podspec Metadata";
  193 + sourceTree = "<group>";
  194 + };
  195 + CDF5B0630A2C13FA33F682BF /* Pods */ = {
  196 + isa = PBXGroup;
  197 + children = (
  198 + 93A0424279F616C6446EBDA9 /* Pods-CNLiveCPhotoRepairModule_Example.debug.xcconfig */,
  199 + 89CF3D123E5AA59A42339173 /* Pods-CNLiveCPhotoRepairModule_Example.release.xcconfig */,
  200 + 64E191C5BAFCCD5AE9796306 /* Pods-CNLiveCPhotoRepairModule_Tests.debug.xcconfig */,
  201 + 663F3316E22005A67AE2BFF7 /* Pods-CNLiveCPhotoRepairModule_Tests.release.xcconfig */,
  202 + );
  203 + path = Pods;
  204 + sourceTree = "<group>";
  205 + };
  206 +/* End PBXGroup section */
  207 +
  208 +/* Begin PBXNativeTarget section */
  209 + 6003F589195388D20070C39A /* CNLiveCPhotoRepairModule_Example */ = {
  210 + isa = PBXNativeTarget;
  211 + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCPhotoRepairModule_Example" */;
  212 + buildPhases = (
  213 + E6EBAD264C9253771B4EED19 /* [CP] Check Pods Manifest.lock */,
  214 + 6003F586195388D20070C39A /* Sources */,
  215 + 6003F587195388D20070C39A /* Frameworks */,
  216 + 6003F588195388D20070C39A /* Resources */,
  217 + 477F1341E8BA5FB54301B4C4 /* [CP] Embed Pods Frameworks */,
  218 + 57D847A15AA633ED25EC4409 /* [CP] Copy Pods Resources */,
  219 + );
  220 + buildRules = (
  221 + );
  222 + dependencies = (
  223 + );
  224 + name = CNLiveCPhotoRepairModule_Example;
  225 + productName = CNLiveCPhotoRepairModule;
  226 + productReference = 6003F58A195388D20070C39A /* CNLiveCPhotoRepairModule_Example.app */;
  227 + productType = "com.apple.product-type.application";
  228 + };
  229 + 6003F5AD195388D20070C39A /* CNLiveCPhotoRepairModule_Tests */ = {
  230 + isa = PBXNativeTarget;
  231 + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCPhotoRepairModule_Tests" */;
  232 + buildPhases = (
  233 + C4F5502DAFA8B51AA4F65806 /* [CP] Check Pods Manifest.lock */,
  234 + 6003F5AA195388D20070C39A /* Sources */,
  235 + 6003F5AB195388D20070C39A /* Frameworks */,
  236 + 6003F5AC195388D20070C39A /* Resources */,
  237 + );
  238 + buildRules = (
  239 + );
  240 + dependencies = (
  241 + 6003F5B4195388D20070C39A /* PBXTargetDependency */,
  242 + );
  243 + name = CNLiveCPhotoRepairModule_Tests;
  244 + productName = CNLiveCPhotoRepairModuleTests;
  245 + productReference = 6003F5AE195388D20070C39A /* CNLiveCPhotoRepairModule_Tests.xctest */;
  246 + productType = "com.apple.product-type.bundle.unit-test";
  247 + };
  248 +/* End PBXNativeTarget section */
  249 +
  250 +/* Begin PBXProject section */
  251 + 6003F582195388D10070C39A /* Project object */ = {
  252 + isa = PBXProject;
  253 + attributes = {
  254 + CLASSPREFIX = CN;
  255 + LastUpgradeCheck = 0720;
  256 + ORGANIZATIONNAME = "杨苓玉";
  257 + TargetAttributes = {
  258 + 6003F589195388D20070C39A = {
  259 + DevelopmentTeam = 94X49GG3ZW;
  260 + };
  261 + 6003F5AD195388D20070C39A = {
  262 + DevelopmentTeam = 94X49GG3ZW;
  263 + TestTargetID = 6003F589195388D20070C39A;
  264 + };
  265 + };
  266 + };
  267 + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveCPhotoRepairModule" */;
  268 + compatibilityVersion = "Xcode 3.2";
  269 + developmentRegion = English;
  270 + hasScannedForEncodings = 0;
  271 + knownRegions = (
  272 + English,
  273 + en,
  274 + Base,
  275 + );
  276 + mainGroup = 6003F581195388D10070C39A;
  277 + productRefGroup = 6003F58B195388D20070C39A /* Products */;
  278 + projectDirPath = "";
  279 + projectRoot = "";
  280 + targets = (
  281 + 6003F589195388D20070C39A /* CNLiveCPhotoRepairModule_Example */,
  282 + 6003F5AD195388D20070C39A /* CNLiveCPhotoRepairModule_Tests */,
  283 + );
  284 + };
  285 +/* End PBXProject section */
  286 +
  287 +/* Begin PBXResourcesBuildPhase section */
  288 + 6003F588195388D20070C39A /* Resources */ = {
  289 + isa = PBXResourcesBuildPhase;
  290 + buildActionMask = 2147483647;
  291 + files = (
  292 + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
  293 + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
  294 + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
  295 + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
  296 + );
  297 + runOnlyForDeploymentPostprocessing = 0;
  298 + };
  299 + 6003F5AC195388D20070C39A /* Resources */ = {
  300 + isa = PBXResourcesBuildPhase;
  301 + buildActionMask = 2147483647;
  302 + files = (
  303 + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
  304 + );
  305 + runOnlyForDeploymentPostprocessing = 0;
  306 + };
  307 +/* End PBXResourcesBuildPhase section */
  308 +
  309 +/* Begin PBXShellScriptBuildPhase section */
  310 + 477F1341E8BA5FB54301B4C4 /* [CP] Embed Pods Frameworks */ = {
  311 + isa = PBXShellScriptBuildPhase;
  312 + buildActionMask = 2147483647;
  313 + files = (
  314 + );
  315 + inputPaths = (
  316 + "${PODS_ROOT}/Target Support Files/Pods-CNLiveCPhotoRepairModule_Example/Pods-CNLiveCPhotoRepairModule_Example-frameworks.sh",
  317 + "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",
  318 + "${BUILT_PRODUCTS_DIR}/CNLiveBaseClass/CNLiveBaseClass.framework",
  319 + "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework",
  320 + "${BUILT_PRODUCTS_DIR}/CNLiveBaseTools/CNLiveBaseTools.framework",
  321 + "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework",
  322 + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.framework",
  323 + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework",
  324 + "${BUILT_PRODUCTS_DIR}/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule.framework",
  325 + "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework",
  326 + "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework",
  327 + "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework",
  328 + "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework",
  329 + "${BUILT_PRODUCTS_DIR}/CNLiveImagePickerController/CNLiveImagePickerController.framework",
  330 + "${BUILT_PRODUCTS_DIR}/CNLiveNewTripartiteManagement/CNLiveNewTripartiteManagement.framework",
  331 + "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework",
  332 + "${BUILT_PRODUCTS_DIR}/CNLiveUploadManager/CNLiveUploadManager.framework",
  333 + "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework",
  334 + "${BUILT_PRODUCTS_DIR}/DSBaseModule/DSBaseModule.framework",
  335 + "${BUILT_PRODUCTS_DIR}/DSGTMBase64/DSGTMBase64.framework",
  336 + "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
  337 + "${BUILT_PRODUCTS_DIR}/HappyDNS/HappyDNS.framework",
  338 + "${BUILT_PRODUCTS_DIR}/JXCategoryView/JXCategoryView.framework",
  339 + "${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework",
  340 + "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework",
  341 + "${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework",
  342 + "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework",
  343 + "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework",
  344 + "${BUILT_PRODUCTS_DIR}/Qiniu/Qiniu.framework",
  345 + "${BUILT_PRODUCTS_DIR}/SAMKeychain/SAMKeychain.framework",
  346 + "${BUILT_PRODUCTS_DIR}/SDAutoLayout/SDAutoLayout.framework",
  347 + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
  348 + "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
  349 + "${BUILT_PRODUCTS_DIR}/WebViewJavascriptBridge/WebViewJavascriptBridge.framework",
  350 + "${BUILT_PRODUCTS_DIR}/YBImageBrowser/YBImageBrowser.framework",
  351 + "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework",
  352 + "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework",
  353 + "${BUILT_PRODUCTS_DIR}/YYCategories/YYCategories.framework",
  354 + "${BUILT_PRODUCTS_DIR}/YYDispatchQueuePool/YYDispatchQueuePool.framework",
  355 + "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework",
  356 + "${BUILT_PRODUCTS_DIR}/YYKeyboardManager/YYKeyboardManager.framework",
  357 + "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework",
  358 + "${BUILT_PRODUCTS_DIR}/YYText/YYText.framework",
  359 + "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework",
  360 + );
  361 + name = "[CP] Embed Pods Frameworks";
  362 + outputPaths = (
  363 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework",
  364 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseClass.framework",
  365 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework",
  366 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseTools.framework",
  367 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework",
  368 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessBaseModule.framework",
  369 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework",
  370 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCPhotoRepairModule.framework",
  371 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework",
  372 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework",
  373 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework",
  374 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework",
  375 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveImagePickerController.framework",
  376 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveNewTripartiteManagement.framework",
  377 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework",
  378 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUploadManager.framework",
  379 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework",
  380 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DSBaseModule.framework",
  381 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DSGTMBase64.framework",
  382 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
  383 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HappyDNS.framework",
  384 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXCategoryView.framework",
  385 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework",
  386 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework",
  387 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework",
  388 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework",
  389 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework",
  390 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Qiniu.framework",
  391 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SAMKeychain.framework",
  392 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDAutoLayout.framework",
  393 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
  394 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
  395 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebViewJavascriptBridge.framework",
  396 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YBImageBrowser.framework",
  397 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework",
  398 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework",
  399 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCategories.framework",
  400 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYDispatchQueuePool.framework",
  401 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework",
  402 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKeyboardManager.framework",
  403 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework",
  404 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYText.framework",
  405 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework",
  406 + );
  407 + runOnlyForDeploymentPostprocessing = 0;
  408 + shellPath = /bin/sh;
  409 + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveCPhotoRepairModule_Example/Pods-CNLiveCPhotoRepairModule_Example-frameworks.sh\"\n";
  410 + showEnvVarsInLog = 0;
  411 + };
  412 + 57D847A15AA633ED25EC4409 /* [CP] Copy Pods Resources */ = {
  413 + isa = PBXShellScriptBuildPhase;
  414 + buildActionMask = 2147483647;
  415 + files = (
  416 + );
  417 + inputPaths = (
  418 + "${PODS_ROOT}/Target Support Files/Pods-CNLiveCPhotoRepairModule_Example/Pods-CNLiveCPhotoRepairModule_Example-resources.sh",
  419 + "${PODS_CONFIGURATION_BUILD_DIR}/CNLivePhotoBrowser/CNLivePhotoBrowser.bundle",
  420 + );
  421 + name = "[CP] Copy Pods Resources";
  422 + outputPaths = (
  423 + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLivePhotoBrowser.bundle",
  424 + );
  425 + runOnlyForDeploymentPostprocessing = 0;
  426 + shellPath = /bin/sh;
  427 + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveCPhotoRepairModule_Example/Pods-CNLiveCPhotoRepairModule_Example-resources.sh\"\n";
  428 + showEnvVarsInLog = 0;
  429 + };
  430 + C4F5502DAFA8B51AA4F65806 /* [CP] Check Pods Manifest.lock */ = {
  431 + isa = PBXShellScriptBuildPhase;
  432 + buildActionMask = 2147483647;
  433 + files = (
  434 + );
  435 + inputFileListPaths = (
  436 + );
  437 + inputPaths = (
  438 + "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
  439 + "${PODS_ROOT}/Manifest.lock",
  440 + );
  441 + name = "[CP] Check Pods Manifest.lock";
  442 + outputFileListPaths = (
  443 + );
  444 + outputPaths = (
  445 + "$(DERIVED_FILE_DIR)/Pods-CNLiveCPhotoRepairModule_Tests-checkManifestLockResult.txt",
  446 + );
  447 + runOnlyForDeploymentPostprocessing = 0;
  448 + shellPath = /bin/sh;
  449 + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
  450 + showEnvVarsInLog = 0;
  451 + };
  452 + E6EBAD264C9253771B4EED19 /* [CP] Check Pods Manifest.lock */ = {
  453 + isa = PBXShellScriptBuildPhase;
  454 + buildActionMask = 2147483647;
  455 + files = (
  456 + );
  457 + inputFileListPaths = (
  458 + );
  459 + inputPaths = (
  460 + "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
  461 + "${PODS_ROOT}/Manifest.lock",
  462 + );
  463 + name = "[CP] Check Pods Manifest.lock";
  464 + outputFileListPaths = (
  465 + );
  466 + outputPaths = (
  467 + "$(DERIVED_FILE_DIR)/Pods-CNLiveCPhotoRepairModule_Example-checkManifestLockResult.txt",
  468 + );
  469 + runOnlyForDeploymentPostprocessing = 0;
  470 + shellPath = /bin/sh;
  471 + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
  472 + showEnvVarsInLog = 0;
  473 + };
  474 +/* End PBXShellScriptBuildPhase section */
  475 +
  476 +/* Begin PBXSourcesBuildPhase section */
  477 + 6003F586195388D20070C39A /* Sources */ = {
  478 + isa = PBXSourcesBuildPhase;
  479 + buildActionMask = 2147483647;
  480 + files = (
  481 + 81B99D4D295E92680048659B /* CNLiveCPhotoRepairModuleService.m in Sources */,
  482 + 6003F59E195388D20070C39A /* CNAppDelegate.m in Sources */,
  483 + 6003F5A7195388D20070C39A /* CNViewController.m in Sources */,
  484 + 6003F59A195388D20070C39A /* main.m in Sources */,
  485 + );
  486 + runOnlyForDeploymentPostprocessing = 0;
  487 + };
  488 + 6003F5AA195388D20070C39A /* Sources */ = {
  489 + isa = PBXSourcesBuildPhase;
  490 + buildActionMask = 2147483647;
  491 + files = (
  492 + 6003F5BC195388D20070C39A /* Tests.m in Sources */,
  493 + );
  494 + runOnlyForDeploymentPostprocessing = 0;
  495 + };
  496 +/* End PBXSourcesBuildPhase section */
  497 +
  498 +/* Begin PBXTargetDependency section */
  499 + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
  500 + isa = PBXTargetDependency;
  501 + target = 6003F589195388D20070C39A /* CNLiveCPhotoRepairModule_Example */;
  502 + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
  503 + };
  504 +/* End PBXTargetDependency section */
  505 +
  506 +/* Begin PBXVariantGroup section */
  507 + 6003F596195388D20070C39A /* InfoPlist.strings */ = {
  508 + isa = PBXVariantGroup;
  509 + children = (
  510 + 6003F597195388D20070C39A /* en */,
  511 + );
  512 + name = InfoPlist.strings;
  513 + sourceTree = "<group>";
  514 + };
  515 + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
  516 + isa = PBXVariantGroup;
  517 + children = (
  518 + 6003F5B9195388D20070C39A /* en */,
  519 + );
  520 + name = InfoPlist.strings;
  521 + sourceTree = "<group>";
  522 + };
  523 + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = {
  524 + isa = PBXVariantGroup;
  525 + children = (
  526 + 71719F9E1E33DC2100824A3D /* Base */,
  527 + );
  528 + name = LaunchScreen.storyboard;
  529 + sourceTree = "<group>";
  530 + };
  531 +/* End PBXVariantGroup section */
  532 +
  533 +/* Begin XCBuildConfiguration section */
  534 + 6003F5BD195388D20070C39A /* Debug */ = {
  535 + isa = XCBuildConfiguration;
  536 + buildSettings = {
  537 + ALWAYS_SEARCH_USER_PATHS = NO;
  538 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
  539 + CLANG_CXX_LIBRARY = "libc++";
  540 + CLANG_ENABLE_MODULES = YES;
  541 + CLANG_ENABLE_OBJC_ARC = YES;
  542 + CLANG_WARN_BOOL_CONVERSION = YES;
  543 + CLANG_WARN_CONSTANT_CONVERSION = YES;
  544 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
  545 + CLANG_WARN_EMPTY_BODY = YES;
  546 + CLANG_WARN_ENUM_CONVERSION = YES;
  547 + CLANG_WARN_INT_CONVERSION = YES;
  548 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
  549 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
  550 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  551 + COPY_PHASE_STRIP = NO;
  552 + ENABLE_TESTABILITY = YES;
  553 + GCC_C_LANGUAGE_STANDARD = gnu99;
  554 + GCC_DYNAMIC_NO_PIC = NO;
  555 + GCC_OPTIMIZATION_LEVEL = 0;
  556 + GCC_PREPROCESSOR_DEFINITIONS = (
  557 + "DEBUG=1",
  558 + "$(inherited)",
  559 + );
  560 + GCC_SYMBOLS_PRIVATE_EXTERN = NO;
  561 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
  562 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
  563 + GCC_WARN_UNDECLARED_SELECTOR = YES;
  564 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
  565 + GCC_WARN_UNUSED_FUNCTION = YES;
  566 + GCC_WARN_UNUSED_VARIABLE = YES;
  567 + IPHONEOS_DEPLOYMENT_TARGET = 9.3;
  568 + ONLY_ACTIVE_ARCH = YES;
  569 + SDKROOT = iphoneos;
  570 + TARGETED_DEVICE_FAMILY = "1,2";
  571 + };
  572 + name = Debug;
  573 + };
  574 + 6003F5BE195388D20070C39A /* Release */ = {
  575 + isa = XCBuildConfiguration;
  576 + buildSettings = {
  577 + ALWAYS_SEARCH_USER_PATHS = NO;
  578 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
  579 + CLANG_CXX_LIBRARY = "libc++";
  580 + CLANG_ENABLE_MODULES = YES;
  581 + CLANG_ENABLE_OBJC_ARC = YES;
  582 + CLANG_WARN_BOOL_CONVERSION = YES;
  583 + CLANG_WARN_CONSTANT_CONVERSION = YES;
  584 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
  585 + CLANG_WARN_EMPTY_BODY = YES;
  586 + CLANG_WARN_ENUM_CONVERSION = YES;
  587 + CLANG_WARN_INT_CONVERSION = YES;
  588 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
  589 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
  590 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  591 + COPY_PHASE_STRIP = YES;
  592 + ENABLE_NS_ASSERTIONS = NO;
  593 + GCC_C_LANGUAGE_STANDARD = gnu99;
  594 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
  595 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
  596 + GCC_WARN_UNDECLARED_SELECTOR = YES;
  597 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
  598 + GCC_WARN_UNUSED_FUNCTION = YES;
  599 + GCC_WARN_UNUSED_VARIABLE = YES;
  600 + IPHONEOS_DEPLOYMENT_TARGET = 9.3;
  601 + SDKROOT = iphoneos;
  602 + TARGETED_DEVICE_FAMILY = "1,2";
  603 + VALIDATE_PRODUCT = YES;
  604 + };
  605 + name = Release;
  606 + };
  607 + 6003F5C0195388D20070C39A /* Debug */ = {
  608 + isa = XCBuildConfiguration;
  609 + baseConfigurationReference = 93A0424279F616C6446EBDA9 /* Pods-CNLiveCPhotoRepairModule_Example.debug.xcconfig */;
  610 + buildSettings = {
  611 + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
  612 + DEVELOPMENT_TEAM = 94X49GG3ZW;
  613 + GCC_PRECOMPILE_PREFIX_HEADER = YES;
  614 + GCC_PREFIX_HEADER = "CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Prefix.pch";
  615 + INFOPLIST_FILE = "CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Info.plist";
  616 + MODULE_NAME = ExampleApp;
  617 + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
  618 + PRODUCT_NAME = "$(TARGET_NAME)";
  619 + SWIFT_VERSION = 4.0;
  620 + WRAPPER_EXTENSION = app;
  621 + };
  622 + name = Debug;
  623 + };
  624 + 6003F5C1195388D20070C39A /* Release */ = {
  625 + isa = XCBuildConfiguration;
  626 + baseConfigurationReference = 89CF3D123E5AA59A42339173 /* Pods-CNLiveCPhotoRepairModule_Example.release.xcconfig */;
  627 + buildSettings = {
  628 + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
  629 + DEVELOPMENT_TEAM = 94X49GG3ZW;
  630 + GCC_PRECOMPILE_PREFIX_HEADER = YES;
  631 + GCC_PREFIX_HEADER = "CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Prefix.pch";
  632 + INFOPLIST_FILE = "CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Info.plist";
  633 + MODULE_NAME = ExampleApp;
  634 + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
  635 + PRODUCT_NAME = "$(TARGET_NAME)";
  636 + SWIFT_VERSION = 4.0;
  637 + WRAPPER_EXTENSION = app;
  638 + };
  639 + name = Release;
  640 + };
  641 + 6003F5C3195388D20070C39A /* Debug */ = {
  642 + isa = XCBuildConfiguration;
  643 + baseConfigurationReference = 64E191C5BAFCCD5AE9796306 /* Pods-CNLiveCPhotoRepairModule_Tests.debug.xcconfig */;
  644 + buildSettings = {
  645 + BUNDLE_LOADER = "$(TEST_HOST)";
  646 + DEVELOPMENT_TEAM = 94X49GG3ZW;
  647 + FRAMEWORK_SEARCH_PATHS = (
  648 + "$(PLATFORM_DIR)/Developer/Library/Frameworks",
  649 + "$(inherited)",
  650 + "$(DEVELOPER_FRAMEWORKS_DIR)",
  651 + );
  652 + GCC_PRECOMPILE_PREFIX_HEADER = YES;
  653 + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
  654 + GCC_PREPROCESSOR_DEFINITIONS = (
  655 + "DEBUG=1",
  656 + "$(inherited)",
  657 + );
  658 + INFOPLIST_FILE = "Tests/Tests-Info.plist";
  659 + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
  660 + PRODUCT_NAME = "$(TARGET_NAME)";
  661 + SWIFT_VERSION = 4.0;
  662 + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveCPhotoRepairModule_Example.app/CNLiveCPhotoRepairModule_Example";
  663 + WRAPPER_EXTENSION = xctest;
  664 + };
  665 + name = Debug;
  666 + };
  667 + 6003F5C4195388D20070C39A /* Release */ = {
  668 + isa = XCBuildConfiguration;
  669 + baseConfigurationReference = 663F3316E22005A67AE2BFF7 /* Pods-CNLiveCPhotoRepairModule_Tests.release.xcconfig */;
  670 + buildSettings = {
  671 + BUNDLE_LOADER = "$(TEST_HOST)";
  672 + DEVELOPMENT_TEAM = 94X49GG3ZW;
  673 + FRAMEWORK_SEARCH_PATHS = (
  674 + "$(PLATFORM_DIR)/Developer/Library/Frameworks",
  675 + "$(inherited)",
  676 + "$(DEVELOPER_FRAMEWORKS_DIR)",
  677 + );
  678 + GCC_PRECOMPILE_PREFIX_HEADER = YES;
  679 + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
  680 + INFOPLIST_FILE = "Tests/Tests-Info.plist";
  681 + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
  682 + PRODUCT_NAME = "$(TARGET_NAME)";
  683 + SWIFT_VERSION = 4.0;
  684 + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveCPhotoRepairModule_Example.app/CNLiveCPhotoRepairModule_Example";
  685 + WRAPPER_EXTENSION = xctest;
  686 + };
  687 + name = Release;
  688 + };
  689 +/* End XCBuildConfiguration section */
  690 +
  691 +/* Begin XCConfigurationList section */
  692 + 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveCPhotoRepairModule" */ = {
  693 + isa = XCConfigurationList;
  694 + buildConfigurations = (
  695 + 6003F5BD195388D20070C39A /* Debug */,
  696 + 6003F5BE195388D20070C39A /* Release */,
  697 + );
  698 + defaultConfigurationIsVisible = 0;
  699 + defaultConfigurationName = Release;
  700 + };
  701 + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCPhotoRepairModule_Example" */ = {
  702 + isa = XCConfigurationList;
  703 + buildConfigurations = (
  704 + 6003F5C0195388D20070C39A /* Debug */,
  705 + 6003F5C1195388D20070C39A /* Release */,
  706 + );
  707 + defaultConfigurationIsVisible = 0;
  708 + defaultConfigurationName = Release;
  709 + };
  710 + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCPhotoRepairModule_Tests" */ = {
  711 + isa = XCConfigurationList;
  712 + buildConfigurations = (
  713 + 6003F5C3195388D20070C39A /* Debug */,
  714 + 6003F5C4195388D20070C39A /* Release */,
  715 + );
  716 + defaultConfigurationIsVisible = 0;
  717 + defaultConfigurationName = Release;
  718 + };
  719 +/* End XCConfigurationList section */
  720 + };
  721 + rootObject = 6003F582195388D10070C39A /* Project object */;
  722 +}
... ...
Example/CNLiveCPhotoRepairModule.xcodeproj/xcshareddata/xcschemes/CNLiveCPhotoRepairModule-Example.xcscheme 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule.xcodeproj/xcshareddata/xcschemes/CNLiveCPhotoRepairModule-Example.xcscheme
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<Scheme
  3 + LastUpgradeVersion = "0720"
  4 + version = "1.3">
  5 + <BuildAction
  6 + parallelizeBuildables = "YES"
  7 + buildImplicitDependencies = "YES">
  8 + <BuildActionEntries>
  9 + <BuildActionEntry
  10 + buildForTesting = "YES"
  11 + buildForRunning = "YES"
  12 + buildForProfiling = "YES"
  13 + buildForArchiving = "YES"
  14 + buildForAnalyzing = "YES">
  15 + <BuildableReference
  16 + BuildableIdentifier = "primary"
  17 + BlueprintIdentifier = "6003F589195388D20070C39A"
  18 + BuildableName = "CNLiveCPhotoRepairModule_Example.app"
  19 + BlueprintName = "CNLiveCPhotoRepairModule_Example"
  20 + ReferencedContainer = "container:CNLiveCPhotoRepairModule.xcodeproj">
  21 + </BuildableReference>
  22 + </BuildActionEntry>
  23 + </BuildActionEntries>
  24 + </BuildAction>
  25 + <TestAction
  26 + buildConfiguration = "Debug"
  27 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
  28 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
  29 + shouldUseLaunchSchemeArgsEnv = "YES">
  30 + <Testables>
  31 + <TestableReference
  32 + skipped = "NO">
  33 + <BuildableReference
  34 + BuildableIdentifier = "primary"
  35 + BlueprintIdentifier = "6003F5AD195388D20070C39A"
  36 + BuildableName = "CNLiveCPhotoRepairModule_Tests.xctest"
  37 + BlueprintName = "CNLiveCPhotoRepairModule_Tests"
  38 + ReferencedContainer = "container:CNLiveCPhotoRepairModule.xcodeproj">
  39 + </BuildableReference>
  40 + </TestableReference>
  41 + </Testables>
  42 + <MacroExpansion>
  43 + <BuildableReference
  44 + BuildableIdentifier = "primary"
  45 + BlueprintIdentifier = "6003F589195388D20070C39A"
  46 + BuildableName = "CNLiveCPhotoRepairModule_Example.app"
  47 + BlueprintName = "CNLiveCPhotoRepairModule_Example"
  48 + ReferencedContainer = "container:CNLiveCPhotoRepairModule.xcodeproj">
  49 + </BuildableReference>
  50 + </MacroExpansion>
  51 + <AdditionalOptions>
  52 + </AdditionalOptions>
  53 + </TestAction>
  54 + <LaunchAction
  55 + buildConfiguration = "Debug"
  56 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
  57 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
  58 + launchStyle = "0"
  59 + useCustomWorkingDirectory = "NO"
  60 + ignoresPersistentStateOnLaunch = "NO"
  61 + debugDocumentVersioning = "YES"
  62 + debugServiceExtension = "internal"
  63 + allowLocationSimulation = "YES">
  64 + <BuildableProductRunnable
  65 + runnableDebuggingMode = "0">
  66 + <BuildableReference
  67 + BuildableIdentifier = "primary"
  68 + BlueprintIdentifier = "6003F589195388D20070C39A"
  69 + BuildableName = "CNLiveCPhotoRepairModule_Example.app"
  70 + BlueprintName = "CNLiveCPhotoRepairModule_Example"
  71 + ReferencedContainer = "container:CNLiveCPhotoRepairModule.xcodeproj">
  72 + </BuildableReference>
  73 + </BuildableProductRunnable>
  74 + <AdditionalOptions>
  75 + </AdditionalOptions>
  76 + </LaunchAction>
  77 + <ProfileAction
  78 + buildConfiguration = "Release"
  79 + shouldUseLaunchSchemeArgsEnv = "YES"
  80 + savedToolIdentifier = ""
  81 + useCustomWorkingDirectory = "NO"
  82 + debugDocumentVersioning = "YES">
  83 + <BuildableProductRunnable
  84 + runnableDebuggingMode = "0">
  85 + <BuildableReference
  86 + BuildableIdentifier = "primary"
  87 + BlueprintIdentifier = "6003F589195388D20070C39A"
  88 + BuildableName = "CNLiveCPhotoRepairModule_Example.app"
  89 + BlueprintName = "CNLiveCPhotoRepairModule_Example"
  90 + ReferencedContainer = "container:CNLiveCPhotoRepairModule.xcodeproj">
  91 + </BuildableReference>
  92 + </BuildableProductRunnable>
  93 + </ProfileAction>
  94 + <AnalyzeAction
  95 + buildConfiguration = "Debug">
  96 + </AnalyzeAction>
  97 + <ArchiveAction
  98 + buildConfiguration = "Release"
  99 + revealArchiveInOrganizer = "YES">
  100 + </ArchiveAction>
  101 +</Scheme>
... ...
Example/CNLiveCPhotoRepairModule/Base.lproj/LaunchScreen.storyboard 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/Base.lproj/LaunchScreen.storyboard
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
  3 + <device id="retina4_7" orientation="portrait">
  4 + <adaptation id="fullscreen"/>
  5 + </device>
  6 + <dependencies>
  7 + <deployment identifier="iOS"/>
  8 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
  9 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
  10 + </dependencies>
  11 + <scenes>
  12 + <!--View Controller-->
  13 + <scene sceneID="EHf-IW-A2E">
  14 + <objects>
  15 + <viewController id="01J-lp-oVM" sceneMemberID="viewController">
  16 + <layoutGuides>
  17 + <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
  18 + <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
  19 + </layoutGuides>
  20 + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
  21 + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
  22 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  23 + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
  24 + </view>
  25 + </viewController>
  26 + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
  27 + </objects>
  28 + <point key="canvasLocation" x="53" y="375"/>
  29 + </scene>
  30 + </scenes>
  31 +</document>
... ...
Example/CNLiveCPhotoRepairModule/Base.lproj/Main.storyboard 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/Base.lproj/Main.storyboard
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
  3 + <device id="retina4_7" orientation="portrait">
  4 + <adaptation id="fullscreen"/>
  5 + </device>
  6 + <dependencies>
  7 + <deployment identifier="iOS"/>
  8 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
  9 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
  10 + </dependencies>
  11 + <scenes>
  12 + <!--View Controller-->
  13 + <scene sceneID="wQg-tq-qST">
  14 + <objects>
  15 + <viewController id="whP-gf-Uak" customClass="CNViewController" sceneMemberID="viewController">
  16 + <layoutGuides>
  17 + <viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/>
  18 + <viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
  19 + </layoutGuides>
  20 + <view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
  21 + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
  22 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  23 + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
  24 + </view>
  25 + </viewController>
  26 + <placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
  27 + </objects>
  28 + <point key="canvasLocation" x="305" y="433"/>
  29 + </scene>
  30 + </scenes>
  31 +</document>
... ...
Example/CNLiveCPhotoRepairModule/CNAppDelegate.h 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNAppDelegate.h
  1 +//
  2 +// CNAppDelegate.h
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by 杨苓玉 on 12/29/2022.
  6 +// Copyright (c) 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +@import UIKit;
  10 +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h>
  11 +
  12 +@interface CNAppDelegate : BaseAppDelegate <UIApplicationDelegate>
  13 +
  14 +@property (strong, nonatomic) UIWindow *window;
  15 +
  16 +@end
... ...
Example/CNLiveCPhotoRepairModule/CNAppDelegate.m 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNAppDelegate.m
  1 +//
  2 +// CNAppDelegate.m
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by 杨苓玉 on 12/29/2022.
  6 +// Copyright (c) 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +#import "CNAppDelegate.h"
  10 +#import <CNLiveUserManagement/CNUserInfoManager.h>
  11 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
  12 +#import "CNViewController.h"
  13 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  14 +
  15 +@implementation CNAppDelegate
  16 +
  17 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  18 +{
  19 + [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore];//CNLiveDebugAppStore];//CNLiveProductionAppStore//CNLiveTestFlight
  20 + [BHContext shareInstance].application = application;
  21 + [BHContext shareInstance].launchOptions = launchOptions;
  22 + [BHContext shareInstance].moduleConfigName = @"CNLiveBeeHive.bundle/BeeHive.bundle/BeeHive";
  23 + [BHContext shareInstance].serviceConfigName = @"CNLiveBeeHive.bundle/BeeHive.bundle/BHService";
  24 + [BeeHive shareInstance].enableException = YES;
  25 +
  26 + [super application:application didFinishLaunchingWithOptions:launchOptions];
  27 + //@"353417" @"353001" @"10499533" @"395785" @"10499273",@"11174272" @"398596" @"10504908"
  28 + [CNUserInfoManager manager].userInfoModel.uid = @"353001";//353417
  29 + // Override point for customization after application launch.
  30 + CNViewController *vc = [[CNViewController alloc] init];
  31 +
  32 + UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
  33 +
  34 +
  35 + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  36 + self.window.rootViewController = nav;
  37 + self.window.backgroundColor = [UIColor whiteColor];
  38 + [self.window makeKeyAndVisible];
  39 + [self setParamNet];
  40 + return YES;
  41 +}
  42 +-(void)setParamNet
  43 +{
  44 + //网家家网络请求参数
  45 + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init];
  46 + [mDict setValue:[CNUserInfoManager manager].userInfoModel.uid forKey:@"loginSid"];
  47 + [mDict setValue:@"com.cnlive.CNLiveNetAdd.debug" forKey:@"platform_id"];
  48 + [mDict setValue:[[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""] forKey:@"uuid"];
  49 + [mDict setValue:@"i" forKey:@"plat"];
  50 + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"];
  51 + [mDict setObject:AppId forKey:@"appId"];
  52 + [mDict setObject:[CNUserInfoManager manager].userInfoModel.uid forKey:@"sid"];
  53 + [CNLiveNetworking setupDefaultParam:mDict];
  54 +
  55 + //电商网络请求参数
  56 + NSMutableDictionary * dsDict = [[NSMutableDictionary alloc] init];
  57 + [dsDict setValue:@"iPhone" forKey:@"Phone-Model"];
  58 + [dsDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] forKey:@"Version"];
  59 + [dsDict setValue:CNUserShareModel.uid forKey:@"Uid"];
  60 + [dsDict setValue:@"0.6.2" forKey:@"Shop-Version"];
  61 + [CNLiveNetworking setupDSShopParam:dsDict];
  62 +
  63 +
  64 + [CNLiveNetworking setupShowResult:NO];
  65 + [CNLiveNetworking setupSignKey:APPKey];
  66 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  67 + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON];
  68 +}
  69 +- (void)applicationWillResignActive:(UIApplication *)application
  70 +{
  71 + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
  72 + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
  73 +}
  74 +
  75 +- (void)applicationDidEnterBackground:(UIApplication *)application
  76 +{
  77 + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
  78 + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
  79 +}
  80 +
  81 +- (void)applicationWillEnterForeground:(UIApplication *)application
  82 +{
  83 + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
  84 +}
  85 +
  86 +- (void)applicationDidBecomeActive:(UIApplication *)application
  87 +{
  88 + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
  89 +}
  90 +
  91 +- (void)applicationWillTerminate:(UIApplication *)application
  92 +{
  93 + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
  94 +}
  95 +
  96 +@end
... ...
Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Info.plist 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Info.plist
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>NSPhotoLibraryUsageDescription</key>
  6 + <string></string>
  7 + <key>CFBundleDevelopmentRegion</key>
  8 + <string>en</string>
  9 + <key>CFBundleDisplayName</key>
  10 + <string>${PRODUCT_NAME}</string>
  11 + <key>CFBundleExecutable</key>
  12 + <string>${EXECUTABLE_NAME}</string>
  13 + <key>CFBundleIdentifier</key>
  14 + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
  15 + <key>CFBundleInfoDictionaryVersion</key>
  16 + <string>6.0</string>
  17 + <key>CFBundleName</key>
  18 + <string>${PRODUCT_NAME}</string>
  19 + <key>CFBundlePackageType</key>
  20 + <string>APPL</string>
  21 + <key>CFBundleShortVersionString</key>
  22 + <string>1.0</string>
  23 + <key>CFBundleSignature</key>
  24 + <string>????</string>
  25 + <key>CFBundleVersion</key>
  26 + <string>1.0</string>
  27 + <key>LSRequiresIPhoneOS</key>
  28 + <true/>
  29 + <key>UILaunchStoryboardName</key>
  30 + <string>LaunchScreen</string>
  31 + <key>UIMainStoryboardFile</key>
  32 + <string>Main</string>
  33 + <key>UIRequiredDeviceCapabilities</key>
  34 + <array>
  35 + <string>armv7</string>
  36 + </array>
  37 + <key>UISupportedInterfaceOrientations</key>
  38 + <array>
  39 + <string>UIInterfaceOrientationPortrait</string>
  40 + <string>UIInterfaceOrientationLandscapeLeft</string>
  41 + <string>UIInterfaceOrientationLandscapeRight</string>
  42 + </array>
  43 + <key>UISupportedInterfaceOrientations~ipad</key>
  44 + <array>
  45 + <string>UIInterfaceOrientationPortrait</string>
  46 + <string>UIInterfaceOrientationPortraitUpsideDown</string>
  47 + <string>UIInterfaceOrientationLandscapeLeft</string>
  48 + <string>UIInterfaceOrientationLandscapeRight</string>
  49 + </array>
  50 +</dict>
  51 +</plist>
... ...
Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Prefix.pch 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModule-Prefix.pch
  1 +//
  2 +// Prefix header
  3 +//
  4 +// The contents of this file are implicitly included at the beginning of every source file.
  5 +//
  6 +
  7 +#import <Availability.h>
  8 +
  9 +#ifndef __IPHONE_5_0
  10 +#warning "This project uses features only available in iOS SDK 5.0 and later."
  11 +#endif
  12 +
  13 +#ifdef __OBJC__
  14 + @import UIKit;
  15 + @import Foundation;
  16 +#endif
... ...
Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModuleProtocol.h 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModuleProtocol.h
  1 +//
  2 +// CNLiveCPhotoRepairModuleProtocol.h
  3 +// CNLiveCPhotoRepairModule_Example
  4 +//
  5 +// Created by iOS on 2022/12/30.
  6 +// Copyright © 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <CNLiveBeeHive/CNLiveBeeHive.h>
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +
  14 +@protocol CNLiveCPhotoRepairModuleProtocol <NSObject,BHServiceProtocol>
  15 +/**
  16 + 调用分享界面进行分享操作
  17 +
  18 + */
  19 +- (void)showShareViewWithParam:(NSDictionary *)param fromVC:(UIViewController *)fromVC;
  20 +@end
  21 +
  22 +NS_ASSUME_NONNULL_END
... ...
Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModuleService.h 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModuleService.h
  1 +//
  2 +// CNLiveCPhotoRepairModuleService.h
  3 +// CNLiveCPhotoRepairModule_Example
  4 +//
  5 +// Created by iOS on 2022/12/30.
  6 +// Copyright © 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "CNLiveCPhotoRepairModuleProtocol.h"
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +
  14 +@interface CNLiveCPhotoRepairModuleService : NSObject<CNLiveCPhotoRepairModuleProtocol>
  15 ++ (void)pushPhotoRepair;
  16 +/**
  17 + *跳转修复完成页面
  18 + *contentId:页面id
  19 + *oldStr:旧照片地址
  20 + *newStr:新照片地址
  21 + */
  22 ++ (void)pushPhotoRepairWithContentId:(NSString *)contentId oldImage:(NSString *)oldStr newImage:(NSString *)newStr;
  23 +@end
  24 +
  25 +NS_ASSUME_NONNULL_END
... ...
Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModuleService.m 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNLiveCPhotoRepairModuleService.m
  1 +//
  2 +// CNLiveCPhotoRepairModuleService.m
  3 +// CNLiveCPhotoRepairModule_Example
  4 +//
  5 +// Created by iOS on 2022/12/30.
  6 +// Copyright © 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +#import "CNLiveCPhotoRepairModuleService.h"
  10 +#import <CNLiveBeeHive/BHRouter.h>
  11 +#import <QMUIKit/QMUIKit.h>
  12 +
  13 +static NSString *const CNLiveCPhotoRepairServiceKey = @"com.cnlive.CNLiveNetAdd://call.service.beehive/CNLiveCPhotoRepairService.CNLiveCPhotoRepairProtocol.";
  14 +///跳转照片修复页
  15 +static NSString *const CNLivePushPhotoRepair = @"pushPhotoRepair";
  16 +///跳转修复结果页
  17 +static NSString *const CNLivePushPhotoRepairResult = @"pushPhotoRepairWithContentId:oldImage:newImage:";
  18 +
  19 +@BeeHiveService(CNLiveCPhotoRepairModuleProtocol,CNLiveCPhotoRepairModuleService);
  20 +@implementation CNLiveCPhotoRepairModuleService
  21 +#pragma mark - 家园调主工程
  22 +- (void)showShareViewWithParam:(NSDictionary *)param fromVC:(UIViewController *)fromVC{
  23 + [QMUITips showSucceed:@"分享成功" inView:fromVC.view];
  24 +}
  25 +#pragma mark - 主工程调家园模块方法
  26 ++ (void)pushPhotoRepair{
  27 + NSURL *url = [NSURL URLWithString:[CNLiveCPhotoRepairServiceKey stringByAppendingString:CNLivePushPhotoRepair]];
  28 + [BHRouter openURL:url];
  29 +}
  30 ++ (void)pushPhotoRepairWithContentId:(NSString *)contentId oldImage:(NSString *)oldStr newImage:(NSString *)newStr{
  31 + NSURL *url = [NSURL URLWithString:[CNLiveCPhotoRepairServiceKey stringByAppendingString:CNLivePushPhotoRepairResult]];
  32 + [BHRouter openURL:url withParams:@{@"CNLiveCPhotoRepairService":@{
  33 + @"contantId":contentId,
  34 + @"oldStr":oldStr,
  35 + @"newStr":newStr
  36 + }}];
  37 +}
  38 +@end
... ...
Example/CNLiveCPhotoRepairModule/CNViewController.h 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNViewController.h
  1 +//
  2 +// CNViewController.h
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by 杨苓玉 on 12/29/2022.
  6 +// Copyright (c) 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +@import UIKit;
  10 +
  11 +@interface CNViewController : UIViewController
  12 +
  13 +@end
... ...
Example/CNLiveCPhotoRepairModule/CNViewController.m 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/CNViewController.m
  1 +//
  2 +// CNViewController.m
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by 杨苓玉 on 12/29/2022.
  6 +// Copyright (c) 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +#import "CNViewController.h"
  10 +#import "CNLiveCPhotoRepairModuleService.h"
  11 +
  12 +@interface CNViewController ()
  13 +
  14 +@end
  15 +
  16 +@implementation CNViewController
  17 +
  18 +- (void)viewDidLoad
  19 +{
  20 + [super viewDidLoad];
  21 + UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 100, 100, 44)];
  22 + btn.backgroundColor = [UIColor redColor];
  23 + [btn addTarget:self action:@selector(pushPhotoRepair) forControlEvents:UIControlEventTouchUpInside];
  24 + [self.view addSubview:btn];
  25 + UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(150, 100, 50, 44)];
  26 + btn1.backgroundColor = [UIColor redColor];
  27 + [btn1 addTarget:self action:@selector(pushPhotoRepairResult) forControlEvents:UIControlEventTouchUpInside];
  28 + [self.view addSubview:btn1];
  29 +}
  30 +- (void)pushPhotoRepair{
  31 + [CNLiveCPhotoRepairModuleService pushPhotoRepair];
  32 +}
  33 +- (void)pushPhotoRepairResult{
  34 + [CNLiveCPhotoRepairModuleService pushPhotoRepairWithContentId:@"123" oldImage:@"345" newImage:@"098"];
  35 +}
  36 +
  37 +- (void)didReceiveMemoryWarning
  38 +{
  39 + [super didReceiveMemoryWarning];
  40 + // Dispose of any resources that can be recreated.
  41 +}
  42 +
  43 +@end
... ...
Example/CNLiveCPhotoRepairModule/Images.xcassets/AppIcon.appiconset/Contents.json 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/Images.xcassets/AppIcon.appiconset/Contents.json
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "iphone",
  5 + "size" : "20x20",
  6 + "scale" : "2x"
  7 + },
  8 + {
  9 + "idiom" : "iphone",
  10 + "size" : "20x20",
  11 + "scale" : "3x"
  12 + },
  13 + {
  14 + "idiom" : "iphone",
  15 + "size" : "29x29",
  16 + "scale" : "2x"
  17 + },
  18 + {
  19 + "idiom" : "iphone",
  20 + "size" : "29x29",
  21 + "scale" : "3x"
  22 + },
  23 + {
  24 + "idiom" : "iphone",
  25 + "size" : "40x40",
  26 + "scale" : "2x"
  27 + },
  28 + {
  29 + "idiom" : "iphone",
  30 + "size" : "40x40",
  31 + "scale" : "3x"
  32 + },
  33 + {
  34 + "idiom" : "iphone",
  35 + "size" : "60x60",
  36 + "scale" : "2x"
  37 + },
  38 + {
  39 + "idiom" : "iphone",
  40 + "size" : "60x60",
  41 + "scale" : "3x"
  42 + },
  43 + {
  44 + "idiom" : "ipad",
  45 + "size" : "20x20",
  46 + "scale" : "1x"
  47 + },
  48 + {
  49 + "idiom" : "ipad",
  50 + "size" : "20x20",
  51 + "scale" : "2x"
  52 + },
  53 + {
  54 + "idiom" : "ipad",
  55 + "size" : "29x29",
  56 + "scale" : "1x"
  57 + },
  58 + {
  59 + "idiom" : "ipad",
  60 + "size" : "29x29",
  61 + "scale" : "2x"
  62 + },
  63 + {
  64 + "idiom" : "ipad",
  65 + "size" : "40x40",
  66 + "scale" : "1x"
  67 + },
  68 + {
  69 + "idiom" : "ipad",
  70 + "size" : "40x40",
  71 + "scale" : "2x"
  72 + },
  73 + {
  74 + "idiom" : "ipad",
  75 + "size" : "76x76",
  76 + "scale" : "1x"
  77 + },
  78 + {
  79 + "idiom" : "ipad",
  80 + "size" : "76x76",
  81 + "scale" : "2x"
  82 + },
  83 + {
  84 + "idiom" : "ipad",
  85 + "size" : "83.5x83.5",
  86 + "scale" : "2x"
  87 + },
  88 + {
  89 + "idiom" : "ios-marketing",
  90 + "size" : "1024x1024",
  91 + "scale" : "1x"
  92 + }
  93 + ],
  94 + "info" : {
  95 + "version" : 1,
  96 + "author" : "xcode"
  97 + }
  98 +}
... ...
Example/CNLiveCPhotoRepairModule/en.lproj/InfoPlist.strings 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/en.lproj/InfoPlist.strings
  1 +/* Localized versions of Info.plist keys */
  2 +
... ...
Example/CNLiveCPhotoRepairModule/main.m 0 → 100644
  1 +++ a/Example/CNLiveCPhotoRepairModule/main.m
  1 +//
  2 +// main.m
  3 +// CNLiveCPhotoRepairModule
  4 +//
  5 +// Created by 杨苓玉 on 12/29/2022.
  6 +// Copyright (c) 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +@import UIKit;
  10 +#import "CNAppDelegate.h"
  11 +
  12 +int main(int argc, char * argv[])
  13 +{
  14 + @autoreleasepool {
  15 + return UIApplicationMain(argc, argv, nil, NSStringFromClass([CNAppDelegate class]));
  16 + }
  17 +}
... ...
Example/Podfile 0 → 100644
  1 +++ a/Example/Podfile
  1 +use_frameworks!
  2 +
  3 +source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
  4 +source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git'
  5 +source 'http://bj.gitlab.cnlive.com/DSIOSTeam/DSSpecRepos.git'
  6 +
  7 +platform :ios, '10.0'
  8 +
  9 +target 'CNLiveCPhotoRepairModule_Example' do
  10 + pod 'CNLiveCPhotoRepairModule', :path => '../'
  11 + #依赖三方私有库,如果里面有.a的时候加上这个
  12 + pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  13 + ############################################ #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件
  14 +
  15 + dir_web = File.join(installer.sandbox.pod_dir('WebViewJavascriptBridge'), 'WebViewJavascriptBridge')
  16 + Dir.foreach(dir_web) {|x|
  17 + real_path = File.join(dir_web, x)
  18 + if (!File.directory?(real_path) && File.exists?(real_path))
  19 + if(x == 'WebViewJavascriptBridge.h' || x == 'WebViewJavascriptBridge.m')
  20 + File.delete(real_path)
  21 + end
  22 + end
  23 + }
  24 + #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件
  25 + #################################################
  26 + end
  27 + target 'CNLiveCPhotoRepairModule_Tests' do
  28 + inherit! :search_paths
  29 +
  30 +
  31 + end
  32 +end
... ...
Example/Tests/Tests-Info.plist 0 → 100644
  1 +++ a/Example/Tests/Tests-Info.plist
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>CFBundleDevelopmentRegion</key>
  6 + <string>en</string>
  7 + <key>CFBundleExecutable</key>
  8 + <string>${EXECUTABLE_NAME}</string>
  9 + <key>CFBundleIdentifier</key>
  10 + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
  11 + <key>CFBundleInfoDictionaryVersion</key>
  12 + <string>6.0</string>
  13 + <key>CFBundlePackageType</key>
  14 + <string>BNDL</string>
  15 + <key>CFBundleShortVersionString</key>
  16 + <string>1.0</string>
  17 + <key>CFBundleSignature</key>
  18 + <string>????</string>
  19 + <key>CFBundleVersion</key>
  20 + <string>1</string>
  21 +</dict>
  22 +</plist>
... ...
Example/Tests/Tests-Prefix.pch 0 → 100644
  1 +++ a/Example/Tests/Tests-Prefix.pch
  1 +// The contents of this file are implicitly included at the beginning of every test case source file.
  2 +
  3 +#ifdef __OBJC__
  4 +
  5 +
  6 +
  7 +#endif
... ...
Example/Tests/Tests.m 0 → 100644
  1 +++ a/Example/Tests/Tests.m
  1 +//
  2 +// CNLiveCPhotoRepairModuleTests.m
  3 +// CNLiveCPhotoRepairModuleTests
  4 +//
  5 +// Created by 杨苓玉 on 12/29/2022.
  6 +// Copyright (c) 2022 杨苓玉. All rights reserved.
  7 +//
  8 +
  9 +@import XCTest;
  10 +
  11 +@interface Tests : XCTestCase
  12 +
  13 +@end
  14 +
  15 +@implementation Tests
  16 +
  17 +- (void)setUp
  18 +{
  19 + [super setUp];
  20 + // Put setup code here. This method is called before the invocation of each test method in the class.
  21 +}
  22 +
  23 +- (void)tearDown
  24 +{
  25 + // Put teardown code here. This method is called after the invocation of each test method in the class.
  26 + [super tearDown];
  27 +}
  28 +
  29 +- (void)testExample
  30 +{
  31 + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
  32 +}
  33 +
  34 +@end
  35 +
... ...
Example/Tests/en.lproj/InfoPlist.strings 0 → 100644
  1 +++ a/Example/Tests/en.lproj/InfoPlist.strings
  1 +/* Localized versions of Info.plist keys */
  2 +
... ...
LICENSE 0 → 100644
  1 +++ a/LICENSE
  1 +Copyright (c) 2022 杨苓玉 <ios_18710032165@163.com>
  2 +
  3 +Permission is hereby granted, free of charge, to any person obtaining a copy
  4 +of this software and associated documentation files (the "Software"), to deal
  5 +in the Software without restriction, including without limitation the rights
  6 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7 +copies of the Software, and to permit persons to whom the Software is
  8 +furnished to do so, subject to the following conditions:
  9 +
  10 +The above copyright notice and this permission notice shall be included in
  11 +all copies or substantial portions of the Software.
  12 +
  13 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19 +THE SOFTWARE.
... ...
README.md 0 → 100644
  1 +++ a/README.md
  1 +# CNLiveCPhotoRepairModule
  2 +
  3 +[![CI Status](https://img.shields.io/travis/杨苓玉/CNLiveCPhotoRepairModule.svg?style=flat)](https://travis-ci.org/杨苓玉/CNLiveCPhotoRepairModule)
  4 +[![Version](https://img.shields.io/cocoapods/v/CNLiveCPhotoRepairModule.svg?style=flat)](https://cocoapods.org/pods/CNLiveCPhotoRepairModule)
  5 +[![License](https://img.shields.io/cocoapods/l/CNLiveCPhotoRepairModule.svg?style=flat)](https://cocoapods.org/pods/CNLiveCPhotoRepairModule)
  6 +[![Platform](https://img.shields.io/cocoapods/p/CNLiveCPhotoRepairModule.svg?style=flat)](https://cocoapods.org/pods/CNLiveCPhotoRepairModule)
  7 +
  8 +## Example
  9 +
  10 +To run the example project, clone the repo, and run `pod install` from the Example directory first.
  11 +
  12 +## Requirements
  13 +
  14 +## Installation
  15 +
  16 +CNLiveCPhotoRepairModule is available through [CocoaPods](https://cocoapods.org). To install
  17 +it, simply add the following line to your Podfile:
  18 +
  19 +```ruby
  20 +pod 'CNLiveCPhotoRepairModule'
  21 +```
  22 +
  23 +## Author
  24 +
  25 +杨苓玉, ios_18710032165@163.com
  26 +
  27 +## License
  28 +
  29 +CNLiveCPhotoRepairModule is available under the MIT license. See the LICENSE file for more info.
... ...
_Pods.xcodeproj 0 → 120000
  1 +++ a/_Pods.xcodeproj
  1 +Example/Pods/Pods.xcodeproj
0 2 \ No newline at end of file
... ...