Commit b059b30a78f6a5531d28bca25b9ad7f2c0348bd5
1 parent
df098422
no message
Showing
83 changed files
with
3315 additions
and
1 deletions
CNLiveQrCodeModule.podspec
0 → 100644
| 1 | +# | ||
| 2 | +# Be sure to run `pod lib lint CNLiveQrCodeModule.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 = 'CNLiveQrCodeModule' | ||
| 11 | + s.version = '0.0.1' | ||
| 12 | + s.summary = 'CNLiveQrCodeModule.' | ||
| 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: 网家家-二维码模块. | ||
| 22 | + DESC | ||
| 23 | + | ||
| 24 | + s.homepage = 'http://bj.gitlab.cnlive.com/ios-team/CNLiveQrCodeModule' | ||
| 25 | + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' | ||
| 26 | + s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
| 27 | + s.author = { '153993236@qq.com' => 'zhangxiaowen@cnlive.com' } | ||
| 28 | + s.source = { :git => 'http://bj.gitlab.cnlive.com/ios-team/CNLiveQrCodeModule.git', :tag => s.version.to_s } | ||
| 29 | + # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' | ||
| 30 | + | ||
| 31 | + s.ios.deployment_target = '9.0' | ||
| 32 | + | ||
| 33 | + s.source_files = 'CNLiveQrCodeModule/Classes/**/*' | ||
| 34 | + | ||
| 35 | + s.resource_bundles = { | ||
| 36 | + 'CNLiveQrCodeModule' => ['CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets'] | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + # s.resource_bundles = { | ||
| 40 | + # 'CNLiveQrCodeModule' => ['CNLiveQrCodeModule/Assets/*.png'] | ||
| 41 | + # } | ||
| 42 | + | ||
| 43 | + # s.public_header_files = 'Pod/Classes/**/*.h' | ||
| 44 | + # s.frameworks = 'UIKit', 'MapKit' | ||
| 45 | + # s.dependency 'AFNetworking', '~> 2.3' | ||
| 46 | + | ||
| 47 | + # pod | ||
| 48 | + s.dependency 'CNLiveTripartiteManagement/QMUIKit' | ||
| 49 | + s.dependency 'CNLiveTripartiteManagement/SDWebImage' | ||
| 50 | + s.dependency 'CNLiveTripartiteManagement/Masonry' | ||
| 51 | + s.dependency 'CNLiveTripartiteManagement/MJExtension' | ||
| 52 | + s.dependency 'SGQRCode' | ||
| 53 | + | ||
| 54 | + # 服务层 | ||
| 55 | + s.dependency 'CNLiveServices' | ||
| 56 | + | ||
| 57 | + # 用户信息本地化 | ||
| 58 | + s.dependency 'CNLiveUserManagement' | ||
| 59 | + | ||
| 60 | +end |
CNLiveQrCodeModule/Assets/.gitkeep
0 → 100644
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/Contents.json
0 → 100644
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/code_refresh.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "code_refresh@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "code_refresh@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/code_refresh.imageset/code_refresh@2x.png
0 → 100644
1.46 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/code_refresh.imageset/code_refresh@3x.png
0 → 100644
2.57 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/default_avatar_f.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "default_avatar_f.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 | \ No newline at end of file | 22 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/default_avatar_f.imageset/default_avatar_f.png
0 → 100644
11.1 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/default_avatar_y.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "default_avatar_y.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 | \ No newline at end of file | 22 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/default_avatar_y.imageset/default_avatar_y.png
0 → 100644
10.7 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/flashlight_close.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "flashlight_close@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "flashlight_close@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/flashlight_close.imageset/flashlight_close@2x.png
0 → 100644
1.29 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/flashlight_close.imageset/flashlight_close@3x.png
0 → 100644
1.41 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/flashlight_open.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "flashlight_open@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "flashlight_open@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/flashlight_open.imageset/flashlight_open@2x.png
0 → 100644
1.34 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/flashlight_open.imageset/flashlight_open@3x.png
0 → 100644
1.52 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_all_front.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "mine_all_front@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "mine_all_front@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_all_front.imageset/mine_all_front@2x.png
0 → 100644
266 Bytes
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_all_front.imageset/mine_all_front@3x.png
0 → 100644
615 Bytes
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_back_white_b.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "mine_back_white_b@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "mine_back_white_b@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_back_white_b.imageset/mine_back_white_b@2x.png
0 → 100644
2.03 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_back_white_b.imageset/mine_back_white_b@3x.png
0 → 100644
2.28 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_code.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "mine_code@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "mine_code@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_code.imageset/mine_code@2x.png
0 → 100644
1.06 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_code.imageset/mine_code@3x.png
0 → 100644
2.03 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_code_more.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "mine_code_more@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "mine_code_more@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_code_more.imageset/mine_code_more@2x.png
0 → 100644
205 Bytes
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_code_more.imageset/mine_code_more@3x.png
0 → 100644
962 Bytes
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_info_front.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "mine_info_front@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "mine_info_front@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_info_front.imageset/mine_info_front@2x.png
0 → 100644
1.24 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_info_front.imageset/mine_info_front@3x.png
0 → 100644
1.51 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_info_qrcode.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "mine_info_qrcode@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "mine_info_qrcode@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_info_qrcode.imageset/mine_info_qrcode@2x.png
0 → 100644
1.64 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/mine_info_qrcode.imageset/mine_info_qrcode@3x.png
0 → 100644
1.73 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_bg.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "qr_code_bg@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "qr_code_bg@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_bg.imageset/qr_code_bg@2x.png
0 → 100644
104 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_bg.imageset/qr_code_bg@3x.png
0 → 100644
142 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_green.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "qr_code_green@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "qr_code_green@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_green.imageset/qr_code_green@2x.png
0 → 100644
1.57 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_green.imageset/qr_code_green@3x.png
0 → 100644
1.72 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_icon.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "qr_code_icon@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "qr_code_icon@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_icon.imageset/qr_code_icon@2x.png
0 → 100644
7.47 KB
CNLiveQrCodeModule/Assets/CNLiveQrCodeModule.xcassets/qr_code_icon.imageset/qr_code_icon@3x.png
0 → 100644
11.1 KB
CNLiveQrCodeModule/Classes/.gitkeep
0 → 100644
CNLiveQrCodeModule/Classes/Controller/CNLiveGroupQrCodeController.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveGroupQrCodeController.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 群组二维码 | ||
| 12 | + */ | ||
| 13 | + | ||
| 14 | +#import <UIKit/UIKit.h> | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_BEGIN | ||
| 17 | + | ||
| 18 | +@interface CNLiveGroupQrCodeController : UIViewController | ||
| 19 | +@property (nonatomic, assign) BOOL isScanCode; | ||
| 20 | + | ||
| 21 | +@end | ||
| 22 | + | ||
| 23 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/Controller/CNLiveGroupQrCodeController.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveGroupQrCodeController.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveGroupQrCodeController.h" | ||
| 10 | + | ||
| 11 | +#import "QMUIKit.h" | ||
| 12 | + | ||
| 13 | +#import "CNLiveQrCodeNavigationBar.h" | ||
| 14 | + | ||
| 15 | +@interface CNLiveGroupQrCodeController() | ||
| 16 | + | ||
| 17 | +@end | ||
| 18 | + | ||
| 19 | +@implementation CNLiveGroupQrCodeController | ||
| 20 | +static const NSInteger kHEIGHT = 250; | ||
| 21 | + | ||
| 22 | +#pragma mark - 加载数据 | ||
| 23 | +- (void)loadData { | ||
| 24 | + | ||
| 25 | + | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +#pragma mark - 生命周期 | ||
| 29 | +- (void)viewWillAppear:(BOOL)animated{ | ||
| 30 | + [super viewWillAppear:animated]; | ||
| 31 | + self.navigationController.navigationBarHidden = YES; | ||
| 32 | + | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +- (void)viewDidLoad { | ||
| 36 | + [super viewDidLoad]; | ||
| 37 | + self.view.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1.0]; | ||
| 38 | + [self createSubViews]; | ||
| 39 | + [self loadData]; | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +- (void)dealloc { | ||
| 43 | + | ||
| 44 | + | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +- (void)createSubViews { | ||
| 48 | + | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +#pragma mark - 状态栏 | ||
| 52 | +/** | ||
| 53 | + * 状态栏的颜色 | ||
| 54 | + * | ||
| 55 | + * @return UIStatusBarStyle | ||
| 56 | + * | ||
| 57 | + */ | ||
| 58 | +- (UIStatusBarStyle)preferredStatusBarStyle{ | ||
| 59 | + return UIStatusBarStyleLightContent; | ||
| 60 | + | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +#pragma mark - 懒加载 | ||
| 64 | + | ||
| 65 | + | ||
| 66 | +#pragma mark - 响应方法 | ||
| 67 | +- (void)soccerDidClicked:(UIButton *)btn{ | ||
| 68 | + | ||
| 69 | +} | ||
| 70 | + | ||
| 71 | +/** | ||
| 72 | + * 创建图片 | ||
| 73 | + * | ||
| 74 | + * @param imageName 图片名字 | ||
| 75 | + * @param bundleName 图片所在的bundle名字 | ||
| 76 | + * @param targetClass 类和bundle的同级目录 | ||
| 77 | + * @return 返回UIImage | ||
| 78 | + */ | ||
| 79 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 80 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 81 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 82 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 83 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 84 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 85 | +} | ||
| 86 | + | ||
| 87 | +@end |
CNLiveQrCodeModule/Classes/Controller/CNLiveMyQrCodeController.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeController.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 我的二维码 | ||
| 11 | + */ | ||
| 12 | + | ||
| 13 | +#import <UIKit/UIKit.h> | ||
| 14 | + | ||
| 15 | +NS_ASSUME_NONNULL_BEGIN | ||
| 16 | + | ||
| 17 | +@interface CNLiveMyQrCodeController : UIViewController | ||
| 18 | +@property (nonatomic, assign) BOOL isScanCode; | ||
| 19 | + | ||
| 20 | +@end | ||
| 21 | + | ||
| 22 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/Controller/CNLiveMyQrCodeController.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeController.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveMyQrCodeController.h" | ||
| 10 | +#import "QMUIKit.h" | ||
| 11 | + | ||
| 12 | +#import <Photos/Photos.h> | ||
| 13 | +#import <Accelerate/Accelerate.h> | ||
| 14 | + | ||
| 15 | +#import <Masonry/Masonry.h> | ||
| 16 | +#import <SDWebImage/SDWebImage.h> | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +#import "CNLiveMyQrCodeView.h" | ||
| 20 | +#import "CNLiveQrCodeNavigationBar.h" | ||
| 21 | + | ||
| 22 | +@interface CNLiveMyQrCodeController ()<CNLiveQrCodeNavigationBarDelegate> | ||
| 23 | +@property (nonatomic, strong) CNLiveQrCodeNavigationBar *navigationBar; | ||
| 24 | +@property (nonatomic, weak) UIImageView *bgView; | ||
| 25 | +@property (nonatomic, weak) CNLiveMyQrCodeView *qrCodeView; | ||
| 26 | +@property (nonatomic, weak) UIButton *rightBtn; | ||
| 27 | + | ||
| 28 | +@end | ||
| 29 | + | ||
| 30 | +@implementation CNLiveMyQrCodeController | ||
| 31 | +static const NSInteger margin = 20; | ||
| 32 | +static const CGFloat timeValue = 1.5; | ||
| 33 | + | ||
| 34 | +#pragma mark - 生命周期 | ||
| 35 | +- (void)viewWillAppear:(BOOL)animated{ | ||
| 36 | + [super viewWillAppear:animated]; | ||
| 37 | + self.navigationController.navigationBarHidden = YES; | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +- (void)viewDidLoad { | ||
| 41 | + [super viewDidLoad]; | ||
| 42 | + self.view.backgroundColor = [UIColor blackColor]; | ||
| 43 | + if (@available(iOS 11, *)) { | ||
| 44 | + } | ||
| 45 | + else { | ||
| 46 | + self.automaticallyAdjustsScrollViewInsets = NO; | ||
| 47 | + } | ||
| 48 | + [self createSubViews]; | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +- (void)dealloc { | ||
| 52 | + NSLog(@"CNLiveMyQrCodeController -- dealloc"); | ||
| 53 | + | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +- (void)createSubViews { | ||
| 57 | + UIImageView *bgView = [[UIImageView alloc]initWithFrame:self.view.bounds]; | ||
| 58 | + UIImage *image = [self xw_getImageName:@"qr_code_bg" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeController class]]; | ||
| 59 | + [bgView sd_setImageWithURL:[NSURL URLWithString:@"User_Head"] placeholderImage:image completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { | ||
| 60 | + if(image){ | ||
| 61 | +// bgView.image = [image blurImageWithRadius:4]; | ||
| 62 | + } | ||
| 63 | + }]; | ||
| 64 | + [self.view addSubview:bgView]; | ||
| 65 | + self.bgView = bgView; | ||
| 66 | + | ||
| 67 | + CNLiveMyQrCodeView *qrCodeView = [[CNLiveMyQrCodeView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-2*margin, 420)]; | ||
| 68 | + qrCodeView.center = self.view.center; | ||
| 69 | + [self.view addSubview:qrCodeView]; | ||
| 70 | + self.qrCodeView = qrCodeView; | ||
| 71 | + [self.view addSubview:self.navigationBar]; | ||
| 72 | + | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +/** | ||
| 76 | + * 状态栏的颜色 | ||
| 77 | + * | ||
| 78 | + * @return UIStatusBarStyle | ||
| 79 | + * | ||
| 80 | + */ | ||
| 81 | +- (UIStatusBarStyle)preferredStatusBarStyle{ | ||
| 82 | + return UIStatusBarStyleLightContent; | ||
| 83 | + | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +#pragma mark - 响应方法 | ||
| 87 | +- (void)goBack { | ||
| 88 | + if (self.presentingViewController != nil) { | ||
| 89 | + [self dismissViewControllerAnimated:YES completion:nil]; | ||
| 90 | + | ||
| 91 | + } | ||
| 92 | + else { | ||
| 93 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 94 | + } | ||
| 95 | +} | ||
| 96 | + | ||
| 97 | +- (void)rightButtonDidClicked:(UIButton *)btn { | ||
| 98 | + btn.userInteractionEnabled = NO; | ||
| 99 | + __weak typeof(self) weakSelf = self; | ||
| 100 | +// XWAlertController *alertController = [XWAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:XWAlertControllerStyleActionSheet]; | ||
| 101 | +// alertController.delegate = self; | ||
| 102 | +// alertController.needDialogBlur = NO; | ||
| 103 | +// XWAlertAction *action1 = [XWAlertAction actionWithTitle:@"保存图片" style:XWAlertActionStyleDefault handler:^(XWAlertAction * _Nonnull action) { | ||
| 104 | +// __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 105 | +// if(!strongSelf) return ; | ||
| 106 | +// [strongSelf getPHAuthorizationStatus:^{ | ||
| 107 | +// UIImage *image = [self.qrCodeView getImage]; | ||
| 108 | +// [strongSelf saveImage:image]; | ||
| 109 | +// }]; | ||
| 110 | +// btn.userInteractionEnabled = YES; | ||
| 111 | +// | ||
| 112 | +// }]; | ||
| 113 | +// XWAlertAction *action2 = [XWAlertAction actionWithTitle:@"扫描二维码" style:XWAlertActionStyleDefault handler:^(XWAlertAction * _Nonnull action) { | ||
| 114 | +// __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 115 | +// if(!strongSelf) return ; | ||
| 116 | +// if(strongSelf.isScanCode){ | ||
| 117 | +// [strongSelf.navigationController popViewControllerAnimated:YES]; | ||
| 118 | +// }else{ | ||
| 119 | +// XWScanQrCodeController *vc = [[XWScanQrCodeController alloc]init]; | ||
| 120 | +// vc.isMyCode = YES; | ||
| 121 | +// [strongSelf.navigationController pushViewController:vc animated:YES]; | ||
| 122 | +// } | ||
| 123 | +// btn.userInteractionEnabled = YES; | ||
| 124 | +// | ||
| 125 | +// }]; | ||
| 126 | +// XWAlertAction *action3 = [XWAlertAction actionWithTitle:@"重置二维码" style:XWAlertActionStyleDefault handler:^(XWAlertAction * _Nonnull action) { | ||
| 127 | +// __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 128 | +// if(!strongSelf) return ; | ||
| 129 | +// [strongSelf.qrCodeView generateQRCode:@"reset"]; | ||
| 130 | +// btn.userInteractionEnabled = YES; | ||
| 131 | +// | ||
| 132 | +// }]; | ||
| 133 | +// XWAlertAction *action4 = [XWAlertAction actionWithTitle:@"取消" style:XWAlertActionStyleCancel handler:^(XWAlertAction * _Nonnull action) { | ||
| 134 | +// btn.userInteractionEnabled = YES; | ||
| 135 | +// }]; | ||
| 136 | +// [alertController addAction:action1]; | ||
| 137 | +// [alertController addAction:action2]; | ||
| 138 | +// [alertController addAction:action3]; // 取消按钮一定排在最底部 | ||
| 139 | +// [alertController addAction:action4]; // 取消按钮一定排在最底部 | ||
| 140 | +// | ||
| 141 | +// [self presentViewController:alertController animated:YES completion:^{}]; | ||
| 142 | + | ||
| 143 | +} | ||
| 144 | +//// 已经dismiss | ||
| 145 | +//- (void)didDismissAlertController:(XWAlertController *)alertController{ | ||
| 146 | +// self.rightBtn.userInteractionEnabled = YES; | ||
| 147 | +//} | ||
| 148 | + | ||
| 149 | +- (void)getPHAuthorizationStatus:(void (^)(void))block{ | ||
| 150 | + // 1.获取当前App的相册授权状态 | ||
| 151 | + PHAuthorizationStatus authorizationStatus = [PHPhotoLibrary authorizationStatus]; | ||
| 152 | + | ||
| 153 | + // 2.判断授权状态 | ||
| 154 | + if (authorizationStatus == PHAuthorizationStatusAuthorized) { | ||
| 155 | + // 2.1 如果已经授权, 保存图片(调用步骤2的方法) | ||
| 156 | + block(); | ||
| 157 | + | ||
| 158 | + } else if (authorizationStatus == PHAuthorizationStatusNotDetermined) { // 如果没决定, 弹出指示框, 让用户选择 | ||
| 159 | + [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { | ||
| 160 | + // 如果用户选择授权, 则保存图片 | ||
| 161 | + if (status == PHAuthorizationStatusAuthorized) { | ||
| 162 | + dispatch_async(dispatch_get_main_queue(), ^{ | ||
| 163 | + block(); | ||
| 164 | + }); | ||
| 165 | + } | ||
| 166 | + }]; | ||
| 167 | + | ||
| 168 | + } else { | ||
| 169 | + NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; | ||
| 170 | + NSString *app_Name = [infoDict objectForKey:@"CFBundleDisplayName"]; | ||
| 171 | + if (app_Name == nil) { | ||
| 172 | + app_Name = [infoDict objectForKey:@"CFBundleName"]; | ||
| 173 | + } | ||
| 174 | + NSString *messageString = [NSString stringWithFormat:@"请在iPhone的\"设置 - 隐私 - 相机\"选项中,允许%@访问你的相册", app_Name]; | ||
| 175 | + UIAlertController *alertC = [UIAlertController alertControllerWithTitle:nil message:messageString preferredStyle:(UIAlertControllerStyleAlert)]; | ||
| 176 | + UIAlertAction *alertA = [UIAlertAction actionWithTitle:@"好" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { | ||
| 177 | + | ||
| 178 | + }]; | ||
| 179 | + | ||
| 180 | + [alertC addAction:alertA]; | ||
| 181 | + [self presentViewController:alertC animated:YES completion:nil]; | ||
| 182 | + } | ||
| 183 | +} | ||
| 184 | + | ||
| 185 | +// 保存图片 | ||
| 186 | +- (void)saveImage:(UIImage *)image{ | ||
| 187 | + [[PHPhotoLibrary sharedPhotoLibrary]performChanges:^{ | ||
| 188 | + [PHAssetChangeRequest creationRequestForAssetFromImage:image]; | ||
| 189 | + | ||
| 190 | + } completionHandler:^(BOOL success, NSError * _Nullable error) { | ||
| 191 | + dispatch_async(dispatch_get_main_queue(), ^{ | ||
| 192 | + if (error) { | ||
| 193 | + NSLog(@"%@",@"保存失败"); | ||
| 194 | + [QMUITips showError:@"保存失败" inView:self.view hideAfterDelay:timeValue]; | ||
| 195 | + } else { | ||
| 196 | + NSLog(@"%@",@"保存成功"); | ||
| 197 | + [QMUITips showSucceed:@"保存成功" inView:self.view hideAfterDelay:timeValue]; | ||
| 198 | + } | ||
| 199 | + }); | ||
| 200 | + | ||
| 201 | + }]; | ||
| 202 | +} | ||
| 203 | + | ||
| 204 | +#pragma mark - 懒加载 | ||
| 205 | +- (void)navigationBar:(CNLiveQrCodeNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{ | ||
| 206 | + if ([actionEvents isEqualToString:@"1"]) { | ||
| 207 | + [self goBack]; | ||
| 208 | + } | ||
| 209 | +} | ||
| 210 | +- (CNLiveQrCodeNavigationBar *)navigationBar { | ||
| 211 | + if (!_navigationBar) { | ||
| 212 | + _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, NavigationContentTop)]; | ||
| 213 | + _navigationBar.delegate = self; | ||
| 214 | + _navigationBar.title.text = @"我的二维码"; | ||
| 215 | + UIImage *image2 = [self xw_getImageName:@"mine_code_more" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeController class]]; | ||
| 216 | + [_navigationBar.right setImage:[image2 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; | ||
| 217 | + } | ||
| 218 | + return _navigationBar; | ||
| 219 | +} | ||
| 220 | + | ||
| 221 | +/** | ||
| 222 | + * 创建图片 | ||
| 223 | + * | ||
| 224 | + * @param imageName 图片名字 | ||
| 225 | + * @param bundleName 图片所在的bundle名字 | ||
| 226 | + * @param targetClass 类和bundle的同级目录 | ||
| 227 | + * @return 返回UIImage | ||
| 228 | + */ | ||
| 229 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 230 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 231 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 232 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 233 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 234 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 235 | +} | ||
| 236 | + | ||
| 237 | +@end |
CNLiveQrCodeModule/Classes/Controller/CNLiveScanQrCodeController.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveScanQrCodeController.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 扫一扫 | ||
| 11 | + */ | ||
| 12 | + | ||
| 13 | +#import <UIKit/UIKit.h> | ||
| 14 | + | ||
| 15 | +NS_ASSUME_NONNULL_BEGIN | ||
| 16 | + | ||
| 17 | +@interface CNLiveScanQrCodeController : UIViewController | ||
| 18 | +@property (nonatomic, assign) BOOL isMyCode; | ||
| 19 | + | ||
| 20 | +@end | ||
| 21 | + | ||
| 22 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/Controller/CNLiveScanQrCodeController.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveScanQrCodeController.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveScanQrCodeController.h" | ||
| 10 | + | ||
| 11 | +#import "MJExtension.h" | ||
| 12 | +#import "QMUIKit.h" | ||
| 13 | + | ||
| 14 | +#import "SGQRCode.h"//二维码库 | ||
| 15 | + | ||
| 16 | +#import "CNLiveMyQrCodeController.h" | ||
| 17 | +#import "CNLiveQrCodeNavigationBar.h" | ||
| 18 | + | ||
| 19 | +//#import "XWScanSuccessController.h" | ||
| 20 | + | ||
| 21 | +@interface CNLiveScanQrCodeController ()<CNLiveQrCodeNavigationBarDelegate>{ | ||
| 22 | + SGQRCodeObtain *obtain; | ||
| 23 | +} | ||
| 24 | +@property (nonatomic, strong) CNLiveQrCodeNavigationBar *navigationBar; | ||
| 25 | +@property (nonatomic, strong) SGQRCodeScanView *scanView; | ||
| 26 | +@property (nonatomic, strong) UIButton *flashlightBtn;//手电筒 | ||
| 27 | +@property (nonatomic, assign) BOOL isSelected;//是否打开手电筒 | ||
| 28 | +@property (nonatomic, strong) UIButton *codeButton;//我的二维码 | ||
| 29 | +@property (nonatomic, strong) UILabel *promptLabel;//将二维码/条码放入框内, 即可自动扫描 | ||
| 30 | + | ||
| 31 | +@end | ||
| 32 | + | ||
| 33 | +@implementation CNLiveScanQrCodeController | ||
| 34 | +static const CGFloat timeValue = 1.5; | ||
| 35 | + | ||
| 36 | +- (void)getAVAuthorizationStatus:(void (^)(void))block{ | ||
| 37 | + AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; | ||
| 38 | + if (device) { | ||
| 39 | + AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; | ||
| 40 | + switch (status) { | ||
| 41 | + case AVAuthorizationStatusNotDetermined: { | ||
| 42 | + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { | ||
| 43 | + if (granted) { | ||
| 44 | + dispatch_sync(dispatch_get_main_queue(), ^{ | ||
| 45 | + block(); | ||
| 46 | + }); | ||
| 47 | + NSLog(@"用户第一次同意了访问相机权限 - - %@", [NSThread currentThread]); | ||
| 48 | + } else { | ||
| 49 | + NSLog(@"用户第一次拒绝了访问相机权限 - - %@", [NSThread currentThread]); | ||
| 50 | + } | ||
| 51 | + }]; | ||
| 52 | + break; | ||
| 53 | + } | ||
| 54 | + case AVAuthorizationStatusAuthorized: { | ||
| 55 | + block(); | ||
| 56 | + break; | ||
| 57 | + } | ||
| 58 | + case AVAuthorizationStatusDenied: { | ||
| 59 | + NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; | ||
| 60 | + NSString *app_Name = [infoDict objectForKey:@"CFBundleDisplayName"]; | ||
| 61 | + if (app_Name == nil) { | ||
| 62 | + app_Name = [infoDict objectForKey:@"CFBundleName"]; | ||
| 63 | + } | ||
| 64 | + NSString *messageString = [NSString stringWithFormat:@"请在iPhone的\"设置 - 隐私 - 相机\"选项中,允许%@访问你的相机", app_Name]; | ||
| 65 | + UIAlertController *alertC = [UIAlertController alertControllerWithTitle:nil message:messageString preferredStyle:(UIAlertControllerStyleAlert)]; | ||
| 66 | + UIAlertAction *alertA = [UIAlertAction actionWithTitle:@"好" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { | ||
| 67 | + | ||
| 68 | + }]; | ||
| 69 | + | ||
| 70 | + [alertC addAction:alertA]; | ||
| 71 | + [self presentViewController:alertC animated:YES completion:nil]; | ||
| 72 | + break; | ||
| 73 | + } | ||
| 74 | + case AVAuthorizationStatusRestricted: { | ||
| 75 | + NSLog(@"因为系统原因, 无法访问相册"); | ||
| 76 | + break; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + default: | ||
| 80 | + break; | ||
| 81 | + } | ||
| 82 | + return; | ||
| 83 | + } | ||
| 84 | + [QMUITips showError:@"未检测到您的摄像头" inView:self.view hideAfterDelay:timeValue]; | ||
| 85 | +} | ||
| 86 | + | ||
| 87 | +#pragma mark - 生命周期 | ||
| 88 | +- (void)viewWillAppear:(BOOL)animated { | ||
| 89 | + [super viewWillAppear:animated]; | ||
| 90 | + self.navigationController.navigationBarHidden = YES; | ||
| 91 | + [obtain startRunningWithBefore:nil completion:nil]; | ||
| 92 | + [self.scanView addTimer]; | ||
| 93 | +} | ||
| 94 | + | ||
| 95 | +- (void)viewWillDisappear:(BOOL)animated { | ||
| 96 | + [super viewWillDisappear:animated]; | ||
| 97 | + [self.scanView removeTimer]; | ||
| 98 | + [self removeFlashlightBtn]; | ||
| 99 | + [obtain stopRunning]; | ||
| 100 | + | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | +- (void)viewDidLoad { | ||
| 104 | + [super viewDidLoad]; | ||
| 105 | + self.view.backgroundColor = [UIColor blackColor]; | ||
| 106 | + if (@available(iOS 11, *)) { | ||
| 107 | + } | ||
| 108 | + else { | ||
| 109 | + self.automaticallyAdjustsScrollViewInsets = NO; | ||
| 110 | + } | ||
| 111 | + obtain = [SGQRCodeObtain QRCodeObtain]; | ||
| 112 | + [self getAVAuthorizationStatus:^{ | ||
| 113 | + [self startScanQRCode]; | ||
| 114 | + | ||
| 115 | + }]; | ||
| 116 | + | ||
| 117 | + [self createSubViews]; | ||
| 118 | + | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +- (void)dealloc { | ||
| 122 | + [self removeScanningView]; | ||
| 123 | +} | ||
| 124 | + | ||
| 125 | +- (void)removeScanningView { | ||
| 126 | + [self.scanView removeTimer]; | ||
| 127 | + [self.scanView removeFromSuperview]; | ||
| 128 | + self.scanView = nil; | ||
| 129 | +} | ||
| 130 | + | ||
| 131 | +#pragma mark - UI | ||
| 132 | +- (void)createSubViews { | ||
| 133 | + [self.view addSubview:self.scanView]; | ||
| 134 | + [self.view addSubview:self.flashlightBtn]; | ||
| 135 | + [self.view addSubview:self.codeButton]; | ||
| 136 | + [self.view addSubview:self.promptLabel]; | ||
| 137 | + [self.view addSubview:self.navigationBar]; | ||
| 138 | + | ||
| 139 | +} | ||
| 140 | +#pragma mark - 扫描二维码 | ||
| 141 | +- (void)startScanQRCode{ | ||
| 142 | + // 创建二维码扫描 | ||
| 143 | + __weak typeof(self) weakSelf = self; | ||
| 144 | + SGQRCodeObtainConfigure *configure = [SGQRCodeObtainConfigure QRCodeObtainConfigure]; | ||
| 145 | + configure.sampleBufferDelegate = YES; | ||
| 146 | + configure.openLog = YES; | ||
| 147 | + configure.rectOfInterest = CGRectMake(0.05, 0.2, 0.7, 0.6); | ||
| 148 | + // 这里只是提供了几种作为参考(共:13);需什么类型添加什么类型即可 | ||
| 149 | + NSArray *arr = @[AVMetadataObjectTypeQRCode, AVMetadataObjectTypeEAN13Code, AVMetadataObjectTypeEAN8Code, AVMetadataObjectTypeCode128Code]; | ||
| 150 | + configure.metadataObjectTypes = arr; | ||
| 151 | + | ||
| 152 | + [obtain establishQRCodeObtainScanWithController:self configure:configure]; | ||
| 153 | + [obtain startRunningWithBefore:^{ | ||
| 154 | +// [SVProgressHUD showWithStatus:@"正在加载..."]; | ||
| 155 | + } completion:^{ | ||
| 156 | +// [SVProgressHUD dismiss]; | ||
| 157 | + }]; | ||
| 158 | + [obtain setBlockWithQRCodeObtainScanResult:^(SGQRCodeObtain *obtain, NSString *result) { | ||
| 159 | + __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 160 | + if(!strongSelf) return ; | ||
| 161 | + if (result == nil) { | ||
| 162 | + NSLog(@"暂未识别出二维码"); | ||
| 163 | + [QMUITips showError:@"暂未识别出二维码" inView:strongSelf.view hideAfterDelay:timeValue]; | ||
| 164 | + | ||
| 165 | + } else { | ||
| 166 | + [obtain stopRunning]; | ||
| 167 | + [obtain playSoundName:@"SGQRCode.bundle/sound.caf"]; | ||
| 168 | + [strongSelf handleResult:result]; | ||
| 169 | + | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + }]; | ||
| 173 | + // 根据外界光线强弱值判断是否自动开启手电筒 | ||
| 174 | + [obtain setBlockWithQRCodeObtainScanBrightness:^(SGQRCodeObtain *obtain, CGFloat brightness) { | ||
| 175 | + __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 176 | + if(!strongSelf) return ; | ||
| 177 | + if (brightness < - 1) { | ||
| 178 | + [strongSelf.view addSubview:weakSelf.flashlightBtn]; | ||
| 179 | + | ||
| 180 | + } else { | ||
| 181 | + if (strongSelf.isSelected == NO) { | ||
| 182 | + [strongSelf removeFlashlightBtn]; | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + }]; | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +#pragma mark - 选择图片识别二维码 | ||
| 189 | +- (void)rightButtonDidClicked:(UIButton *)btn { | ||
| 190 | + // 从相册中读取二维码 | ||
| 191 | + [obtain establishAuthorizationQRCodeObtainAlbumWithController:nil]; | ||
| 192 | + if (obtain.isPHAuthorization == YES) { | ||
| 193 | + [self.scanView removeTimer]; | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + __weak typeof(self) weakSelf = self; | ||
| 197 | + [obtain setBlockWithQRCodeObtainAlbumDidCancelImagePickerController:^(SGQRCodeObtain *obtain) { | ||
| 198 | + __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 199 | + if(!strongSelf) return ; | ||
| 200 | + }]; | ||
| 201 | + [obtain setBlockWithQRCodeObtainAlbumResult:^(SGQRCodeObtain *obtain, NSString *result) { | ||
| 202 | + __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 203 | + if(!strongSelf) return ; | ||
| 204 | + if (result == nil) { | ||
| 205 | + NSLog(@"暂未识别出二维码"); | ||
| 206 | + [QMUITips showError:@"暂未识别出二维码" inView:strongSelf.view hideAfterDelay:timeValue]; | ||
| 207 | + | ||
| 208 | + } else { | ||
| 209 | + [strongSelf handleResult:result]; | ||
| 210 | + } | ||
| 211 | + }]; | ||
| 212 | +} | ||
| 213 | + | ||
| 214 | +#pragma mark - 识别二维码后判断处理 | ||
| 215 | +- (void)handleResult:(NSString *)result{ | ||
| 216 | + NSLog(@"结果---%@",result); | ||
| 217 | + // 1.json字符串转字典 | ||
| 218 | + NSDictionary *resultDic = [self dictionaryWithJsonString:result]; | ||
| 219 | + // 2.字典取值判断是不是app的业务 | ||
| 220 | + // 是app的业务 | ||
| 221 | + if (resultDic&&[resultDic[@"type"] isEqualToString:@"user"]) { | ||
| 222 | + // 3.字典取值解密判断页面跳转 | ||
| 223 | + if(resultDic[@"content"]&&![resultDic[@"content"] isEqualToString:@""]){ | ||
| 224 | +// NSString *content = [XWCryptoDES decryptUseDES:resultDic[@"content"] key:AppDESKey]; | ||
| 225 | +// NSDictionary *contentDic = [self dictionaryWithJsonString:content]; | ||
| 226 | +// [self jumpToController:contentDic]; | ||
| 227 | + } | ||
| 228 | + } | ||
| 229 | + // 不是app的业务 | ||
| 230 | + else{ | ||
| 231 | +// XWScanSuccessController *jumpVC = [[XWScanSuccessController alloc] init]; | ||
| 232 | +// jumpVC.jump_URL = result; | ||
| 233 | +// [self.navigationController pushViewController:jumpVC animated:YES]; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | +} | ||
| 237 | + | ||
| 238 | +#pragma mark - 识别二维码后页面跳转 | ||
| 239 | +// 页面跳转 | ||
| 240 | +- (void)jumpToController:(NSDictionary *)content { | ||
| 241 | + | ||
| 242 | + | ||
| 243 | +} | ||
| 244 | + | ||
| 245 | +// json字符串转字典 | ||
| 246 | +- (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString { | ||
| 247 | + if (jsonString == nil) { | ||
| 248 | + return nil; | ||
| 249 | + } | ||
| 250 | + NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; | ||
| 251 | + NSError *err; | ||
| 252 | + NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err]; | ||
| 253 | + if(err) { | ||
| 254 | + NSLog(@"json解析失败:%@",err); | ||
| 255 | + return @{}; | ||
| 256 | + } | ||
| 257 | + return dic; | ||
| 258 | +} | ||
| 259 | + | ||
| 260 | +/** | ||
| 261 | + * 状态栏的颜色 | ||
| 262 | + * | ||
| 263 | + * @return UIStatusBarStyle | ||
| 264 | + * | ||
| 265 | + */ | ||
| 266 | +- (UIStatusBarStyle)preferredStatusBarStyle{ | ||
| 267 | + return UIStatusBarStyleLightContent; | ||
| 268 | + | ||
| 269 | +} | ||
| 270 | +#pragma mark - 懒加载 | ||
| 271 | +- (void)navigationBar:(CNLiveQrCodeNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{ | ||
| 272 | + if ([actionEvents isEqualToString:@"1"]) { | ||
| 273 | + [self goBack]; | ||
| 274 | + } | ||
| 275 | +} | ||
| 276 | +- (CNLiveQrCodeNavigationBar *)navigationBar { | ||
| 277 | + if (!_navigationBar) { | ||
| 278 | + _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, NavigationContentTop)]; | ||
| 279 | + _navigationBar.delegate = self; | ||
| 280 | + _navigationBar.title.text = @"扫一扫"; | ||
| 281 | + [_navigationBar.right setTitle:@"相册" forState:UIControlStateNormal]; | ||
| 282 | + } | ||
| 283 | + return _navigationBar; | ||
| 284 | +} | ||
| 285 | +- (SGQRCodeScanView *)scanView { | ||
| 286 | + if (!_scanView) { | ||
| 287 | + _scanView = [[SGQRCodeScanView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; | ||
| 288 | + } | ||
| 289 | + return _scanView; | ||
| 290 | +} | ||
| 291 | +- (UIButton *)flashlightBtn { | ||
| 292 | + if (!_flashlightBtn) { | ||
| 293 | + _flashlightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 294 | + CGFloat flashlightBtnW = 60; | ||
| 295 | + CGFloat flashlightBtnH = 50; | ||
| 296 | + CGFloat flashlightBtnX = 0.5 * (self.view.frame.size.width - flashlightBtnW); | ||
| 297 | + CGFloat flashlightBtnY = 0.55 * self.view.frame.size.height; | ||
| 298 | + _flashlightBtn.frame = CGRectMake(flashlightBtnX, flashlightBtnY, flashlightBtnW, flashlightBtnH); | ||
| 299 | + UIImage *image1 = [self xw_getImageName:@"flashlight_close" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]]; | ||
| 300 | + UIImage *image2 = [self xw_getImageName:@"flashlight_open" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]]; | ||
| 301 | + [_flashlightBtn setImage:image1 forState:UIControlStateNormal]; | ||
| 302 | + [_flashlightBtn setImage:image2 forState:UIControlStateSelected]; | ||
| 303 | + [_flashlightBtn addTarget:self action:@selector(flashlightButtonDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 304 | + } | ||
| 305 | + return _flashlightBtn; | ||
| 306 | + | ||
| 307 | +} | ||
| 308 | +- (UILabel *)promptLabel { | ||
| 309 | + if (!_promptLabel) { | ||
| 310 | + _promptLabel = [[UILabel alloc] init]; | ||
| 311 | + _promptLabel.backgroundColor = [UIColor clearColor]; | ||
| 312 | + CGFloat promptLabelX = 0; | ||
| 313 | + CGFloat promptLabelY = 0.73 * self.view.frame.size.height; | ||
| 314 | + CGFloat promptLabelW = self.view.frame.size.width; | ||
| 315 | + CGFloat promptLabelH = 25; | ||
| 316 | + _promptLabel.frame = CGRectMake(promptLabelX, promptLabelY, promptLabelW, promptLabelH); | ||
| 317 | + _promptLabel.textAlignment = NSTextAlignmentCenter; | ||
| 318 | + _promptLabel.font = [UIFont boldSystemFontOfSize:13.0]; | ||
| 319 | + _promptLabel.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.6]; | ||
| 320 | + _promptLabel.text = @"将二维码/条码放入框内, 即可自动扫描"; | ||
| 321 | + } | ||
| 322 | + return _promptLabel; | ||
| 323 | + | ||
| 324 | +} | ||
| 325 | +- (UIButton *)codeButton { | ||
| 326 | + if (!_codeButton) { | ||
| 327 | + _codeButton = [UIButton buttonWithType:(UIButtonTypeCustom)]; | ||
| 328 | + CGFloat flashlightBtnW = 120; | ||
| 329 | + CGFloat flashlightBtnH = 50; | ||
| 330 | + CGFloat flashlightBtnX = 0.5 * (self.view.frame.size.width - flashlightBtnW); | ||
| 331 | + CGFloat flashlightBtnY = CGRectGetMaxY(self.promptLabel.frame)+15; | ||
| 332 | + _codeButton.frame = CGRectMake(flashlightBtnX, flashlightBtnY, flashlightBtnW, flashlightBtnH); | ||
| 333 | + UIImage *image = [self xw_getImageName:@"qr_code_green" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]]; | ||
| 334 | + [_codeButton setImage:image forState:UIControlStateNormal]; | ||
| 335 | + [_codeButton setTitle:@" 我的二维码" forState:UIControlStateNormal]; | ||
| 336 | + _codeButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:15.0f]; | ||
| 337 | + [_codeButton setTitleColor:[UIColor colorWithRed:26/255.0 green:161/255.0 blue:45/255.0 alpha:1.0] forState:UIControlStateNormal]; | ||
| 338 | + [_codeButton addTarget:self action:@selector(codeButtonDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 339 | + [_codeButton setAdjustsImageWhenHighlighted:NO]; | ||
| 340 | + } | ||
| 341 | + return _codeButton; | ||
| 342 | + | ||
| 343 | +} | ||
| 344 | + | ||
| 345 | +#pragma mark - 响应方法 | ||
| 346 | +- (void)goBack { | ||
| 347 | + if (self.presentingViewController != nil) { | ||
| 348 | + [self dismissViewControllerAnimated:YES completion:nil]; | ||
| 349 | + | ||
| 350 | + } | ||
| 351 | + else { | ||
| 352 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 353 | + } | ||
| 354 | +} | ||
| 355 | +- (void)flashlightButtonDidClicked:(UIButton *)button { | ||
| 356 | + if (button.selected == NO) { | ||
| 357 | + [obtain openFlashlight]; | ||
| 358 | + self.isSelected = YES; | ||
| 359 | + button.selected = YES; | ||
| 360 | + } | ||
| 361 | + else { | ||
| 362 | + [self removeFlashlightBtn]; | ||
| 363 | + } | ||
| 364 | +} | ||
| 365 | +- (void)removeFlashlightBtn { | ||
| 366 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 367 | + [self->obtain closeFlashlight]; | ||
| 368 | + self.isSelected = NO; | ||
| 369 | + self.flashlightBtn.selected = NO; | ||
| 370 | + [self.flashlightBtn removeFromSuperview]; | ||
| 371 | + }); | ||
| 372 | + | ||
| 373 | +} | ||
| 374 | +- (void)codeButtonDidClicked:(UIButton *)button{ | ||
| 375 | + if(self.isMyCode){ | ||
| 376 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 377 | + }else{ | ||
| 378 | + CNLiveMyQrCodeController *vc = [[CNLiveMyQrCodeController alloc] init]; | ||
| 379 | + vc.isScanCode = YES; | ||
| 380 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 381 | + } | ||
| 382 | + | ||
| 383 | + | ||
| 384 | +} | ||
| 385 | +/** | ||
| 386 | + * 创建图片 | ||
| 387 | + * | ||
| 388 | + * @param imageName 图片名字 | ||
| 389 | + * @param bundleName 图片所在的bundle名字 | ||
| 390 | + * @param targetClass 类和bundle的同级目录 | ||
| 391 | + * @return 返回UIImage | ||
| 392 | + */ | ||
| 393 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 394 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 395 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 396 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 397 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 398 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 399 | +} | ||
| 400 | + | ||
| 401 | +@end |
CNLiveQrCodeModule/Classes/Model/CNLiveQrCodeModel.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeModel.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | +typedef NS_ENUM(NSInteger, CNLiveQrCodeCellType) { | ||
| 13 | + CNLiveQrCodeCellTypeOrder = 0, | ||
| 14 | + CNLiveQrCodeCellTypeTool = 1, | ||
| 15 | + CNLiveQrCodeCellTypeGoods = 2, | ||
| 16 | + CNLiveQrCodeCellTypeSports = 3 | ||
| 17 | + | ||
| 18 | +}; | ||
| 19 | + | ||
| 20 | +@interface CNLiveQrCodeModel : NSObject | ||
| 21 | +@property (nonatomic, copy) NSString *name; | ||
| 22 | +@property (nonatomic, copy) NSString *pic; | ||
| 23 | + | ||
| 24 | +@property (nonatomic, copy) NSString *style; | ||
| 25 | + | ||
| 26 | +@property (nonatomic, strong) NSArray *titles; | ||
| 27 | +@property (nonatomic, strong) NSArray *images; | ||
| 28 | + | ||
| 29 | +@property (nonatomic, assign) CNLiveQrCodeCellType type; | ||
| 30 | + | ||
| 31 | +@property (nonatomic, assign) CGFloat height; | ||
| 32 | +@property (nonatomic, assign) CGFloat margin; | ||
| 33 | + | ||
| 34 | +@end | ||
| 35 | + | ||
| 36 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/Model/CNLiveQrCodeModel.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeModel.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveQrCodeModel.h" | ||
| 10 | + | ||
| 11 | +@implementation CNLiveQrCodeModel | ||
| 12 | +static const NSInteger margin = 10; | ||
| 13 | + | ||
| 14 | +- (CNLiveQrCodeCellType)type{ | ||
| 15 | + if([self.style isEqualToString:@"1"]){ | ||
| 16 | + return CNLiveQrCodeCellTypeOrder; | ||
| 17 | + } | ||
| 18 | + else if([self.style isEqualToString:@"2"]){ | ||
| 19 | + return CNLiveQrCodeCellTypeTool; | ||
| 20 | + | ||
| 21 | + } | ||
| 22 | + else if([self.style isEqualToString:@"3"]){ | ||
| 23 | + return CNLiveQrCodeCellTypeGoods; | ||
| 24 | + | ||
| 25 | + } | ||
| 26 | + else if([self.style isEqualToString:@"4"]){ | ||
| 27 | + return CNLiveQrCodeCellTypeSports; | ||
| 28 | + | ||
| 29 | + } | ||
| 30 | + return CNLiveQrCodeCellTypeOrder; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +- (CGFloat)height{ | ||
| 34 | + CGFloat titleHeight = 50; | ||
| 35 | + CGFloat btnHeight = 60; | ||
| 36 | + | ||
| 37 | + //订单 | ||
| 38 | + if(self.type == CNLiveQrCodeCellTypeOrder){ | ||
| 39 | + return 2*margin+titleHeight+btnHeight+margin; | ||
| 40 | + } | ||
| 41 | + //工具 | ||
| 42 | + else if(self.type == CNLiveQrCodeCellTypeTool){ | ||
| 43 | + return 2*margin+titleHeight+ceilf(self.titles.count/4.0)*(btnHeight+margin); | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | + //商品 | ||
| 47 | + else if(self.type == CNLiveQrCodeCellTypeGoods){ | ||
| 48 | + // 电票的高度 80 | ||
| 49 | + return 2*margin+titleHeight+80+margin; | ||
| 50 | + | ||
| 51 | + } | ||
| 52 | + //大众体育 | ||
| 53 | + else if(self.type == CNLiveQrCodeCellTypeSports){ | ||
| 54 | + return 2*margin+titleHeight+ceilf(self.titles.count/4.0)*(btnHeight+margin); | ||
| 55 | + | ||
| 56 | + } | ||
| 57 | + return 0.0000001f; | ||
| 58 | +} | ||
| 59 | + | ||
| 60 | +@end |
CNLiveQrCodeModule/Classes/Module/CNLiveQrCodeModule.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeModule.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveQrCodeModule : NSObject | ||
| 14 | + | ||
| 15 | +@end | ||
| 16 | + | ||
| 17 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/Module/CNLiveQrCodeModule.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeModule.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveQrCodeModule.h" | ||
| 10 | +#import "CNLiveServices.h" | ||
| 11 | + | ||
| 12 | +@BeeHiveMod(CNLiveQrCodeModule) | ||
| 13 | +@interface CNLiveQrCodeModule()<BHModuleProtocol> | ||
| 14 | + | ||
| 15 | +@end | ||
| 16 | + | ||
| 17 | +@implementation CNLiveQrCodeModule | ||
| 18 | +- (id)init { | ||
| 19 | + if (self = [super init]) { | ||
| 20 | + | ||
| 21 | + } | ||
| 22 | + return self; | ||
| 23 | + | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +- (NSUInteger)moduleLevel { | ||
| 27 | + return 0; | ||
| 28 | + | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +- (void)modSetUp:(BHContext *)context { | ||
| 32 | + switch (context.env) { | ||
| 33 | + case BHEnvironmentDev: | ||
| 34 | + //....初始化开发环境 | ||
| 35 | + break; | ||
| 36 | + case BHEnvironmentProd: | ||
| 37 | + //....初始化生产环境 | ||
| 38 | + default: | ||
| 39 | + break; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +- (void)modInit:(BHContext *)context { | ||
| 45 | + | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +@end |
CNLiveQrCodeModule/Classes/Module/CNLiveQrCodeService.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeService.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveQrCodeService : NSObject | ||
| 14 | + | ||
| 15 | +@end | ||
| 16 | + | ||
| 17 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/Module/CNLiveQrCodeService.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeService.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveQrCodeService.h" | ||
| 10 | +#import "CNLiveServices.h" | ||
| 11 | +#import "CNLiveScanQrCodeController.h" | ||
| 12 | +#import "CNLiveMyQrCodeController.h" | ||
| 13 | +#import "CNLiveGroupQrCodeController.h" | ||
| 14 | + | ||
| 15 | +//@BeeHiveService(CNLiveQrCodeServiceProtocol,CNLiveQrCodeService) | ||
| 16 | +//@interface CNLiveQrCodeService ()<CNLiveQrCodeServiceProtocol> | ||
| 17 | +@interface CNLiveQrCodeService () | ||
| 18 | + | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +@implementation CNLiveQrCodeService | ||
| 22 | + | ||
| 23 | +// 扫一扫 | ||
| 24 | +- (UIViewController *)getSweepQrCodeController { | ||
| 25 | + return [CNLiveScanQrCodeController new]; | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +- (void)pushToSweepQrCodeController { | ||
| 29 | + CNLiveScanQrCodeController *vc = [[CNLiveScanQrCodeController alloc]init]; | ||
| 30 | +// [CNLivePageJumpManager pushViewController:vc]; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +// 我的二维码 | ||
| 34 | +- (UIViewController *)getMyQrCodeController { | ||
| 35 | + return [CNLiveMyQrCodeController new]; | ||
| 36 | +} | ||
| 37 | + | ||
| 38 | +- (void)pushToMyQrCodeController { | ||
| 39 | + CNLiveMyQrCodeController *vc = [[CNLiveMyQrCodeController alloc]init]; | ||
| 40 | +// [CNLivePageJumpManager pushViewController:vc]; | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +// 群组二维码 | ||
| 44 | +- (UIViewController *)getGroupQrCodeController { | ||
| 45 | + return [CNLiveGroupQrCodeController new]; | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +- (void)pushToGroupQrCodeController { | ||
| 49 | + CNLiveGroupQrCodeController *vc = [[CNLiveGroupQrCodeController alloc]init]; | ||
| 50 | +// [CNLivePageJumpManager pushViewController:vc]; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +@end |
CNLiveQrCodeModule/Classes/View/CNLiveGroupQrCodeView.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveGroupQrCodeView.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveGroupQrCodeView : UIView | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +@end | ||
| 17 | + | ||
| 18 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/View/CNLiveGroupQrCodeView.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveGroupQrCodeView.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveGroupQrCodeView.h" | ||
| 10 | +#import <Masonry/Masonry.h> | ||
| 11 | +#import <SDWebImage/SDWebImage.h> | ||
| 12 | +#import "QMUIKit.h" | ||
| 13 | + | ||
| 14 | +@interface CNLiveGroupQrCodeView () | ||
| 15 | +@property (nonatomic, strong) UIImageView *bgView; | ||
| 16 | +@property (nonatomic, strong) UIButton *witness; | ||
| 17 | + | ||
| 18 | +@property (nonatomic, strong) UIImageView *header; | ||
| 19 | +@property (nonatomic, strong) UILabel *name; | ||
| 20 | +@property (nonatomic, strong) UILabel *certification; | ||
| 21 | +@property (nonatomic, strong) UILabel *address; | ||
| 22 | +@property (nonatomic, strong) UIButton *sign; | ||
| 23 | + | ||
| 24 | +@end | ||
| 25 | + | ||
| 26 | +@implementation CNLiveGroupQrCodeView | ||
| 27 | +static const NSInteger margin = 20; | ||
| 28 | + | ||
| 29 | +- (instancetype)initWithFrame:(CGRect)frame{ | ||
| 30 | + self = [super initWithFrame:frame]; | ||
| 31 | + if(self){ | ||
| 32 | + self.userInteractionEnabled = YES; | ||
| 33 | + self.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1.0]; | ||
| 34 | + [self createSubViews]; | ||
| 35 | + } | ||
| 36 | + return self; | ||
| 37 | +} | ||
| 38 | +// 实现方法 | ||
| 39 | +- (void)userInfoUpdateNotification:(NSNotification *)noti{ | ||
| 40 | + //使用userInfo处理消息 | ||
| 41 | +// NSDictionary *dic = [noti userInfo]; | ||
| 42 | +// XWUserInfoDataType type = [[dic objectForKey:@"type"] integerValue]; | ||
| 43 | +// if(type == XWUserInfoDataTypeHead){ | ||
| 44 | +// UIImage *info = [dic objectForKey:@"info"]; | ||
| 45 | +// _header.image = info; | ||
| 46 | +// | ||
| 47 | +// }else if(type == XWUserInfoDataTypeNickname){ | ||
| 48 | +// NSString *info = [dic objectForKey:@"info"]; | ||
| 49 | +// _name.attributedText = [self createAttributedImageName:@"mine_code" string:info isFront:NO]; | ||
| 50 | +// | ||
| 51 | +// }else if(type == XWUserInfoDataTypeAddress){ | ||
| 52 | +// NSString *info = [dic objectForKey:@"info"]; | ||
| 53 | +// _address.attributedText = [self createAttributedImageName:@"mine_location" string:info isFront:YES]; | ||
| 54 | +// | ||
| 55 | +// } | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | +- (void)dealloc { | ||
| 59 | + NSLog(@"CNLiveGroupQrCodeView -- dealloc"); | ||
| 60 | +// [XWUserInfoNotification removeObserver:self]; | ||
| 61 | + | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | +- (void)createSubViews { | ||
| 65 | + [self addSubview:self.bgView]; | ||
| 66 | + [self addSubview:self.witness]; | ||
| 67 | + | ||
| 68 | + [self addSubview:self.header]; | ||
| 69 | + [self addSubview:self.name]; | ||
| 70 | + [self addSubview:self.certification]; | ||
| 71 | + [self addSubview:self.address]; | ||
| 72 | + [self addSubview:self.sign]; | ||
| 73 | + | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +- (void)layoutSubviews{ | ||
| 77 | + [super layoutSubviews]; | ||
| 78 | + [_witness mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 79 | + make.left.equalTo(self.mas_left).with.offset(1.5*margin); | ||
| 80 | + make.right.equalTo(self.mas_right).with.offset(-1.5*margin); | ||
| 81 | + make.width.height.offset(60); | ||
| 82 | + make.bottom.equalTo(self.mas_bottom).with.offset(-0.5*margin); | ||
| 83 | + | ||
| 84 | + }]; | ||
| 85 | + | ||
| 86 | + [_bgView mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 87 | + make.left.equalTo(self.mas_left).with.offset(0); | ||
| 88 | + make.right.equalTo(self.mas_right).with.offset(-0); | ||
| 89 | + make.top.equalTo(self.mas_top).with.offset(0); | ||
| 90 | + make.bottom.equalTo(self.witness.mas_centerY).with.offset(0.5*margin); | ||
| 91 | + | ||
| 92 | + }]; | ||
| 93 | + | ||
| 94 | + [_header mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 95 | + make.left.equalTo(self.mas_left).with.offset(margin); | ||
| 96 | + make.centerY.equalTo(self.bgView.mas_centerY).with.offset(0); | ||
| 97 | + make.width.height.offset(60); | ||
| 98 | + | ||
| 99 | + }]; | ||
| 100 | + | ||
| 101 | + [_certification mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 102 | + make.centerY.equalTo(self.header.mas_centerY); | ||
| 103 | + make.left.equalTo(self.header.mas_right).with.offset(margin/2.0); | ||
| 104 | + make.height.offset(35); | ||
| 105 | + | ||
| 106 | + }]; | ||
| 107 | + | ||
| 108 | + [_name mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 109 | + make.bottom.equalTo(self.certification.mas_top); | ||
| 110 | + make.left.equalTo(self.certification.mas_left); | ||
| 111 | + make.right.equalTo(self.bgView.mas_right).with.offset(-margin); | ||
| 112 | + make.height.equalTo(self.certification.mas_height); | ||
| 113 | + | ||
| 114 | + }]; | ||
| 115 | + | ||
| 116 | + [_address mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 117 | + make.top.equalTo(self.certification.mas_bottom); | ||
| 118 | + make.left.equalTo(self.name.mas_left); | ||
| 119 | + make.right.equalTo(self.name.mas_right); | ||
| 120 | + make.height.equalTo(self.name.mas_height); | ||
| 121 | + | ||
| 122 | + }]; | ||
| 123 | + | ||
| 124 | + [_sign mas_remakeConstraints:^(MASConstraintMaker *make) { | ||
| 125 | + make.right.equalTo(self.mas_right).with.offset(0); | ||
| 126 | + make.centerY.equalTo(self.header.mas_centerY).with.offset(0); | ||
| 127 | + make.width.mas_equalTo(105); | ||
| 128 | + make.height.mas_equalTo(32); | ||
| 129 | + | ||
| 130 | + }]; | ||
| 131 | +} | ||
| 132 | +/* | ||
| 133 | + // Only override drawRect: if you perform custom drawing. | ||
| 134 | + // An empty implementation adversely affects performance during animation. | ||
| 135 | + - (void)drawRect:(CGRect)rect { | ||
| 136 | + // Drawing code | ||
| 137 | + } | ||
| 138 | + */ | ||
| 139 | +#pragma mark - Private Methods | ||
| 140 | +- (NSMutableAttributedString *)createAttributedImageName:(NSString *)imageName string:(NSString *)string isFront:(BOOL)isFront{ | ||
| 141 | + if(isFront){ | ||
| 142 | + string = [NSString stringWithFormat:@" %@",string]; | ||
| 143 | + } | ||
| 144 | + // 1.创建一个富文本 | ||
| 145 | + NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:string]; | ||
| 146 | + // 修改富文本中的不同文字的样式 | ||
| 147 | +// [attri addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, string.length)]; | ||
| 148 | +// [attri addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0, string.length)]; | ||
| 149 | + // 2.添加表情图片 | ||
| 150 | + NSTextAttachment *attch = [[NSTextAttachment alloc] init]; | ||
| 151 | + // 表情图片 | ||
| 152 | + UIImage *xw_image = [self xw_getImageName:imageName bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeView class]]; | ||
| 153 | + attch.image = xw_image; | ||
| 154 | + if(isFront){ | ||
| 155 | + // 设置图片大小 | ||
| 156 | + attch.bounds = CGRectMake(0, -1.5, 10, 12); | ||
| 157 | + // 创建带有图片的富文本 | ||
| 158 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | ||
| 159 | + [attri insertAttributedString:str atIndex:0];// 插入某个位置 | ||
| 160 | + }else{ | ||
| 161 | + // 设置图片大小 | ||
| 162 | + attch.bounds = CGRectMake(10, -2, 15, 15); | ||
| 163 | + // 创建带有图片的富文本 | ||
| 164 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | ||
| 165 | + [attri insertAttributedString:str atIndex:string.length];// 插入某个位置 | ||
| 166 | + | ||
| 167 | + } | ||
| 168 | + return attri; | ||
| 169 | + | ||
| 170 | +} | ||
| 171 | +- (NSMutableAttributedString *)createAttributedImages:(NSArray *)images { | ||
| 172 | + // 1.创建一个富文本 | ||
| 173 | + NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:@""]; | ||
| 174 | + for(NSString *image in images){ | ||
| 175 | + // 2.添加表情图片 | ||
| 176 | + NSTextAttachment *attch = [[NSTextAttachment alloc] init]; | ||
| 177 | + // 表情图片 | ||
| 178 | + UIImage *xw_image = [self xw_getImageName:image bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeView class]]; | ||
| 179 | + attch.image = xw_image; | ||
| 180 | + // 创建带有图片的富文本 | ||
| 181 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | ||
| 182 | + NSAttributedString *space = [[NSAttributedString alloc]initWithString:@" "]; | ||
| 183 | + | ||
| 184 | + [attri insertAttributedString:space atIndex:0]; | ||
| 185 | + [attri insertAttributedString:str atIndex:0];// 插入某个位置 | ||
| 186 | + | ||
| 187 | + } | ||
| 188 | + return attri; | ||
| 189 | + | ||
| 190 | +} | ||
| 191 | + | ||
| 192 | +#pragma mark - 懒加载 | ||
| 193 | +- (UIButton *)witness { | ||
| 194 | + if (!_witness) { | ||
| 195 | + _witness = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 196 | + UIImage *xw_image = [self xw_getImageName:@"mine_observer" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeView class]]; | ||
| 197 | + _witness.imageView.contentMode = UIViewContentModeScaleAspectFit; | ||
| 198 | + [_witness setImage:xw_image forState:UIControlStateNormal]; | ||
| 199 | + _witness.adjustsImageWhenHighlighted = NO; | ||
| 200 | + [_witness addTarget:self action:@selector(witnessDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 201 | + } | ||
| 202 | + return _witness; | ||
| 203 | +} | ||
| 204 | +- (UIImageView *)bgView { | ||
| 205 | + if (!_bgView) { | ||
| 206 | + _bgView = [[UIImageView alloc] init]; | ||
| 207 | + _bgView.userInteractionEnabled = YES; | ||
| 208 | + UIImage *xw_image = [self xw_getImageName:@"mine_bg" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeView class]]; | ||
| 209 | + _bgView.image = xw_image; | ||
| 210 | + } | ||
| 211 | + return _bgView; | ||
| 212 | +} | ||
| 213 | +- (UIImageView *)header { | ||
| 214 | + if (!_header) { | ||
| 215 | + _header = [[UIImageView alloc] init]; | ||
| 216 | + _header.userInteractionEnabled = YES; | ||
| 217 | + _header.layer.masksToBounds = YES; | ||
| 218 | + _header.layer.cornerRadius = 30; | ||
| 219 | + UIImage *xw_image = [self xw_getImageName:@"default_avatar_y" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeView class]]; | ||
| 220 | + [_header sd_setImageWithURL:[NSURL URLWithString:@"头像"] placeholderImage:xw_image]; | ||
| 221 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(headerTapDidClicked:)]; | ||
| 222 | + [_header addGestureRecognizer:tap]; | ||
| 223 | + } | ||
| 224 | + return _header; | ||
| 225 | +} | ||
| 226 | + | ||
| 227 | +- (UILabel *)name { | ||
| 228 | + if (!_name) { | ||
| 229 | + _name = [[UILabel alloc] init]; | ||
| 230 | + _name.userInteractionEnabled = YES; | ||
| 231 | + _name.numberOfLines = 1; | ||
| 232 | + _name.textColor = [UIColor whiteColor]; | ||
| 233 | + _name.font = [UIFont systemFontOfSize:16]; | ||
| 234 | + _name.attributedText = [self createAttributedImageName:@"mine_code" string:@"张晓文" isFront:NO]; | ||
| 235 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(nameTapDidClicked:)]; | ||
| 236 | + [_name addGestureRecognizer:tap]; | ||
| 237 | + | ||
| 238 | + } | ||
| 239 | + return _name; | ||
| 240 | +} | ||
| 241 | +- (UILabel *)certification { | ||
| 242 | + if (!_certification) { | ||
| 243 | + _certification = [[UILabel alloc] init]; | ||
| 244 | + _certification.numberOfLines = 1; | ||
| 245 | + _certification.textColor = [UIColor whiteColor]; | ||
| 246 | + _certification.font = [UIFont systemFontOfSize:16]; | ||
| 247 | + _certification.attributedText = [self createAttributedImages:@[@"mine_overbadge",@"mine_common", @"mine_wjj_certification"]]; | ||
| 248 | + } | ||
| 249 | + return _certification; | ||
| 250 | +} | ||
| 251 | +- (UILabel *)address { | ||
| 252 | + if (!_address) { | ||
| 253 | + _address = [[UILabel alloc] init]; | ||
| 254 | + _address.numberOfLines = 1; | ||
| 255 | + _address.textColor = [UIColor colorWithRed:140/255.0 green:140/255.0 blue:142/255.0 alpha:1.0]; | ||
| 256 | + _address.font = [UIFont systemFontOfSize:13]; | ||
| 257 | + _address.attributedText = [self createAttributedImageName:@"mine_location" string:@"北京海淀区花园桥" isFront:YES]; | ||
| 258 | + } | ||
| 259 | + return _address; | ||
| 260 | +} | ||
| 261 | +- (UIButton *)sign { | ||
| 262 | + if (!_sign) { | ||
| 263 | + _sign = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 264 | + _sign.frame = CGRectMake(0, 0, 105, 32); | ||
| 265 | + _sign.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.2]; | ||
| 266 | + [_sign setTitle:@"签到赚积分" forState:UIControlStateNormal]; | ||
| 267 | + _sign.titleLabel.font = [UIFont systemFontOfSize:13.0]; | ||
| 268 | + [_sign setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 269 | + UIImage *xw_image = [self xw_getImageName:@"sign_in_soccer" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeView class]]; | ||
| 270 | + [_sign setImage:xw_image forState:UIControlStateNormal]; | ||
| 271 | + [_sign addTarget:self action:@selector(signDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 272 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_sign.layer.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopLeft cornerRadii:CGSizeMake(16, 16)]; | ||
| 273 | + CAShapeLayer *maskLayer = [CAShapeLayer layer]; | ||
| 274 | + maskLayer.frame = _sign.bounds; | ||
| 275 | + maskLayer.path = maskPath.CGPath; | ||
| 276 | + _sign.layer.mask = maskLayer; | ||
| 277 | + } | ||
| 278 | + return _sign; | ||
| 279 | +} | ||
| 280 | + | ||
| 281 | +#pragma mark - 响应方法 | ||
| 282 | +- (void)headerTapDidClicked:(UITapGestureRecognizer *)tap{ | ||
| 283 | + | ||
| 284 | + | ||
| 285 | +} | ||
| 286 | + | ||
| 287 | +/** | ||
| 288 | + * 创建图片 | ||
| 289 | + * | ||
| 290 | + * @param imageName 图片名字 | ||
| 291 | + * @param bundleName 图片所在的bundle名字 | ||
| 292 | + * @param targetClass 类和bundle的同级目录 | ||
| 293 | + * @return 返回UIImage | ||
| 294 | + */ | ||
| 295 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 296 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 297 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 298 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 299 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 300 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 301 | + | ||
| 302 | +} | ||
| 303 | + | ||
| 304 | +@end |
CNLiveQrCodeModule/Classes/View/CNLiveMyQrCodeView.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveMyQrCodeView.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveMyQrCodeView : UIView | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +@end | ||
| 17 | + | ||
| 18 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/View/CNLiveMyQrCodeView.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveMyQrCodeView.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveMyQrCodeView.h" | ||
| 10 | +#import <Masonry/Masonry.h> | ||
| 11 | +#import <SDWebImage/SDWebImage.h> | ||
| 12 | +#import "QMUIKit.h" | ||
| 13 | +#import "SGQRCode.h"//二维码库 | ||
| 14 | + | ||
| 15 | +@interface CNLiveMyQrCodeView () | ||
| 16 | +@property (nonatomic, strong) UIImageView *header; | ||
| 17 | +@property (nonatomic, strong) UILabel *name; | ||
| 18 | +@property (nonatomic, strong) UILabel *address; | ||
| 19 | +@property (nonatomic, strong) UIImageView *qrCode; | ||
| 20 | + | ||
| 21 | +@property (nonatomic, strong) UILabel *friends; | ||
| 22 | + | ||
| 23 | +@end | ||
| 24 | + | ||
| 25 | +@implementation CNLiveMyQrCodeView | ||
| 26 | +static const NSInteger margin = 20; | ||
| 27 | + | ||
| 28 | +- (instancetype)initWithFrame:(CGRect)frame{ | ||
| 29 | + self = [super initWithFrame:frame]; | ||
| 30 | + if(self){ | ||
| 31 | + self.backgroundColor = [UIColor whiteColor]; | ||
| 32 | + self.layer.masksToBounds = YES; | ||
| 33 | + self.layer.cornerRadius = 10; | ||
| 34 | + // 生成二维码 | ||
| 35 | + [self generateQRCode:@"gen"]; | ||
| 36 | + [self createSubViews]; | ||
| 37 | + } | ||
| 38 | + return self; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +- (void)dealloc { | ||
| 42 | + NSLog(@"XWMyQrCodeView -- dealloc"); | ||
| 43 | + | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +- (void)createSubViews { | ||
| 47 | + [self addSubview:self.header]; | ||
| 48 | + [self addSubview:self.name]; | ||
| 49 | + [self addSubview:self.address]; | ||
| 50 | + [self addSubview:self.qrCode]; | ||
| 51 | + [self addSubview:self.friends]; | ||
| 52 | + [_header mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 53 | + make.left.equalTo(self.mas_left).with.offset(margin); | ||
| 54 | + make.top.equalTo(self.mas_top).with.offset(margin); | ||
| 55 | + make.width.height.offset(60); | ||
| 56 | + | ||
| 57 | + }]; | ||
| 58 | + | ||
| 59 | + [_name mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 60 | + make.top.equalTo(self.header.mas_top); | ||
| 61 | + make.left.equalTo(self.header.mas_right).with.offset(margin/2.0); | ||
| 62 | + make.right.equalTo(self.mas_right).with.offset(-margin); | ||
| 63 | + make.height.offset(30); | ||
| 64 | + | ||
| 65 | + }]; | ||
| 66 | + | ||
| 67 | + [_address mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 68 | + make.top.equalTo(self.name.mas_bottom); | ||
| 69 | + make.left.equalTo(self.name.mas_left); | ||
| 70 | + make.right.equalTo(self.name.mas_right); | ||
| 71 | + make.height.equalTo(self.name.mas_height); | ||
| 72 | + | ||
| 73 | + }]; | ||
| 74 | + | ||
| 75 | + [_qrCode mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 76 | + make.centerX.equalTo(self.mas_centerX).with.offset(0); | ||
| 77 | + make.top.equalTo(self.header.mas_bottom).with.offset(margin); | ||
| 78 | + make.width.height.equalTo(self.mas_width).with.offset(-4*margin); | ||
| 79 | + | ||
| 80 | + }]; | ||
| 81 | + | ||
| 82 | + [_friends mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 83 | + make.left.equalTo(self.mas_left); | ||
| 84 | + make.right.equalTo(self.mas_right); | ||
| 85 | + make.bottom.equalTo(self.mas_bottom).with.offset(-margin); | ||
| 86 | + | ||
| 87 | + }]; | ||
| 88 | + | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +// 重置二维码 | ||
| 92 | +- (void)generateQRCode:(NSString *)type{ | ||
| 93 | +// NSDictionary *params = @{ | ||
| 94 | +// @"appId":@"AppId", | ||
| 95 | +// @"sid":@"uid", | ||
| 96 | +// @"type":type | ||
| 97 | +// }; | ||
| 98 | +// __weak typeof(self) weakSelf = self; | ||
| 99 | +// [GetViewData POST:XWGenOrResetCodeUrl params:params success:^(NSString * _Nullable code, id _Nullable dataObj) { | ||
| 100 | +// if (dataObj) { | ||
| 101 | +// __strong typeof(weakSelf) strongSelf = weakSelf; | ||
| 102 | +// if(!strongSelf) return ; | ||
| 103 | +// NSDictionary *dic = @{@"content":[XWCryptoDES encryptUseDES:[self dictionaryToJsonString:@{@"name":@"张晓文",@"id":@"1243124"}] key:AppDESKey],@"type":@"user"}; | ||
| 104 | +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil]; | ||
| 105 | +// NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | ||
| 106 | +// UIImage *image = [UIImage xw_getImageName:@"qr_code_icon" bundle:@"XWMyModule.bundle/XWMyModule" targetClass:[XWMyQrCodeView class]]; | ||
| 107 | +// strongSelf.qrCode.image = [SGQRCodeObtain generateQRCodeWithData:jsonStr size:180.0 logoImage:image ratio:0.2]; | ||
| 108 | +// }else{ | ||
| 109 | +// [XWAlertView alertErrorViewWithTextMessage:@"生成失败" view:XW_AppKeyWindow]; | ||
| 110 | +// | ||
| 111 | +// } | ||
| 112 | +// } failure:^(NSError * _Nullable error) { | ||
| 113 | +// [XWAlertView alertErrorViewWithTextMessage:@"生成失败" view:XW_AppKeyWindow]; | ||
| 114 | +// | ||
| 115 | +// }]; | ||
| 116 | +// NSDictionary *dic = @{@"content":[XWCryptoDES encryptUseDES:[self dictionaryToJsonString:@{@"name":@"张晓文",@"id":@"1243124"}] key:AppDESKey],@"type":@"user"}; | ||
| 117 | +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil]; | ||
| 118 | +// NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | ||
| 119 | +// UIImage *image = [self xw_getImageName:@"qr_code_icon" bundleName:@"XWMyModule.bundle/XWMyModule" targetClass:[XWMyQrCodeView class]]; | ||
| 120 | +// self.qrCode.image = [SGQRCodeObtain generateQRCodeWithData:jsonStr size:180.0 logoImage:image ratio:0.2]; | ||
| 121 | +// | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +// 字典转json字符串 | ||
| 125 | +- (NSString *)dictionaryToJsonString:(NSDictionary *)dic { | ||
| 126 | + NSError *parseError = nil; | ||
| 127 | + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError]; | ||
| 128 | + | ||
| 129 | + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | ||
| 130 | +} | ||
| 131 | +// 保存图片 | ||
| 132 | +- (UIImage *)getImage{ | ||
| 133 | + return _qrCode.image; | ||
| 134 | +} | ||
| 135 | +/* | ||
| 136 | + // Only override drawRect: if you perform custom drawing. | ||
| 137 | + // An empty implementation adversely affects performance during animation. | ||
| 138 | + - (void)drawRect:(CGRect)rect { | ||
| 139 | + // Drawing code | ||
| 140 | + } | ||
| 141 | + */ | ||
| 142 | +#pragma mark - 懒加载 | ||
| 143 | +- (UIImageView *)header { | ||
| 144 | + if (!_header) { | ||
| 145 | + _header = [[UIImageView alloc] init]; | ||
| 146 | + _header.backgroundColor = [UIColor redColor]; | ||
| 147 | + _header.layer.masksToBounds = YES; | ||
| 148 | + _header.layer.cornerRadius = 5; | ||
| 149 | + UIImage *xw_image = [self xw_getImageName:@"default_avatar_f" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeView class]]; | ||
| 150 | + [_header sd_setImageWithURL:[NSURL URLWithString:@"User_Head"] placeholderImage:xw_image]; | ||
| 151 | + } | ||
| 152 | + return _header; | ||
| 153 | +} | ||
| 154 | + | ||
| 155 | +- (UILabel *)name { | ||
| 156 | + if (!_name) { | ||
| 157 | + _name = [[UILabel alloc] init]; | ||
| 158 | + _name.numberOfLines = 1; | ||
| 159 | + _name.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | ||
| 160 | + _name.font = [UIFont systemFontOfSize:16]; | ||
| 161 | + _name.text = @"User_Name"; | ||
| 162 | + } | ||
| 163 | + return _name; | ||
| 164 | +} | ||
| 165 | +- (UILabel *)address { | ||
| 166 | + if (!_address) { | ||
| 167 | + _address = [[UILabel alloc] init]; | ||
| 168 | + _address.numberOfLines = 1; | ||
| 169 | + _address.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | ||
| 170 | + _address.font = [UIFont systemFontOfSize:14]; | ||
| 171 | + _address.text = @"User_Address"; | ||
| 172 | + } | ||
| 173 | + return _address; | ||
| 174 | +} | ||
| 175 | +- (UIImageView *)qrCode { | ||
| 176 | + if (!_qrCode) { | ||
| 177 | + _qrCode = [[UIImageView alloc] init]; | ||
| 178 | + } | ||
| 179 | + return _qrCode; | ||
| 180 | +} | ||
| 181 | +- (UILabel *)friends { | ||
| 182 | + if (!_friends) { | ||
| 183 | + _friends = [[UILabel alloc] init]; | ||
| 184 | + _friends.numberOfLines = 1; | ||
| 185 | + _friends.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | ||
| 186 | + _friends.font = [UIFont systemFontOfSize:16]; | ||
| 187 | + _friends.textAlignment = NSTextAlignmentCenter; | ||
| 188 | + _friends.text = @"扫描二维码,加我好友"; | ||
| 189 | + } | ||
| 190 | + return _friends; | ||
| 191 | +} | ||
| 192 | + | ||
| 193 | +/** | ||
| 194 | + * 创建图片 | ||
| 195 | + * | ||
| 196 | + * @param imageName 图片名字 | ||
| 197 | + * @param bundleName 图片所在的bundle名字 | ||
| 198 | + * @param targetClass 类和bundle的同级目录 | ||
| 199 | + * @return 返回UIImage | ||
| 200 | + */ | ||
| 201 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 202 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 203 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 204 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 205 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 206 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 207 | + | ||
| 208 | +} | ||
| 209 | + | ||
| 210 | +@end |
CNLiveQrCodeModule/Classes/View/CNLiveQrCodeNavigationBar.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeNavigationBar.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | +@class CNLiveQrCodeNavigationBar; | ||
| 13 | + | ||
| 14 | +@protocol CNLiveQrCodeNavigationBarDelegate <NSObject> | ||
| 15 | +- (void)navigationBar:(CNLiveQrCodeNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents; | ||
| 16 | + | ||
| 17 | +@end | ||
| 18 | + | ||
| 19 | +@interface CNLiveQrCodeNavigationBar : UIView | ||
| 20 | +@property (nonatomic, weak) id<CNLiveQrCodeNavigationBarDelegate> delegate; | ||
| 21 | +@property (nonatomic, strong) UIView *navView; | ||
| 22 | +@property (nonatomic, strong) UIButton *left; | ||
| 23 | +@property (nonatomic, strong) UILabel *title; | ||
| 24 | +@property (nonatomic, strong) UIButton *right; | ||
| 25 | + | ||
| 26 | +@end | ||
| 27 | + | ||
| 28 | +NS_ASSUME_NONNULL_END |
CNLiveQrCodeModule/Classes/View/CNLiveQrCodeNavigationBar.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeNavigationBar.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveQrCodeNavigationBar.h" | ||
| 10 | +#import "QMUIKit.h" | ||
| 11 | + | ||
| 12 | +@interface CNLiveQrCodeNavigationBar () | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@implementation CNLiveQrCodeNavigationBar | ||
| 17 | +static const NSInteger margin = 15; | ||
| 18 | + | ||
| 19 | +- (instancetype)initWithFrame:(CGRect)frame{ | ||
| 20 | + self = [super initWithFrame:frame]; | ||
| 21 | + if(self){ | ||
| 22 | + self.userInteractionEnabled = YES; | ||
| 23 | + self.backgroundColor = [UIColor clearColor]; | ||
| 24 | + [self createSubViews]; | ||
| 25 | + } | ||
| 26 | + return self; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +- (void)dealloc { | ||
| 30 | + NSLog(@"CNLiveQrCodeNavigationBar -- dealloc"); | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +- (void)createSubViews { | ||
| 34 | + [self addSubview:self.navView]; | ||
| 35 | + [self addSubview:self.left]; | ||
| 36 | + [self addSubview:self.title]; | ||
| 37 | + [self addSubview:self.right]; | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +/* | ||
| 41 | + // Only override drawRect: if you perform custom drawing. | ||
| 42 | + // An empty implementation adversely affects performance during animation. | ||
| 43 | + - (void)drawRect:(CGRect)rect { | ||
| 44 | + // Drawing code | ||
| 45 | + } | ||
| 46 | + */ | ||
| 47 | + | ||
| 48 | +#pragma mark - 懒加载 | ||
| 49 | +- (UIView *)navView { | ||
| 50 | + if (!_navView) { | ||
| 51 | + _navView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, NavigationContentTop)]; | ||
| 52 | + _navView.backgroundColor = [UIColor clearColor]; | ||
| 53 | + } | ||
| 54 | + return _navView; | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +- (UIButton *)left { | ||
| 58 | + if (!_left) { | ||
| 59 | + _left= [UIButton buttonWithType:UIButtonTypeSystem]; | ||
| 60 | + _left.frame = CGRectMake(margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight); | ||
| 61 | + UIImage *image = [self xw_getImageName:@"mine_back_white_b" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveQrCodeNavigationBar class]]; | ||
| 62 | + [_left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; | ||
| 63 | + [_left setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft]; | ||
| 64 | + [_left addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside]; | ||
| 65 | + } | ||
| 66 | + return _left; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +- (UILabel *)title { | ||
| 70 | + if (!_title) { | ||
| 71 | + _title = [[UILabel alloc] initWithFrame:CGRectMake(margin+NavigationBarHeight, StatusBarHeight, SCREEN_WIDTH-2*(margin+NavigationBarHeight), NavigationBarHeight)]; | ||
| 72 | + [_title setFont:[UIFont systemFontOfSize:18]]; | ||
| 73 | + _title.textColor = [UIColor whiteColor]; | ||
| 74 | + _title.textAlignment = NSTextAlignmentCenter; | ||
| 75 | + } | ||
| 76 | + return _title; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +- (UIButton *)right { | ||
| 80 | + if (!_right) { | ||
| 81 | + _right = [UIButton buttonWithType:UIButtonTypeSystem]; | ||
| 82 | + _right.frame = CGRectMake(SCREEN_WIDTH-50-margin, StatusBarHeight, 50, NavigationBarHeight); | ||
| 83 | + [_right setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight]; | ||
| 84 | + _right.adjustsImageWhenHighlighted = NO; | ||
| 85 | + _right.titleLabel.font = [UIFont systemFontOfSize:15]; | ||
| 86 | + [_right setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 87 | + [_right addTarget:self action:@selector(rightDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 88 | + } | ||
| 89 | + return _right; | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +#pragma mark - 响应方法 | ||
| 93 | +- (void)goBack{ | ||
| 94 | + if (self.delegate && [self.delegate respondsToSelector:@selector(navigationBar:actionEvents:)]) { | ||
| 95 | + [self.delegate navigationBar:self actionEvents:@"1"]; | ||
| 96 | + } | ||
| 97 | +} | ||
| 98 | +- (void)rightDidClicked:(UIButton *)btn{ | ||
| 99 | + if (self.delegate && [self.delegate respondsToSelector:@selector(navigationBar:actionEvents:)]) { | ||
| 100 | + [self.delegate navigationBar:self actionEvents:@"2"]; | ||
| 101 | + } | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | +/** | ||
| 105 | + * 创建图片 | ||
| 106 | + * | ||
| 107 | + * @param imageName 图片名字 | ||
| 108 | + * @param bundleName 图片所在的bundle名字 | ||
| 109 | + * @param targetClass 类和bundle的同级目录 | ||
| 110 | + * @return 返回UIImage | ||
| 111 | + */ | ||
| 112 | +- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{ | ||
| 113 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 114 | + NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"]; | ||
| 115 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 116 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 117 | + return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 118 | + | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +@end |
Example/CNLiveQrCodeModule.xcodeproj/project.pbxproj
0 → 100644
| 1 | +// !$*UTF8*$! | ||
| 2 | +{ | ||
| 3 | + archiveVersion = 1; | ||
| 4 | + classes = { | ||
| 5 | + }; | ||
| 6 | + objectVersion = 46; | ||
| 7 | + objects = { | ||
| 8 | + | ||
| 9 | +/* Begin PBXBuildFile section */ | ||
| 10 | + 0B466373120CEC1F0FC8AB0D /* Pods_CNLiveQrCodeModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 548F17C9A1850CF06D8B0CD2 /* Pods_CNLiveQrCodeModule_Tests.framework */; }; | ||
| 11 | + 13A9117B14171C6BBDD86E49 /* Pods_CNLiveQrCodeModule_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42171FA547E30017538561CB /* Pods_CNLiveQrCodeModule_Example.framework */; }; | ||
| 12 | + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | ||
| 13 | + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; | ||
| 14 | + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | ||
| 15 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; | ||
| 16 | + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; | ||
| 17 | + 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */; }; | ||
| 18 | + 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* CNLIVEViewController.m */; }; | ||
| 19 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; | ||
| 20 | + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; | ||
| 21 | + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | ||
| 22 | + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | ||
| 23 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; | ||
| 24 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; | ||
| 25 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; | ||
| 26 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; | ||
| 27 | +/* End PBXBuildFile section */ | ||
| 28 | + | ||
| 29 | +/* Begin PBXContainerItemProxy section */ | ||
| 30 | + 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { | ||
| 31 | + isa = PBXContainerItemProxy; | ||
| 32 | + containerPortal = 6003F582195388D10070C39A /* Project object */; | ||
| 33 | + proxyType = 1; | ||
| 34 | + remoteGlobalIDString = 6003F589195388D20070C39A; | ||
| 35 | + remoteInfo = CNLiveQrCodeModule; | ||
| 36 | + }; | ||
| 37 | +/* End PBXContainerItemProxy section */ | ||
| 38 | + | ||
| 39 | +/* Begin PBXFileReference section */ | ||
| 40 | + 2B2A508D9E4A1862D04EFFA6 /* CNLiveQrCodeModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveQrCodeModule.podspec; path = ../CNLiveQrCodeModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; | ||
| 41 | + 2F8F921452834FD6B810C3C5 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; | ||
| 42 | + 42171FA547E30017538561CB /* Pods_CNLiveQrCodeModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveQrCodeModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 43 | + 548F17C9A1850CF06D8B0CD2 /* Pods_CNLiveQrCodeModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveQrCodeModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 44 | + 5E882B36B0FCBD2ABA154014 /* Pods-CNLiveQrCodeModule_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveQrCodeModule_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveQrCodeModule_Tests/Pods-CNLiveQrCodeModule_Tests.debug.xcconfig"; sourceTree = "<group>"; }; | ||
| 45 | + 6003F58A195388D20070C39A /* CNLiveQrCodeModule_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveQrCodeModule_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 46 | + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; | ||
| 47 | + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; | ||
| 48 | + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; | ||
| 49 | + 6003F595195388D20070C39A /* CNLiveQrCodeModule-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CNLiveQrCodeModule-Info.plist"; sourceTree = "<group>"; }; | ||
| 50 | + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | ||
| 51 | + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; | ||
| 52 | + 6003F59B195388D20070C39A /* CNLiveQrCodeModule-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CNLiveQrCodeModule-Prefix.pch"; sourceTree = "<group>"; }; | ||
| 53 | + 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEAppDelegate.h; sourceTree = "<group>"; }; | ||
| 54 | + 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEAppDelegate.m; sourceTree = "<group>"; }; | ||
| 55 | + 6003F5A5195388D20070C39A /* CNLIVEViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEViewController.h; sourceTree = "<group>"; }; | ||
| 56 | + 6003F5A6195388D20070C39A /* CNLIVEViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEViewController.m; sourceTree = "<group>"; }; | ||
| 57 | + 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; | ||
| 58 | + 6003F5AE195388D20070C39A /* CNLiveQrCodeModule_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CNLiveQrCodeModule_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 59 | + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; | ||
| 60 | + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; }; | ||
| 61 | + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | ||
| 62 | + 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; }; | ||
| 63 | + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; }; | ||
| 64 | + 68CC44ADAAA9CB1EE3C11C87 /* Pods-CNLiveQrCodeModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveQrCodeModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveQrCodeModule_Tests/Pods-CNLiveQrCodeModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; | ||
| 65 | + 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | ||
| 66 | + 7B093BB1E0711E1E61322AB8 /* Pods-CNLiveQrCodeModule_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveQrCodeModule_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveQrCodeModule_Example/Pods-CNLiveQrCodeModule_Example.release.xcconfig"; sourceTree = "<group>"; }; | ||
| 67 | + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | ||
| 68 | + A0377411729C4CC393713844 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; }; | ||
| 69 | + ADFA0FB46C34F98FB4FC588D /* Pods-CNLiveQrCodeModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveQrCodeModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveQrCodeModule_Example/Pods-CNLiveQrCodeModule_Example.debug.xcconfig"; sourceTree = "<group>"; }; | ||
| 70 | +/* End PBXFileReference section */ | ||
| 71 | + | ||
| 72 | +/* Begin PBXFrameworksBuildPhase section */ | ||
| 73 | + 6003F587195388D20070C39A /* Frameworks */ = { | ||
| 74 | + isa = PBXFrameworksBuildPhase; | ||
| 75 | + buildActionMask = 2147483647; | ||
| 76 | + files = ( | ||
| 77 | + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, | ||
| 78 | + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, | ||
| 79 | + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, | ||
| 80 | + 13A9117B14171C6BBDD86E49 /* Pods_CNLiveQrCodeModule_Example.framework in Frameworks */, | ||
| 81 | + ); | ||
| 82 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 83 | + }; | ||
| 84 | + 6003F5AB195388D20070C39A /* Frameworks */ = { | ||
| 85 | + isa = PBXFrameworksBuildPhase; | ||
| 86 | + buildActionMask = 2147483647; | ||
| 87 | + files = ( | ||
| 88 | + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, | ||
| 89 | + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, | ||
| 90 | + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, | ||
| 91 | + 0B466373120CEC1F0FC8AB0D /* Pods_CNLiveQrCodeModule_Tests.framework in Frameworks */, | ||
| 92 | + ); | ||
| 93 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 94 | + }; | ||
| 95 | +/* End PBXFrameworksBuildPhase section */ | ||
| 96 | + | ||
| 97 | +/* Begin PBXGroup section */ | ||
| 98 | + 6003F581195388D10070C39A = { | ||
| 99 | + isa = PBXGroup; | ||
| 100 | + children = ( | ||
| 101 | + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, | ||
| 102 | + 6003F593195388D20070C39A /* Example for CNLiveQrCodeModule */, | ||
| 103 | + 6003F5B5195388D20070C39A /* Tests */, | ||
| 104 | + 6003F58C195388D20070C39A /* Frameworks */, | ||
| 105 | + 6003F58B195388D20070C39A /* Products */, | ||
| 106 | + 8372D8994AB768D2D88745F0 /* Pods */, | ||
| 107 | + ); | ||
| 108 | + sourceTree = "<group>"; | ||
| 109 | + }; | ||
| 110 | + 6003F58B195388D20070C39A /* Products */ = { | ||
| 111 | + isa = PBXGroup; | ||
| 112 | + children = ( | ||
| 113 | + 6003F58A195388D20070C39A /* CNLiveQrCodeModule_Example.app */, | ||
| 114 | + 6003F5AE195388D20070C39A /* CNLiveQrCodeModule_Tests.xctest */, | ||
| 115 | + ); | ||
| 116 | + name = Products; | ||
| 117 | + sourceTree = "<group>"; | ||
| 118 | + }; | ||
| 119 | + 6003F58C195388D20070C39A /* Frameworks */ = { | ||
| 120 | + isa = PBXGroup; | ||
| 121 | + children = ( | ||
| 122 | + 6003F58D195388D20070C39A /* Foundation.framework */, | ||
| 123 | + 6003F58F195388D20070C39A /* CoreGraphics.framework */, | ||
| 124 | + 6003F591195388D20070C39A /* UIKit.framework */, | ||
| 125 | + 6003F5AF195388D20070C39A /* XCTest.framework */, | ||
| 126 | + 42171FA547E30017538561CB /* Pods_CNLiveQrCodeModule_Example.framework */, | ||
| 127 | + 548F17C9A1850CF06D8B0CD2 /* Pods_CNLiveQrCodeModule_Tests.framework */, | ||
| 128 | + ); | ||
| 129 | + name = Frameworks; | ||
| 130 | + sourceTree = "<group>"; | ||
| 131 | + }; | ||
| 132 | + 6003F593195388D20070C39A /* Example for CNLiveQrCodeModule */ = { | ||
| 133 | + isa = PBXGroup; | ||
| 134 | + children = ( | ||
| 135 | + 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */, | ||
| 136 | + 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */, | ||
| 137 | + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, | ||
| 138 | + 6003F5A5195388D20070C39A /* CNLIVEViewController.h */, | ||
| 139 | + 6003F5A6195388D20070C39A /* CNLIVEViewController.m */, | ||
| 140 | + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, | ||
| 141 | + 6003F5A8195388D20070C39A /* Images.xcassets */, | ||
| 142 | + 6003F594195388D20070C39A /* Supporting Files */, | ||
| 143 | + ); | ||
| 144 | + name = "Example for CNLiveQrCodeModule"; | ||
| 145 | + path = CNLiveQrCodeModule; | ||
| 146 | + sourceTree = "<group>"; | ||
| 147 | + }; | ||
| 148 | + 6003F594195388D20070C39A /* Supporting Files */ = { | ||
| 149 | + isa = PBXGroup; | ||
| 150 | + children = ( | ||
| 151 | + 6003F595195388D20070C39A /* CNLiveQrCodeModule-Info.plist */, | ||
| 152 | + 6003F596195388D20070C39A /* InfoPlist.strings */, | ||
| 153 | + 6003F599195388D20070C39A /* main.m */, | ||
| 154 | + 6003F59B195388D20070C39A /* CNLiveQrCodeModule-Prefix.pch */, | ||
| 155 | + ); | ||
| 156 | + name = "Supporting Files"; | ||
| 157 | + sourceTree = "<group>"; | ||
| 158 | + }; | ||
| 159 | + 6003F5B5195388D20070C39A /* Tests */ = { | ||
| 160 | + isa = PBXGroup; | ||
| 161 | + children = ( | ||
| 162 | + 6003F5BB195388D20070C39A /* Tests.m */, | ||
| 163 | + 6003F5B6195388D20070C39A /* Supporting Files */, | ||
| 164 | + ); | ||
| 165 | + path = Tests; | ||
| 166 | + sourceTree = "<group>"; | ||
| 167 | + }; | ||
| 168 | + 6003F5B6195388D20070C39A /* Supporting Files */ = { | ||
| 169 | + isa = PBXGroup; | ||
| 170 | + children = ( | ||
| 171 | + 6003F5B7195388D20070C39A /* Tests-Info.plist */, | ||
| 172 | + 6003F5B8195388D20070C39A /* InfoPlist.strings */, | ||
| 173 | + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, | ||
| 174 | + ); | ||
| 175 | + name = "Supporting Files"; | ||
| 176 | + sourceTree = "<group>"; | ||
| 177 | + }; | ||
| 178 | + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { | ||
| 179 | + isa = PBXGroup; | ||
| 180 | + children = ( | ||
| 181 | + 2B2A508D9E4A1862D04EFFA6 /* CNLiveQrCodeModule.podspec */, | ||
| 182 | + 2F8F921452834FD6B810C3C5 /* README.md */, | ||
| 183 | + A0377411729C4CC393713844 /* LICENSE */, | ||
| 184 | + ); | ||
| 185 | + name = "Podspec Metadata"; | ||
| 186 | + sourceTree = "<group>"; | ||
| 187 | + }; | ||
| 188 | + 8372D8994AB768D2D88745F0 /* Pods */ = { | ||
| 189 | + isa = PBXGroup; | ||
| 190 | + children = ( | ||
| 191 | + ADFA0FB46C34F98FB4FC588D /* Pods-CNLiveQrCodeModule_Example.debug.xcconfig */, | ||
| 192 | + 7B093BB1E0711E1E61322AB8 /* Pods-CNLiveQrCodeModule_Example.release.xcconfig */, | ||
| 193 | + 5E882B36B0FCBD2ABA154014 /* Pods-CNLiveQrCodeModule_Tests.debug.xcconfig */, | ||
| 194 | + 68CC44ADAAA9CB1EE3C11C87 /* Pods-CNLiveQrCodeModule_Tests.release.xcconfig */, | ||
| 195 | + ); | ||
| 196 | + path = Pods; | ||
| 197 | + sourceTree = "<group>"; | ||
| 198 | + }; | ||
| 199 | +/* End PBXGroup section */ | ||
| 200 | + | ||
| 201 | +/* Begin PBXNativeTarget section */ | ||
| 202 | + 6003F589195388D20070C39A /* CNLiveQrCodeModule_Example */ = { | ||
| 203 | + isa = PBXNativeTarget; | ||
| 204 | + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveQrCodeModule_Example" */; | ||
| 205 | + buildPhases = ( | ||
| 206 | + 331689B0771077B305836D8A /* [CP] Check Pods Manifest.lock */, | ||
| 207 | + 6003F586195388D20070C39A /* Sources */, | ||
| 208 | + 6003F587195388D20070C39A /* Frameworks */, | ||
| 209 | + 6003F588195388D20070C39A /* Resources */, | ||
| 210 | + B8536AFDA8AE694C88DC31C9 /* [CP] Embed Pods Frameworks */, | ||
| 211 | + ); | ||
| 212 | + buildRules = ( | ||
| 213 | + ); | ||
| 214 | + dependencies = ( | ||
| 215 | + ); | ||
| 216 | + name = CNLiveQrCodeModule_Example; | ||
| 217 | + productName = CNLiveQrCodeModule; | ||
| 218 | + productReference = 6003F58A195388D20070C39A /* CNLiveQrCodeModule_Example.app */; | ||
| 219 | + productType = "com.apple.product-type.application"; | ||
| 220 | + }; | ||
| 221 | + 6003F5AD195388D20070C39A /* CNLiveQrCodeModule_Tests */ = { | ||
| 222 | + isa = PBXNativeTarget; | ||
| 223 | + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveQrCodeModule_Tests" */; | ||
| 224 | + buildPhases = ( | ||
| 225 | + 667E6DC32E1A51CD56D1B74A /* [CP] Check Pods Manifest.lock */, | ||
| 226 | + 6003F5AA195388D20070C39A /* Sources */, | ||
| 227 | + 6003F5AB195388D20070C39A /* Frameworks */, | ||
| 228 | + 6003F5AC195388D20070C39A /* Resources */, | ||
| 229 | + ); | ||
| 230 | + buildRules = ( | ||
| 231 | + ); | ||
| 232 | + dependencies = ( | ||
| 233 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */, | ||
| 234 | + ); | ||
| 235 | + name = CNLiveQrCodeModule_Tests; | ||
| 236 | + productName = CNLiveQrCodeModuleTests; | ||
| 237 | + productReference = 6003F5AE195388D20070C39A /* CNLiveQrCodeModule_Tests.xctest */; | ||
| 238 | + productType = "com.apple.product-type.bundle.unit-test"; | ||
| 239 | + }; | ||
| 240 | +/* End PBXNativeTarget section */ | ||
| 241 | + | ||
| 242 | +/* Begin PBXProject section */ | ||
| 243 | + 6003F582195388D10070C39A /* Project object */ = { | ||
| 244 | + isa = PBXProject; | ||
| 245 | + attributes = { | ||
| 246 | + CLASSPREFIX = CNLIVE; | ||
| 247 | + LastUpgradeCheck = 0720; | ||
| 248 | + ORGANIZATIONNAME = "153993236@qq.com"; | ||
| 249 | + TargetAttributes = { | ||
| 250 | + 6003F589195388D20070C39A = { | ||
| 251 | + DevelopmentTeam = 94X49GG3ZW; | ||
| 252 | + }; | ||
| 253 | + 6003F5AD195388D20070C39A = { | ||
| 254 | + TestTargetID = 6003F589195388D20070C39A; | ||
| 255 | + }; | ||
| 256 | + }; | ||
| 257 | + }; | ||
| 258 | + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveQrCodeModule" */; | ||
| 259 | + compatibilityVersion = "Xcode 3.2"; | ||
| 260 | + developmentRegion = English; | ||
| 261 | + hasScannedForEncodings = 0; | ||
| 262 | + knownRegions = ( | ||
| 263 | + English, | ||
| 264 | + en, | ||
| 265 | + Base, | ||
| 266 | + ); | ||
| 267 | + mainGroup = 6003F581195388D10070C39A; | ||
| 268 | + productRefGroup = 6003F58B195388D20070C39A /* Products */; | ||
| 269 | + projectDirPath = ""; | ||
| 270 | + projectRoot = ""; | ||
| 271 | + targets = ( | ||
| 272 | + 6003F589195388D20070C39A /* CNLiveQrCodeModule_Example */, | ||
| 273 | + 6003F5AD195388D20070C39A /* CNLiveQrCodeModule_Tests */, | ||
| 274 | + ); | ||
| 275 | + }; | ||
| 276 | +/* End PBXProject section */ | ||
| 277 | + | ||
| 278 | +/* Begin PBXResourcesBuildPhase section */ | ||
| 279 | + 6003F588195388D20070C39A /* Resources */ = { | ||
| 280 | + isa = PBXResourcesBuildPhase; | ||
| 281 | + buildActionMask = 2147483647; | ||
| 282 | + files = ( | ||
| 283 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, | ||
| 284 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, | ||
| 285 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, | ||
| 286 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, | ||
| 287 | + ); | ||
| 288 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 289 | + }; | ||
| 290 | + 6003F5AC195388D20070C39A /* Resources */ = { | ||
| 291 | + isa = PBXResourcesBuildPhase; | ||
| 292 | + buildActionMask = 2147483647; | ||
| 293 | + files = ( | ||
| 294 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, | ||
| 295 | + ); | ||
| 296 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 297 | + }; | ||
| 298 | +/* End PBXResourcesBuildPhase section */ | ||
| 299 | + | ||
| 300 | +/* Begin PBXShellScriptBuildPhase section */ | ||
| 301 | + 331689B0771077B305836D8A /* [CP] Check Pods Manifest.lock */ = { | ||
| 302 | + isa = PBXShellScriptBuildPhase; | ||
| 303 | + buildActionMask = 2147483647; | ||
| 304 | + files = ( | ||
| 305 | + ); | ||
| 306 | + inputFileListPaths = ( | ||
| 307 | + ); | ||
| 308 | + inputPaths = ( | ||
| 309 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 310 | + "${PODS_ROOT}/Manifest.lock", | ||
| 311 | + ); | ||
| 312 | + name = "[CP] Check Pods Manifest.lock"; | ||
| 313 | + outputFileListPaths = ( | ||
| 314 | + ); | ||
| 315 | + outputPaths = ( | ||
| 316 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveQrCodeModule_Example-checkManifestLockResult.txt", | ||
| 317 | + ); | ||
| 318 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 319 | + shellPath = /bin/sh; | ||
| 320 | + 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"; | ||
| 321 | + showEnvVarsInLog = 0; | ||
| 322 | + }; | ||
| 323 | + 667E6DC32E1A51CD56D1B74A /* [CP] Check Pods Manifest.lock */ = { | ||
| 324 | + isa = PBXShellScriptBuildPhase; | ||
| 325 | + buildActionMask = 2147483647; | ||
| 326 | + files = ( | ||
| 327 | + ); | ||
| 328 | + inputFileListPaths = ( | ||
| 329 | + ); | ||
| 330 | + inputPaths = ( | ||
| 331 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 332 | + "${PODS_ROOT}/Manifest.lock", | ||
| 333 | + ); | ||
| 334 | + name = "[CP] Check Pods Manifest.lock"; | ||
| 335 | + outputFileListPaths = ( | ||
| 336 | + ); | ||
| 337 | + outputPaths = ( | ||
| 338 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveQrCodeModule_Tests-checkManifestLockResult.txt", | ||
| 339 | + ); | ||
| 340 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 341 | + shellPath = /bin/sh; | ||
| 342 | + 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"; | ||
| 343 | + showEnvVarsInLog = 0; | ||
| 344 | + }; | ||
| 345 | + B8536AFDA8AE694C88DC31C9 /* [CP] Embed Pods Frameworks */ = { | ||
| 346 | + isa = PBXShellScriptBuildPhase; | ||
| 347 | + buildActionMask = 2147483647; | ||
| 348 | + files = ( | ||
| 349 | + ); | ||
| 350 | + inputPaths = ( | ||
| 351 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveQrCodeModule_Example/Pods-CNLiveQrCodeModule_Example-frameworks.sh", | ||
| 352 | + "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", | ||
| 353 | + "${BUILT_PRODUCTS_DIR}/CNLiveQrCodeModule/CNLiveQrCodeModule.framework", | ||
| 354 | + "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", | ||
| 355 | + "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", | ||
| 356 | + "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", | ||
| 357 | + "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", | ||
| 358 | + "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", | ||
| 359 | + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", | ||
| 360 | + "${BUILT_PRODUCTS_DIR}/SGQRCode/SGQRCode.framework", | ||
| 361 | + ); | ||
| 362 | + name = "[CP] Embed Pods Frameworks"; | ||
| 363 | + outputPaths = ( | ||
| 364 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", | ||
| 365 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveQrCodeModule.framework", | ||
| 366 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", | ||
| 367 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", | ||
| 368 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", | ||
| 369 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", | ||
| 370 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", | ||
| 371 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", | ||
| 372 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SGQRCode.framework", | ||
| 373 | + ); | ||
| 374 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 375 | + shellPath = /bin/sh; | ||
| 376 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveQrCodeModule_Example/Pods-CNLiveQrCodeModule_Example-frameworks.sh\"\n"; | ||
| 377 | + showEnvVarsInLog = 0; | ||
| 378 | + }; | ||
| 379 | +/* End PBXShellScriptBuildPhase section */ | ||
| 380 | + | ||
| 381 | +/* Begin PBXSourcesBuildPhase section */ | ||
| 382 | + 6003F586195388D20070C39A /* Sources */ = { | ||
| 383 | + isa = PBXSourcesBuildPhase; | ||
| 384 | + buildActionMask = 2147483647; | ||
| 385 | + files = ( | ||
| 386 | + 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, | ||
| 387 | + 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, | ||
| 388 | + 6003F59A195388D20070C39A /* main.m in Sources */, | ||
| 389 | + ); | ||
| 390 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 391 | + }; | ||
| 392 | + 6003F5AA195388D20070C39A /* Sources */ = { | ||
| 393 | + isa = PBXSourcesBuildPhase; | ||
| 394 | + buildActionMask = 2147483647; | ||
| 395 | + files = ( | ||
| 396 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */, | ||
| 397 | + ); | ||
| 398 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 399 | + }; | ||
| 400 | +/* End PBXSourcesBuildPhase section */ | ||
| 401 | + | ||
| 402 | +/* Begin PBXTargetDependency section */ | ||
| 403 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { | ||
| 404 | + isa = PBXTargetDependency; | ||
| 405 | + target = 6003F589195388D20070C39A /* CNLiveQrCodeModule_Example */; | ||
| 406 | + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; | ||
| 407 | + }; | ||
| 408 | +/* End PBXTargetDependency section */ | ||
| 409 | + | ||
| 410 | +/* Begin PBXVariantGroup section */ | ||
| 411 | + 6003F596195388D20070C39A /* InfoPlist.strings */ = { | ||
| 412 | + isa = PBXVariantGroup; | ||
| 413 | + children = ( | ||
| 414 | + 6003F597195388D20070C39A /* en */, | ||
| 415 | + ); | ||
| 416 | + name = InfoPlist.strings; | ||
| 417 | + sourceTree = "<group>"; | ||
| 418 | + }; | ||
| 419 | + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { | ||
| 420 | + isa = PBXVariantGroup; | ||
| 421 | + children = ( | ||
| 422 | + 6003F5B9195388D20070C39A /* en */, | ||
| 423 | + ); | ||
| 424 | + name = InfoPlist.strings; | ||
| 425 | + sourceTree = "<group>"; | ||
| 426 | + }; | ||
| 427 | + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { | ||
| 428 | + isa = PBXVariantGroup; | ||
| 429 | + children = ( | ||
| 430 | + 71719F9E1E33DC2100824A3D /* Base */, | ||
| 431 | + ); | ||
| 432 | + name = LaunchScreen.storyboard; | ||
| 433 | + sourceTree = "<group>"; | ||
| 434 | + }; | ||
| 435 | +/* End PBXVariantGroup section */ | ||
| 436 | + | ||
| 437 | +/* Begin XCBuildConfiguration section */ | ||
| 438 | + 6003F5BD195388D20070C39A /* Debug */ = { | ||
| 439 | + isa = XCBuildConfiguration; | ||
| 440 | + buildSettings = { | ||
| 441 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 442 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 443 | + CLANG_CXX_LIBRARY = "libc++"; | ||
| 444 | + CLANG_ENABLE_MODULES = YES; | ||
| 445 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
| 446 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 447 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 448 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 449 | + CLANG_WARN_EMPTY_BODY = YES; | ||
| 450 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 451 | + CLANG_WARN_INT_CONVERSION = YES; | ||
| 452 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 453 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 454 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 455 | + COPY_PHASE_STRIP = NO; | ||
| 456 | + ENABLE_TESTABILITY = YES; | ||
| 457 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 458 | + GCC_DYNAMIC_NO_PIC = NO; | ||
| 459 | + GCC_OPTIMIZATION_LEVEL = 0; | ||
| 460 | + GCC_PREPROCESSOR_DEFINITIONS = ( | ||
| 461 | + "DEBUG=1", | ||
| 462 | + "$(inherited)", | ||
| 463 | + ); | ||
| 464 | + GCC_SYMBOLS_PRIVATE_EXTERN = NO; | ||
| 465 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 466 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 467 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 468 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 469 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 470 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 471 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | ||
| 472 | + ONLY_ACTIVE_ARCH = YES; | ||
| 473 | + SDKROOT = iphoneos; | ||
| 474 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 475 | + }; | ||
| 476 | + name = Debug; | ||
| 477 | + }; | ||
| 478 | + 6003F5BE195388D20070C39A /* Release */ = { | ||
| 479 | + isa = XCBuildConfiguration; | ||
| 480 | + buildSettings = { | ||
| 481 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 482 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 483 | + CLANG_CXX_LIBRARY = "libc++"; | ||
| 484 | + CLANG_ENABLE_MODULES = YES; | ||
| 485 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
| 486 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 487 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 488 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 489 | + CLANG_WARN_EMPTY_BODY = YES; | ||
| 490 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 491 | + CLANG_WARN_INT_CONVERSION = YES; | ||
| 492 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 493 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 494 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 495 | + COPY_PHASE_STRIP = YES; | ||
| 496 | + ENABLE_NS_ASSERTIONS = NO; | ||
| 497 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 498 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 499 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 500 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 501 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 502 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 503 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 504 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | ||
| 505 | + SDKROOT = iphoneos; | ||
| 506 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 507 | + VALIDATE_PRODUCT = YES; | ||
| 508 | + }; | ||
| 509 | + name = Release; | ||
| 510 | + }; | ||
| 511 | + 6003F5C0195388D20070C39A /* Debug */ = { | ||
| 512 | + isa = XCBuildConfiguration; | ||
| 513 | + baseConfigurationReference = ADFA0FB46C34F98FB4FC588D /* Pods-CNLiveQrCodeModule_Example.debug.xcconfig */; | ||
| 514 | + buildSettings = { | ||
| 515 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 516 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 517 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 518 | + GCC_PREFIX_HEADER = "CNLiveQrCodeModule/CNLiveQrCodeModule-Prefix.pch"; | ||
| 519 | + INFOPLIST_FILE = "CNLiveQrCodeModule/CNLiveQrCodeModule-Info.plist"; | ||
| 520 | + MODULE_NAME = ExampleApp; | ||
| 521 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 522 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 523 | + SWIFT_VERSION = 4.0; | ||
| 524 | + WRAPPER_EXTENSION = app; | ||
| 525 | + }; | ||
| 526 | + name = Debug; | ||
| 527 | + }; | ||
| 528 | + 6003F5C1195388D20070C39A /* Release */ = { | ||
| 529 | + isa = XCBuildConfiguration; | ||
| 530 | + baseConfigurationReference = 7B093BB1E0711E1E61322AB8 /* Pods-CNLiveQrCodeModule_Example.release.xcconfig */; | ||
| 531 | + buildSettings = { | ||
| 532 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 533 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 534 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 535 | + GCC_PREFIX_HEADER = "CNLiveQrCodeModule/CNLiveQrCodeModule-Prefix.pch"; | ||
| 536 | + INFOPLIST_FILE = "CNLiveQrCodeModule/CNLiveQrCodeModule-Info.plist"; | ||
| 537 | + MODULE_NAME = ExampleApp; | ||
| 538 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 539 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 540 | + SWIFT_VERSION = 4.0; | ||
| 541 | + WRAPPER_EXTENSION = app; | ||
| 542 | + }; | ||
| 543 | + name = Release; | ||
| 544 | + }; | ||
| 545 | + 6003F5C3195388D20070C39A /* Debug */ = { | ||
| 546 | + isa = XCBuildConfiguration; | ||
| 547 | + baseConfigurationReference = 5E882B36B0FCBD2ABA154014 /* Pods-CNLiveQrCodeModule_Tests.debug.xcconfig */; | ||
| 548 | + buildSettings = { | ||
| 549 | + BUNDLE_LOADER = "$(TEST_HOST)"; | ||
| 550 | + FRAMEWORK_SEARCH_PATHS = ( | ||
| 551 | + "$(PLATFORM_DIR)/Developer/Library/Frameworks", | ||
| 552 | + "$(inherited)", | ||
| 553 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | ||
| 554 | + ); | ||
| 555 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 556 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | ||
| 557 | + GCC_PREPROCESSOR_DEFINITIONS = ( | ||
| 558 | + "DEBUG=1", | ||
| 559 | + "$(inherited)", | ||
| 560 | + ); | ||
| 561 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | ||
| 562 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 563 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 564 | + SWIFT_VERSION = 4.0; | ||
| 565 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveQrCodeModule_Example.app/CNLiveQrCodeModule_Example"; | ||
| 566 | + WRAPPER_EXTENSION = xctest; | ||
| 567 | + }; | ||
| 568 | + name = Debug; | ||
| 569 | + }; | ||
| 570 | + 6003F5C4195388D20070C39A /* Release */ = { | ||
| 571 | + isa = XCBuildConfiguration; | ||
| 572 | + baseConfigurationReference = 68CC44ADAAA9CB1EE3C11C87 /* Pods-CNLiveQrCodeModule_Tests.release.xcconfig */; | ||
| 573 | + buildSettings = { | ||
| 574 | + BUNDLE_LOADER = "$(TEST_HOST)"; | ||
| 575 | + FRAMEWORK_SEARCH_PATHS = ( | ||
| 576 | + "$(PLATFORM_DIR)/Developer/Library/Frameworks", | ||
| 577 | + "$(inherited)", | ||
| 578 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | ||
| 579 | + ); | ||
| 580 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 581 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | ||
| 582 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | ||
| 583 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 584 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 585 | + SWIFT_VERSION = 4.0; | ||
| 586 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveQrCodeModule_Example.app/CNLiveQrCodeModule_Example"; | ||
| 587 | + WRAPPER_EXTENSION = xctest; | ||
| 588 | + }; | ||
| 589 | + name = Release; | ||
| 590 | + }; | ||
| 591 | +/* End XCBuildConfiguration section */ | ||
| 592 | + | ||
| 593 | +/* Begin XCConfigurationList section */ | ||
| 594 | + 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveQrCodeModule" */ = { | ||
| 595 | + isa = XCConfigurationList; | ||
| 596 | + buildConfigurations = ( | ||
| 597 | + 6003F5BD195388D20070C39A /* Debug */, | ||
| 598 | + 6003F5BE195388D20070C39A /* Release */, | ||
| 599 | + ); | ||
| 600 | + defaultConfigurationIsVisible = 0; | ||
| 601 | + defaultConfigurationName = Release; | ||
| 602 | + }; | ||
| 603 | + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveQrCodeModule_Example" */ = { | ||
| 604 | + isa = XCConfigurationList; | ||
| 605 | + buildConfigurations = ( | ||
| 606 | + 6003F5C0195388D20070C39A /* Debug */, | ||
| 607 | + 6003F5C1195388D20070C39A /* Release */, | ||
| 608 | + ); | ||
| 609 | + defaultConfigurationIsVisible = 0; | ||
| 610 | + defaultConfigurationName = Release; | ||
| 611 | + }; | ||
| 612 | + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveQrCodeModule_Tests" */ = { | ||
| 613 | + isa = XCConfigurationList; | ||
| 614 | + buildConfigurations = ( | ||
| 615 | + 6003F5C3195388D20070C39A /* Debug */, | ||
| 616 | + 6003F5C4195388D20070C39A /* Release */, | ||
| 617 | + ); | ||
| 618 | + defaultConfigurationIsVisible = 0; | ||
| 619 | + defaultConfigurationName = Release; | ||
| 620 | + }; | ||
| 621 | +/* End XCConfigurationList section */ | ||
| 622 | + }; | ||
| 623 | + rootObject = 6003F582195388D10070C39A /* Project object */; | ||
| 624 | +} |
Example/CNLiveQrCodeModule.xcodeproj/xcshareddata/xcschemes/CNLiveQrCodeModule-Example.xcscheme
0 → 100644
| 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 = "CNLiveQrCodeModule_Example.app" | ||
| 19 | + BlueprintName = "CNLiveQrCodeModule_Example" | ||
| 20 | + ReferencedContainer = "container:CNLiveQrCodeModule.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 = "CNLiveQrCodeModule_Tests.xctest" | ||
| 37 | + BlueprintName = "CNLiveQrCodeModule_Tests" | ||
| 38 | + ReferencedContainer = "container:CNLiveQrCodeModule.xcodeproj"> | ||
| 39 | + </BuildableReference> | ||
| 40 | + </TestableReference> | ||
| 41 | + </Testables> | ||
| 42 | + <MacroExpansion> | ||
| 43 | + <BuildableReference | ||
| 44 | + BuildableIdentifier = "primary" | ||
| 45 | + BlueprintIdentifier = "6003F589195388D20070C39A" | ||
| 46 | + BuildableName = "CNLiveQrCodeModule_Example.app" | ||
| 47 | + BlueprintName = "CNLiveQrCodeModule_Example" | ||
| 48 | + ReferencedContainer = "container:CNLiveQrCodeModule.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 = "CNLiveQrCodeModule_Example.app" | ||
| 70 | + BlueprintName = "CNLiveQrCodeModule_Example" | ||
| 71 | + ReferencedContainer = "container:CNLiveQrCodeModule.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 = "CNLiveQrCodeModule_Example.app" | ||
| 89 | + BlueprintName = "CNLiveQrCodeModule_Example" | ||
| 90 | + ReferencedContainer = "container:CNLiveQrCodeModule.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/CNLiveQrCodeModule/Base.lproj/LaunchScreen.storyboard
0 → 100644
| 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/CNLiveQrCodeModule/Base.lproj/Main.storyboard
0 → 100644
| 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="CNLIVEViewController" 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/CNLiveQrCodeModule/CNLIVEAppDelegate.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLIVEAppDelegate.h | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/14/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +@import UIKit; | ||
| 10 | + | ||
| 11 | +@interface CNLIVEAppDelegate : UIResponder <UIApplicationDelegate> | ||
| 12 | + | ||
| 13 | +@property (strong, nonatomic) UIWindow *window; | ||
| 14 | + | ||
| 15 | +@end |
Example/CNLiveQrCodeModule/CNLIVEAppDelegate.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLIVEAppDelegate.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/14/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLIVEAppDelegate.h" | ||
| 10 | +#import "CNLiveMyQrCodeController.h" | ||
| 11 | +#import "CNLiveScanQrCodeController.h" | ||
| 12 | + | ||
| 13 | +@implementation CNLIVEAppDelegate | ||
| 14 | + | ||
| 15 | +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
| 16 | +{ | ||
| 17 | + // Override point for customization after application launch. | ||
| 18 | + | ||
| 19 | + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | ||
| 20 | + | ||
| 21 | + CNLiveScanQrCodeController *vc = [[CNLiveScanQrCodeController alloc] init]; | ||
| 22 | + | ||
| 23 | + UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; | ||
| 24 | + | ||
| 25 | + self.window.rootViewController = nav;//设置根视图控制器 | ||
| 26 | + | ||
| 27 | + [self.window makeKeyAndVisible]; | ||
| 28 | + return YES; | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +- (void)applicationWillResignActive:(UIApplication *)application | ||
| 32 | +{ | ||
| 33 | + // 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. | ||
| 34 | + // 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. | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +- (void)applicationDidEnterBackground:(UIApplication *)application | ||
| 38 | +{ | ||
| 39 | + // 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. | ||
| 40 | + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +- (void)applicationWillEnterForeground:(UIApplication *)application | ||
| 44 | +{ | ||
| 45 | + // 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. | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +- (void)applicationDidBecomeActive:(UIApplication *)application | ||
| 49 | +{ | ||
| 50 | + // 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. | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +- (void)applicationWillTerminate:(UIApplication *)application | ||
| 54 | +{ | ||
| 55 | + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | +@end |
Example/CNLiveQrCodeModule/CNLIVEViewController.h
0 → 100644
Example/CNLiveQrCodeModule/CNLIVEViewController.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLIVEViewController.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/14/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLIVEViewController.h" | ||
| 10 | + | ||
| 11 | +@interface CNLIVEViewController () | ||
| 12 | + | ||
| 13 | +@end | ||
| 14 | + | ||
| 15 | +@implementation CNLIVEViewController | ||
| 16 | + | ||
| 17 | +- (void)viewDidLoad | ||
| 18 | +{ | ||
| 19 | + [super viewDidLoad]; | ||
| 20 | + // Do any additional setup after loading the view, typically from a nib. | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +- (void)didReceiveMemoryWarning | ||
| 24 | +{ | ||
| 25 | + [super didReceiveMemoryWarning]; | ||
| 26 | + // Dispose of any resources that can be recreated. | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +@end |
Example/CNLiveQrCodeModule/CNLiveQrCodeModule-Info.plist
0 → 100644
| 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>NSCameraUsageDescription</key> | ||
| 6 | + <string>App需要您的同意,才能访问相机</string> | ||
| 7 | + <key>NSMicrophoneUsageDescription</key> | ||
| 8 | + <string>App需要您的同意,才能访问麦克风</string> | ||
| 9 | + <key>NSPhotoLibraryAddUsageDescription</key> | ||
| 10 | + <string>App需要您的同意,才能访问相册</string> | ||
| 11 | + <key>NSPhotoLibraryUsageDescription</key> | ||
| 12 | + <string>App需要您的同意,才能访问相册</string> | ||
| 13 | + <key>CFBundleDevelopmentRegion</key> | ||
| 14 | + <string>en</string> | ||
| 15 | + <key>CFBundleDisplayName</key> | ||
| 16 | + <string>${PRODUCT_NAME}</string> | ||
| 17 | + <key>CFBundleExecutable</key> | ||
| 18 | + <string>${EXECUTABLE_NAME}</string> | ||
| 19 | + <key>CFBundleIdentifier</key> | ||
| 20 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
| 21 | + <key>CFBundleInfoDictionaryVersion</key> | ||
| 22 | + <string>6.0</string> | ||
| 23 | + <key>CFBundleName</key> | ||
| 24 | + <string>${PRODUCT_NAME}</string> | ||
| 25 | + <key>CFBundlePackageType</key> | ||
| 26 | + <string>APPL</string> | ||
| 27 | + <key>CFBundleShortVersionString</key> | ||
| 28 | + <string>1.0</string> | ||
| 29 | + <key>CFBundleSignature</key> | ||
| 30 | + <string>????</string> | ||
| 31 | + <key>CFBundleVersion</key> | ||
| 32 | + <string>1.0</string> | ||
| 33 | + <key>LSRequiresIPhoneOS</key> | ||
| 34 | + <true/> | ||
| 35 | + <key>UILaunchStoryboardName</key> | ||
| 36 | + <string>LaunchScreen</string> | ||
| 37 | + <key>UIMainStoryboardFile</key> | ||
| 38 | + <string>Main</string> | ||
| 39 | + <key>UIRequiredDeviceCapabilities</key> | ||
| 40 | + <array> | ||
| 41 | + <string>armv7</string> | ||
| 42 | + </array> | ||
| 43 | + <key>UISupportedInterfaceOrientations</key> | ||
| 44 | + <array> | ||
| 45 | + <string>UIInterfaceOrientationPortrait</string> | ||
| 46 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 47 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 48 | + </array> | ||
| 49 | + <key>UISupportedInterfaceOrientations~ipad</key> | ||
| 50 | + <array> | ||
| 51 | + <string>UIInterfaceOrientationPortrait</string> | ||
| 52 | + <string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
| 53 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 54 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 55 | + </array> | ||
| 56 | +</dict> | ||
| 57 | +</plist> |
Example/CNLiveQrCodeModule/CNLiveQrCodeModule-Prefix.pch
0 → 100644
| 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/CNLiveQrCodeModule/Images.xcassets/AppIcon.appiconset/Contents.json
0 → 100644
| 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/CNLiveQrCodeModule/en.lproj/InfoPlist.strings
0 → 100644
Example/CNLiveQrCodeModule/main.m
0 → 100644
| 1 | +// | ||
| 2 | +// main.m | ||
| 3 | +// CNLiveQrCodeModule | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/14/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +@import UIKit; | ||
| 10 | +#import "CNLIVEAppDelegate.h" | ||
| 11 | + | ||
| 12 | +int main(int argc, char * argv[]) | ||
| 13 | +{ | ||
| 14 | + @autoreleasepool { | ||
| 15 | + return UIApplicationMain(argc, argv, nil, NSStringFromClass([CNLIVEAppDelegate class])); | ||
| 16 | + } | ||
| 17 | +} |
Example/Podfile
0 → 100644
| 1 | +use_frameworks! | ||
| 2 | +source 'https://github.com/CocoaPods/Specs.git' | ||
| 3 | +source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git' | ||
| 4 | +platform :ios, '9.0' | ||
| 5 | + | ||
| 6 | +target 'CNLiveQrCodeModule_Example' do | ||
| 7 | + pod 'CNLiveQrCodeModule', :path => '../' | ||
| 8 | + | ||
| 9 | + target 'CNLiveQrCodeModule_Tests' do | ||
| 10 | + inherit! :search_paths | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + end | ||
| 14 | +end |
Example/Tests/Tests-Info.plist
0 → 100644
| 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
Example/Tests/Tests.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveQrCodeModuleTests.m | ||
| 3 | +// CNLiveQrCodeModuleTests | ||
| 4 | +// | ||
| 5 | +// Created by 153993236@qq.com on 11/14/2019. | ||
| 6 | +// Copyright (c) 2019 153993236@qq.com. 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
LICENSE
0 → 100644
| 1 | +Copyright (c) 2019 153993236@qq.com <zhangxiaowen@cnlive.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
| 1 | -CNLiveQrCodeModule | ||
| 2 | \ No newline at end of file | 1 | \ No newline at end of file |
| 2 | +# CNLiveQrCodeModule | ||
| 3 | + | ||
| 4 | +[](https://travis-ci.org/153993236@qq.com/CNLiveQrCodeModule) | ||
| 5 | +[](https://cocoapods.org/pods/CNLiveQrCodeModule) | ||
| 6 | +[](https://cocoapods.org/pods/CNLiveQrCodeModule) | ||
| 7 | +[](https://cocoapods.org/pods/CNLiveQrCodeModule) | ||
| 8 | + | ||
| 9 | +## Example | ||
| 10 | + | ||
| 11 | +To run the example project, clone the repo, and run `pod install` from the Example directory first. | ||
| 12 | + | ||
| 13 | +## Requirements | ||
| 14 | + | ||
| 15 | +## Installation | ||
| 16 | + | ||
| 17 | +CNLiveQrCodeModule is available through [CocoaPods](https://cocoapods.org). To install | ||
| 18 | +it, simply add the following line to your Podfile: | ||
| 19 | + | ||
| 20 | +```ruby | ||
| 21 | +pod 'CNLiveQrCodeModule' | ||
| 22 | +``` | ||
| 23 | + | ||
| 24 | +## Author | ||
| 25 | + | ||
| 26 | +153993236@qq.com, zhangxiaowen@cnlive.com | ||
| 27 | + | ||
| 28 | +## License | ||
| 29 | + | ||
| 30 | +CNLiveQrCodeModule is available under the MIT license. See the LICENSE file for more info. |
_Pods.xcodeproj
0 → 120000