Commit 48859467566b2bf44a256186a1e33cdf05cb814d
1 parent
adcec47d
no message
Showing
118 changed files
with
6614 additions
and
1 deletions
CNLiveBMineModule.podspec
0 → 100644
| 1 | +# | |
| 2 | +# Be sure to run `pod lib lint CNLiveBMineModule.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 = 'CNLiveBMineModule' | |
| 11 | + s.version = '0.0.1' | |
| 12 | + s.summary = 'CNLiveBMineModule.' | |
| 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/CNLiveBMineModule' | |
| 25 | + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' | |
| 26 | + s.license = { :type => 'MIT', :file => 'LICENSE' } | |
| 27 | + s.author = { 'iOS-Xiaowen' => '153993236@qq.com' } | |
| 28 | + s.source = { :git => 'http://bj.gitlab.cnlive.com/ios-team/CNLiveBMineModule.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 = 'CNLiveBMineModule/Classes/**/*' | |
| 34 | + | |
| 35 | + # Module | |
| 36 | + s.subspec 'Module' do |ss| | |
| 37 | + ss.source_files = 'CNLiveBMineModule/Classes/Module/*.{h,m}' | |
| 38 | + ss.dependency 'CNLiveBMineModule/Controller' | |
| 39 | + end | |
| 40 | + | |
| 41 | + # Controller | |
| 42 | + s.subspec 'Controller' do |ss| | |
| 43 | + ss.source_files = 'CNLiveBMineModule/Classes/Controller/*.{h,m}' | |
| 44 | + ss.dependency 'CNLiveBMineModule/UserInfo' | |
| 45 | + ss.dependency 'CNLiveBMineModule/View' | |
| 46 | + end | |
| 47 | + | |
| 48 | + # View | |
| 49 | + s.subspec 'View' do |ss| | |
| 50 | + ss.source_files = 'CNLiveBMineModule/Classes/View/*.{h,m}' | |
| 51 | + ss.dependency 'CNLiveBMineModule/Model' | |
| 52 | + ss.dependency 'CNLiveBMineModule/UserInfo' | |
| 53 | + end | |
| 54 | + | |
| 55 | + # Model | |
| 56 | + s.subspec 'Model' do |ss| | |
| 57 | + ss.source_files = 'CNLiveBMineModule/Classes/Model/*.{h,m}' | |
| 58 | + end | |
| 59 | + | |
| 60 | + # 用户信息/个人资料 | |
| 61 | + s.subspec 'UserInfo' do |ss| | |
| 62 | + ss.source_files = 'CNLiveBMineModule/Classes/UserInfo/*.{h,m}' | |
| 63 | + end | |
| 64 | + | |
| 65 | + # 设置 | |
| 66 | + s.subspec 'Setting' do |ss| | |
| 67 | + ss.source_files = 'CNLiveBMineModule/Classes/Setting/**/*.{h,m}' | |
| 68 | + end | |
| 69 | + s.resource_bundles = { | |
| 70 | + 'CNLiveBMineModule' => ['CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets'] | |
| 71 | + } | |
| 72 | + | |
| 73 | + # s.public_header_files = 'Pod/Classes/**/*.h' | |
| 74 | + # s.frameworks = 'UIKit', 'MapKit' | |
| 75 | + # s.dependency 'AFNetworking', '~> 2.3' | |
| 76 | + | |
| 77 | + # pod | |
| 78 | + s.dependency 'CNLiveSDKs/CNLiveUserSystemSDK', '~> 0.3.2.0' #GitHub所以指定版本号 | |
| 79 | + s.dependency 'CNLiveTripartiteManagement/QMUIKit' | |
| 80 | + s.dependency 'CNLiveTripartiteManagement/SDWebImage' | |
| 81 | + s.dependency 'CNLiveTripartiteManagement/Masonry' | |
| 82 | + s.dependency 'CNLiveTripartiteManagement/MJExtension' | |
| 83 | + s.dependency 'CNLiveTripartiteManagement/AFNetworking' | |
| 84 | + | |
| 85 | + # 服务层 | |
| 86 | + s.dependency 'CNLiveServices' | |
| 87 | + | |
| 88 | + # 环境 | |
| 89 | + s.dependency 'CNLiveEnvironment' | |
| 90 | + | |
| 91 | + # 基类 | |
| 92 | + s.dependency 'CNLiveCommonClass' | |
| 93 | + | |
| 94 | + # IM | |
| 95 | + s.dependency 'CNLiveIMBaseSDK' | |
| 96 | + | |
| 97 | + # 类别 | |
| 98 | + s.dependency 'CNLiveCategory' | |
| 99 | + | |
| 100 | + # 用户信息本地化 | |
| 101 | + s.dependency 'CNLiveUserManagement' | |
| 102 | + | |
| 103 | + s.dependency 'CNLiveCommonCategory' | |
| 104 | + s.dependency 'CNLiveCustomControl' | |
| 105 | + s.dependency 'CNLiveManager' | |
| 106 | + s.dependency 'CNLiveImagePickerController' | |
| 107 | + s.dependency 'CNLiveAVCamera' | |
| 108 | + s.dependency 'CNLiveUserAgreementManager' | |
| 109 | + s.dependency 'CNLiveChooseCountry' | |
| 110 | + | |
| 111 | + s.static_framework = true | |
| 112 | + | |
| 113 | +end | ... | ... |
CNLiveBMineModule/Assets/.gitkeep
0 → 100644
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/Contents.json
0 → 100644
CNLiveBMineModule/Assets/CNLiveBMineModule.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 | 22 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/default_avatar_f.imageset/default_avatar_f.png
0 → 100644
11.1 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.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 | 22 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/default_avatar_y.imageset/default_avatar_y.png
0 → 100644
10.7 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_bg.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_bg@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_bg@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_bg.imageset/mine_bg@2x.png
0 → 100644
168 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_bg.imageset/mine_bg@3x.png
0 → 100644
332 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_cancellation_agree.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_cancellation_agree@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_cancellation_agree@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_cancellation_agree.imageset/mine_cancellation_agree@2x.png
0 → 100644
331 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_cancellation_agree.imageset/mine_cancellation_agree@3x.png
0 → 100644
650 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_cancellation_agree_sel.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_cancellation_agree_sel@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_cancellation_agree_sel@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_cancellation_agree_sel.imageset/mine_cancellation_agree_sel@2x.png
0 → 100644
733 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_cancellation_agree_sel.imageset/mine_cancellation_agree_sel@3x.png
0 → 100644
1.33 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_common.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "mine_common@2x.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "filename" : "mine_common@3x.png", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "version" : 1, | |
| 20 | + "author" : "xcode" | |
| 21 | + } | |
| 22 | +} | |
| 0 | 23 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_common.imageset/mine_common@2x.png
0 → 100644
2.14 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_common.imageset/mine_common@3x.png
0 → 100644
4.11 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_doyen.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "mine_doyen@2x.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "filename" : "mine_doyen@3x.png", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "version" : 1, | |
| 20 | + "author" : "xcode" | |
| 21 | + } | |
| 22 | +} | |
| 0 | 23 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_doyen.imageset/mine_doyen@2x.png
0 → 100644
1.79 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_doyen.imageset/mine_doyen@3x.png
0 → 100644
3.32 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_into.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_into@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_into@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_into.imageset/mine_into@2x.png
0 → 100644
573 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_into.imageset/mine_into@3x.png
0 → 100644
653 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_location.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "mine_location@2x.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "filename" : "mine_location@3x.png", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "version" : 1, | |
| 20 | + "author" : "xcode" | |
| 21 | + } | |
| 22 | +} | |
| 0 | 23 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_location.imageset/mine_location@2x.png
0 → 100644
767 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_location.imageset/mine_location@3x.png
0 → 100644
1.47 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_logo.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_logo@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_logo@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_logo.imageset/mine_logo@2x.png
0 → 100644
24.8 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_logo.imageset/mine_logo@3x.png
0 → 100644
48.4 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_overbadge.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "mine_overbadge@2x.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "filename" : "mine_overbadge@3x.png", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "version" : 1, | |
| 20 | + "author" : "xcode" | |
| 21 | + } | |
| 22 | +} | |
| 0 | 23 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_overbadge.imageset/mine_overbadge@2x.png
0 → 100644
1.91 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_overbadge.imageset/mine_overbadge@3x.png
0 → 100644
3.61 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_qb.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_qb@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_qb@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_qb.imageset/mine_qb@2x.png
0 → 100644
2.75 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_qb.imageset/mine_qb@3x.png
0 → 100644
5.12 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_sz.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_sz@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_sz@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_sz.imageset/mine_sz@2x.png
0 → 100644
2.67 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_sz.imageset/mine_sz@3x.png
0 → 100644
4.59 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_update_select.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "mine_update_select@2x.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "filename" : "mine_update_select@3x.png", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "version" : 1, | |
| 20 | + "author" : "xcode" | |
| 21 | + } | |
| 22 | +} | |
| 0 | 23 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_update_select.imageset/mine_update_select@2x.png
0 → 100644
330 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_update_select.imageset/mine_update_select@3x.png
0 → 100644
700 Bytes
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_wjj_certification.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "mine_wjj_certification@2x.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "filename" : "mine_wjj_certification@3x.png", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "version" : 1, | |
| 20 | + "author" : "xcode" | |
| 21 | + } | |
| 22 | +} | |
| 0 | 23 | \ No newline at end of file | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_wjj_certification.imageset/mine_wjj_certification@2x.png
0 → 100644
6.92 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_wjj_certification.imageset/mine_wjj_certification@3x.png
0 → 100644
15.1 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_zbzx.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_zbzx@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_zbzx@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_zbzx.imageset/mine_zbzx@2x.png
0 → 100644
1.84 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_zbzx.imageset/mine_zbzx@3x.png
0 → 100644
3.44 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_zy.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_zy@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_zy@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_zy.imageset/mine_zy@2x.png
0 → 100644
41.8 KB
CNLiveBMineModule/Assets/CNLiveBMineModule.xcassets/mine_zy.imageset/mine_zy@3x.png
0 → 100644
148 KB
CNLiveBMineModule/Classes/.gitkeep
0 → 100644
CNLiveBMineModule/Classes/Controller/CNLiveBMineController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.h | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNCommonViewController.h" | |
| 14 | + | |
| 15 | +NS_ASSUME_NONNULL_BEGIN | |
| 16 | + | |
| 17 | +@interface CNLiveBMineController : CNCommonViewController | |
| 18 | + | |
| 19 | +@end | |
| 20 | + | |
| 21 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Controller/CNLiveBMineController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveBMineController.h" | |
| 10 | + | |
| 11 | +#import "MJExtension.h" | |
| 12 | +#import "QMUIKit.h" | |
| 13 | + | |
| 14 | +#import "CNLiveServices.h" | |
| 15 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 16 | +#import "CNUserInfoManager.h" | |
| 17 | +//#import "CNLiveEnvironment.h" | |
| 18 | +#import "CNLiveCategory.h" | |
| 19 | + | |
| 20 | +#import "CNLiveBMineHeaderView.h" | |
| 21 | +#import "CNLiveBMineCell.h" | |
| 22 | +#import "CNLiveBMineModel.h" | |
| 23 | +#import "CNLiveBMineRequest.h" | |
| 24 | + | |
| 25 | +#import "CNLiveUserInfoController.h" | |
| 26 | +#import "CNLiveSettingController.h" | |
| 27 | + | |
| 28 | +@interface CNLiveBMineController()<UITableViewDelegate, UITableViewDataSource, CNLiveBMineHeaderViewDelegate, CNLiveBMineCellDelegate> | |
| 29 | +@property (nonatomic, strong) UITableView *tableView; | |
| 30 | +@property (nonatomic, weak) CNLiveBMineHeaderView *headerView; | |
| 31 | +@property (nonatomic, strong) NSMutableArray *data; | |
| 32 | + | |
| 33 | +@end | |
| 34 | + | |
| 35 | +@implementation CNLiveBMineController | |
| 36 | +static const NSInteger kHEIGHT = 253; | |
| 37 | +static const CGFloat timeValue = 1.5; | |
| 38 | + | |
| 39 | +#pragma mark - 加载数据 | |
| 40 | +- (void)loadData { | |
| 41 | + NSArray *data = @[ | |
| 42 | + @{ | |
| 43 | + @"name":@"直播中心", | |
| 44 | + @"image":@"mine_zbzx", | |
| 45 | + }, | |
| 46 | + @{ | |
| 47 | + @"name":@"钱包", | |
| 48 | + @"image":@"mine_qb", | |
| 49 | + }, | |
| 50 | + @{ | |
| 51 | + @"name":@"设置", | |
| 52 | + @"image":@"mine_sz", | |
| 53 | + } | |
| 54 | + ]; | |
| 55 | + for(NSDictionary *dic in data){ | |
| 56 | + CNLiveBMineModel *model = [CNLiveBMineModel mj_objectWithKeyValues:dic]; | |
| 57 | + [self.data addObject:model]; | |
| 58 | + } | |
| 59 | + [self.tableView reloadData]; | |
| 60 | + | |
| 61 | +} | |
| 62 | + | |
| 63 | +#pragma mark - 生命周期 | |
| 64 | +- (void)viewWillAppear:(BOOL)animated{ | |
| 65 | + [super viewWillAppear:animated]; | |
| 66 | + self.navigationController.navigationBarHidden = YES; | |
| 67 | + | |
| 68 | + [self requestCertification]; | |
| 69 | + if(self.headerView){ | |
| 70 | + self.headerView.frame = CGRectMake(0, -kHEIGHT, SCREEN_WIDTH, kHEIGHT); | |
| 71 | + } | |
| 72 | + self.headerView.isRefresh = YES; | |
| 73 | + [self.tableView reloadData]; | |
| 74 | +} | |
| 75 | + | |
| 76 | +- (void)viewDidLoad { | |
| 77 | + [super viewDidLoad]; | |
| 78 | + self.view.backgroundColor = [UIColor whiteColor]; | |
| 79 | + if (@available(iOS 11, *)) { | |
| 80 | + self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 81 | + } | |
| 82 | + else { | |
| 83 | + self.automaticallyAdjustsScrollViewInsets = NO; | |
| 84 | + } | |
| 85 | + [self createSubViews]; | |
| 86 | + [self loadData]; | |
| 87 | +} | |
| 88 | + | |
| 89 | +- (void)createSubViews { | |
| 90 | + [self.view addSubview:self.tableView]; | |
| 91 | + CNLiveBMineHeaderView *headerView = [[CNLiveBMineHeaderView alloc]initWithFrame:CGRectMake(0, -kHEIGHT, SCREEN_WIDTH, kHEIGHT)]; | |
| 92 | + headerView.delegate = self; | |
| 93 | + headerView.tag = 666; | |
| 94 | + [self.tableView addSubview:headerView]; | |
| 95 | + self.headerView = headerView; | |
| 96 | +} | |
| 97 | + | |
| 98 | +#pragma mark - UITableViewDelegate | |
| 99 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 100 | + return 45; | |
| 101 | +} | |
| 102 | + | |
| 103 | +#pragma mark - UITableViewDataSource | |
| 104 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 105 | + return self.data.count; | |
| 106 | +} | |
| 107 | + | |
| 108 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 109 | + CNLiveBMineCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBMineCell]; | |
| 110 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 111 | + cell.delegate = self; | |
| 112 | + cell.model = self.data[indexPath.row]; | |
| 113 | + return cell; | |
| 114 | +} | |
| 115 | + | |
| 116 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 117 | + CNLiveSettingController *vc = [[CNLiveSettingController alloc]init]; | |
| 118 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 119 | +} | |
| 120 | + | |
| 121 | +#pragma mark - CNLiveBMineHeaderViewDelegate | |
| 122 | +- (void)headerView:(CNLiveBMineHeaderView *)headerView pushToController:(CNLiveBMineHeaderViewType)type{ | |
| 123 | + switch (type) { | |
| 124 | + case CNLiveBMineHeaderViewTypeUerInfo: | |
| 125 | + { | |
| 126 | + CNLiveUserInfoController *vc = [[CNLiveUserInfoController alloc]init]; | |
| 127 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 128 | + } | |
| 129 | + break; | |
| 130 | + case CNLiveBMineHeaderViewTypeWintess: | |
| 131 | + { | |
| 132 | + | |
| 133 | + } | |
| 134 | + break; | |
| 135 | + } | |
| 136 | +} | |
| 137 | + | |
| 138 | +#pragma mark - 请求方法 | |
| 139 | +// 请求签到赚积分 | |
| 140 | +- (void)requestSignIn{ | |
| 141 | + self.headerView.interactionEnabled = NO; | |
| 142 | + [CNLiveBMineRequest signIn:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError * _Nonnull error) { | |
| 143 | + if (error.code == -1001 || error.code == -1009) { | |
| 144 | + [QMUITips showError:@"网络连接已断开" inView:self.view hideAfterDelay:timeValue]; | |
| 145 | + return ; | |
| 146 | + } | |
| 147 | + if (isSuccess) { | |
| 148 | + id<CNLiveIntegralServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveIntegralServiceProtocol)]; | |
| 149 | + NSInteger status = [data[@"status"] integerValue]; | |
| 150 | + if (status == 1) { | |
| 151 | + [service showGoldWhereaboutsViewWithDic:data]; | |
| 152 | + }else{ | |
| 153 | + [service showSignInViewWithDic:data]; | |
| 154 | + } | |
| 155 | + | |
| 156 | + }else{ | |
| 157 | + [QMUITips showError:@"签到失败" inView:self.view hideAfterDelay:timeValue]; | |
| 158 | + | |
| 159 | + } | |
| 160 | + self.headerView.interactionEnabled = YES; | |
| 161 | + }]; | |
| 162 | +} | |
| 163 | + | |
| 164 | +// 请求用户认证 | |
| 165 | +- (void)requestCertification{ | |
| 166 | + [CNLiveBMineRequest certification:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError * _Nonnull error) { | |
| 167 | + if (error.code == -1001 || error.code == -1009) { | |
| 168 | + [QMUITips showError:@"网络连接已断开" inView:self.view hideAfterDelay:timeValue]; | |
| 169 | + return ; | |
| 170 | + } | |
| 171 | + if (isSuccess) { | |
| 172 | + NSString *darenIdentity = [NSString stringWithFormat:@"%@",[data objectForKey:@"darenIdentity"]]; | |
| 173 | + if ([darenIdentity isEqualToString:@"1"]) { //普通用户 | |
| 174 | + CNUserShareModel.isDaren = 0; | |
| 175 | + self.headerView.certificationImages = @[@"mine_wjj_certification",@"mine_common",@"mine_overbadge"]; | |
| 176 | + | |
| 177 | + } else if ([darenIdentity isEqualToString:@"0"]) { //达人用户 | |
| 178 | + CNUserShareModel.isDaren = 1; | |
| 179 | + self.headerView.certificationImages = @[@"mine_wjj_certification",@"mine_doyen", @"mine_overbadge"]; | |
| 180 | + | |
| 181 | + } | |
| 182 | + } | |
| 183 | + }]; | |
| 184 | +} | |
| 185 | + | |
| 186 | +#pragma mark - CNLiveBMineCellDelegate | |
| 187 | +- (void)cell:(CNLiveBMineCell *)cell didSelectItemAtItem:(NSInteger)item{ | |
| 188 | +// switch (cell.model.type) { | |
| 189 | +// case CNLiveBMineCellTypeOrder: | |
| 190 | +// { | |
| 191 | +// if(item == 4){ | |
| 192 | +// //售后 | |
| 193 | +// id<CNLiveOrderServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveOrderServiceProtocol)]; | |
| 194 | +// [service pushToRefundViewController:0]; | |
| 195 | +// | |
| 196 | +// }else{ | |
| 197 | +// id<CNLiveOrderServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveOrderServiceProtocol)]; | |
| 198 | +// [service pushToOrderViewController:item]; | |
| 199 | +// } | |
| 200 | +// } | |
| 201 | +// break; | |
| 202 | +// case CNLiveBMineCellTypeTool: | |
| 203 | +// { | |
| 204 | +// if(item == 0){ | |
| 205 | +// // 收货地址 | |
| 206 | +// id<CNLiveOrderServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveOrderServiceProtocol)]; | |
| 207 | +// [service pushToAddressViewController]; | |
| 208 | +// } | |
| 209 | +// else if(item == 1){ | |
| 210 | +// // 余额 | |
| 211 | +// id<CNLiveBalanceServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveBalanceServiceProtocol)]; | |
| 212 | +// [service pushToBalanceViewControllerWithType:@"1" ID:CNUserShareModel.uid]; | |
| 213 | +// } | |
| 214 | +// else if(item == 2){ | |
| 215 | +// // 收藏 | |
| 216 | +// id<CNLiveCollectionServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveCollectionServiceProtocol)]; | |
| 217 | +// [service pushToCollectionViewController]; | |
| 218 | +// } | |
| 219 | +// else if(item == 3){ | |
| 220 | +// // 发布记录 | |
| 221 | +//// XWOrdersController *vc = [[XWOrdersController alloc]init]; | |
| 222 | +//// [self.navigationController pushViewController:vc animated:YES]; | |
| 223 | +// } | |
| 224 | +// else if(item == 4){ | |
| 225 | +// // 邀请好友 | |
| 226 | +//// XWOrdersController *vc = [[XWOrdersController alloc]init]; | |
| 227 | +//// [self.navigationController pushViewController:vc animated:YES]; | |
| 228 | +// } | |
| 229 | +// else if(item == 5){ | |
| 230 | +// // 设置 | |
| 231 | +// id<CNLiveSettingServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveSettingServiceProtocol)]; | |
| 232 | +// [service pushToSettingViewController]; | |
| 233 | +// } | |
| 234 | +// else if(item == 6){ | |
| 235 | +// // 小家音响 | |
| 236 | +// NSLog(@"小家音响"); | |
| 237 | +// } | |
| 238 | +// else if(item == 7){ | |
| 239 | +// // 我的礼盒 | |
| 240 | +// id<CNLiveOrderServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveOrderServiceProtocol)]; | |
| 241 | +// [service pushToGiftBoxViewController]; | |
| 242 | +// } | |
| 243 | +// else if(item == 8){ | |
| 244 | +// // 我的话题 | |
| 245 | +// NSLog(@"我的话题"); | |
| 246 | +// } | |
| 247 | +// else if(item == 9){ | |
| 248 | +// // 路径工具 | |
| 249 | +// NSLog(@"路径工具"); | |
| 250 | +// } | |
| 251 | +// | |
| 252 | +// } | |
| 253 | +// break; | |
| 254 | +// case CNLiveBMineCellTypeGoods: | |
| 255 | +// { | |
| 256 | +// | |
| 257 | +// } | |
| 258 | +// break; | |
| 259 | +// case CNLiveBMineCellTypeSports: | |
| 260 | +// { | |
| 261 | +// if(item == 0){ | |
| 262 | +// // 我的活动 | |
| 263 | +// NSLog(@"我的活动"); | |
| 264 | +// } | |
| 265 | +// else if(item == 1){ | |
| 266 | +// // 我的记录 | |
| 267 | +// NSLog(@"我的记录"); | |
| 268 | +// } | |
| 269 | +// } | |
| 270 | +// break; | |
| 271 | +// | |
| 272 | +// default: | |
| 273 | +// break; | |
| 274 | +// } | |
| 275 | + | |
| 276 | +} | |
| 277 | + | |
| 278 | +#pragma mark - 状态栏 | |
| 279 | +- (UIStatusBarStyle)preferredStatusBarStyle{ | |
| 280 | + return UIStatusBarStyleLightContent; | |
| 281 | + | |
| 282 | +} | |
| 283 | + | |
| 284 | +#pragma mark - 响应方法 | |
| 285 | +- (void)soccerDidClicked:(UIButton *)btn{ | |
| 286 | + id<CNLiveIntegralServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveIntegralServiceProtocol)]; | |
| 287 | + [service pushToTaskListViewController]; | |
| 288 | +} | |
| 289 | + | |
| 290 | +#pragma mark - 懒加载 | |
| 291 | +- (NSMutableArray *)data { | |
| 292 | + if (!_data) { | |
| 293 | + _data = [NSMutableArray array]; | |
| 294 | + } | |
| 295 | + return _data; | |
| 296 | +} | |
| 297 | + | |
| 298 | +- (UITableView *)tableView{ | |
| 299 | + if(!_tableView){ | |
| 300 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-TabBarHeight) style:UITableViewStylePlain]; | |
| 301 | + _tableView.showsVerticalScrollIndicator = NO; | |
| 302 | + _tableView.delegate = self; | |
| 303 | + _tableView.dataSource = self; | |
| 304 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 305 | + _tableView.backgroundColor = [UIColor whiteColor]; | |
| 306 | + _tableView.estimatedRowHeight = 0; | |
| 307 | + _tableView.estimatedSectionHeaderHeight = 0; | |
| 308 | + _tableView.estimatedSectionFooterHeight = 0; | |
| 309 | + [_tableView registerClass:[CNLiveBMineCell class] forCellReuseIdentifier:kCNLiveBMineCell]; | |
| 310 | + _tableView.contentInset = UIEdgeInsetsMake(kHEIGHT, 0, 0, 0); | |
| 311 | + } | |
| 312 | + return _tableView; | |
| 313 | +} | |
| 314 | + | |
| 315 | +@end | ... | ... |
CNLiveBMineModule/Classes/Model/CNLiveBMineModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineModel.h | |
| 3 | +// CNLiveBMineModule | |
| 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 | + | |
| 13 | +@interface CNLiveBMineModel : NSObject | |
| 14 | +@property (nonatomic, copy) NSString *name; | |
| 15 | +@property (nonatomic, copy) NSString *image; | |
| 16 | + | |
| 17 | +@end | |
| 18 | + | |
| 19 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Model/CNLiveBMineModel.m
0 → 100644
CNLiveBMineModule/Classes/Model/CNLiveBMineRequest.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineRequest.h | |
| 3 | +// CNLiveBMineModule | |
| 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 void(^CertificationBlock)(BOOL isSuccess, NSDictionary *data, NSError *error); | |
| 13 | +typedef void(^SignInBlock)(BOOL isSuccess, NSDictionary *data, NSError *error); | |
| 14 | + | |
| 15 | +@interface CNLiveBMineRequest : NSObject | |
| 16 | + | |
| 17 | +// 请求用户认证 | |
| 18 | ++ (void)certification:(CertificationBlock)block; | |
| 19 | + | |
| 20 | + | |
| 21 | +// 签到 | |
| 22 | ++ (void)signIn:(SignInBlock)block; | |
| 23 | + | |
| 24 | +@end | |
| 25 | + | |
| 26 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Model/CNLiveBMineRequest.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineRequest.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | |
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveBMineRequest.h" | |
| 10 | +#import "CNLiveCategory.h" | |
| 11 | +#import "CNLiveNetworking.h" | |
| 12 | +#import "CNLiveEnvironment.h" | |
| 13 | +#import "CNUserInfoManager.h" | |
| 14 | + | |
| 15 | +@implementation CNLiveBMineRequest | |
| 16 | +// 请求用户认证 | |
| 17 | ++ (void)certification:(CertificationBlock)block { | |
| 18 | + NSDictionary *params = @{ | |
| 19 | + @"witSid":CNUserShareModel.uid ? CNUserShareModel.uid : @"" | |
| 20 | + }; | |
| 21 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 22 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCheckWitnessUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 23 | + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]] && responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) { | |
| 24 | + NSString *errorCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]]; | |
| 25 | + NSDictionary *data = responseObject[@"data"]; | |
| 26 | + block?block([errorCode isEqualToString:@"0"], data, error):@""; | |
| 27 | + }else{ | |
| 28 | + block?block(NO, @{}, error):@""; | |
| 29 | + | |
| 30 | + } | |
| 31 | + | |
| 32 | + }]; | |
| 33 | + | |
| 34 | +} | |
| 35 | + | |
| 36 | ++ (void)signIn:(SignInBlock)block { | |
| 37 | + NSDictionary *params = @{@"sid":CNUserShareModel.uid}; | |
| 38 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 39 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNIntegralSignInUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 40 | + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]] && responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) { | |
| 41 | + NSString *errorCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]]; | |
| 42 | + NSDictionary *data = responseObject[@"data"]; | |
| 43 | + block?block([errorCode isEqualToString:@"0"], data, error):@""; | |
| 44 | + }else{ | |
| 45 | + block?block(NO, @{}, error):@""; | |
| 46 | + | |
| 47 | + } | |
| 48 | + | |
| 49 | + }]; | |
| 50 | +} | |
| 51 | + | |
| 52 | +@end | ... | ... |
CNLiveBMineModule/Classes/Module/CNLiveBMineModule.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineModule.h | |
| 3 | +// CNLiveBMineModule | |
| 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 CNLiveBMineModule : NSObject | |
| 14 | + | |
| 15 | +@end | |
| 16 | + | |
| 17 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Module/CNLiveBMineModule.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineModule.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveBMineModule.h" | |
| 10 | +#import "CNLiveServices.h" | |
| 11 | + | |
| 12 | +@BeeHiveMod(CNLiveBMineModule) | |
| 13 | +@interface CNLiveBMineModule()<BHModuleProtocol> | |
| 14 | + | |
| 15 | +@end | |
| 16 | + | |
| 17 | +@implementation CNLiveBMineModule | |
| 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 | ... | ... |
CNLiveBMineModule/Classes/Module/CNLiveBMineService.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineService.h | |
| 3 | +// CNLiveBMineModule | |
| 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 CNLiveBMineService : NSObject | |
| 14 | + | |
| 15 | +@end | |
| 16 | + | |
| 17 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Module/CNLiveBMineService.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineService.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveBMineService.h" | |
| 10 | +#import "CNLiveServices.h" | |
| 11 | +#import "CNLivePageJumpManager.h" | |
| 12 | + | |
| 13 | +#import "CNLiveBMineController.h" | |
| 14 | +#import "CNLiveUserInfoController.h" | |
| 15 | + | |
| 16 | +//@BeeHiveService(CNLiveBMineServiceProtocol,CNLiveBMineService) | |
| 17 | +////@interface CNLiveBMineService ()<CNLiveBMineServiceProtocol> | |
| 18 | +//@interface CNLiveBMineService () | |
| 19 | +// | |
| 20 | +//@end | |
| 21 | + | |
| 22 | +@implementation CNLiveBMineService | |
| 23 | + | |
| 24 | +// 我的 | |
| 25 | +- (UIViewController *)getMineViewController { | |
| 26 | + return [CNLiveBMineController new]; | |
| 27 | +} | |
| 28 | + | |
| 29 | +- (void)pushToMineViewController { | |
| 30 | + CNLiveBMineController *vc = [[CNLiveBMineController alloc]init]; | |
| 31 | + [CNLivePageJumpManager pushViewController:vc]; | |
| 32 | +} | |
| 33 | + | |
| 34 | +// 个人资料 | |
| 35 | +- (UIViewController *)getUserInfoViewController { | |
| 36 | + return [CNLiveUserInfoController new]; | |
| 37 | +} | |
| 38 | + | |
| 39 | +- (void)pushToUserInfoViewController { | |
| 40 | + CNLiveUserInfoController *vc = [[CNLiveUserInfoController alloc]init]; | |
| 41 | + [CNLivePageJumpManager pushViewController:vc]; | |
| 42 | +} | |
| 43 | + | |
| 44 | +@end | ... | ... |
CNLiveBMineModule/Classes/Setting/AboutUs/CNLiveAboutUsController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveAboutUsController.h | |
| 3 | +// CNLiveBMineModule | |
| 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 | +#import "CNCommonViewController.h" | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_BEGIN | |
| 17 | + | |
| 18 | +@interface CNLiveAboutUsController : CNCommonViewController | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/AboutUs/CNLiveAboutUsController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveAboutUsController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveAboutUsController.h" | |
| 10 | +#import "MJExtension.h" | |
| 11 | +#import "QMUIKit.h" | |
| 12 | + | |
| 13 | +#import "CNLiveServices.h" | |
| 14 | +#import "CNLiveUserAgreementManager.h" | |
| 15 | +#import "CNLiveEnvironment.h" | |
| 16 | +#import "CNLiveCategory.h" | |
| 17 | +#import "CNLiveBaseKit.h" | |
| 18 | +#import "CNLiveNavigationBar.h" | |
| 19 | + | |
| 20 | +#import "CNLiveSettingModel.h" | |
| 21 | +#import "CNLiveSettingCell.h" | |
| 22 | + | |
| 23 | +@interface CNLiveAboutUsController () | |
| 24 | +<UITableViewDelegate, UITableViewDataSource> | |
| 25 | +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar; | |
| 26 | +@property (nonatomic, strong) UITableView *tableView; | |
| 27 | +@property (nonatomic, strong) UIView *headerView; | |
| 28 | +@property (nonatomic, strong) UIView *footerView; | |
| 29 | +@property (nonatomic, strong) NSMutableArray *data; | |
| 30 | + | |
| 31 | +@end | |
| 32 | + | |
| 33 | +@implementation CNLiveAboutUsController | |
| 34 | +static const NSInteger timeValue = 1.5; | |
| 35 | + | |
| 36 | +#pragma mark - 加载数据 | |
| 37 | +- (void)loadData { | |
| 38 | + // 版本 | |
| 39 | + NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; | |
| 40 | + NSString *shortVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; | |
| 41 | + NSString *appVersion = TestEnvironment?[NSString stringWithFormat:@"%@ beta",shortVersion]:shortVersion; | |
| 42 | + | |
| 43 | + NSArray *data = @[ | |
| 44 | + @{ | |
| 45 | + @"style":@"1", | |
| 46 | + @"title":@"给软件评分", | |
| 47 | + @"height":@"51", | |
| 48 | + @"lineHeight":@"1" | |
| 49 | + }, | |
| 50 | + @{ | |
| 51 | + @"style":@"1", | |
| 52 | + @"title":@"应用简介", | |
| 53 | + @"height":@"60", | |
| 54 | + @"lineHeight":@"10" | |
| 55 | + }, | |
| 56 | + @{ | |
| 57 | + @"style":@"1", | |
| 58 | + @"title":@"隐私政策协议", | |
| 59 | + @"height":@"51", | |
| 60 | + @"lineHeight":@"1" | |
| 61 | + }, | |
| 62 | + @{ | |
| 63 | + @"style":@"1", | |
| 64 | + @"title":@"软件许可及服务协议", | |
| 65 | + @"height":@"51", | |
| 66 | + @"lineHeight":@"1" | |
| 67 | + }, | |
| 68 | + @{ | |
| 69 | + @"style":@"1", | |
| 70 | + @"title":@"版权信息", | |
| 71 | + @"height":@"51", | |
| 72 | + @"lineHeight":@"1" | |
| 73 | + }, | |
| 74 | + @{ | |
| 75 | + @"style":@"1", | |
| 76 | + @"title":@"资质信息", | |
| 77 | + @"height":@"51", | |
| 78 | + @"lineHeight":@"1" | |
| 79 | + }, | |
| 80 | + @{ | |
| 81 | + @"style":@"4", | |
| 82 | + @"title":@"当前版本", | |
| 83 | + @"content":appVersion, | |
| 84 | + @"height":@"51", | |
| 85 | + @"lineHeight":@"1" | |
| 86 | + }, | |
| 87 | + @{ | |
| 88 | + @"style":@"1", | |
| 89 | + @"title":@"联系我们", | |
| 90 | + @"height":@"51", | |
| 91 | + @"lineHeight":@"1" | |
| 92 | + }, | |
| 93 | + @{ | |
| 94 | + @"style":@"1", | |
| 95 | + @"title":@"投诉", | |
| 96 | + @"height":@"51", | |
| 97 | + @"lineHeight":@"1" | |
| 98 | + } | |
| 99 | + | |
| 100 | + ]; | |
| 101 | + for(NSDictionary *dic in data){ | |
| 102 | + [self.data addObject:[CNLiveSettingModel mj_objectWithKeyValues:dic]]; | |
| 103 | + } | |
| 104 | + [self.tableView reloadData]; | |
| 105 | + | |
| 106 | +} | |
| 107 | + | |
| 108 | +#pragma mark - 生命周期 | |
| 109 | +- (void)viewWillAppear:(BOOL)animated{ | |
| 110 | + [super viewWillAppear:animated]; | |
| 111 | + self.navigationController.navigationBarHidden = YES; | |
| 112 | +} | |
| 113 | + | |
| 114 | +- (void)viewDidLoad { | |
| 115 | + [super viewDidLoad]; | |
| 116 | + self.view.backgroundColor = [UIColor whiteColor]; | |
| 117 | + if (@available(iOS 11, *)) { | |
| 118 | + self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 119 | + } | |
| 120 | + else { | |
| 121 | + self.automaticallyAdjustsScrollViewInsets = NO; | |
| 122 | + } | |
| 123 | + | |
| 124 | + [self createSubViews]; | |
| 125 | + [self loadData]; | |
| 126 | + | |
| 127 | +} | |
| 128 | + | |
| 129 | +- (void)dealloc { | |
| 130 | + | |
| 131 | + | |
| 132 | +} | |
| 133 | + | |
| 134 | +- (void)createSubViews { | |
| 135 | + [self.view addSubview:self.navigationBar]; | |
| 136 | + [self.view addSubview:self.tableView]; | |
| 137 | +} | |
| 138 | + | |
| 139 | +#pragma mark - UITableViewDelegate | |
| 140 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 141 | + CNLiveSettingModel *model = self.data[indexPath.row]; | |
| 142 | + return model.height; | |
| 143 | +} | |
| 144 | + | |
| 145 | +#pragma mark - UITableViewDataSource | |
| 146 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 147 | + return self.data.count; | |
| 148 | +} | |
| 149 | + | |
| 150 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 151 | + CNLiveSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveSettingCell]; | |
| 152 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 153 | + CNLiveSettingModel *model = self.data[indexPath.row]; | |
| 154 | + cell.model = model; | |
| 155 | + cell.lineColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 156 | + return cell; | |
| 157 | +} | |
| 158 | + | |
| 159 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 160 | + if(indexPath.row == 0){ // 给软件评分 | |
| 161 | + NSString *app = [NSString stringWithFormat:@"https://itunes.apple.com/app/apple-store/id%@?ct=web&mt=8",@"1337575478"]; | |
| 162 | + if (@available(iOS 10.0, *)) { | |
| 163 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:app] options:@{} completionHandler:nil]; | |
| 164 | + } else { | |
| 165 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:app]]; | |
| 166 | + } | |
| 167 | + | |
| 168 | + } | |
| 169 | + else if(indexPath.row == 1){ // 应用简介 | |
| 170 | + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementIntroduction]; | |
| 171 | + | |
| 172 | + } | |
| 173 | + else if(indexPath.row == 2){ // 隐私政策协议 | |
| 174 | + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementPrivacy]; | |
| 175 | + | |
| 176 | + } | |
| 177 | + else if(indexPath.row == 3){ // 软件许可及服务协议 | |
| 178 | + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementPermission]; | |
| 179 | + } | |
| 180 | + else if(indexPath.row == 4){ // 版权信息 | |
| 181 | + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementCopyright]; | |
| 182 | + | |
| 183 | + } | |
| 184 | + else if(indexPath.row == 5){ // 资质信息 | |
| 185 | + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementEnterpriseQualification]; | |
| 186 | + } | |
| 187 | + else if(indexPath.row == 6){ // 当前版本 | |
| 188 | + | |
| 189 | + } | |
| 190 | + else if(indexPath.row == 7){ // 联系我们 | |
| 191 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"确定" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 192 | + NSMutableString *tel = [[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"010-88824192"]; | |
| 193 | + if (@available(iOS 10.0, *)) { | |
| 194 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:tel] options:@{} completionHandler:nil]; | |
| 195 | + } else { | |
| 196 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:tel]]; | |
| 197 | + } | |
| 198 | + | |
| 199 | + }]; | |
| 200 | + QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 201 | + }]; | |
| 202 | + | |
| 203 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"联系我们" message:@"您确定要拨打010-88824192吗?" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 204 | + [alertController addAction:sure]; | |
| 205 | + [alertController addAction:cancel]; | |
| 206 | + | |
| 207 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 208 | + | |
| 209 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 210 | + | |
| 211 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 212 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 213 | + | |
| 214 | + sure.buttonAttributes = titleAttributs; | |
| 215 | + cancel.buttonAttributes = cancelAttributs; | |
| 216 | + | |
| 217 | + [alertController showWithAnimated:YES]; | |
| 218 | + | |
| 219 | + }else if (indexPath.row == 8){ // 投诉 | |
| 220 | + | |
| 221 | + | |
| 222 | + } | |
| 223 | + | |
| 224 | +} | |
| 225 | + | |
| 226 | +#pragma mark - 懒加载 | |
| 227 | +- (NSMutableArray *)data { | |
| 228 | + if (!_data) { | |
| 229 | + _data = [NSMutableArray array]; | |
| 230 | + } | |
| 231 | + return _data; | |
| 232 | +} | |
| 233 | + | |
| 234 | +- (CNLiveNavigationBar *)navigationBar { | |
| 235 | + if (!_navigationBar) { | |
| 236 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 237 | + _navigationBar.title.text = [NSString stringWithFormat:@"关于%@",DisplayName]; | |
| 238 | + __weak typeof(self) weakSelf = self; | |
| 239 | + _navigationBar.onClickLeftButton = ^{ | |
| 240 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 241 | + if(!strongSelf) return ; | |
| 242 | + [strongSelf goBack]; | |
| 243 | + }; | |
| 244 | + } | |
| 245 | + return _navigationBar; | |
| 246 | +} | |
| 247 | + | |
| 248 | +- (UITableView *)tableView{ | |
| 249 | + if(!_tableView){ | |
| 250 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavigationContentTop, SCREEN_WIDTH, SCREEN_HEIGHT-NavigationContentTop) style:UITableViewStylePlain]; | |
| 251 | + _tableView.delegate = self; | |
| 252 | + _tableView.dataSource = self; | |
| 253 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 254 | + _tableView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 255 | + _tableView.estimatedRowHeight = 0; | |
| 256 | + _tableView.estimatedSectionHeaderHeight = 0; | |
| 257 | + _tableView.estimatedSectionFooterHeight = 0; | |
| 258 | + [_tableView registerClass:[CNLiveSettingCell class] forCellReuseIdentifier:kCNLiveSettingCell]; | |
| 259 | + _tableView.tableHeaderView = self.headerView; | |
| 260 | + _tableView.tableFooterView = self.footerView; | |
| 261 | + | |
| 262 | + } | |
| 263 | + return _tableView; | |
| 264 | +} | |
| 265 | + | |
| 266 | +- (UIView *)headerView { | |
| 267 | + if (!_headerView) { | |
| 268 | + _headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 160)]; | |
| 269 | + _headerView.clipsToBounds = YES; | |
| 270 | + _headerView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 271 | + UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-80)/2.0, 30, 80, 105)]; | |
| 272 | + UIImage *image = [self getImageWithImageName:@"mine_logo" bundleName:@"CNLiveBMineModule" targetClass:[self class]]; | |
| 273 | + imageView.image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; | |
| 274 | + imageView.contentMode = UIViewContentModeCenter; | |
| 275 | + [_headerView addSubview:imageView]; | |
| 276 | + | |
| 277 | + } | |
| 278 | + return _headerView; | |
| 279 | +} | |
| 280 | + | |
| 281 | +- (UIView *)footerView { | |
| 282 | + if (!_footerView) { | |
| 283 | + _footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 100)]; | |
| 284 | + _footerView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 285 | + UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 25, SCREEN_WIDTH, 25)]; | |
| 286 | + title.textColor = [UIColor colorWithRed:40/255.0 green:40/255.0 blue:40/255.0 alpha:1.0]; | |
| 287 | + title.font = UIFontCNMake(12.0); | |
| 288 | + title.text = @"版权信息"; | |
| 289 | + title.textAlignment = NSTextAlignmentCenter; | |
| 290 | + [_footerView addSubview:title]; | |
| 291 | + UILabel *subTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, SCREEN_WIDTH, 25)]; | |
| 292 | + subTitle.textColor = [UIColor colorWithRed:40/255.0 green:40/255.0 blue:40/255.0 alpha:1.0]; | |
| 293 | + subTitle.font = UIFontCNMake(12.0); | |
| 294 | + subTitle.text = @"北京中投视讯文化传媒股份有限公司版权所有"; | |
| 295 | + subTitle.textAlignment = NSTextAlignmentCenter; | |
| 296 | + [_footerView addSubview:subTitle]; | |
| 297 | + } | |
| 298 | + return _footerView; | |
| 299 | +} | |
| 300 | + | |
| 301 | +#pragma mark - 响应方法 | |
| 302 | +- (void)goBack { | |
| 303 | + if (self.presentingViewController != nil) { | |
| 304 | + [self dismissViewControllerAnimated:YES completion:nil]; | |
| 305 | + } | |
| 306 | + else { | |
| 307 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 308 | + } | |
| 309 | +} | |
| 310 | + | |
| 311 | +@end | ... | ... |
CNLiveBMineModule/Classes/Setting/Cancellation/CNLiveCancellationController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCancellationController.h | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/3/21. | |
| 6 | +// Copyright © 2019年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +// 注销账号 | |
| 10 | + | |
| 11 | +#import "CNCommonViewController.h" | |
| 12 | + | |
| 13 | +NS_ASSUME_NONNULL_BEGIN | |
| 14 | + | |
| 15 | +@interface CNLiveCancellationController : CNCommonViewController | |
| 16 | + | |
| 17 | +@end | |
| 18 | + | |
| 19 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/Cancellation/CNLiveCancellationController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCancellationController.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/3/21. | |
| 6 | +// Copyright © 2019年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveCancellationController.h" | |
| 10 | +#import <WebKit/WebKit.h> | |
| 11 | +#import <Masonry/Masonry.h> | |
| 12 | +#import "QMUIKit.h" | |
| 13 | + | |
| 14 | +#import "CNLiveNetworking.h" | |
| 15 | +#import "CNLiveEnvironment.h" | |
| 16 | +#import "CNUserInfoManager.h" | |
| 17 | + | |
| 18 | +#import "CNLiveNavigationBar.h" | |
| 19 | +#import "CNLiveCancellationView.h" | |
| 20 | + | |
| 21 | +#import "CNLiveUserAgreementManager.h" | |
| 22 | + | |
| 23 | +@interface CNLiveCancellationController ()<WKNavigationDelegate,WKUIDelegate,CNLiveCancellationViewDelegate> | |
| 24 | +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar; | |
| 25 | +@property (nonatomic, weak) WKWebView *webView; | |
| 26 | +@property (nonatomic, weak) CNLiveCancellationView *cancellationView; | |
| 27 | + | |
| 28 | +@end | |
| 29 | + | |
| 30 | +@implementation CNLiveCancellationController | |
| 31 | +static const NSInteger timeValue = 1.5; | |
| 32 | + | |
| 33 | +#pragma mark - Data | |
| 34 | +- (void)setData { | |
| 35 | + [[CNLiveUserAgreementManager manager] getAgreementH5WithType:CNLiveUserAgreementReviewApply success:^(NSString * _Nonnull h5, NSString * _Nonnull title, BOOL isShow) { | |
| 36 | + [QMUITips showLoadingInView:self.view]; | |
| 37 | + [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:h5]]]; | |
| 38 | + | |
| 39 | + } failure:^(NSError * _Nonnull error) { | |
| 40 | + [self loadHTMLString]; | |
| 41 | + | |
| 42 | + }]; | |
| 43 | +} | |
| 44 | + | |
| 45 | +#pragma mark - 生命周期 | |
| 46 | +- (void)viewWillAppear:(BOOL)animated{ | |
| 47 | + [super viewWillAppear:animated]; | |
| 48 | + self.navigationController.navigationBarHidden = YES; | |
| 49 | +} | |
| 50 | + | |
| 51 | +- (void)viewDidLoad { | |
| 52 | + [super viewDidLoad]; | |
| 53 | + // Do any additional setup after loading the view. | |
| 54 | + self.view.backgroundColor = [UIColor whiteColor]; | |
| 55 | + self.edgesForExtendedLayout = UIRectEdgeNone;//双击webview不上移 | |
| 56 | + | |
| 57 | + [self createUI]; | |
| 58 | + [self layoutUI]; | |
| 59 | + [self setData]; | |
| 60 | + | |
| 61 | +} | |
| 62 | +- (void)dealloc{ | |
| 63 | + | |
| 64 | +} | |
| 65 | +#pragma mark - UI | |
| 66 | +- (void)createUI { | |
| 67 | + [self.view addSubview:self.navigationBar]; | |
| 68 | + | |
| 69 | + WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc]init]; | |
| 70 | + config.preferences = [WKPreferences new]; | |
| 71 | + config.preferences.javaScriptEnabled = YES; | |
| 72 | + config.preferences.javaScriptCanOpenWindowsAutomatically = NO; | |
| 73 | + config.userContentController = [[WKUserContentController alloc]init]; | |
| 74 | + | |
| 75 | + //下方代码,禁止缩放 | |
| 76 | + WKUserContentController *userController = [WKUserContentController new]; | |
| 77 | + NSString *js = @"var script = document.createElement('meta');" | |
| 78 | + "script.name = 'viewport';" | |
| 79 | + "script.content=\"width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no\";" | |
| 80 | + "document.getElementsByTagName('div')[0].appendChild(script);"; | |
| 81 | + WKUserScript *script = [[WKUserScript alloc] initWithSource:js injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO]; | |
| 82 | + | |
| 83 | + NSMutableString *javascript = [NSMutableString string]; | |
| 84 | + [javascript appendString:@"document.documentElement.style.webkitTouchCallout='none';"];//禁止长按 | |
| 85 | + [javascript appendString:@"document.documentElement.style.webkitUserSelect='none';"];//禁止选择 | |
| 86 | + WKUserScript *noneSelectScript = [[WKUserScript alloc] initWithSource:javascript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES]; | |
| 87 | + [userController addUserScript:script]; | |
| 88 | + [userController addUserScript:noneSelectScript]; | |
| 89 | + config.userContentController = userController; | |
| 90 | + | |
| 91 | + WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:config]; | |
| 92 | + webView.navigationDelegate = self; | |
| 93 | + webView.UIDelegate = self; | |
| 94 | + webView.scrollView.bounces = NO; | |
| 95 | + webView.scrollView.showsVerticalScrollIndicator = NO; | |
| 96 | + webView.scrollView.showsHorizontalScrollIndicator = NO; | |
| 97 | + [self.view addSubview:webView]; | |
| 98 | + _webView = webView; | |
| 99 | + | |
| 100 | + CNLiveCancellationView *cancellationView = [[CNLiveCancellationView alloc]init]; | |
| 101 | + cancellationView.delegate = self; | |
| 102 | + [self.view addSubview:cancellationView]; | |
| 103 | + _cancellationView = cancellationView; | |
| 104 | + | |
| 105 | +} | |
| 106 | +- (void)layoutUI{ | |
| 107 | + [_cancellationView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 108 | + make.left.equalTo(self.view.mas_left).with.offset(0); | |
| 109 | + make.right.equalTo(self.view.mas_right).with.offset(-0); | |
| 110 | + make.bottom.equalTo(self.view.mas_bottom).with.offset(-SafeAreaInsetsConstantForDeviceWithNotch.bottom); | |
| 111 | + make.height.offset(120); | |
| 112 | + }]; | |
| 113 | + [_webView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 114 | + make.top.equalTo(self.view.mas_top).with.offset(NavigationContentTop); | |
| 115 | + make.left.equalTo(self.view.mas_left).with.offset(0); | |
| 116 | + make.right.equalTo(self.view.mas_right).with.offset(-0); | |
| 117 | + make.bottom.equalTo(_cancellationView.mas_top).with.offset(-0); | |
| 118 | + | |
| 119 | + }]; | |
| 120 | + | |
| 121 | +} | |
| 122 | +#pragma mark - WKNavigationDelegate | |
| 123 | +// 页面加载完成之后调用 | |
| 124 | +- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{ | |
| 125 | + [QMUITips hideAllTipsInView:self.view]; | |
| 126 | + | |
| 127 | +} | |
| 128 | +// 页面加载失败时调用 | |
| 129 | +- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{ | |
| 130 | + [self loadHTMLString]; | |
| 131 | + [QMUITips hideAllTipsInView:self.view]; | |
| 132 | + | |
| 133 | +} | |
| 134 | + | |
| 135 | +#pragma mark - CNLiveCancellationViewDelegate | |
| 136 | +- (void)clickedProtocol:(CNLiveCancellationView *)view{ | |
| 137 | + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementCancellation]; | |
| 138 | +} | |
| 139 | + | |
| 140 | +- (void)clickedCancellation:(CNLiveCancellationView *)view{ | |
| 141 | + __weak typeof(self) weakSelf = self; | |
| 142 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"是" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 143 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 144 | + if(!strongSelf) return ; | |
| 145 | + [strongSelf sendCancellationRequest]; | |
| 146 | + | |
| 147 | + }]; | |
| 148 | + QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"否" style:QMUIAlertActionStyleCancel handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 149 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 150 | + if(!strongSelf) return ; | |
| 151 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 152 | + | |
| 153 | + }]; | |
| 154 | + | |
| 155 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"您确定要注销此账户吗,工作人员将在5个工作日内完成审核" message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 156 | + [alertController addAction:sure]; | |
| 157 | + [alertController addAction:cancel]; | |
| 158 | + | |
| 159 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 160 | + | |
| 161 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 162 | + | |
| 163 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 164 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 165 | + | |
| 166 | + sure.buttonAttributes = titleAttributs; | |
| 167 | + cancel.buttonAttributes = cancelAttributs; | |
| 168 | + | |
| 169 | + [alertController showWithAnimated:YES]; | |
| 170 | + | |
| 171 | +} | |
| 172 | + | |
| 173 | +#pragma mark - Private Methods | |
| 174 | +- (void)loadHTMLString{ | |
| 175 | + NSString *htmlContent = [NSString stringWithFormat:@"<div style=\"padding:0 5px;\"><p style=\"font-size:1.0625em;\"><strong>%@</strong></p><hr style=\"background-color:#EEEEEE;height:1px;border:none;\"/><p style=\"font-size:1em;\">%@</p><hr style=\"background-color:#EEEEEE;height:1px;border:none;\"/><p style=\"font-size:1em;\">%@</p><hr style=\"background-color:#EEEEEE;height:1px;border:none;\"/><p style=\"font-size:1em;\">%@</p><hr style=\"background-color:#EEEEEE;height:1px;border:none;\"/><p style=\"font-size:1em;\">%@</p></div>",@"我们对你注销网家家账号的决定深表遗憾。如果你仍执意注销账号,你的账号需同时满足以下条件:",@"1.账号处于安全状态: 最近1个月内无绑定手机/修改手机号、无找回密码/修改密码等操作,账号为正常使用中且在1年内无任何账号被限制的记录。",@"2.账号财产已结清,没有未完成和/或存在争议的服务: 账号中没有资产、欠款、未结清的资金和虚拟权益;本账号及通过本账号接入的第三方中没有未完成和/或存在争议的服务。",@"3.账号权限解除: 账号已解除与其他产品、网站授权登录或绑定关系。",@"4.账号无任何纠纷,包括投诉举报或被投诉举报。"]; | |
| 176 | + [_webView loadHTMLString:htmlContent baseURL:nil]; | |
| 177 | + | |
| 178 | +} | |
| 179 | +//请求注销接口 | |
| 180 | +- (void)sendCancellationRequest{ | |
| 181 | + NSDictionary *params = @{@"loginSid":CNUserShareModel.uid}; | |
| 182 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 183 | + [CNLiveNetworking setupShowDataResult:NO]; | |
| 184 | + | |
| 185 | + [QMUITips showLoadingInView:self.view]; | |
| 186 | + | |
| 187 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCancellationUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 188 | + [QMUITips hideAllTipsInView:self.view]; | |
| 189 | + if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 190 | + //我知道了 | |
| 191 | + [self showIKnow]; | |
| 192 | + | |
| 193 | + }else if([responseObject[@"errorCode"] isEqualToString:@"455"]){ | |
| 194 | + [QMUITips showError:@"账号已经在注销中,请等待" inView:self.view hideAfterDelay:timeValue]; | |
| 195 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
| 196 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 197 | + | |
| 198 | + }); | |
| 199 | + | |
| 200 | + }else{ | |
| 201 | + [QMUITips showError:@"注销失败" inView:self.view hideAfterDelay:timeValue]; | |
| 202 | + | |
| 203 | + } | |
| 204 | + | |
| 205 | + }]; | |
| 206 | + | |
| 207 | +} | |
| 208 | + | |
| 209 | +//我知道了 | |
| 210 | +- (void)showIKnow{ | |
| 211 | + __weak typeof(self) weakSelf = self; | |
| 212 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"我知道了" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 213 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 214 | + if(!strongSelf) return ; | |
| 215 | + [strongSelf.navigationController popViewControllerAnimated:YES]; | |
| 216 | + | |
| 217 | + }]; | |
| 218 | + | |
| 219 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"您的注销申请已提交,我们将在5个工作日内完成审核" message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 220 | + [alertController addAction:sure]; | |
| 221 | + | |
| 222 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 223 | + | |
| 224 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 225 | + | |
| 226 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 227 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 228 | + sure.buttonAttributes = titleAttributs; | |
| 229 | + [alertController showWithAnimated:YES]; | |
| 230 | + | |
| 231 | +} | |
| 232 | + | |
| 233 | +/* | |
| 234 | +#pragma mark - Navigation | |
| 235 | + | |
| 236 | +// In a storyboard-based application, you will often want to do a little preparation before navigation | |
| 237 | +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
| 238 | + // Get the new view controller using [segue destinationViewController]. | |
| 239 | + // Pass the selected object to the new view controller. | |
| 240 | +} | |
| 241 | +*/ | |
| 242 | + | |
| 243 | +#pragma mark - 懒加载 | |
| 244 | +- (CNLiveNavigationBar *)navigationBar { | |
| 245 | + if (!_navigationBar) { | |
| 246 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 247 | + _navigationBar.title.text = @"审核申请"; | |
| 248 | + __weak typeof(self) weakSelf = self; | |
| 249 | + _navigationBar.onClickLeftButton = ^{ | |
| 250 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 251 | + if(!strongSelf) return ; | |
| 252 | + [strongSelf goBack]; | |
| 253 | + }; | |
| 254 | + } | |
| 255 | + return _navigationBar; | |
| 256 | +} | |
| 257 | + | |
| 258 | +#pragma mark - 响应方法 | |
| 259 | +- (void)goBack { | |
| 260 | + if (self.presentingViewController != nil) { | |
| 261 | + [self dismissViewControllerAnimated:YES completion:nil]; | |
| 262 | + } | |
| 263 | + else { | |
| 264 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 265 | + } | |
| 266 | +} | |
| 267 | + | |
| 268 | +@end | ... | ... |
CNLiveBMineModule/Classes/Setting/Cancellation/CNLiveCancellationView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCancellationView.h | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/3/21. | |
| 6 | +// Copyright © 2019年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +@class CNLiveCancellationView; | |
| 13 | +@protocol CNLiveCancellationViewDelegate <NSObject> | |
| 14 | +- (void)clickedCancellation:(CNLiveCancellationView *)view; | |
| 15 | +- (void)clickedProtocol:(CNLiveCancellationView *)view; | |
| 16 | + | |
| 17 | +@end | |
| 18 | +@interface CNLiveCancellationView : UIView | |
| 19 | +@property (nonatomic, weak) id<CNLiveCancellationViewDelegate> delegate; | |
| 20 | + | |
| 21 | +@end | |
| 22 | + | |
| 23 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/Cancellation/CNLiveCancellationView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveCancellationView.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/3/21. | |
| 6 | +// Copyright © 2019年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveCancellationView.h" | |
| 10 | +#import "YYKit.h" | |
| 11 | +#import <Masonry/Masonry.h> | |
| 12 | +#import "CNLiveCategory.h" | |
| 13 | + | |
| 14 | +@interface CNLiveCancellationView()<UITextViewDelegate> | |
| 15 | +@property (nonatomic, strong) UIButton *agreeBtn; | |
| 16 | +@property (nonatomic, strong) YYLabel *protocol; | |
| 17 | +@property (nonatomic, strong) UIButton *cancellationBtn; | |
| 18 | + | |
| 19 | +@end | |
| 20 | + | |
| 21 | +@implementation CNLiveCancellationView | |
| 22 | +static const NSInteger margin = 15; | |
| 23 | +#pragma mark - Init | |
| 24 | +- (instancetype)initWithFrame:(CGRect)frame { | |
| 25 | + self = [super initWithFrame:frame]; | |
| 26 | + if (self) { | |
| 27 | + self.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 28 | + [self setup]; | |
| 29 | + } | |
| 30 | + return self; | |
| 31 | +} | |
| 32 | +- (void)dealloc{ | |
| 33 | + | |
| 34 | +} | |
| 35 | + | |
| 36 | +#pragma mark - UI | |
| 37 | +- (void)setup { | |
| 38 | + [self addSubview:self.agreeBtn]; | |
| 39 | + [self addSubview:self.protocol]; | |
| 40 | + [self addSubview:self.cancellationBtn]; | |
| 41 | + | |
| 42 | +} | |
| 43 | +- (void)layoutSubviews{ | |
| 44 | + [super layoutSubviews]; | |
| 45 | + [_agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 46 | + make.left.equalTo(self.mas_left).with.offset(0); | |
| 47 | + make.top.equalTo(self.mas_top).with.offset(margin); | |
| 48 | + make.width.height.offset(30); | |
| 49 | + | |
| 50 | + }]; | |
| 51 | + [_protocol mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 52 | + make.left.equalTo(self->_agreeBtn.mas_right).with.offset(8); | |
| 53 | + make.right.equalTo(self.mas_right).with.offset(-margin); | |
| 54 | + make.top.equalTo(self->_agreeBtn.mas_top).with.offset(0); | |
| 55 | + make.height.offset(30); | |
| 56 | + | |
| 57 | + }]; | |
| 58 | + [_cancellationBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 59 | + make.left.equalTo(self.mas_left).with.offset(margin); | |
| 60 | + make.right.equalTo(self.mas_right).with.offset(-margin); | |
| 61 | + make.bottom.equalTo(self.mas_bottom).with.offset(-margin); | |
| 62 | + make.height.offset(40); | |
| 63 | + | |
| 64 | + }]; | |
| 65 | + | |
| 66 | +} | |
| 67 | + | |
| 68 | +#pragma mark - Data | |
| 69 | +/* | |
| 70 | + // Only override drawRect: if you perform custom drawing. | |
| 71 | + // An empty implementation adversely affects performance during animation. | |
| 72 | + - (void)drawRect:(CGRect)rect { | |
| 73 | + // Drawing code | |
| 74 | + } | |
| 75 | + */ | |
| 76 | +#pragma mark - Action | |
| 77 | +- (void)clickedAgreeButton:(UIButton *)btn{ | |
| 78 | + btn.selected = !btn.selected; | |
| 79 | + if(btn.selected){ | |
| 80 | + _cancellationBtn.backgroundColor = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 81 | + | |
| 82 | + }else{ | |
| 83 | + _cancellationBtn.backgroundColor = [UIColor colorWithRed:146/255.0 green:227/255.0 blue:154/255.0 alpha:1.0]; | |
| 84 | + } | |
| 85 | +} | |
| 86 | +- (void)cancellationDidClicked:(UIButton *)btn{ | |
| 87 | + if (self.delegate && [self.delegate respondsToSelector:@selector(clickedCancellation:)] && _agreeBtn.selected) { | |
| 88 | + [self.delegate clickedCancellation:self]; | |
| 89 | + | |
| 90 | + } | |
| 91 | +} | |
| 92 | + | |
| 93 | +#pragma mark - UITextViewDelegate | |
| 94 | +- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange { | |
| 95 | + if ([[URL scheme] isEqualToString:@"cancellation"]) { | |
| 96 | + if (self.delegate && [self.delegate respondsToSelector:@selector(clickedProtocol:)]) { | |
| 97 | + [self.delegate clickedProtocol:self]; | |
| 98 | + | |
| 99 | + } | |
| 100 | + return NO; | |
| 101 | + } | |
| 102 | + return YES; | |
| 103 | +} | |
| 104 | + | |
| 105 | +#pragma mark - Lazy loading | |
| 106 | +- (UIButton *)agreeBtn{ | |
| 107 | + if (!_agreeBtn) { | |
| 108 | + _agreeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 109 | + UIImage *xw_image1 = [self getImageWithImageName:@"mine_cancellation_agree" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveCancellationView class]]; | |
| 110 | + | |
| 111 | + UIImage *xw_image2 = [self getImageWithImageName:@"mine_cancellation_agree_sel" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveCancellationView class]]; | |
| 112 | + | |
| 113 | + [_agreeBtn setImage:xw_image1 forState:UIControlStateNormal]; | |
| 114 | + [_agreeBtn setImage:xw_image2 forState:UIControlStateSelected]; | |
| 115 | + [_agreeBtn addTarget:self action:@selector(clickedAgreeButton:) forControlEvents:UIControlEventTouchUpInside]; | |
| 116 | + _agreeBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;//居左显示 | |
| 117 | + | |
| 118 | + } | |
| 119 | + return _agreeBtn; | |
| 120 | +} | |
| 121 | + | |
| 122 | +- (YYLabel *)protocol{ | |
| 123 | + if (!_protocol) { | |
| 124 | + _protocol = [[YYLabel alloc] init]; | |
| 125 | + NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@"我已阅读并同意《注销协议》"]; | |
| 126 | + text.font = [UIFont fontWithName:@"PingFangSC-Regular" size:16]; | |
| 127 | + text.color = [UIColor colorWithRed:40/255.0 green:40/255.0 blue:40/255.0 alpha:1.0]; | |
| 128 | + | |
| 129 | + __weak typeof(self) weakSelf = self; | |
| 130 | + [text setTextHighlightRange:NSMakeRange(7, 6) color:[UIColor colorWithRed:72/255.0 green:167/255.0 blue:249/255.0 alpha:1.0] backgroundColor:[UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { | |
| 131 | + if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(clickedProtocol:)]) { | |
| 132 | + [weakSelf.delegate clickedProtocol:weakSelf]; | |
| 133 | + | |
| 134 | + } | |
| 135 | + | |
| 136 | + }]; | |
| 137 | + | |
| 138 | + _protocol.attributedText = text; | |
| 139 | + | |
| 140 | + } | |
| 141 | + return _protocol; | |
| 142 | +} | |
| 143 | + | |
| 144 | +- (UIButton *)cancellationBtn{ | |
| 145 | + if (!_cancellationBtn) { | |
| 146 | + _cancellationBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 147 | + [_cancellationBtn setTitle:@"确认注销" forState:UIControlStateNormal]; | |
| 148 | + _cancellationBtn.backgroundColor = [UIColor colorWithRed:72/255.0 green:167/255.0 blue:249/255.0 alpha:1.0]; | |
| 149 | + _cancellationBtn.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:17]; | |
| 150 | + _cancellationBtn.layer.cornerRadius = 20; | |
| 151 | + _cancellationBtn.layer.masksToBounds = YES; | |
| 152 | + [_cancellationBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
| 153 | + [_cancellationBtn addTarget:self action:@selector(cancellationDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
| 154 | + } | |
| 155 | + return _cancellationBtn; | |
| 156 | +} | |
| 157 | + | |
| 158 | +@end | |
| 159 | + | ... | ... |
CNLiveBMineModule/Classes/Setting/Controller/CNLiveSettingController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSettingController.h | |
| 3 | +// CNLiveBMineModule | |
| 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 | +#import "CNCommonViewController.h" | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_BEGIN | |
| 17 | + | |
| 18 | +@interface CNLiveSettingController : CNCommonViewController | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/Controller/CNLiveSettingController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSettingController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveSettingController.h" | |
| 10 | +#import "MJExtension.h" | |
| 11 | +#import <SDWebImage/SDWebImage.h> | |
| 12 | +#import "QMUIKit.h" | |
| 13 | + | |
| 14 | +#import "CNLiveUserAgreementManager.h" | |
| 15 | +#import "CNUserInfoManager.h" | |
| 16 | + | |
| 17 | +#import "CNLiveSettingModel.h" | |
| 18 | +#import "CNLiveSettingCell.h" | |
| 19 | +#import "CNLiveServices.h" | |
| 20 | +#import "CNLiveNavigationBar.h" | |
| 21 | + | |
| 22 | +#import "CNLiveUpdateTelController.h"//修改手机号 | |
| 23 | +#import "CNLiveCancellationController.h"//注销 | |
| 24 | +#import "CNLiveAboutUsController.h"//关于我们 | |
| 25 | +#import "CNLiveBaseKit.h" | |
| 26 | + | |
| 27 | +@interface CNLiveSettingController () | |
| 28 | +<UITableViewDelegate, UITableViewDataSource> | |
| 29 | +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar; | |
| 30 | +@property (nonatomic, strong) UITableView *tableView; | |
| 31 | +@property (nonatomic, strong) UIButton *logout; | |
| 32 | +@property (nonatomic, strong) NSMutableArray *data; | |
| 33 | + | |
| 34 | +@end | |
| 35 | + | |
| 36 | +@implementation CNLiveSettingController | |
| 37 | +static const NSInteger timeValue = 1.5; | |
| 38 | +#pragma mark - 加载数据 | |
| 39 | +- (void)loadData { | |
| 40 | + NSArray *data = @[ | |
| 41 | + @{ | |
| 42 | + @"style":@"2", | |
| 43 | + @"title":@"更换手机号", | |
| 44 | + @"content":CNUserShareModel.mobile, | |
| 45 | + @"height":@"60", | |
| 46 | + @"lineHeight":@"10" | |
| 47 | + }, | |
| 48 | + @{ | |
| 49 | + @"style":@"2", | |
| 50 | + @"title":@"绑定管理", | |
| 51 | + @"content":@"", | |
| 52 | + @"height":@"60", | |
| 53 | + @"lineHeight":@"10" | |
| 54 | + }, | |
| 55 | + @{ | |
| 56 | + @"style":@"2", | |
| 57 | + @"title":@"帮助与反馈", | |
| 58 | + @"content":@"", | |
| 59 | + @"height":@"60", | |
| 60 | + @"lineHeight":@"10" | |
| 61 | + }, | |
| 62 | + @{ | |
| 63 | + @"style":@"2", | |
| 64 | + @"title":@"清除缓存", | |
| 65 | + @"content":@"30k", | |
| 66 | + @"height":@"51", | |
| 67 | + @"lineHeight":@"1" | |
| 68 | + }, | |
| 69 | + @{ | |
| 70 | + @"style":@"1", | |
| 71 | + @"title":@"关于我们", | |
| 72 | + @"height":@"51", | |
| 73 | + @"lineHeight":@"1" | |
| 74 | + }, | |
| 75 | + @{ | |
| 76 | + @"style":@"1", | |
| 77 | + @"title":@"注销账号", | |
| 78 | + @"height":@"51", | |
| 79 | + @"lineHeight":@"1" | |
| 80 | + } | |
| 81 | + | |
| 82 | + ]; | |
| 83 | + for(NSDictionary *dic in data){ | |
| 84 | + [self.data addObject:[CNLiveSettingModel mj_objectWithKeyValues:dic]]; | |
| 85 | + } | |
| 86 | + [self getSDCacheSize]; | |
| 87 | + [self.tableView reloadData]; | |
| 88 | + | |
| 89 | +} | |
| 90 | +- (void)getSDCacheSize { | |
| 91 | + __weak typeof(self) weakSelf = self; | |
| 92 | + [[SDImageCache sharedImageCache] calculateSizeWithCompletionBlock:^(NSUInteger fileCount, NSUInteger totalSize) { | |
| 93 | + NSString *cacheString = @""; | |
| 94 | + if (totalSize/(1024.0*1024.0) >= 1.0) { | |
| 95 | + cacheString = [NSString stringWithFormat:@"%.1fMB",totalSize/(1024.0*1024)]; | |
| 96 | + } else { | |
| 97 | + cacheString = [NSString stringWithFormat:@"%.1fKB",totalSize/1024.0]; | |
| 98 | + } | |
| 99 | + for (CNLiveSettingModel *model in self.data) { | |
| 100 | + if([model.title isEqualToString:@"清除缓存"]){ | |
| 101 | + model.content = cacheString; | |
| 102 | + } | |
| 103 | + } | |
| 104 | + [weakSelf.tableView reloadData]; | |
| 105 | + | |
| 106 | + }]; | |
| 107 | +} | |
| 108 | + | |
| 109 | +#pragma mark - 生命周期 | |
| 110 | +- (void)viewWillAppear:(BOOL)animated{ | |
| 111 | + [super viewWillAppear:animated]; | |
| 112 | + self.navigationController.navigationBarHidden = YES; | |
| 113 | + [self.tableView reloadData]; | |
| 114 | + self.logout.titleLabel.font = UIFontBoldCNMake(17.0); | |
| 115 | + | |
| 116 | +} | |
| 117 | + | |
| 118 | +- (void)viewDidLoad { | |
| 119 | + [super viewDidLoad]; | |
| 120 | + self.view.backgroundColor = [UIColor whiteColor]; | |
| 121 | + if (@available(iOS 11, *)) { | |
| 122 | + self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 123 | + } | |
| 124 | + else { | |
| 125 | + self.automaticallyAdjustsScrollViewInsets = NO; | |
| 126 | + } | |
| 127 | + | |
| 128 | + [self createSubViews]; | |
| 129 | + [self loadData]; | |
| 130 | + | |
| 131 | +} | |
| 132 | + | |
| 133 | +- (void)dealloc { | |
| 134 | + | |
| 135 | + | |
| 136 | +} | |
| 137 | + | |
| 138 | +- (void)createSubViews { | |
| 139 | + [self.view addSubview:self.navigationBar]; | |
| 140 | + [self.view addSubview:self.tableView]; | |
| 141 | + [self.view addSubview:self.logout]; | |
| 142 | + | |
| 143 | +} | |
| 144 | +#pragma mark - UITableViewDelegate | |
| 145 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 146 | + CNLiveSettingModel *model = self.data[indexPath.row]; | |
| 147 | + return model.height; | |
| 148 | +} | |
| 149 | + | |
| 150 | +#pragma mark - UITableViewDataSource | |
| 151 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 152 | + return self.data.count; | |
| 153 | +} | |
| 154 | + | |
| 155 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 156 | + CNLiveSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveSettingCell]; | |
| 157 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 158 | + CNLiveSettingModel *model = self.data[indexPath.row]; | |
| 159 | + cell.model = model; | |
| 160 | + return cell; | |
| 161 | +} | |
| 162 | + | |
| 163 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 164 | + if(indexPath.row == 0){ // 更换手机号 | |
| 165 | + CNLiveUpdateTelController *vc = [[CNLiveUpdateTelController alloc]init]; | |
| 166 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 167 | + | |
| 168 | + } | |
| 169 | + else if(indexPath.row == 1){ //绑定管理 | |
| 170 | + | |
| 171 | + } | |
| 172 | + else if(indexPath.row == 2){ //帮助手册 | |
| 173 | + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementHelp]; | |
| 174 | + | |
| 175 | + } | |
| 176 | + else if(indexPath.row == 3){ // 清除缓存 | |
| 177 | + __weak typeof(self) weakSelf = self; | |
| 178 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"确定" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 179 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 180 | + if(!strongSelf) return ; | |
| 181 | + [strongSelf cleanLocalCache]; | |
| 182 | + | |
| 183 | + }]; | |
| 184 | + QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 185 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 186 | + if(!strongSelf) return ; | |
| 187 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 188 | + | |
| 189 | + }]; | |
| 190 | + | |
| 191 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"确定清除本地缓存吗?" message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 192 | + [alertController addAction:sure]; | |
| 193 | + [alertController addAction:cancel]; | |
| 194 | + | |
| 195 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 196 | + | |
| 197 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 198 | + | |
| 199 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 200 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 201 | + | |
| 202 | + sure.buttonAttributes = titleAttributs; | |
| 203 | + cancel.buttonAttributes = cancelAttributs; | |
| 204 | + | |
| 205 | + [alertController showWithAnimated:YES]; | |
| 206 | + | |
| 207 | + }else if (indexPath.row == 4){ | |
| 208 | + CNLiveAboutUsController *vc = [[CNLiveAboutUsController alloc]init]; | |
| 209 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 210 | + } | |
| 211 | + else if (indexPath.row == 5) { | |
| 212 | + CNLiveCancellationController *vc = [[CNLiveCancellationController alloc]init]; | |
| 213 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 214 | + } | |
| 215 | +} | |
| 216 | + | |
| 217 | +#pragma mark - 懒加载 | |
| 218 | +- (NSMutableArray *)data { | |
| 219 | + if (!_data) { | |
| 220 | + _data = [NSMutableArray array]; | |
| 221 | + } | |
| 222 | + return _data; | |
| 223 | +} | |
| 224 | + | |
| 225 | +- (CNLiveNavigationBar *)navigationBar { | |
| 226 | + if (!_navigationBar) { | |
| 227 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 228 | + _navigationBar.title.text = @"设置"; | |
| 229 | + __weak typeof(self) weakSelf = self; | |
| 230 | + _navigationBar.onClickLeftButton = ^{ | |
| 231 | + [weakSelf goBack]; | |
| 232 | + }; | |
| 233 | + } | |
| 234 | + return _navigationBar; | |
| 235 | +} | |
| 236 | + | |
| 237 | +- (UITableView *)tableView{ | |
| 238 | + if(!_tableView){ | |
| 239 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavigationContentTop, SCREEN_WIDTH, SCREEN_HEIGHT-NavigationContentTop-50) style:UITableViewStylePlain]; | |
| 240 | + _tableView.delegate = self; | |
| 241 | + _tableView.dataSource = self; | |
| 242 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 243 | + _tableView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 244 | + _tableView.estimatedRowHeight = 0; | |
| 245 | + _tableView.estimatedSectionHeaderHeight = 0; | |
| 246 | + _tableView.estimatedSectionFooterHeight = 0; | |
| 247 | + [_tableView registerClass:[CNLiveSettingCell class] forCellReuseIdentifier:kCNLiveSettingCell]; | |
| 248 | + } | |
| 249 | + return _tableView; | |
| 250 | +} | |
| 251 | + | |
| 252 | +- (UIButton *)logout{ | |
| 253 | + if(!_logout){ | |
| 254 | + _logout = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 255 | + _logout.frame = CGRectMake(0, SCREEN_HEIGHT-SafeAreaInsetsConstantForDeviceWithNotch.bottom-50, SCREEN_WIDTH, 50); | |
| 256 | + _logout.backgroundColor = [UIColor whiteColor]; | |
| 257 | + _logout.titleLabel.font = UIFontBoldCNMake(17.0); | |
| 258 | + [_logout setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; | |
| 259 | + [_logout setTitle:@"退出登录" forState:UIControlStateNormal]; | |
| 260 | + _logout.adjustsImageWhenHighlighted = NO; | |
| 261 | + [_logout addTarget:self action:@selector(logoutDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
| 262 | + } | |
| 263 | + return _logout; | |
| 264 | +} | |
| 265 | + | |
| 266 | +#pragma mark - 响应方法 | |
| 267 | +- (void)goBack { | |
| 268 | + if (self.presentingViewController != nil) { | |
| 269 | + [self dismissViewControllerAnimated:YES completion:nil]; | |
| 270 | + } | |
| 271 | + else { | |
| 272 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 273 | + } | |
| 274 | +} | |
| 275 | + | |
| 276 | +- (void)logoutDidClicked:(UIButton *)btn{ | |
| 277 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"退出登录" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 278 | + [UIApplication sharedApplication].delegate.window.rootViewController = nil; | |
| 279 | + [self cleanLocalCache]; | |
| 280 | + id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)]; | |
| 281 | + UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[login getLoginViewController]]; | |
| 282 | + [UIApplication sharedApplication].delegate.window.rootViewController = nav; | |
| 283 | + }]; | |
| 284 | + | |
| 285 | + QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:nil]; | |
| 286 | + | |
| 287 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:QMUIAlertControllerStyleActionSheet]; | |
| 288 | + [alertController addAction:sure]; | |
| 289 | + [alertController addAction:cancel]; | |
| 290 | + | |
| 291 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 292 | + | |
| 293 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 294 | + | |
| 295 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 296 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 297 | + | |
| 298 | + sure.buttonAttributes = titleAttributs; | |
| 299 | + cancel.buttonAttributes = cancelAttributs; | |
| 300 | + | |
| 301 | + [alertController showWithAnimated:YES]; | |
| 302 | + | |
| 303 | +} | |
| 304 | + | |
| 305 | +#pragma mark - 私有方法 | |
| 306 | +// 清除本地缓存 | |
| 307 | +- (void)cleanLocalCache{ | |
| 308 | +// [XWUserManager removeUserInfo]; | |
| 309 | + [[SDImageCache sharedImageCache] clearMemory]; | |
| 310 | + [[SDImageCache sharedImageCache] clearDiskOnCompletion:^{ | |
| 311 | + [QMUITips showSucceed:@"清除成功" inView:self.view hideAfterDelay:timeValue]; | |
| 312 | + [self getSDCacheSize]; | |
| 313 | + | |
| 314 | + }]; | |
| 315 | +} | |
| 316 | + | |
| 317 | +#pragma mark - 公共方法 | |
| 318 | +// 清除本地缓存 | |
| 319 | ++ (void)cleanLocalCache{ | |
| 320 | +// [XWUserManager removeUserInfo]; | |
| 321 | + [[SDImageCache sharedImageCache] clearMemory]; | |
| 322 | + [[SDImageCache sharedImageCache] clearDiskOnCompletion:^{ | |
| 323 | + | |
| 324 | + }]; | |
| 325 | +} | |
| 326 | + | |
| 327 | +@end | ... | ... |
CNLiveBMineModule/Classes/Setting/Model/CNLiveSettingModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSettingModel.h | |
| 3 | +// CNLiveBMineModule | |
| 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, CNLiveSettingModelType) { | |
| 13 | + CNLiveSettingModelTypeDefault = 0, | |
| 14 | + CNLiveSettingModelTypeText = 1, | |
| 15 | + CNLiveSettingModelTypeTextFront = 2 | |
| 16 | +}; | |
| 17 | + | |
| 18 | +@interface CNLiveSettingModel : NSObject | |
| 19 | +@property (nonatomic, copy) NSString *title; | |
| 20 | +@property (nonatomic, copy) NSString *content; | |
| 21 | +@property (nonatomic, copy) NSString *style; | |
| 22 | + | |
| 23 | +@property (nonatomic, assign) CNLiveSettingModelType type; | |
| 24 | +@property (nonatomic, assign) CGFloat height; | |
| 25 | +@property (nonatomic, assign) CGFloat lineHeight; | |
| 26 | + | |
| 27 | +@end | |
| 28 | + | |
| 29 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/Model/CNLiveSettingModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSettingModel.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | |
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveSettingModel.h" | |
| 10 | + | |
| 11 | +@implementation CNLiveSettingModel | |
| 12 | + | |
| 13 | +- (CNLiveSettingModelType)type{ | |
| 14 | + if([self.style isEqualToString:@"1"]){ | |
| 15 | + return CNLiveSettingModelTypeDefault; | |
| 16 | + } | |
| 17 | + else if([self.style isEqualToString:@"2"]){ | |
| 18 | + return CNLiveSettingModelTypeTextFront; | |
| 19 | + | |
| 20 | + } | |
| 21 | + else if([self.style isEqualToString:@"4"]){ | |
| 22 | + return CNLiveSettingModelTypeText; | |
| 23 | + | |
| 24 | + } | |
| 25 | + return CNLiveSettingModelTypeDefault; | |
| 26 | +} | |
| 27 | + | |
| 28 | +@end | ... | ... |
CNLiveBMineModule/Classes/Setting/Model/CNLiveSettingRequest.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSettingRequest.h | |
| 3 | +// CNLiveBMineModule | |
| 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 | + | |
| 13 | +@interface CNLiveSettingRequest : NSObject | |
| 14 | + | |
| 15 | + | |
| 16 | +@end | |
| 17 | + | |
| 18 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/Model/CNLiveSettingRequest.m
0 → 100644
CNLiveBMineModule/Classes/Setting/UpdateTel/CNLiveUpdateTelController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUpdateTelController.h | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNCommonViewController.h" | |
| 10 | + | |
| 11 | +@interface CNLiveUpdateTelController : CNCommonViewController | |
| 12 | + | |
| 13 | +@end | ... | ... |
CNLiveBMineModule/Classes/Setting/UpdateTel/CNLiveUpdateTelController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUpdateTelController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveUpdateTelController.h" | |
| 10 | +#import "CNLiveChooseCountryController.h" | |
| 11 | +#import "YYKit.h" | |
| 12 | +#import <Masonry/Masonry.h> | |
| 13 | +#import "QMUIKit.h" | |
| 14 | + | |
| 15 | +#import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h> | |
| 16 | +#import "CNUserInfoManager.h" | |
| 17 | +#import "NSString+CNLiveExtension.h" | |
| 18 | +#import "CNLiveCategory.h" | |
| 19 | +#import "CNLiveBaseKit.h" | |
| 20 | + | |
| 21 | +#import "CNLiveNavigationBar.h" | |
| 22 | +#import "CNLiveUpdateTelView.h" | |
| 23 | + | |
| 24 | +@interface CNLiveUpdateTelController()<UITextFieldDelegate, CNLiveUpdateTelViewDelegate, ChooseCountriesDelegate> | |
| 25 | + | |
| 26 | +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar; | |
| 27 | +@property (nonatomic, strong) CNLiveUpdateTelView *updateTel;//背景 | |
| 28 | +@property (nonatomic, strong) YYLabel *connection; | |
| 29 | + | |
| 30 | +@end | |
| 31 | + | |
| 32 | +@implementation CNLiveUpdateTelController | |
| 33 | +static const NSInteger timeValue = 1.5; | |
| 34 | + | |
| 35 | +- (void)viewWillAppear:(BOOL)animated { | |
| 36 | + [super viewWillAppear:animated]; | |
| 37 | + self.navigationController.navigationBarHidden = YES; | |
| 38 | + | |
| 39 | +} | |
| 40 | + | |
| 41 | +- (void)viewDidLoad { | |
| 42 | + [super viewDidLoad]; | |
| 43 | + // Do any additional setup after loading the view. | |
| 44 | + | |
| 45 | + self.view.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 46 | + | |
| 47 | + [self createSubViews]; | |
| 48 | + [self xw_layoutSubviews]; | |
| 49 | + | |
| 50 | + __weak typeof(self) weakSelf = self; | |
| 51 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"确定" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 52 | + | |
| 53 | + }]; | |
| 54 | + QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 55 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 56 | + if(!strongSelf) return ; | |
| 57 | + [strongSelf.navigationController popViewControllerAnimated:YES]; | |
| 58 | + }]; | |
| 59 | + | |
| 60 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"更换手机号将只能使用新绑定的手机号登录app,是否继续修改?" message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 61 | + [alertController addAction:sure]; | |
| 62 | + [alertController addAction:cancel]; | |
| 63 | + | |
| 64 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 65 | + | |
| 66 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 67 | + | |
| 68 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 69 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 70 | + | |
| 71 | + sure.buttonAttributes = titleAttributs; | |
| 72 | + cancel.buttonAttributes = cancelAttributs; | |
| 73 | + | |
| 74 | + [alertController showWithAnimated:YES]; | |
| 75 | + | |
| 76 | +} | |
| 77 | + | |
| 78 | +#pragma mark - UI | |
| 79 | +- (void)createSubViews{ | |
| 80 | + [self.view addSubview:self.navigationBar]; | |
| 81 | + [self.view addSubview:self.updateTel]; | |
| 82 | + [self.view addSubview:self.connection]; | |
| 83 | +} | |
| 84 | + | |
| 85 | +- (void)xw_layoutSubviews{ | |
| 86 | + [self.updateTel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 87 | + make.left.right.equalTo(self.view); | |
| 88 | + make.top.equalTo(self.view).offset(NavigationContentTop); | |
| 89 | + make.height.mas_equalTo(220); | |
| 90 | + }]; | |
| 91 | + [self.connection mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 92 | + make.left.right.equalTo(self.view); | |
| 93 | + make.bottom.equalTo(self.view.mas_bottom).offset(-30); | |
| 94 | + }]; | |
| 95 | + | |
| 96 | +} | |
| 97 | + | |
| 98 | +- (void)didReceiveMemoryWarning { | |
| 99 | + [super didReceiveMemoryWarning]; | |
| 100 | + // Dispose of any resources that can be recreated. | |
| 101 | +} | |
| 102 | + | |
| 103 | +#pragma mark - ChooseCountriesDelegate | |
| 104 | +- (void)chooseViewController:(CNLiveChooseCountryController *)controller countryName:(NSString *)name countryCode:(NSString *)code{ | |
| 105 | + _updateTel.countryName.text = name; | |
| 106 | + _updateTel.countryCode.text = [NSString stringWithFormat:@"+%@",code]; | |
| 107 | + _updateTel.codeNum = code; | |
| 108 | + | |
| 109 | +} | |
| 110 | + | |
| 111 | +#pragma mark - CNLiveUpdateTelViewDelegate | |
| 112 | +- (void)selectCountry:(CNLiveUpdateTelView *)view{ | |
| 113 | + CNLiveChooseCountryController *vc = [[CNLiveChooseCountryController alloc]init]; | |
| 114 | + vc.modalPresentationStyle = UIModalPresentationFullScreen; | |
| 115 | + vc.delegate = self; | |
| 116 | + vc.hidesBottomBarWhenPushed = YES; | |
| 117 | + [self presentViewController:vc animated:YES completion:nil]; | |
| 118 | +} | |
| 119 | + | |
| 120 | +- (void)bindingSuccess:(CNLiveUpdateTelView *)view{ | |
| 121 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 122 | +} | |
| 123 | + | |
| 124 | +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { | |
| 125 | + [self.updateTel.telTF resignFirstResponder]; | |
| 126 | +} | |
| 127 | + | |
| 128 | +#pragma mark - Lazy Loading | |
| 129 | +- (CNLiveNavigationBar *)navigationBar { | |
| 130 | + if (!_navigationBar) { | |
| 131 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 132 | + _navigationBar.title.text = @"更换手机号"; | |
| 133 | + __weak typeof(self) weakSelf = self; | |
| 134 | + _navigationBar.onClickLeftButton = ^{ | |
| 135 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 136 | + if(!strongSelf) return ; | |
| 137 | + [strongSelf.navigationController popViewControllerAnimated:YES]; | |
| 138 | + }; | |
| 139 | + | |
| 140 | + } | |
| 141 | + return _navigationBar; | |
| 142 | +} | |
| 143 | + | |
| 144 | +- (CNLiveUpdateTelView *)updateTel{ | |
| 145 | + if (!_updateTel) { | |
| 146 | + _updateTel = [[CNLiveUpdateTelView alloc] init]; | |
| 147 | + _updateTel.delegate = self; | |
| 148 | + _updateTel.codeNum = @"86"; | |
| 149 | + } | |
| 150 | + return _updateTel; | |
| 151 | +} | |
| 152 | + | |
| 153 | +- (YYLabel *)connection { | |
| 154 | + if (!_connection) { | |
| 155 | + _connection = [[YYLabel alloc] init]; | |
| 156 | + _connection.numberOfLines = 0; | |
| 157 | + NSString *str = @"若当前号码已不用或丢失,请点击联系客服"; | |
| 158 | + NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:str]; | |
| 159 | + text.color = [UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1.0]; | |
| 160 | + text.font = UIFontCNMake(12.0); | |
| 161 | + [text setTextHighlightRange:NSMakeRange(text.length-4, 4) color:[UIColor colorWithRed:44/255.0 green:209/255.0 blue:201/255.0 alpha:1.0] backgroundColor:[UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { | |
| 162 | + | |
| 163 | + NSString *phoneStr = @"010-65832485"; | |
| 164 | + | |
| 165 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"好" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 166 | + if (@available(iOS 10.0, *)) { | |
| 167 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",phoneStr]] options:@{} completionHandler:nil]; | |
| 168 | + } else { | |
| 169 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",phoneStr]]]; | |
| 170 | + } | |
| 171 | + | |
| 172 | + }]; | |
| 173 | + QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 174 | + }]; | |
| 175 | + | |
| 176 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"联系客服" message:[NSString stringWithFormat:@"将给%@拨打电话",phoneStr] preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 177 | + [alertController addAction:sure]; | |
| 178 | + [alertController addAction:cancel]; | |
| 179 | + | |
| 180 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 181 | + | |
| 182 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 183 | + | |
| 184 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 185 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 186 | + | |
| 187 | + sure.buttonAttributes = titleAttributs; | |
| 188 | + cancel.buttonAttributes = cancelAttributs; | |
| 189 | + | |
| 190 | + [alertController showWithAnimated:YES]; | |
| 191 | + | |
| 192 | + } ]; | |
| 193 | + _connection.attributedText = text; | |
| 194 | + _connection.textAlignment = NSTextAlignmentCenter; | |
| 195 | + | |
| 196 | + } | |
| 197 | + return _connection; | |
| 198 | +} | |
| 199 | + | |
| 200 | +/* | |
| 201 | +#pragma mark - Navigation | |
| 202 | + | |
| 203 | +// In a storyboard-based application, you will often want to do a little preparation before navigation | |
| 204 | +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
| 205 | + // Get the new view controller using [segue destinationViewController]. | |
| 206 | + // Pass the selected object to the new view controller. | |
| 207 | +} | |
| 208 | +*/ | |
| 209 | + | |
| 210 | +@end | ... | ... |
CNLiveBMineModule/Classes/Setting/UpdateTel/CNLiveUpdateTelView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUpdateTelView.h | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/3/21. | |
| 6 | +// Copyright © 2019年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +@class CNLiveUpdateTelView; | |
| 13 | +@protocol CNLiveUpdateTelViewDelegate <NSObject> | |
| 14 | +- (void)selectCountry:(CNLiveUpdateTelView *)view; | |
| 15 | +- (void)bindingSuccess:(CNLiveUpdateTelView *)view; | |
| 16 | + | |
| 17 | +@end | |
| 18 | +@interface CNLiveUpdateTelView : UIView | |
| 19 | +@property (nonatomic, weak) id<CNLiveUpdateTelViewDelegate> delegate; | |
| 20 | + | |
| 21 | +@property (nonatomic, strong) UILabel *countryName; | |
| 22 | +@property (nonatomic, strong) UILabel *countryCode; | |
| 23 | + | |
| 24 | +@property (nonatomic, strong) UITextField *telTF; | |
| 25 | +@property (nonatomic, strong) UITextField *codeTF; | |
| 26 | + | |
| 27 | +@property (nonatomic, assign) BOOL gotVerificationCode; | |
| 28 | +@property (nonatomic, assign) BOOL gotVerificationCodeIng; | |
| 29 | + | |
| 30 | +@property (nonatomic, copy) NSString *codeNum; | |
| 31 | + | |
| 32 | +@end | |
| 33 | + | |
| 34 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/UpdateTel/CNLiveUpdateTelView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUpdateTelView.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/3/21. | |
| 6 | +// Copyright © 2019年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveUpdateTelView.h" | |
| 10 | +#import "YYKit.h" | |
| 11 | +#import <Masonry/Masonry.h> | |
| 12 | +#import "QMUIKit.h" | |
| 13 | + | |
| 14 | +#import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h> | |
| 15 | +#import "NSString+CNLiveExtension.h" | |
| 16 | +#import "CNUserInfoManager.h" | |
| 17 | +#import "CNLiveCategory.h" | |
| 18 | +#import "CNLiveBaseKit.h" | |
| 19 | + | |
| 20 | +#define TIMECOUNT 60; | |
| 21 | + | |
| 22 | +@interface CNLiveUpdateTelView()<UITextFieldDelegate> | |
| 23 | + | |
| 24 | +@property (nonatomic, strong) UIView *lineView; | |
| 25 | +@property (nonatomic, strong) UIImageView *countryImg; | |
| 26 | +@property (nonatomic, strong) UILabel *numberLabel;//手机号 | |
| 27 | +@property (nonatomic, strong) UILabel *codeLabel;//验证码 | |
| 28 | +@property (nonatomic, strong) UIButton *verification;//验证码按钮 | |
| 29 | + | |
| 30 | +@property (nonatomic, strong) UIView *bindingView;//改变按钮 | |
| 31 | +@property (nonatomic, strong) UIButton *binding;//改变按钮 | |
| 32 | + | |
| 33 | +@end | |
| 34 | + | |
| 35 | +@implementation CNLiveUpdateTelView | |
| 36 | +static const NSInteger margin = 15; | |
| 37 | +static const NSInteger timeValue = 1.5; | |
| 38 | + | |
| 39 | +#pragma mark - Init | |
| 40 | +- (instancetype)initWithFrame:(CGRect)frame { | |
| 41 | + self = [super initWithFrame:frame]; | |
| 42 | + if (self) { | |
| 43 | + self.backgroundColor = [UIColor whiteColor]; | |
| 44 | + [self createSubViews]; | |
| 45 | + } | |
| 46 | + return self; | |
| 47 | +} | |
| 48 | + | |
| 49 | +#pragma mark - Data | |
| 50 | +- (void)setCodeNum:(NSString *)codeNum{ | |
| 51 | + _codeNum = codeNum; | |
| 52 | +} | |
| 53 | + | |
| 54 | +#pragma mark - UI | |
| 55 | +- (void)createSubViews { | |
| 56 | + [self addSubview:self.countryName]; | |
| 57 | + [self addSubview:self.lineView]; | |
| 58 | + [self addSubview:self.countryImg]; | |
| 59 | + [self addSubview:self.countryCode]; | |
| 60 | + | |
| 61 | + [self addSubview:self.numberLabel]; | |
| 62 | + [self addSubview:self.telTF]; | |
| 63 | + | |
| 64 | + [self addSubview:self.codeLabel]; | |
| 65 | + [self addSubview:self.codeTF]; | |
| 66 | + | |
| 67 | + [self addSubview:self.verification]; | |
| 68 | + | |
| 69 | + [self addSubview:self.bindingView]; | |
| 70 | + [self addSubview:self.binding]; | |
| 71 | + | |
| 72 | +} | |
| 73 | +- (void)layoutSubviews{ | |
| 74 | + [super layoutSubviews]; | |
| 75 | + | |
| 76 | + [self.countryName mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 77 | + make.top.equalTo(self).offset(0); | |
| 78 | + make.left.equalTo(self).offset(margin); | |
| 79 | + make.height.mas_equalTo(50); | |
| 80 | + }]; | |
| 81 | + [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 82 | + make.top.equalTo(self.countryName.mas_bottom).offset(0); | |
| 83 | + make.left.right.equalTo(self).offset(0); | |
| 84 | + make.height.mas_equalTo(10); | |
| 85 | + }]; | |
| 86 | + [self.countryImg mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 87 | + make.top.equalTo(self).offset(0); | |
| 88 | + make.right.equalTo(self).offset(-margin); | |
| 89 | + make.height.mas_equalTo(50); | |
| 90 | + make.width.mas_equalTo(10); | |
| 91 | + }]; | |
| 92 | + [self.countryCode mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 93 | + make.top.equalTo(self).offset(0); | |
| 94 | + make.right.equalTo(self.countryImg.mas_left).offset(-5); | |
| 95 | + make.height.mas_equalTo(50); | |
| 96 | + }]; | |
| 97 | + [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 98 | + make.top.equalTo(self.lineView.mas_bottom).offset(0); | |
| 99 | + make.left.equalTo(self).offset(margin); | |
| 100 | + make.height.mas_equalTo(50); | |
| 101 | + }]; | |
| 102 | + [self.verification mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 103 | + make.centerY.equalTo(self.numberLabel); | |
| 104 | + make.right.equalTo(self).offset(-margin); | |
| 105 | + make.width.mas_equalTo(100); | |
| 106 | + make.height.mas_equalTo(30); | |
| 107 | + }]; | |
| 108 | + [self.telTF mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 109 | + make.centerY.equalTo(self.numberLabel); | |
| 110 | + make.left.equalTo(self.numberLabel.mas_right).offset(20); | |
| 111 | +// make.right.equalTo(self.verification.mas_left).offset(-10); | |
| 112 | + }]; | |
| 113 | + [self.codeLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 114 | + make.top.equalTo(self.numberLabel.mas_bottom).offset(0); | |
| 115 | + make.left.equalTo(self.numberLabel); | |
| 116 | +// make.width.mas_equalTo(50); | |
| 117 | + make.height.mas_equalTo(50); | |
| 118 | + | |
| 119 | + }]; | |
| 120 | + [self.codeTF mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 121 | + make.centerY.equalTo(self.codeLabel); | |
| 122 | + make.left.equalTo(self.codeLabel.mas_right).offset(20); | |
| 123 | + make.width.equalTo(self.telTF); | |
| 124 | + }]; | |
| 125 | + | |
| 126 | + [self.bindingView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 127 | + make.top.equalTo(self.codeTF.mas_bottom).offset(15); | |
| 128 | + make.left.equalTo(self).offset(0); | |
| 129 | + make.right.equalTo(self).offset(-0); | |
| 130 | + make.bottom.equalTo(self.mas_bottom).offset(-0); | |
| 131 | + }]; | |
| 132 | + | |
| 133 | + [self.binding mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 134 | + make.top.equalTo(self.codeTF.mas_bottom).offset(30); | |
| 135 | + make.left.equalTo(self).offset(60); | |
| 136 | + make.right.equalTo(self).offset(-60); | |
| 137 | + make.height.mas_equalTo(45); | |
| 138 | + }]; | |
| 139 | +} | |
| 140 | + | |
| 141 | +/* | |
| 142 | + // Only override drawRect: if you perform custom drawing. | |
| 143 | + // An empty implementation adversely affects performance during animation. | |
| 144 | + - (void)drawRect:(CGRect)rect { | |
| 145 | + // Drawing code | |
| 146 | + } | |
| 147 | + */ | |
| 148 | + | |
| 149 | +#pragma mark - UITextFieldDelegate | |
| 150 | +- (void)textFieldDidChange:(UITextField *)textField { | |
| 151 | + if (textField.tag == 10001) { //手机号 | |
| 152 | + if (!self.gotVerificationCodeIng) { | |
| 153 | + [self setupTextFieldUI:textField]; | |
| 154 | + } | |
| 155 | + } | |
| 156 | + else if (textField.tag == 10002) { //验证码 | |
| 157 | + | |
| 158 | + } | |
| 159 | + | |
| 160 | +} | |
| 161 | + | |
| 162 | +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { | |
| 163 | + if([string length] != 0){ | |
| 164 | + NSLog(@"增"); | |
| 165 | + if (textField.tag == 10002) { | |
| 166 | + if (textField.text.length>=6) { | |
| 167 | + return NO; | |
| 168 | + } | |
| 169 | + } | |
| 170 | + if (textField.tag == 10001) { | |
| 171 | + if (textField.text.length>=11) { | |
| 172 | + return NO; | |
| 173 | + } | |
| 174 | + } | |
| 175 | + } | |
| 176 | + else { | |
| 177 | + NSLog(@"删"); | |
| 178 | + return YES; | |
| 179 | + } | |
| 180 | + return YES; | |
| 181 | +} | |
| 182 | + | |
| 183 | +#pragma mark - 懒加载 | |
| 184 | +- (UILabel *)countryName { | |
| 185 | + if (!_countryName) { | |
| 186 | + _countryName = [[UILabel alloc] init]; | |
| 187 | + _countryName.textColor = [UIColor colorWithRed:26/255.0 green:26/255.0 blue:26/255.0 alpha:1.0]; | |
| 188 | + _countryName.font = UIFontCNMake(14.0); | |
| 189 | + _countryName.text = @"中国大陆"; | |
| 190 | + _countryName.textAlignment = NSTextAlignmentLeft; | |
| 191 | + } | |
| 192 | + return _countryName; | |
| 193 | +} | |
| 194 | + | |
| 195 | +- (UIView *)lineView { | |
| 196 | + if (!_lineView) { | |
| 197 | + _lineView = [[UIView alloc] init]; | |
| 198 | + _lineView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 199 | + } | |
| 200 | + return _lineView; | |
| 201 | +} | |
| 202 | + | |
| 203 | +- (UIImageView *)countryImg{ | |
| 204 | + if (!_countryImg) { | |
| 205 | + _countryImg = [[UIImageView alloc] init]; | |
| 206 | + _countryImg.userInteractionEnabled = YES; | |
| 207 | + UIImage *image = [self getImageWithImageName:@"mine_info_front" bundleName:@"CNLiveBMineModule" targetClass:[self class]]; | |
| 208 | + _countryImg.image = image; | |
| 209 | + _countryImg.contentMode = UIViewContentModeCenter; | |
| 210 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(countryTap:)]; | |
| 211 | + [_countryImg addGestureRecognizer:tap]; | |
| 212 | + } | |
| 213 | + return _countryImg; | |
| 214 | +} | |
| 215 | + | |
| 216 | +- (UILabel *)countryCode { | |
| 217 | + if (!_countryCode) { | |
| 218 | + _countryCode = [[UILabel alloc] init]; | |
| 219 | + _countryCode.textColor = [UIColor colorWithRed:26/255.0 green:26/255.0 blue:26/255.0 alpha:1.0]; | |
| 220 | + _countryCode.font = UIFontCNMake(14.0); | |
| 221 | + _countryCode.text = @"+86"; | |
| 222 | + _countryCode.textAlignment = NSTextAlignmentLeft; | |
| 223 | + _countryCode.userInteractionEnabled = YES; | |
| 224 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(countryTap:)]; | |
| 225 | + [_countryCode addGestureRecognizer:tap]; | |
| 226 | + } | |
| 227 | + return _countryCode; | |
| 228 | +} | |
| 229 | + | |
| 230 | +- (UILabel *)numberLabel { | |
| 231 | + if (!_numberLabel) { | |
| 232 | + _numberLabel = [[UILabel alloc] init]; | |
| 233 | + _numberLabel.textColor = [UIColor colorWithRed:26/255.0 green:26/255.0 blue:26/255.0 alpha:1.0]; | |
| 234 | + _numberLabel.font = UIFontCNMake(14.0); | |
| 235 | + _numberLabel.text = @"手机号"; | |
| 236 | + _numberLabel.textAlignment = NSTextAlignmentLeft; | |
| 237 | + } | |
| 238 | + return _numberLabel; | |
| 239 | +} | |
| 240 | + | |
| 241 | +- (UILabel *)codeLabel { | |
| 242 | + if (!_codeLabel) { | |
| 243 | + _codeLabel = [[UILabel alloc] init]; | |
| 244 | + _codeLabel.textColor = [UIColor colorWithRed:26/255.0 green:26/255.0 blue:26/255.0 alpha:1.0]; | |
| 245 | + _codeLabel.font = UIFontCNMake(14.0); | |
| 246 | + _codeLabel.text = @"验证码"; | |
| 247 | + _codeLabel.textAlignment = NSTextAlignmentLeft; | |
| 248 | + } | |
| 249 | + return _codeLabel; | |
| 250 | +} | |
| 251 | + | |
| 252 | +- (UITextField *)telTF { | |
| 253 | + if (!_telTF) { | |
| 254 | + _telTF = [[UITextField alloc] init]; | |
| 255 | + _telTF.textColor = [UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1.0]; | |
| 256 | + _telTF.font = UIFontCNMake(14.0); | |
| 257 | + _telTF.placeholder = @"请输入新手机号"; | |
| 258 | + _telTF.delegate = self; | |
| 259 | + _telTF.keyboardType = UIKeyboardTypeNumberPad; | |
| 260 | + [_telTF addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; | |
| 261 | + _telTF.tag = 10001; | |
| 262 | + } | |
| 263 | + return _telTF; | |
| 264 | +} | |
| 265 | + | |
| 266 | +- (UITextField *)codeTF { | |
| 267 | + if (!_codeTF) { | |
| 268 | + _codeTF = [[UITextField alloc] init]; | |
| 269 | + _codeTF.textColor = [UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1.0]; | |
| 270 | + _codeTF.font = UIFontCNMake(14.0); | |
| 271 | + _codeTF.placeholder = @"请输入验证码"; | |
| 272 | + _codeTF.delegate = self; | |
| 273 | + _codeTF.keyboardType = UIKeyboardTypeNumberPad; | |
| 274 | + [_codeTF addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; | |
| 275 | + _codeTF.tag = 10002; | |
| 276 | + } | |
| 277 | + return _codeTF; | |
| 278 | +} | |
| 279 | + | |
| 280 | +- (UIButton *)verification{ | |
| 281 | + if (!_verification) { | |
| 282 | + _verification = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 283 | + [_verification setTitle:@"获取验证码" forState:UIControlStateNormal]; | |
| 284 | + [_verification setTitleColor:[UIColor colorWithRed:195/255.0 green:195/255.0 blue:195/255.0 alpha:1.0] forState:UIControlStateNormal]; | |
| 285 | + _verification.titleLabel.font = [UIFont systemFontOfSize:14.0]; | |
| 286 | + _verification.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 287 | + _verification.layer.cornerRadius = 15; | |
| 288 | + _verification.layer.masksToBounds = YES; | |
| 289 | + [_verification addTarget:self action:@selector(verificationDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
| 290 | + } | |
| 291 | + return _verification; | |
| 292 | +} | |
| 293 | + | |
| 294 | +- (UIView *)bindingView{ | |
| 295 | + if (!_bindingView) { | |
| 296 | + _bindingView = [[UIView alloc]init]; | |
| 297 | + _bindingView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 298 | + } | |
| 299 | + return _bindingView; | |
| 300 | +} | |
| 301 | + | |
| 302 | +- (UIButton *)binding{ | |
| 303 | + if (!_binding) { | |
| 304 | + _binding = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 305 | + [_binding setTitle:@"验证后绑定新手机号" forState:UIControlStateNormal]; | |
| 306 | + [_binding setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
| 307 | + _binding.titleLabel.font = UIFontCNMake(15.0); | |
| 308 | + _binding.backgroundColor = [UIColor colorWithRed:0/255.0 green:194/255.0 blue:0/255.0 alpha:1.0]; | |
| 309 | + _binding.layer.cornerRadius = 45/2.0; | |
| 310 | + _binding.layer.masksToBounds = YES; | |
| 311 | + [_binding addTarget:self action:@selector(bindingDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
| 312 | + } | |
| 313 | + return _binding; | |
| 314 | + | |
| 315 | +} | |
| 316 | + | |
| 317 | +#pragma mark - 私有方法 | |
| 318 | + | |
| 319 | +#pragma mark - Action | |
| 320 | +- (void)countryTap:(UITapGestureRecognizer *)tap{ | |
| 321 | + if (self.delegate && [self.delegate respondsToSelector:@selector(selectCountry:)]) { | |
| 322 | + [self.delegate selectCountry:self]; | |
| 323 | + } | |
| 324 | +} | |
| 325 | + | |
| 326 | +- (void)verificationDidClicked:(UIButton *)sender { | |
| 327 | + if ([NSString isEmpty:self.telTF.text] || [self.telTF.text isWhitespaceAndNewlines]) { | |
| 328 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"我知道了" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 329 | + }]; | |
| 330 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"请输入正确的手机号码" message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 331 | + [alertController addAction:sure]; | |
| 332 | + | |
| 333 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 334 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 335 | + sure.buttonAttributes = titleAttributs; | |
| 336 | + | |
| 337 | + [alertController showWithAnimated:YES]; | |
| 338 | + } | |
| 339 | + else if ([self.telTF.text isEqualToString:CNUserShareModel.mobile]) { | |
| 340 | + [QMUITips showWithText:@"您更新的手机号与旧手机号一致,请重新输入确认" inView:[UIApplication sharedApplication].delegate.window hideAfterDelay:timeValue]; | |
| 341 | + } | |
| 342 | + else { | |
| 343 | + // 发送验证码 | |
| 344 | + [self.telTF resignFirstResponder]; | |
| 345 | + [self.codeTF becomeFirstResponder]; | |
| 346 | + | |
| 347 | + self.verification.userInteractionEnabled = NO; | |
| 348 | + self.verification.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 349 | + [self.verification setTitleColor:[UIColor colorWithRed:195/255.0 green:195/255.0 blue:195/255.0 alpha:1.0] forState:UIControlStateNormal]; | |
| 350 | + self.gotVerificationCodeIng = YES; | |
| 351 | + | |
| 352 | + [CNLiveUserSystemCenter verificationCodeType:VerificationCodeTypeRegister mobile:self.telTF.text countryCode:_codeNum success:^(id result) { | |
| 353 | + | |
| 354 | + [QMUITips showSucceed:@"短信发送成功" inView:[UIApplication sharedApplication].delegate.window hideAfterDelay:timeValue]; | |
| 355 | + self.gotVerificationCode = YES; | |
| 356 | + [self countDown]; | |
| 357 | + | |
| 358 | + } failure:^(NSDictionary *errorDic) { | |
| 359 | + NSString *errMsg; | |
| 360 | + if ([[NSString stringWithFormat:@"%@",errorDic[@"errorCode"]] isEqualToString:@"408"]) { | |
| 361 | + errMsg = @"请填写正确的手机号"; | |
| 362 | + } else { | |
| 363 | + errMsg = errorDic[@"errorMessage"]; | |
| 364 | + } | |
| 365 | + [QMUITips showError:errMsg inView:[UIApplication sharedApplication].delegate.window hideAfterDelay:timeValue]; | |
| 366 | + | |
| 367 | + self.gotVerificationCode = NO; | |
| 368 | + self.verification.userInteractionEnabled = YES; | |
| 369 | + self.verification.backgroundColor = [UIColor colorWithRed:0/255.0 green:194/255.0 blue:0/255.0 alpha:1.0]; | |
| 370 | + [self.verification setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
| 371 | + self.gotVerificationCodeIng = NO; | |
| 372 | + | |
| 373 | + }]; | |
| 374 | + } | |
| 375 | + | |
| 376 | +} | |
| 377 | + | |
| 378 | +- (void)bindingDidClicked:(UIButton *)sender { | |
| 379 | + if (self.gotVerificationCode) { | |
| 380 | + if (self.codeTF.text.length == 6) { | |
| 381 | + [QMUITips showLoadingInView:self]; | |
| 382 | + [CNLiveUserSystemCenter updateMobileWithUid:CNUserShareModel.uid mobile:self.telTF.text countryCode:_codeNum verificationCode:self.codeTF.text success:^(id result) { | |
| 383 | + CNUserShareModel.mobile = self.telTF.text; | |
| 384 | + [CNUserInfoModel setLocalUserInfo:self.countryName.text withKey:@"countryname"]; | |
| 385 | + [CNUserInfoModel setLocalUserInfo:self.countryCode.text withKey:@"countrycode"]; | |
| 386 | + [QMUITips hideAllToastInView:self animated:YES]; | |
| 387 | + if (self.delegate && [self.delegate respondsToSelector:@selector(bindingSuccess:)]) { | |
| 388 | + [self.delegate bindingSuccess:self]; | |
| 389 | + } | |
| 390 | + | |
| 391 | + } failure:^(NSDictionary *errorDic) { | |
| 392 | + [QMUITips hideAllToastInView:self animated:YES]; | |
| 393 | + [QMUITips showError:errorDic[@"errorMessage"] inView:[UIApplication sharedApplication].delegate.window hideAfterDelay:timeValue]; | |
| 394 | + | |
| 395 | + }]; | |
| 396 | + | |
| 397 | + } else { | |
| 398 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"我知道了" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 399 | + }]; | |
| 400 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"请输入正确的验证码" message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 401 | + [alertController addAction:sure]; | |
| 402 | + | |
| 403 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 404 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 405 | + sure.buttonAttributes = titleAttributs; | |
| 406 | + | |
| 407 | + [alertController showWithAnimated:YES]; | |
| 408 | + } | |
| 409 | + | |
| 410 | + } else { | |
| 411 | + NSString *alertText = @"请先获取验证码"; | |
| 412 | + if (self.telTF.text.length != 11) { | |
| 413 | + alertText = @"请先输入正确的手机号码"; | |
| 414 | + } else { | |
| 415 | + alertText = @"请先获取验证码"; | |
| 416 | + } | |
| 417 | + | |
| 418 | + QMUIAlertAction *sure = [QMUIAlertAction actionWithTitle:@"我知道了" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 419 | + }]; | |
| 420 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:alertText message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; | |
| 421 | + [alertController addAction:sure]; | |
| 422 | + | |
| 423 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 424 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 425 | + sure.buttonAttributes = titleAttributs; | |
| 426 | + | |
| 427 | + [alertController showWithAnimated:YES]; | |
| 428 | + | |
| 429 | + } | |
| 430 | + | |
| 431 | +} | |
| 432 | + | |
| 433 | +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { | |
| 434 | + [self.telTF resignFirstResponder]; | |
| 435 | +} | |
| 436 | + | |
| 437 | +#pragma mark - 倒计时 | |
| 438 | +- (void)countDown { | |
| 439 | + __block NSInteger second = TIMECOUNT; | |
| 440 | + //(1) | |
| 441 | + dispatch_queue_t quene = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
| 442 | + //(2) | |
| 443 | + dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, quene); | |
| 444 | + //(3) | |
| 445 | + dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC, 0 * NSEC_PER_SEC); | |
| 446 | + //(4) | |
| 447 | + dispatch_source_set_event_handler(timer, ^{ | |
| 448 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 449 | + if (second == 0) { | |
| 450 | + [self setupTextFieldUI:self.telTF]; | |
| 451 | + self.gotVerificationCodeIng = NO; | |
| 452 | + [self.verification setTitle:[NSString stringWithFormat:@"获取验证码"] forState:UIControlStateNormal]; | |
| 453 | + second = TIMECOUNT; | |
| 454 | + dispatch_cancel(timer); | |
| 455 | + } else { | |
| 456 | + [self.verification setTitle:[NSString stringWithFormat:@"%lds",second] forState:UIControlStateNormal]; | |
| 457 | + second--; | |
| 458 | + } | |
| 459 | + }); | |
| 460 | + }); | |
| 461 | + //(5) | |
| 462 | + dispatch_resume(timer); | |
| 463 | +} | |
| 464 | + | |
| 465 | +- (void)setupTextFieldUI:(UITextField *)textField{ | |
| 466 | + if (textField.text.length > 0) { | |
| 467 | + _verification.userInteractionEnabled = YES; | |
| 468 | + _verification.backgroundColor = [UIColor colorWithRed:0/255.0 green:194/255.0 blue:0/255.0 alpha:1.0]; | |
| 469 | + [_verification setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
| 470 | + } | |
| 471 | + else { | |
| 472 | + _verification.userInteractionEnabled = NO; | |
| 473 | + _verification.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 474 | + [_verification setTitleColor:[UIColor colorWithRed:195/255.0 green:195/255.0 blue:195/255.0 alpha:1.0] forState:UIControlStateNormal]; | |
| 475 | + } | |
| 476 | +} | |
| 477 | + | |
| 478 | +@end | |
| 479 | + | ... | ... |
CNLiveBMineModule/Classes/Setting/View/CNLiveSettingCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSettingCell.h | |
| 3 | +// CNLiveBMineModule | |
| 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 CNLiveSettingModel; | |
| 13 | +static NSString * const kCNLiveSettingCell = @"CNLiveSettingCell"; | |
| 14 | + | |
| 15 | +@interface CNLiveSettingCell : UITableViewCell | |
| 16 | + | |
| 17 | +@property (nonatomic, strong) CNLiveSettingModel *model; | |
| 18 | +@property (nonatomic, strong) UIColor *lineColor; | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/Setting/View/CNLiveSettingCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveSettingCell.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/9/6. | |
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveSettingCell.h" | |
| 10 | +#import <Masonry/Masonry.h> | |
| 11 | +#import "CNLiveCategory.h" | |
| 12 | +#import "CNLiveBaseKit.h" | |
| 13 | + | |
| 14 | +#import "CNLiveSettingModel.h" | |
| 15 | + | |
| 16 | +@interface CNLiveSettingCell() | |
| 17 | +@property (nonatomic, strong) UIView *line; | |
| 18 | +@property (nonatomic, strong) UILabel *title; | |
| 19 | +@property (nonatomic, strong) UILabel *content; | |
| 20 | +@property (nonatomic, strong) UIImageView *front; | |
| 21 | + | |
| 22 | +@end | |
| 23 | + | |
| 24 | +@implementation CNLiveSettingCell | |
| 25 | +static const NSInteger margin = 12; | |
| 26 | + | |
| 27 | +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
| 28 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 29 | + if (self) { | |
| 30 | + self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 31 | + | |
| 32 | + [self.contentView addSubview:self.line]; | |
| 33 | + [self.contentView addSubview:self.title]; | |
| 34 | + [self.contentView addSubview:self.content]; | |
| 35 | + [self.contentView addSubview:self.front]; | |
| 36 | + | |
| 37 | + } | |
| 38 | + return self; | |
| 39 | +} | |
| 40 | +- (void)setModel:(CNLiveSettingModel *)model{ | |
| 41 | + _model = model; | |
| 42 | + _title.text = model.title; | |
| 43 | + _content.text = model.content; | |
| 44 | + [self xw_layoutSubviews]; | |
| 45 | +} | |
| 46 | + | |
| 47 | +- (void)xw_layoutSubviews{ | |
| 48 | + _title.font = UIFontCNMake(16.0); | |
| 49 | + _content.font = UIFontCNMake(14.0); | |
| 50 | + | |
| 51 | + [_line mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 52 | + make.left.equalTo(self.contentView.mas_left).with.offset(0); | |
| 53 | + make.right.equalTo(self.contentView.mas_right).with.offset(0); | |
| 54 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | |
| 55 | + make.height.offset(self.model.lineHeight); | |
| 56 | + | |
| 57 | + }]; | |
| 58 | + | |
| 59 | + [_title mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 60 | + make.left.equalTo(self.line.mas_left).with.offset(margin); | |
| 61 | + make.top.equalTo(self.line.mas_bottom).with.offset(0); | |
| 62 | + make.height.offset(self.model.height-self.model.lineHeight); | |
| 63 | + | |
| 64 | + }]; | |
| 65 | + | |
| 66 | + [_front mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 67 | + make.right.equalTo(self.line.mas_right).with.offset(-margin); | |
| 68 | + make.top.equalTo(self.title.mas_top).with.offset(0); | |
| 69 | + make.width.with.offset(margin); | |
| 70 | + make.height.equalTo(self.title.mas_height); | |
| 71 | + | |
| 72 | + }]; | |
| 73 | + | |
| 74 | + switch (self.model.type) { | |
| 75 | + case CNLiveSettingModelTypeTextFront: | |
| 76 | + { | |
| 77 | + _front.hidden = NO; | |
| 78 | + _content.hidden = NO; | |
| 79 | + [_content mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 80 | + make.top.equalTo(self.title.mas_top).with.offset(0); | |
| 81 | + make.left.equalTo(self.title.mas_right).with.offset(0); | |
| 82 | + make.right.equalTo(self.front.mas_left).with.offset(-margin); | |
| 83 | + make.height.equalTo(self.title.mas_height); | |
| 84 | + | |
| 85 | + }]; | |
| 86 | + } | |
| 87 | + break; | |
| 88 | + case CNLiveSettingModelTypeText: | |
| 89 | + { | |
| 90 | + _front.hidden = YES; | |
| 91 | + _content.hidden = NO; | |
| 92 | + [_content mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 93 | + make.top.equalTo(self.title.mas_top).with.offset(0); | |
| 94 | + make.left.equalTo(self.title.mas_right).with.offset(0); | |
| 95 | + make.right.equalTo(self.mas_right).with.offset(-margin); | |
| 96 | + make.height.equalTo(self.title.mas_height); | |
| 97 | + | |
| 98 | + }]; | |
| 99 | + } | |
| 100 | + break; | |
| 101 | + | |
| 102 | + default: | |
| 103 | + { | |
| 104 | + _front.hidden = NO; | |
| 105 | + _content.hidden = YES; | |
| 106 | + | |
| 107 | + } | |
| 108 | + break; | |
| 109 | + } | |
| 110 | + | |
| 111 | +} | |
| 112 | +- (void)setLineColor:(UIColor *)lineColor{ | |
| 113 | + _lineColor = lineColor; | |
| 114 | + _line.backgroundColor = lineColor; | |
| 115 | +} | |
| 116 | +- (void)awakeFromNib { | |
| 117 | + [super awakeFromNib]; | |
| 118 | + // Initialization code | |
| 119 | +} | |
| 120 | + | |
| 121 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 122 | + [super setSelected:selected animated:animated]; | |
| 123 | + | |
| 124 | + // Configure the view for the selected state | |
| 125 | +} | |
| 126 | + | |
| 127 | +#pragma mark - 响应方法 | |
| 128 | + | |
| 129 | +#pragma mark - 懒加载 | |
| 130 | +- (UIView *)line { | |
| 131 | + if (!_line) { | |
| 132 | + _line = [[UIView alloc] init]; | |
| 133 | + _line.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 134 | + } | |
| 135 | + return _line; | |
| 136 | +} | |
| 137 | + | |
| 138 | +- (UILabel *)title { | |
| 139 | + if (!_title) { | |
| 140 | + _title = [[UILabel alloc] init]; | |
| 141 | + _title.numberOfLines = 1; | |
| 142 | + _title.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 143 | + _title.font = UIFontCNMake(16.0); | |
| 144 | + } | |
| 145 | + return _title; | |
| 146 | +} | |
| 147 | + | |
| 148 | +- (UILabel *)content { | |
| 149 | + if (!_content) { | |
| 150 | + _content = [[UILabel alloc] init]; | |
| 151 | + _content.numberOfLines = 1; | |
| 152 | + _content.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 153 | + _content.textColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0]; | |
| 154 | + _content.font = UIFontCNMake(14.0); | |
| 155 | + } | |
| 156 | + return _content; | |
| 157 | +} | |
| 158 | + | |
| 159 | +- (UIImageView *)front { | |
| 160 | + if (!_front) { | |
| 161 | + _front = [[UIImageView alloc] init]; | |
| 162 | + UIImage *xw_image = [self getImageWithImageName:@"mine_into" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveSettingCell class]]; | |
| 163 | + _front.image = xw_image; | |
| 164 | + _front.contentMode = UIViewContentModeCenter; | |
| 165 | + } | |
| 166 | + return _front; | |
| 167 | +} | |
| 168 | + | |
| 169 | +@end | |
| 170 | + | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveInfoUpdateCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveInfoUpdateCell.m | |
| 3 | +// CNLiveBMineModule | |
| 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 <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +static NSString * const kCNLiveInfoUpdateCell = @"CNLiveInfoUpdateCell"; | |
| 13 | + | |
| 14 | +@interface CNLiveInfoUpdateCell : UITableViewCell | |
| 15 | +@property (nonatomic, copy) NSString *text; | |
| 16 | +@property (nonatomic, assign) BOOL isShow; | |
| 17 | + | |
| 18 | +@end | |
| 19 | + | |
| 20 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveInfoUpdateCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveInfoUpdateCell.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveInfoUpdateCell.h" | |
| 10 | +#import <Masonry/Masonry.h> | |
| 11 | +#import <SDWebImage/SDWebImage.h> | |
| 12 | +#import "CNLiveUserInfoModel.h" | |
| 13 | +#import "CNLiveCategory.h" | |
| 14 | + | |
| 15 | +@interface CNLiveInfoUpdateCell() | |
| 16 | +@property (nonatomic, strong) UIView *line; | |
| 17 | +@property (nonatomic, strong) UILabel *title; | |
| 18 | + | |
| 19 | +@property (nonatomic, strong) UIImageView *pic; | |
| 20 | + | |
| 21 | +@end | |
| 22 | + | |
| 23 | +@implementation CNLiveInfoUpdateCell | |
| 24 | +static const NSInteger margin = 12; | |
| 25 | + | |
| 26 | +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
| 27 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 28 | + if (self) { | |
| 29 | + self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 30 | + | |
| 31 | + [self.contentView addSubview:self.title]; | |
| 32 | + [self.contentView addSubview:self.pic]; | |
| 33 | + [self.contentView addSubview:self.line]; | |
| 34 | + | |
| 35 | + [self xw_layoutSubviews]; | |
| 36 | + | |
| 37 | + } | |
| 38 | + return self; | |
| 39 | +} | |
| 40 | + | |
| 41 | +- (void)xw_layoutSubviews{ | |
| 42 | + | |
| 43 | + [_title mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 44 | + make.left.equalTo(self.contentView.mas_left).with.offset(margin); | |
| 45 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | |
| 46 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(0); | |
| 47 | + | |
| 48 | + }]; | |
| 49 | + | |
| 50 | + [_pic mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 51 | + make.right.equalTo(self.contentView.mas_right).with.offset(-margin); | |
| 52 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | |
| 53 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(0); | |
| 54 | + | |
| 55 | + }]; | |
| 56 | + | |
| 57 | + [_line mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 58 | + make.left.equalTo(self.contentView.mas_left).with.offset(0); | |
| 59 | + make.right.equalTo(self.contentView.mas_right).with.offset(-0); | |
| 60 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(0); | |
| 61 | + make.height.offset(0.5); | |
| 62 | + | |
| 63 | + }]; | |
| 64 | + | |
| 65 | + | |
| 66 | +} | |
| 67 | + | |
| 68 | +- (void)setText:(NSString *)text{ | |
| 69 | + _text = text; | |
| 70 | + _title.text = text; | |
| 71 | +} | |
| 72 | + | |
| 73 | +- (void)setIsShow:(BOOL)isShow{ | |
| 74 | + _isShow = isShow; | |
| 75 | + _pic.hidden = !isShow; | |
| 76 | +} | |
| 77 | + | |
| 78 | +- (void)awakeFromNib { | |
| 79 | + [super awakeFromNib]; | |
| 80 | + // Initialization code | |
| 81 | +} | |
| 82 | + | |
| 83 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 84 | + [super setSelected:selected animated:animated]; | |
| 85 | + | |
| 86 | + // Configure the view for the selected state | |
| 87 | +} | |
| 88 | +#pragma mark - 懒加载 | |
| 89 | +- (UIView *)line { | |
| 90 | + if (!_line) { | |
| 91 | + _line = [[UIView alloc] init]; | |
| 92 | + _line.backgroundColor = [UIColor colorWithRed:235/255.0 green:235/255.0 blue:235/255.0 alpha:1.0]; | |
| 93 | + } | |
| 94 | + return _line; | |
| 95 | +} | |
| 96 | + | |
| 97 | +- (UILabel *)title { | |
| 98 | + if (!_title) { | |
| 99 | + _title = [[UILabel alloc] init]; | |
| 100 | + _title.numberOfLines = 1; | |
| 101 | + _title.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 102 | + _title.font = [UIFont systemFontOfSize:16]; | |
| 103 | + } | |
| 104 | + return _title; | |
| 105 | +} | |
| 106 | + | |
| 107 | + | |
| 108 | +- (UIImageView *)pic { | |
| 109 | + if (!_pic) { | |
| 110 | + _pic = [[UIImageView alloc] init]; | |
| 111 | + UIImage *xw_image = [self getImageWithImageName:@"mine_update_select" bundleName:@"CNLiveBMineModule" targetClass:[self class]]; | |
| 112 | + _pic.image = xw_image; | |
| 113 | + _pic.hidden = YES; | |
| 114 | + _pic.contentMode = UIViewContentModeCenter; | |
| 115 | + | |
| 116 | + } | |
| 117 | + return _pic; | |
| 118 | +} | |
| 119 | + | |
| 120 | +@end | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveInfoUpdateController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNCommonViewController.h" | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +@class CNLiveUserInfoModel; | |
| 13 | + | |
| 14 | +@interface CNLiveInfoUpdateController : CNCommonViewController | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * @abstract 对象方法 初始化方法 | |
| 18 | + * | |
| 19 | + * @param model 模型 | |
| 20 | + */ | |
| 21 | +- (instancetype)initWithModel:(CNLiveUserInfoModel *)model; | |
| 22 | + | |
| 23 | +@end | |
| 24 | + | |
| 25 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveInfoUpdateController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveInfoUpdateController.h" | |
| 10 | +#import "QMUIKit.h" | |
| 11 | +#import <SDWebImage/SDWebImage.h> | |
| 12 | +#import <Masonry/Masonry.h> | |
| 13 | + | |
| 14 | +#import <AVFoundation/AVCaptureDevice.h> | |
| 15 | +#import <AVFoundation/AVMediaFormat.h> | |
| 16 | +#import "XFCameraController.h" | |
| 17 | +#import "TZImagePickerController.h" | |
| 18 | +#import "CNUserInfoManager.h" | |
| 19 | +#import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h> | |
| 20 | +#import <CNLiveUserSystemSDK/CNLiveUserSystemTypeDef.h> | |
| 21 | +#import "NSString+CNLiveExtension.h" | |
| 22 | +#import "NSDictionary+Safety.h" | |
| 23 | +#import "UIImage+Common.h" | |
| 24 | +#import "CNLiveManager.h" | |
| 25 | +#import "TIMAdapter.h" | |
| 26 | +#import "CommonLibrary.h" | |
| 27 | + | |
| 28 | +#import "CNLiveCategory.h" | |
| 29 | +#import "CNLiveNavigationBar.h" | |
| 30 | + | |
| 31 | +//#import "CNLiveUserInfoModel.h" | |
| 32 | +#import "CNLiveUserInfoNotification.h" | |
| 33 | +#import "CNLiveInfoUpdateCell.h" | |
| 34 | + | |
| 35 | +@interface CNLiveInfoUpdateController ()<UITextFieldDelegate,UITextViewDelegate,QMUIAlertControllerDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,TZImagePickerControllerDelegate,UITableViewDelegate,UITableViewDataSource>{ | |
| 36 | + UIImage *_image; | |
| 37 | +} | |
| 38 | +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar; | |
| 39 | +@property (nonatomic, strong) CNLiveUserInfoModel *model; | |
| 40 | + | |
| 41 | +@property (nonatomic, strong) UIView *contentView; | |
| 42 | + | |
| 43 | +// 头像 | |
| 44 | +@property (nonatomic, strong) UIImageView *imageView; | |
| 45 | + | |
| 46 | +// 昵称/地址 | |
| 47 | +@property (nonatomic, strong) UITextField *textField; | |
| 48 | + | |
| 49 | +// 个性签名 | |
| 50 | +@property (nonatomic, strong) UITextView *textView; | |
| 51 | +@property (nonatomic, strong) UILabel *textNum; | |
| 52 | + | |
| 53 | +// 性别 | |
| 54 | +@property (nonatomic, strong) UITableView *tableView; | |
| 55 | +@property (nonatomic, strong) NSString *gender; | |
| 56 | + | |
| 57 | +@end | |
| 58 | + | |
| 59 | +@implementation CNLiveInfoUpdateController | |
| 60 | + | |
| 61 | +#define _locMaxLength 12 | |
| 62 | +#define _nickMaxLength 20 | |
| 63 | +#define MAX_LIMIT_NUMS 30 | |
| 64 | + | |
| 65 | +static const NSInteger margin = 15; | |
| 66 | +static const CGFloat timeValue = 1.5; | |
| 67 | + | |
| 68 | +#pragma mark - 初始化方法 | |
| 69 | +- (instancetype)initWithModel:(CNLiveUserInfoModel *)model{ | |
| 70 | + self = [super init]; | |
| 71 | + if (self) { | |
| 72 | + self.model = model; | |
| 73 | + self.gender = CNUserShareModel.gender; | |
| 74 | + } | |
| 75 | + return self; | |
| 76 | +} | |
| 77 | + | |
| 78 | +#pragma mark - 生命周期 | |
| 79 | +- (void)viewWillAppear:(BOOL)animated{ | |
| 80 | + [super viewWillAppear:animated]; | |
| 81 | + self.navigationController.navigationBarHidden = YES; | |
| 82 | +} | |
| 83 | + | |
| 84 | +- (void)viewDidLoad { | |
| 85 | + [super viewDidLoad]; | |
| 86 | + self.view.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1.0]; | |
| 87 | + if (@available(iOS 11, *)) { | |
| 88 | + } | |
| 89 | + else { | |
| 90 | + self.automaticallyAdjustsScrollViewInsets = NO; | |
| 91 | + } | |
| 92 | + [self.view addSubview:self.navigationBar]; | |
| 93 | + [self.view addSubview:self.contentView]; | |
| 94 | +} | |
| 95 | + | |
| 96 | +#pragma mark - UITextFieldDelegate | |
| 97 | +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { | |
| 98 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 99 | + self.navigationBar.right.backgroundColor = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 100 | + NSInteger maxLength = (self.model.dataType == CNLiveUserInfoDataTypeNickname) ? _nickMaxLength : _locMaxLength; | |
| 101 | + if (range.location >= maxLength) { | |
| 102 | + textField.text = [textField.text substringToIndex:maxLength]; | |
| 103 | + return NO; | |
| 104 | + } | |
| 105 | + return YES; | |
| 106 | +} | |
| 107 | + | |
| 108 | +- (BOOL)textFieldShouldReturn:(UITextField *)textField { | |
| 109 | + switch (self.model.dataType) { | |
| 110 | + case CNLiveUserInfoDataTypeNickname: | |
| 111 | + { | |
| 112 | + [self requestUpdateUserNickname]; | |
| 113 | + } | |
| 114 | + break; | |
| 115 | + case CNLiveUserInfoDataTypeAddress: | |
| 116 | + { | |
| 117 | + [self requestUpdateUserAddress]; | |
| 118 | + } | |
| 119 | + break; | |
| 120 | + | |
| 121 | + default: | |
| 122 | + break; | |
| 123 | + } | |
| 124 | + return YES; | |
| 125 | +} | |
| 126 | + | |
| 127 | +#pragma mark - UITextViewDelegate | |
| 128 | +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { | |
| 129 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 130 | + self.navigationBar.right.backgroundColor = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 131 | + | |
| 132 | + if([text length] != 0) { | |
| 133 | + NSLog(@"增"); | |
| 134 | + if ([[text removeNewLine] length] == 0) { //换行 | |
| 135 | + return NO; | |
| 136 | + } | |
| 137 | + } | |
| 138 | + else { | |
| 139 | + NSLog(@"删"); | |
| 140 | + return YES; | |
| 141 | + } | |
| 142 | + NSLog(@"%lu",(unsigned long)textView.text.length); | |
| 143 | + | |
| 144 | + UITextRange *selectedRange = [textView markedTextRange]; //获取高亮部分 | |
| 145 | + UITextPosition *pos = [textView positionFromPosition:selectedRange.start offset:0]; | |
| 146 | + NSString *selectedtext = [textView textInRange:selectedRange]; //获取高亮部分内容 | |
| 147 | + | |
| 148 | + //如果有高亮且当前字数开始位置小于最大限制时允许输入 | |
| 149 | + if (selectedRange && pos) { | |
| 150 | + NSInteger startOffset = [textView offsetFromPosition:textView.beginningOfDocument toPosition:selectedRange.start]; | |
| 151 | + NSInteger endOffset = [textView offsetFromPosition:textView.beginningOfDocument toPosition:selectedRange.end]; | |
| 152 | + NSRange offsetRange = NSMakeRange(startOffset, endOffset - startOffset); | |
| 153 | + | |
| 154 | + if (offsetRange.location < MAX_LIMIT_NUMS && offsetRange.location+selectedtext.length <= MAX_LIMIT_NUMS && offsetRange.location+text.length <= MAX_LIMIT_NUMS) { | |
| 155 | + return YES; | |
| 156 | + } | |
| 157 | + else { | |
| 158 | + return NO; | |
| 159 | + } | |
| 160 | + } | |
| 161 | + | |
| 162 | + NSString *comcatstr = [textView.text stringByReplacingCharactersInRange:range withString:text];//拼上 | |
| 163 | + NSInteger caninputlen = MAX_LIMIT_NUMS - comcatstr.length;//最大减全拼上(拼后剩/超) | |
| 164 | + if (caninputlen >= 0) { | |
| 165 | + return YES; | |
| 166 | + } | |
| 167 | + else { | |
| 168 | + NSInteger len = text.length + caninputlen; //原本剩余的空间 | |
| 169 | + //防止当text.length + caninputlen < 0时,使得rg.length为一个非法最大正数出错 | |
| 170 | + NSRange rg = {0,MAX(len,0)}; | |
| 171 | + | |
| 172 | + if (rg.length > 0) { | |
| 173 | + NSString *s = @"";//正确待拼text | |
| 174 | + //判断是否只普通的字符或asc码(对于中文和表情返回NO) | |
| 175 | + BOOL asc = [text canBeConvertedToEncoding:NSASCIIStringEncoding]; | |
| 176 | + if (asc) { | |
| 177 | + s = [text substringWithRange:rg];//因为是ascii码直接取就可以了不会错 | |
| 178 | + } | |
| 179 | + else { | |
| 180 | + __block NSInteger idx = 0; | |
| 181 | + __block NSString *trimString = @"";//截取出的字串 | |
| 182 | + //使用字符串遍历,这个方法能准确知道每个emoji是占一个unicode还是两个 | |
| 183 | + [text enumerateSubstringsInRange:NSMakeRange(0, [text length]) | |
| 184 | + options:NSStringEnumerationByComposedCharacterSequences | |
| 185 | + usingBlock: ^(NSString* substring, NSRange substringRange, NSRange enclosingRange, BOOL* stop) { | |
| 186 | + | |
| 187 | + NSInteger steplen = substring.length; | |
| 188 | + if (steplen>rg.length) { | |
| 189 | + *stop = YES; //取出所需要就break,提高效率 | |
| 190 | + return ; | |
| 191 | + } | |
| 192 | + if (idx >= rg.length) { | |
| 193 | + *stop = YES; //取出所需要就break,提高效率 | |
| 194 | + return ; | |
| 195 | + } | |
| 196 | + | |
| 197 | + trimString = [trimString stringByAppendingString:substring]; | |
| 198 | + idx = idx + steplen;//这里变化了,使用了字串占的长度来作为步长 | |
| 199 | + }]; | |
| 200 | + | |
| 201 | + s = trimString; | |
| 202 | + } | |
| 203 | + //rang是指从当前光标处进行替换处理(注意如果执行此句后面返回的是YES会触发didchange事件) | |
| 204 | + [textView setText:[textView.text stringByReplacingCharactersInRange:range withString:s]]; | |
| 205 | + //既然是超出部分截取了,哪一定是最大限制了。 | |
| 206 | + self.textNum.text = [NSString stringWithFormat:@"%d",0]; | |
| 207 | + } | |
| 208 | + return NO; | |
| 209 | + } | |
| 210 | + | |
| 211 | +} | |
| 212 | + | |
| 213 | +- (void)textViewDidChange:(UITextView *)textView{ | |
| 214 | + NSString *nsTextContent = textView.text; //总text | |
| 215 | + NSInteger existTextNum = nsTextContent.length; //总length | |
| 216 | + | |
| 217 | + if (existTextNum > MAX_LIMIT_NUMS) { | |
| 218 | + //截取到最大位置的字符(由于超出截部分在should时被处理了所在这里这了提高效率不再判断) | |
| 219 | + NSString *s = [nsTextContent substringToIndex:MAX_LIMIT_NUMS]; | |
| 220 | + [textView setText:s]; | |
| 221 | + } | |
| 222 | + //不让显示负数 | |
| 223 | + self.textNum.text = [NSString stringWithFormat:@"%ld",MAX(0,MAX_LIMIT_NUMS - existTextNum)]; | |
| 224 | + | |
| 225 | +} | |
| 226 | + | |
| 227 | +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { | |
| 228 | + [self.view endEditing:YES]; | |
| 229 | +} | |
| 230 | +#pragma mark - UITableViewDataSource | |
| 231 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 232 | + return 2; | |
| 233 | +} | |
| 234 | + | |
| 235 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 236 | + NSArray *data = @[@"男", @"女"]; | |
| 237 | + CNLiveInfoUpdateCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveInfoUpdateCell forIndexPath:indexPath]; | |
| 238 | + cell.text = data[indexPath.row]; | |
| 239 | + if(indexPath.row == 0){ | |
| 240 | + cell.isShow = [CNUserShareModel.gender isEqualToString:@"m"]; | |
| 241 | + }else if (indexPath.row == 1){ | |
| 242 | + cell.isShow = [CNUserShareModel.gender isEqualToString:@"f"]; | |
| 243 | + } | |
| 244 | + return cell; | |
| 245 | +} | |
| 246 | + | |
| 247 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 248 | + return 50.0; | |
| 249 | +} | |
| 250 | + | |
| 251 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 252 | + [self.tableView qmui_clearsSelection]; | |
| 253 | + | |
| 254 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 255 | + self.navigationBar.right.backgroundColor = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 256 | + | |
| 257 | + CNLiveInfoUpdateCell *cell = [tableView cellForRowAtIndexPath:indexPath]; | |
| 258 | + NSArray *visibleCells = [self.tableView visibleCells]; | |
| 259 | + for (CNLiveInfoUpdateCell *visibleCell in visibleCells) { | |
| 260 | + visibleCell.isShow = NO; | |
| 261 | + } | |
| 262 | + cell.isShow = YES; | |
| 263 | + | |
| 264 | + if(indexPath.row == 0){ | |
| 265 | + self.gender = @"m"; | |
| 266 | + }else if(indexPath.row == 1){ | |
| 267 | + self.gender = @"f"; | |
| 268 | + } | |
| 269 | + | |
| 270 | +} | |
| 271 | + | |
| 272 | +- (void)didHideAlertController:(QMUIAlertController *)alertController{ | |
| 273 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 274 | + | |
| 275 | +} | |
| 276 | + | |
| 277 | +#pragma mark - 更新头像 | |
| 278 | +// 修改头像 | |
| 279 | +- (void)updateHeaderActionSheetView{ | |
| 280 | + __weak typeof(self) weakSelf = self; | |
| 281 | + QMUIAlertAction *action1 = [QMUIAlertAction actionWithTitle:@"拍照" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 282 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 283 | + if(!strongSelf) return ; | |
| 284 | + strongSelf.navigationBar.right.userInteractionEnabled = YES; | |
| 285 | + __strong typeof(strongSelf) weakSelf = strongSelf; | |
| 286 | + [CNLiveAuthorizationManager getAVAuthorizationStatus:^{ | |
| 287 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 288 | + if(!strongSelf) return ; | |
| 289 | + XFCameraController *cameraController = [[XFCameraController alloc] init]; | |
| 290 | + cameraController.isCanShootVideo = NO; | |
| 291 | + cameraController.modalPresentationStyle = UIModalPresentationFullScreen; | |
| 292 | + __weak XFCameraController *weakCameraController = cameraController; | |
| 293 | + __weak typeof(strongSelf) weakSelf = strongSelf; | |
| 294 | + cameraController.takePhotosCompletionBlock = ^(UIImage *image, NSError *error) { | |
| 295 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 296 | + if(!strongSelf) return ; | |
| 297 | + strongSelf->_image = image; | |
| 298 | + [strongSelf requestUpdateUserHeader:image]; | |
| 299 | + | |
| 300 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 301 | + [weakCameraController dismissViewControllerAnimated:YES completion:nil]; | |
| 302 | + }); | |
| 303 | + }; | |
| 304 | + [self presentViewController:cameraController animated:YES completion:nil]; | |
| 305 | + }]; | |
| 306 | + | |
| 307 | + }]; | |
| 308 | + QMUIAlertAction *action2 = [QMUIAlertAction actionWithTitle:@"从手机相册中选择" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 309 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 310 | + if(!strongSelf) return ; | |
| 311 | + strongSelf.navigationBar.right.userInteractionEnabled = YES; | |
| 312 | + __strong typeof(strongSelf) weakSelf = strongSelf; | |
| 313 | + [CNLiveAuthorizationManager getPHAuthorizationStatus:^{ | |
| 314 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 315 | + if(!strongSelf) return ; | |
| 316 | + TZImagePickerController *picker = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:strongSelf]; | |
| 317 | + picker.modalPresentationStyle = UIModalPresentationFullScreen; | |
| 318 | + picker.allowPickingVideo = NO; | |
| 319 | + picker.allowPreview = NO; | |
| 320 | + __weak typeof(strongSelf) weakSelf = strongSelf; | |
| 321 | + [picker setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { | |
| 322 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 323 | + if(!strongSelf) return ; | |
| 324 | + strongSelf->_image = [photos firstObject]; | |
| 325 | + [strongSelf requestUpdateUserHeader:[photos firstObject]]; | |
| 326 | + }]; | |
| 327 | + [strongSelf presentViewController:picker animated:YES completion:nil]; | |
| 328 | + }]; | |
| 329 | + | |
| 330 | + }]; | |
| 331 | + QMUIAlertAction *action3 = [QMUIAlertAction actionWithTitle:@"保存图片" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 332 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 333 | + if(!strongSelf) return ; | |
| 334 | + [CNLiveAuthorizationManager getPHAuthorizationStatus:^{ | |
| 335 | + UIImage *image = [strongSelf generateImage:strongSelf.imageView]; | |
| 336 | + [QMUITips showLoadingInView:strongSelf.view]; | |
| 337 | + [strongSelf saveImage:image]; | |
| 338 | + [QMUITips hideAllTipsInView:strongSelf.view]; | |
| 339 | + }]; | |
| 340 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 341 | + | |
| 342 | + }]; | |
| 343 | + QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | |
| 344 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 345 | + if(!strongSelf) return ; | |
| 346 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 347 | + | |
| 348 | + }]; | |
| 349 | + | |
| 350 | + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:QMUIAlertControllerStyleActionSheet]; | |
| 351 | + alertController.delegate = self; | |
| 352 | + [alertController addAction:action1]; | |
| 353 | + [alertController addAction:action2]; | |
| 354 | + [alertController addAction:action3]; | |
| 355 | + [alertController addAction:cancel]; | |
| 356 | + | |
| 357 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 358 | + | |
| 359 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 360 | + | |
| 361 | + NSMutableDictionary *cancelAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | |
| 362 | + cancelAttributs[NSForegroundColorAttributeName] = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 363 | + | |
| 364 | + action1.buttonAttributes = titleAttributs; | |
| 365 | + action2.buttonAttributes = titleAttributs; | |
| 366 | + action3.buttonAttributes = titleAttributs; | |
| 367 | + cancel.buttonAttributes = cancelAttributs; | |
| 368 | + | |
| 369 | + [alertController showWithAnimated:YES]; | |
| 370 | +} | |
| 371 | + | |
| 372 | +// 更新头像 | |
| 373 | +- (void)requestUpdateUserHeader:(UIImage *)image{ | |
| 374 | + // 固定方向 | |
| 375 | + image = [image fixOrientation]; | |
| 376 | + //压缩图片质量 | |
| 377 | + image = [self reduceImage:image percent:0.5]; | |
| 378 | + [QMUITips showLoading:@"修改中" inView:self.view]; | |
| 379 | + | |
| 380 | + [CNLiveUserSystemCenter uploadIconWithUid:CNUserShareModel.uid icon:image compressionQuality:0.99 success:^(id result) { | |
| 381 | + CNUserShareModel.faceUrl = result[@"data"][@"faceUrl"]; | |
| 382 | + CNUserShareModel.bigFaceUrl = result[@"data"][@"bigFaceUrl"]; | |
| 383 | + | |
| 384 | + [self.imageView sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.bigFaceUrl] placeholderImage:image completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { | |
| 385 | + }]; | |
| 386 | + | |
| 387 | + [self showSucceed:CNUserShareModel.faceUrl]; | |
| 388 | + | |
| 389 | + } failure:^(NSDictionary *errorDic) { | |
| 390 | + [self showError:errorDic[@"errorMessage"]]; | |
| 391 | + | |
| 392 | + }]; | |
| 393 | + | |
| 394 | +} | |
| 395 | + | |
| 396 | +// 压缩图片质量 | |
| 397 | +- (UIImage *)reduceImage:(UIImage *)image percent:(float)percent { | |
| 398 | + NSData *imageData = UIImageJPEGRepresentation(image, percent); | |
| 399 | + UIImage *newImage = [UIImage imageWithData:imageData]; | |
| 400 | + return newImage; | |
| 401 | +} | |
| 402 | + | |
| 403 | +// 保存图片 | |
| 404 | +- (void)saveImage:(UIImage *)image{ | |
| 405 | + if(!image){ | |
| 406 | + [QMUITips showError:@"保存失败" inView:self.view hideAfterDelay:timeValue]; | |
| 407 | + return; | |
| 408 | + } | |
| 409 | + [[PHPhotoLibrary sharedPhotoLibrary]performChanges:^{ | |
| 410 | + [PHAssetChangeRequest creationRequestForAssetFromImage:image]; | |
| 411 | + | |
| 412 | + } completionHandler:^(BOOL success, NSError * _Nullable error) { | |
| 413 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 414 | + if (success) { | |
| 415 | + [QMUITips showSucceed:@"保存成功" inView:self.view hideAfterDelay:timeValue]; | |
| 416 | + } else { | |
| 417 | + [QMUITips showError:@"保存失败" inView:self.view hideAfterDelay:timeValue]; | |
| 418 | + } | |
| 419 | + }); | |
| 420 | + | |
| 421 | + }]; | |
| 422 | +} | |
| 423 | + | |
| 424 | +// UIView转UIImage | |
| 425 | +- (UIImage *)generateImage:(UIView *)view{ | |
| 426 | + // 1.开启上下文 | |
| 427 | + UIGraphicsBeginImageContextWithOptions(view.frame.size, NO, 0.0); | |
| 428 | + // 2. 将控制器View的Layer渲染到上下文 | |
| 429 | + [view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
| 430 | + // 3.取出图片 | |
| 431 | + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| 432 | + // 4.结束上下文 | |
| 433 | + UIGraphicsEndImageContext(); | |
| 434 | + | |
| 435 | + return newImage; | |
| 436 | +} | |
| 437 | + | |
| 438 | +#pragma mark - 更新昵称 | |
| 439 | +- (void)requestUpdateUserNickname{ | |
| 440 | + NSString *text = [self.textField.text trim]; | |
| 441 | + if (text.length == 0) { | |
| 442 | + [QMUITips showError:@"没有输入名字,请重新填写" inView:self.view hideAfterDelay:timeValue]; | |
| 443 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 444 | + return; | |
| 445 | + } | |
| 446 | + if ([text isEqualToString:CNUserShareModel.nickname]) { | |
| 447 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 448 | + [self goBack]; | |
| 449 | + return; | |
| 450 | + } | |
| 451 | + | |
| 452 | + [QMUITips showLoading:@"修改中" inView:self.view]; | |
| 453 | + [CNLiveUserSystemCenter modifyUserInfoType:UserInfoTypeNickName uid:CNUserShareModel.uid modifyInfo:text success:^(id result) { | |
| 454 | + CNUserShareModel.nickname = self.textField.text; | |
| 455 | + [self showSucceed:CNUserShareModel.nickname]; | |
| 456 | + | |
| 457 | + } failure:^(NSDictionary *errorDic) { | |
| 458 | + [self showError:errorDic[@"errorMessage"]]; | |
| 459 | + | |
| 460 | + }]; | |
| 461 | + | |
| 462 | +} | |
| 463 | + | |
| 464 | +#pragma mark - 更新性别 | |
| 465 | +- (void)requestUpdateUserGender{ | |
| 466 | + if ([self.gender isEqualToString:CNUserShareModel.gender]) { | |
| 467 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 468 | + [self goBack]; | |
| 469 | + return; | |
| 470 | + } | |
| 471 | + [QMUITips showLoading:@"修改中" inView:self.view]; | |
| 472 | + [CNLiveUserSystemCenter modifyUserInfoType:UserInfoTypeGender uid:CNUserShareModel.uid modifyInfo:self.gender success:^(id result) { | |
| 473 | + CNUserShareModel.gender = self.gender; | |
| 474 | + [self showSucceed:CNUserShareModel.gender]; | |
| 475 | + | |
| 476 | + } failure:^(NSDictionary *errorDic) { | |
| 477 | + [self showError:errorDic[@"errorMessage"]]; | |
| 478 | + | |
| 479 | + }]; | |
| 480 | + | |
| 481 | +} | |
| 482 | + | |
| 483 | +#pragma mark - 更新地区 | |
| 484 | +- (void)requestUpdateUserAddress{ | |
| 485 | + NSString *text = [self.textField.text trim]; | |
| 486 | + if (text.length == 0) { | |
| 487 | + [QMUITips showError:@"请填写您的位置" inView:self.view hideAfterDelay:timeValue]; | |
| 488 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 489 | + return; | |
| 490 | + } | |
| 491 | + if ([text isEqualToString:CNUserShareModel.location]) { | |
| 492 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 493 | + [self goBack]; | |
| 494 | + return; | |
| 495 | + } | |
| 496 | + | |
| 497 | + [QMUITips showLoading:@"修改中" inView:self.view]; | |
| 498 | + [CNLiveUserSystemCenter modifyUserInfoType:UserInfoTypeLocation uid:CNUserShareModel.uid modifyInfo:text success:^(id result) { | |
| 499 | + CNUserShareModel.location = self.textField.text; | |
| 500 | + [self showSucceed:CNUserShareModel.location]; | |
| 501 | + | |
| 502 | + } failure:^(NSDictionary *errorDic) { | |
| 503 | + [self showError:errorDic[@"errorMessage"]]; | |
| 504 | + | |
| 505 | + }]; | |
| 506 | + | |
| 507 | +} | |
| 508 | + | |
| 509 | +#pragma mark - 更新个性签名 | |
| 510 | +- (void)requestUpdateUserIntroduction { | |
| 511 | + BOOL isNil = [[self.textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]length] == 0; | |
| 512 | + | |
| 513 | + if ([self.textView.text isEqualToString:CNUserShareModel.signature]) { | |
| 514 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 515 | + [self goBack]; | |
| 516 | + } | |
| 517 | + | |
| 518 | + // 签名不可以为空 | |
| 519 | + NSString *signature; | |
| 520 | + if (isNil) { | |
| 521 | + signature = @""; | |
| 522 | + } else { | |
| 523 | + signature = [self.textView.text qmui_trim]; | |
| 524 | + } | |
| 525 | + | |
| 526 | + NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:signature,@"userSign", nil]; | |
| 527 | + NSString *updateSign = CNLiveNSDictionaryDicToJson(dic); | |
| 528 | + | |
| 529 | + [QMUITips showLoading:@"修改中" inView:self.view]; | |
| 530 | + [CNLiveUserSystemCenter updateOtherInfoWithUid:CNUserShareModel.uid extInfo:updateSign success:^(id result) { | |
| 531 | + CNUserShareModel.signature = signature; | |
| 532 | + [self showSucceed:CNUserShareModel.signature]; | |
| 533 | + | |
| 534 | + } failure:^(NSDictionary *errorDic) { | |
| 535 | + [self showError:errorDic[@"errorMessage"]]; | |
| 536 | + | |
| 537 | + }]; | |
| 538 | + | |
| 539 | +} | |
| 540 | + | |
| 541 | +#pragma mark - 更新提示 | |
| 542 | +- (void)showSucceed:(NSString *)info{ | |
| 543 | + [CNLiveUserInfoNotification postUserInfoUpdateNotificationType:self.model.dataType info:info]; | |
| 544 | + | |
| 545 | + [[IMAPlatform sharedInstance].host asyncProfile]; | |
| 546 | + [QMUITips hideAllToastInView:self.view animated:YES]; | |
| 547 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 548 | + [QMUITips showSucceed:@"修改成功" inView:self.view]; | |
| 549 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeValue * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
| 550 | + [QMUITips hideAllToastInView:self.view animated:YES]; | |
| 551 | + [self goBack]; | |
| 552 | + }); | |
| 553 | + | |
| 554 | +} | |
| 555 | +- (void)showError:(NSString *)text{ | |
| 556 | + self.navigationBar.right.userInteractionEnabled = YES; | |
| 557 | + [QMUITips hideAllToastInView:self.view animated:YES]; | |
| 558 | + [QMUITips showError:text inView:self.view hideAfterDelay:timeValue]; | |
| 559 | +} | |
| 560 | + | |
| 561 | +#pragma mark - 懒加载 | |
| 562 | +- (CNLiveNavigationBar *)navigationBar { | |
| 563 | + if (!_navigationBar) { | |
| 564 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 565 | + _navigationBar.title.text = @"个人资料"; | |
| 566 | + switch (self.model.dataType) { | |
| 567 | + case CNLiveUserInfoDataTypeHeader: | |
| 568 | + { | |
| 569 | + UIImage *xw_image = [self getImageWithImageName:@"cnlive_black_more" bundleName:@"CNLiveCustomControl" targetClass:[CNLiveNavigationBar class]]; | |
| 570 | + _navigationBar.rightImage = xw_image; | |
| 571 | + } | |
| 572 | + break; | |
| 573 | + default: | |
| 574 | + { | |
| 575 | + _navigationBar.rightTitle = @"完成"; | |
| 576 | + _navigationBar.right.frame = CGRectMake(SCREEN_WIDTH-45-15, StatusBarHeight+10, 45, 24); | |
| 577 | + [_navigationBar.right setContentHorizontalAlignment:UIControlContentHorizontalAlignmentCenter]; | |
| 578 | + _navigationBar.right.backgroundColor = [UIColor lightGrayColor]; | |
| 579 | + _navigationBar.right.userInteractionEnabled = NO; | |
| 580 | + _navigationBar.right.titleLabel.font = [UIFont boldSystemFontOfSize:13]; | |
| 581 | + [_navigationBar.right setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
| 582 | + _navigationBar.right.adjustsImageWhenHighlighted = NO; | |
| 583 | + _navigationBar.right.layer.masksToBounds = YES; | |
| 584 | + _navigationBar.right.layer.cornerRadius = 5; | |
| 585 | + | |
| 586 | + } | |
| 587 | + break; | |
| 588 | + } | |
| 589 | + | |
| 590 | + __weak typeof(self) weakSelf = self; | |
| 591 | + _navigationBar.onClickLeftButton = ^{ | |
| 592 | + [weakSelf goBack]; | |
| 593 | + }; | |
| 594 | + _navigationBar.onClickRightButton = ^{ | |
| 595 | + [self.textField resignFirstResponder]; | |
| 596 | + [self.textView resignFirstResponder]; | |
| 597 | + | |
| 598 | + switch (self.model.dataType) { | |
| 599 | + case CNLiveUserInfoDataTypeHeader://头像 | |
| 600 | + { | |
| 601 | + [self updateHeaderActionSheetView]; | |
| 602 | + } | |
| 603 | + break; | |
| 604 | + case CNLiveUserInfoDataTypeNickname://昵称 | |
| 605 | + { | |
| 606 | + [self requestUpdateUserNickname]; | |
| 607 | + } | |
| 608 | + break; | |
| 609 | + case CNLiveUserInfoDataTypeGender://昵称 | |
| 610 | + { | |
| 611 | + [self requestUpdateUserGender]; | |
| 612 | + } | |
| 613 | + break; | |
| 614 | + case CNLiveUserInfoDataTypeAddress://地区 | |
| 615 | + { | |
| 616 | + [self requestUpdateUserAddress]; | |
| 617 | + } | |
| 618 | + break; | |
| 619 | + case CNLiveUserInfoDataTypeIntroduction://简介 | |
| 620 | + { | |
| 621 | + [self requestUpdateUserIntroduction]; | |
| 622 | + } | |
| 623 | + break; | |
| 624 | + | |
| 625 | + default: | |
| 626 | + break; | |
| 627 | + } | |
| 628 | + | |
| 629 | + }; | |
| 630 | + } | |
| 631 | + return _navigationBar; | |
| 632 | +} | |
| 633 | + | |
| 634 | +- (UIView *)contentView{ | |
| 635 | + if(!_contentView){ | |
| 636 | + _contentView = [[UIView alloc] initWithFrame:CGRectMake(0, NavigationContentTop+margin, SCREEN_WIDTH, 50)]; | |
| 637 | + _contentView.backgroundColor = [UIColor whiteColor]; | |
| 638 | + switch (self.model.dataType) { | |
| 639 | + case CNLiveUserInfoDataTypeHeader: | |
| 640 | + { | |
| 641 | + self.view.backgroundColor = [UIColor blackColor]; | |
| 642 | + _contentView.backgroundColor = [UIColor blackColor]; | |
| 643 | + | |
| 644 | + self.navigationBar.title.text = @"个人头像"; | |
| 645 | + [self.view addSubview:self.imageView]; | |
| 646 | + | |
| 647 | + } | |
| 648 | + break; | |
| 649 | + case CNLiveUserInfoDataTypeNickname: | |
| 650 | + { | |
| 651 | + self.navigationBar.title.text = @"设置昵称"; | |
| 652 | + | |
| 653 | + [_contentView addSubview:self.textField]; | |
| 654 | + self.textField.placeholder = @"请输入昵称"; | |
| 655 | + | |
| 656 | + self.textField.text = self.model.info; | |
| 657 | + } | |
| 658 | + break; | |
| 659 | + case CNLiveUserInfoDataTypeAddress: | |
| 660 | + { | |
| 661 | + self.navigationBar.title.text = @"设置地区"; | |
| 662 | + | |
| 663 | + [_contentView addSubview:self.textField]; | |
| 664 | + self.textField.placeholder = @"请输入你所在的地区"; | |
| 665 | + | |
| 666 | + self.textField.text = self.model.info; | |
| 667 | + } | |
| 668 | + break; | |
| 669 | + case CNLiveUserInfoDataTypeGender: | |
| 670 | + { | |
| 671 | + self.navigationBar.title.text = @"设置性别"; | |
| 672 | + [self.navigationBar.left setTitle:@"取消" forState:UIControlStateNormal]; | |
| 673 | + [self.navigationBar.left setTitleColor:[UIColor colorWithRed:30/255.0 green:30/255.0 blue:30/255.0 alpha:1.0] forState:UIControlStateNormal]; | |
| 674 | + [self.navigationBar.left setImage:nil forState:UIControlStateNormal]; | |
| 675 | + _contentView.frame = CGRectMake(0, NavigationContentTop+margin, SCREEN_WIDTH, 100); | |
| 676 | + [_contentView addSubview:self.tableView]; | |
| 677 | + } | |
| 678 | + break; | |
| 679 | + case CNLiveUserInfoDataTypeIntroduction: | |
| 680 | + { | |
| 681 | + self.navigationBar.title.text = @"设置个性签名"; | |
| 682 | + | |
| 683 | + _contentView.frame = CGRectMake(0, NavigationContentTop+margin, SCREEN_WIDTH, 120); | |
| 684 | + [_contentView addSubview:self.textView]; | |
| 685 | + self.textView.text = self.model.info; | |
| 686 | + self.textNum.text = [NSString stringWithFormat:@"%lu",MAX(0,MAX_LIMIT_NUMS - self.textView.text.length)]; | |
| 687 | + | |
| 688 | + [_contentView addSubview:self.textNum]; | |
| 689 | + [self.textNum mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 690 | + make.right.equalTo(self.textView); | |
| 691 | + make.bottom.equalTo(self.textView).offset(-margin); | |
| 692 | + }]; | |
| 693 | + } | |
| 694 | + break; | |
| 695 | + default: | |
| 696 | + { | |
| 697 | + | |
| 698 | + } | |
| 699 | + break; | |
| 700 | + } | |
| 701 | + | |
| 702 | + } | |
| 703 | + return _contentView; | |
| 704 | + | |
| 705 | +} | |
| 706 | + | |
| 707 | +- (UIImageView *)imageView{ | |
| 708 | + if(!_imageView){ | |
| 709 | + _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH)]; | |
| 710 | + _imageView.center = self.view.center; | |
| 711 | + UIImage *xw_image = [self getImageWithImageName:@"default_avatar_f" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveInfoUpdateController class]]; | |
| 712 | + [_imageView sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.bigFaceUrl?CNUserShareModel.bigFaceUrl:CNUserShareModel.faceUrl] placeholderImage:xw_image]; | |
| 713 | + } | |
| 714 | + return _imageView; | |
| 715 | +} | |
| 716 | + | |
| 717 | +- (UITextField *)textField{ | |
| 718 | + if(!_textField){ | |
| 719 | + _textField = [[UITextField alloc] initWithFrame:CGRectMake(margin, 0, SCREEN_WIDTH-2*margin, 50)]; | |
| 720 | + _textField.delegate = self; | |
| 721 | + _textField.backgroundColor = [UIColor whiteColor];// 设置背景颜色 | |
| 722 | + _textField.textColor = [UIColor blackColor]; // 设置文字的颜色 | |
| 723 | + _textField.clearsOnBeginEditing = YES; // 当第二次输入的时候,清空上一次的内容 | |
| 724 | + _textField.font = [UIFont systemFontOfSize:15.0f]; | |
| 725 | + _textField.clearButtonMode = UITextFieldViewModeWhileEditing; // 编辑的时候会显示出删除全部的小X | |
| 726 | + _textField.clearButtonMode = UITextFieldViewModeAlways; | |
| 727 | + _textField.backgroundColor = [UIColor whiteColor]; | |
| 728 | + //设置显示模式为永远显示(默认不显示) | |
| 729 | + _textField.leftViewMode = UITextFieldViewModeAlways; | |
| 730 | + _textField.returnKeyType = UIReturnKeyDone; | |
| 731 | + _textField.delegate = self; | |
| 732 | + } | |
| 733 | + return _textField; | |
| 734 | +} | |
| 735 | + | |
| 736 | +- (UITextView *)textView{ | |
| 737 | + if(!_textView){ | |
| 738 | + _textView = [[UITextView alloc] initWithFrame:CGRectMake(margin, 0, SCREEN_WIDTH-2*margin, 120)]; | |
| 739 | + _textView.delegate = self; | |
| 740 | + _textView.backgroundColor = [UIColor whiteColor];// 设置背景颜色 | |
| 741 | + _textView.textColor = [UIColor blackColor]; // 设置文字的颜色 | |
| 742 | + _textView.font = [UIFont systemFontOfSize:16.0f]; | |
| 743 | + } | |
| 744 | + return _textView; | |
| 745 | +} | |
| 746 | + | |
| 747 | +- (UILabel *)textNum { | |
| 748 | + if (!_textNum) { | |
| 749 | + _textNum = [[UILabel alloc] init]; | |
| 750 | + _textNum.textColor = [UIColor colorWithRed:206/255.0 green:206/255.0 blue:206/255.0 alpha:1.0]; | |
| 751 | + _textNum.font = [UIFont systemFontOfSize:16]; | |
| 752 | + _textNum.text = @"30"; | |
| 753 | + } | |
| 754 | + return _textNum; | |
| 755 | +} | |
| 756 | + | |
| 757 | +- (UITableView *)tableView { | |
| 758 | + if (!_tableView) { | |
| 759 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 100) style:UITableViewStylePlain]; | |
| 760 | + _tableView.delegate = self; | |
| 761 | + _tableView.dataSource = self; | |
| 762 | + _tableView.showsVerticalScrollIndicator = NO; | |
| 763 | + _tableView.showsHorizontalScrollIndicator = NO; | |
| 764 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 765 | + [_tableView registerClass:[CNLiveInfoUpdateCell class] forCellReuseIdentifier:kCNLiveInfoUpdateCell]; | |
| 766 | + _tableView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | |
| 767 | + } | |
| 768 | + return _tableView; | |
| 769 | +} | |
| 770 | + | |
| 771 | +#pragma mark - 响应方法 | |
| 772 | +- (void)goBack { | |
| 773 | + [self.textField resignFirstResponder]; | |
| 774 | + [self.textView resignFirstResponder]; | |
| 775 | + | |
| 776 | + if (self.presentingViewController != nil) { | |
| 777 | + [self dismissViewControllerAnimated:YES completion:nil]; | |
| 778 | + } | |
| 779 | + else { | |
| 780 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 781 | + } | |
| 782 | +} | |
| 783 | + | |
| 784 | +@end | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUserInfoCell.m | |
| 3 | +// CNLiveBMineModule | |
| 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 <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +@class CNLiveUserInfoModel; | |
| 13 | +static NSString * const kCNLiveUserInfoCell = @"CNLiveUserInfoCell"; | |
| 14 | + | |
| 15 | +@interface CNLiveUserInfoCell : UITableViewCell | |
| 16 | + | |
| 17 | +@property (nonatomic, strong) CNLiveUserInfoModel *model; | |
| 18 | +@property (nonatomic, strong) UIImage *image; | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUserInfoCell.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveUserInfoCell.h" | |
| 10 | +#import <Masonry/Masonry.h> | |
| 11 | +#import <SDWebImage/SDWebImage.h> | |
| 12 | +#import "CNLiveUserInfoModel.h" | |
| 13 | +#import "CNLiveCategory.h" | |
| 14 | + | |
| 15 | +@interface CNLiveUserInfoCell() | |
| 16 | +@property (nonatomic, strong) UIView *line; | |
| 17 | +@property (nonatomic, strong) UILabel *title; | |
| 18 | +@property (nonatomic, strong) UILabel *content; | |
| 19 | +@property (nonatomic, strong) UIImageView *front; | |
| 20 | +@property (nonatomic, strong) UIImageView *pic; | |
| 21 | + | |
| 22 | +@end | |
| 23 | + | |
| 24 | +@implementation CNLiveUserInfoCell | |
| 25 | +static const NSInteger margin = 12; | |
| 26 | + | |
| 27 | +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
| 28 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 29 | + if (self) { | |
| 30 | + self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 31 | + | |
| 32 | + [self.contentView addSubview:self.line]; | |
| 33 | + [self.contentView addSubview:self.title]; | |
| 34 | + [self.contentView addSubview:self.content]; | |
| 35 | + [self.contentView addSubview:self.front]; | |
| 36 | + [self.contentView addSubview:self.pic]; | |
| 37 | + | |
| 38 | + } | |
| 39 | + return self; | |
| 40 | +} | |
| 41 | + | |
| 42 | +- (void)setImage:(UIImage *)image{ | |
| 43 | + _image = image; | |
| 44 | + if(self.model.dataType == CNLiveUserInfoDataTypeHeader){ | |
| 45 | + _pic.image = image; | |
| 46 | + } | |
| 47 | +} | |
| 48 | + | |
| 49 | +- (void)setModel:(CNLiveUserInfoModel *)model{ | |
| 50 | + _model = model; | |
| 51 | + _title.text = model.title; | |
| 52 | + | |
| 53 | + _content.text = model.info; | |
| 54 | + | |
| 55 | + if(model.dataType == CNLiveUserInfoDataTypeHeader){ | |
| 56 | + _pic.backgroundColor = [UIColor whiteColor]; | |
| 57 | + _pic.contentMode = UIViewContentModeScaleToFill; | |
| 58 | + _pic.layer.masksToBounds = YES; | |
| 59 | + _pic.layer.cornerRadius = 5.0; | |
| 60 | + UIImage *xw_image = [self getImageWithImageName:@"default_avatar_y" bundleName:@"CNLiveBMineModule" targetClass:[self class]]; | |
| 61 | + [_pic sd_setImageWithURL:[NSURL URLWithString:model.info] placeholderImage:xw_image]; | |
| 62 | + | |
| 63 | + }else if (model.dataType == CNLiveUserInfoDataTypeNickname){ | |
| 64 | + | |
| 65 | + | |
| 66 | + }else if (model.dataType == CNLiveUserInfoDataTypeGender){ | |
| 67 | + if([model.info isEqualToString:@"m"]){ | |
| 68 | + _content.text = @"男"; | |
| 69 | + }else if([model.info isEqualToString:@"f"]){ | |
| 70 | + _content.text = @"女"; | |
| 71 | + }else{ | |
| 72 | + _content.text = @"未知"; | |
| 73 | + } | |
| 74 | + | |
| 75 | + }else if (model.dataType == CNLiveUserInfoDataTypeCode){ | |
| 76 | + | |
| 77 | + }else if (model.dataType == CNLiveUserInfoDataTypeAddress){ | |
| 78 | + | |
| 79 | + }else if (model.dataType == CNLiveUserInfoDataTypeIntroduction){ | |
| 80 | + | |
| 81 | + } | |
| 82 | + | |
| 83 | + [self xw_layoutSubviews]; | |
| 84 | +} | |
| 85 | + | |
| 86 | +- (void)xw_layoutSubviews{ | |
| 87 | + | |
| 88 | + CGFloat line_margin = self.model.lineHeight >= 5?0:margin; | |
| 89 | + | |
| 90 | + [_line mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 91 | + make.left.equalTo(self.contentView.mas_left).with.offset(line_margin); | |
| 92 | + make.right.equalTo(self.contentView.mas_right).with.offset(-line_margin); | |
| 93 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(0); | |
| 94 | + make.height.offset(self.model.lineHeight); | |
| 95 | + | |
| 96 | + }]; | |
| 97 | + | |
| 98 | + [_title mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 99 | + make.left.equalTo(self.contentView.mas_left).with.offset(margin); | |
| 100 | + make.top.equalTo(self.contentView.mas_top).with.offset(0); | |
| 101 | + make.height.offset(self.model.height-self.model.lineHeight); | |
| 102 | + | |
| 103 | + }]; | |
| 104 | + | |
| 105 | + [_front mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 106 | + make.right.equalTo(self.contentView.mas_right).with.offset(-margin); | |
| 107 | + make.top.equalTo(self.title.mas_top).with.offset(0); | |
| 108 | + make.width.with.offset(margin); | |
| 109 | + make.height.equalTo(self.title.mas_height); | |
| 110 | + | |
| 111 | + }]; | |
| 112 | + | |
| 113 | + switch (self.model.layoutType) { | |
| 114 | + case CNLiveUserInfoLayoutTypeText: | |
| 115 | + { | |
| 116 | + _content.hidden = NO; | |
| 117 | + _pic.hidden = YES; | |
| 118 | + [_content mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 119 | + make.top.equalTo(self.title.mas_top).with.offset(0); | |
| 120 | + make.left.equalTo(self.title.mas_right).with.offset(margin); | |
| 121 | + make.right.equalTo(self.front.mas_left).with.offset(-margin); | |
| 122 | + make.height.equalTo(self.title.mas_height); | |
| 123 | + | |
| 124 | + }]; | |
| 125 | + } | |
| 126 | + break; | |
| 127 | + case CNLiveUserInfoLayoutTypeImage: | |
| 128 | + { | |
| 129 | + CGFloat height = self.model.height-self.model.lineHeight-2*margin; | |
| 130 | + _content.hidden = YES; | |
| 131 | + _pic.hidden = NO; | |
| 132 | + [_pic mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 133 | + make.top.equalTo(self.contentView.mas_top).with.offset(margin); | |
| 134 | + make.right.equalTo(self.front.mas_left).with.offset(-margin); | |
| 135 | + make.width.height.offset(height); | |
| 136 | + | |
| 137 | + }]; | |
| 138 | + | |
| 139 | + } | |
| 140 | + break; | |
| 141 | + | |
| 142 | + default: | |
| 143 | + { | |
| 144 | + _content.hidden = YES; | |
| 145 | + _pic.hidden = YES; | |
| 146 | + | |
| 147 | + } | |
| 148 | + break; | |
| 149 | + } | |
| 150 | + | |
| 151 | +} | |
| 152 | +- (void)awakeFromNib { | |
| 153 | + [super awakeFromNib]; | |
| 154 | + // Initialization code | |
| 155 | +} | |
| 156 | + | |
| 157 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 158 | + [super setSelected:selected animated:animated]; | |
| 159 | + | |
| 160 | + // Configure the view for the selected state | |
| 161 | +} | |
| 162 | +#pragma mark - 懒加载 | |
| 163 | +- (UIView *)line { | |
| 164 | + if (!_line) { | |
| 165 | + _line = [[UIView alloc] init]; | |
| 166 | + _line.backgroundColor = [UIColor colorWithRed:235/255.0 green:235/255.0 blue:235/255.0 alpha:1.0]; | |
| 167 | + } | |
| 168 | + return _line; | |
| 169 | +} | |
| 170 | + | |
| 171 | +- (UILabel *)title { | |
| 172 | + if (!_title) { | |
| 173 | + _title = [[UILabel alloc] init]; | |
| 174 | + _title.numberOfLines = 1; | |
| 175 | + _title.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | |
| 176 | + _title.font = [UIFont systemFontOfSize:16]; | |
| 177 | + } | |
| 178 | + return _title; | |
| 179 | +} | |
| 180 | + | |
| 181 | +- (UILabel *)content { | |
| 182 | + if (!_content) { | |
| 183 | + _content = [[UILabel alloc] init]; | |
| 184 | + _content.numberOfLines = 1; | |
| 185 | + _content.lineBreakMode = NSLineBreakByTruncatingTail; | |
| 186 | + _content.textColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0]; | |
| 187 | + _content.font = [UIFont systemFontOfSize:14]; | |
| 188 | + _content.textAlignment = NSTextAlignmentRight; | |
| 189 | + } | |
| 190 | + return _content; | |
| 191 | +} | |
| 192 | + | |
| 193 | +- (UIImageView *)front { | |
| 194 | + if (!_front) { | |
| 195 | + _front = [[UIImageView alloc] init]; | |
| 196 | + UIImage *xw_image = [self getImageWithImageName:@"mine_into" bundleName:@"CNLiveBMineModule" targetClass:[self class]]; | |
| 197 | + _front.image = xw_image; | |
| 198 | + _front.contentMode = UIViewContentModeCenter; | |
| 199 | + | |
| 200 | + } | |
| 201 | + return _front; | |
| 202 | +} | |
| 203 | +- (UIImageView *)pic { | |
| 204 | + if (!_pic) { | |
| 205 | + _pic = [[UIImageView alloc] init]; | |
| 206 | + } | |
| 207 | + return _pic; | |
| 208 | +} | |
| 209 | +#pragma mark - 响应方法 | |
| 210 | +- (void)switchChanged:(UISwitch *)sw{ | |
| 211 | + | |
| 212 | +} | |
| 213 | + | |
| 214 | +@end | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 | +#import "CNCommonViewController.h" | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_BEGIN | |
| 17 | + | |
| 18 | +@interface CNLiveUserInfoController : CNCommonViewController | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveUserInfoController.h" | |
| 10 | +#import "MJExtension.h" | |
| 11 | +#import "QMUIKit.h" | |
| 12 | + | |
| 13 | +#import "CNUserInfoManager.h" | |
| 14 | +#import "CNLiveServices.h" | |
| 15 | +#import "CNLiveNavigationBar.h" | |
| 16 | + | |
| 17 | +#import "CNLiveUserInfoCell.h" | |
| 18 | +#import "CNLiveUserInfoModel.h" | |
| 19 | +#import "CNLiveInfoUpdateController.h" | |
| 20 | +#import "CNLiveUserInfoNotification.h" | |
| 21 | + | |
| 22 | +@interface CNLiveUserInfoController ()<UITableViewDelegate, UITableViewDataSource>{ | |
| 23 | + UIImage *_image; | |
| 24 | +} | |
| 25 | +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar; | |
| 26 | +@property (nonatomic, strong) UITableView *tableView; | |
| 27 | +@property (nonatomic, strong) NSMutableArray *data; | |
| 28 | + | |
| 29 | +@end | |
| 30 | + | |
| 31 | +@implementation CNLiveUserInfoController | |
| 32 | +#pragma mark - 加载数据 | |
| 33 | +- (void)loadData { | |
| 34 | + NSArray *data = @[ | |
| 35 | + @{ | |
| 36 | + @"layout":@"2", | |
| 37 | + @"data":@"0", | |
| 38 | + @"title":@"头像", | |
| 39 | + @"info":CNUserShareModel.faceUrl?CNUserShareModel.faceUrl:@"", | |
| 40 | + @"height":@"81", | |
| 41 | + @"lineHeight":@"0.5" | |
| 42 | + }, | |
| 43 | + @{ | |
| 44 | + @"layout":@"1", | |
| 45 | + @"data":@"1", | |
| 46 | + @"title":@"昵称", | |
| 47 | + @"info":CNUserShareModel.nickname?CNUserShareModel.nickname:@"", | |
| 48 | + @"height":@"51", | |
| 49 | + @"lineHeight":@"0.5" | |
| 50 | + }, | |
| 51 | + @{ | |
| 52 | + @"layout":@"1", | |
| 53 | + @"data":@"2", | |
| 54 | + @"title":@"性别", | |
| 55 | + @"info":CNUserShareModel.gender?CNUserShareModel.gender:@"未知", | |
| 56 | + @"height":@"60", | |
| 57 | + @"lineHeight":@"10" | |
| 58 | + }, | |
| 59 | + @{ | |
| 60 | + @"layout":@"1", | |
| 61 | + @"data":@"4", | |
| 62 | + @"title":@"地区", | |
| 63 | + @"info":CNUserShareModel.location?CNUserShareModel.location:@"", | |
| 64 | + @"height":@"60", | |
| 65 | + @"lineHeight":@"10" | |
| 66 | + } | |
| 67 | + | |
| 68 | + ]; | |
| 69 | + for(NSDictionary *dic in data){ | |
| 70 | + [self.data addObject:[CNLiveUserInfoModel mj_objectWithKeyValues:dic]]; | |
| 71 | + } | |
| 72 | + [self.tableView reloadData]; | |
| 73 | + | |
| 74 | +} | |
| 75 | + | |
| 76 | +#pragma mark - 生命周期 | |
| 77 | +- (void)viewWillAppear:(BOOL)animated{ | |
| 78 | + [super viewWillAppear:animated]; | |
| 79 | + self.navigationController.navigationBarHidden = YES; | |
| 80 | +} | |
| 81 | + | |
| 82 | +- (void)viewDidLoad { | |
| 83 | + [super viewDidLoad]; | |
| 84 | + self.view.backgroundColor = [UIColor whiteColor]; | |
| 85 | + if (@available(iOS 11, *)) { | |
| 86 | + self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 87 | + } | |
| 88 | + else { | |
| 89 | + self.automaticallyAdjustsScrollViewInsets = NO; | |
| 90 | + } | |
| 91 | + [CNLiveUserInfoNotification addUserInfoUpdateObserver:self selector:@selector(userInfoUpdateNotification:)]; | |
| 92 | + | |
| 93 | + [self createSubViews]; | |
| 94 | + [self loadData]; | |
| 95 | + | |
| 96 | +} | |
| 97 | + | |
| 98 | +- (void)dealloc { | |
| 99 | + [CNLiveUserInfoNotification removeObserver:self]; | |
| 100 | +} | |
| 101 | + | |
| 102 | +- (void)createSubViews { | |
| 103 | + [self.view addSubview:self.navigationBar]; | |
| 104 | + [self.view addSubview:self.tableView]; | |
| 105 | + | |
| 106 | +} | |
| 107 | + | |
| 108 | +#pragma mark - UITableViewDelegate | |
| 109 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 110 | + CNLiveUserInfoModel *model = self.data[indexPath.row]; | |
| 111 | + return model.height; | |
| 112 | +} | |
| 113 | + | |
| 114 | +#pragma mark - UITableViewDataSource | |
| 115 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 116 | + return self.data.count; | |
| 117 | +} | |
| 118 | + | |
| 119 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 120 | + CNLiveUserInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveUserInfoCell]; | |
| 121 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 122 | + CNLiveUserInfoModel *model = self.data[indexPath.row]; | |
| 123 | + cell.model = model; | |
| 124 | + if(_image){ | |
| 125 | + cell.image = _image; | |
| 126 | + } | |
| 127 | + return cell; | |
| 128 | +} | |
| 129 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| 130 | + CNLiveUserInfoModel *model = self.data[indexPath.row]; | |
| 131 | + switch (model.dataType) { | |
| 132 | + case CNLiveUserInfoDataTypeCode: | |
| 133 | + { | |
| 134 | + id<CNLiveQrCodeServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveQrCodeServiceProtocol)]; | |
| 135 | + [service pushToMyQrCodeController:NO]; | |
| 136 | + } | |
| 137 | + break; | |
| 138 | + default: | |
| 139 | + { | |
| 140 | + CNLiveInfoUpdateController *vc = [[CNLiveInfoUpdateController alloc]initWithModel:model]; | |
| 141 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 142 | + } | |
| 143 | + break; | |
| 144 | + } | |
| 145 | +} | |
| 146 | + | |
| 147 | +#pragma mark - 监听 | |
| 148 | +// 更新用户信息 | |
| 149 | +- (void)userInfoUpdateNotification:(NSNotification *)noti{ | |
| 150 | + //使用userInfo处理消息 | |
| 151 | + NSDictionary *dic = [noti userInfo]; | |
| 152 | + CNLiveUserInfoDataType dataType = [[dic objectForKey:@"dataType"] integerValue]; | |
| 153 | + NSString *info = [dic objectForKey:@"info"]; | |
| 154 | + | |
| 155 | + // 更新cell展示信息 | |
| 156 | + for(CNLiveUserInfoModel *model in self.data){ | |
| 157 | + if(dataType == model.dataType){ | |
| 158 | + model.info = info; | |
| 159 | + break; | |
| 160 | + } | |
| 161 | + } | |
| 162 | + [self.tableView reloadData]; | |
| 163 | + | |
| 164 | +} | |
| 165 | + | |
| 166 | +#pragma mark - 懒加载 | |
| 167 | +- (CNLiveNavigationBar *)navigationBar { | |
| 168 | + if (!_navigationBar) { | |
| 169 | + _navigationBar = [CNLiveNavigationBar navigationBar]; | |
| 170 | + _navigationBar.title.text = @"个人资料"; | |
| 171 | + __weak typeof(self) weakSelf = self; | |
| 172 | + _navigationBar.onClickLeftButton = ^{ | |
| 173 | + [weakSelf goBack]; | |
| 174 | + }; | |
| 175 | + } | |
| 176 | + return _navigationBar; | |
| 177 | +} | |
| 178 | + | |
| 179 | +- (NSMutableArray *)data { | |
| 180 | + if (!_data) { | |
| 181 | + _data = [NSMutableArray array]; | |
| 182 | + } | |
| 183 | + return _data; | |
| 184 | +} | |
| 185 | + | |
| 186 | +- (UITableView *)tableView{ | |
| 187 | + if(!_tableView){ | |
| 188 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavigationContentTop, SCREEN_WIDTH, SCREEN_HEIGHT-NavigationContentTop) style:UITableViewStylePlain]; | |
| 189 | + _tableView.delegate = self; | |
| 190 | + _tableView.dataSource = self; | |
| 191 | + _tableView.bounces = NO; | |
| 192 | + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 193 | + _tableView.backgroundColor = [UIColor whiteColor]; | |
| 194 | + _tableView.estimatedRowHeight = 0; | |
| 195 | + _tableView.estimatedSectionHeaderHeight = 0; | |
| 196 | + _tableView.estimatedSectionFooterHeight = 0; | |
| 197 | + [_tableView registerClass:[CNLiveUserInfoCell class] forCellReuseIdentifier:kCNLiveUserInfoCell]; | |
| 198 | + } | |
| 199 | + return _tableView; | |
| 200 | +} | |
| 201 | + | |
| 202 | +#pragma mark - 响应方法 | |
| 203 | +- (void)goBack { | |
| 204 | + if (self.presentingViewController != nil) { | |
| 205 | + [self dismissViewControllerAnimated:YES completion:nil]; | |
| 206 | + } | |
| 207 | + else { | |
| 208 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 209 | + } | |
| 210 | +} | |
| 211 | + | |
| 212 | +@end | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 | +typedef NS_ENUM(NSInteger, CNLiveUserInfoLayoutType) { | |
| 14 | + CNLiveUserInfoLayoutTypeDefault = 0, | |
| 15 | + CNLiveUserInfoLayoutTypeText = 1, | |
| 16 | + CNLiveUserInfoLayoutTypeImage = 2 | |
| 17 | +}; | |
| 18 | + | |
| 19 | +typedef NS_ENUM(NSInteger, CNLiveUserInfoDataType) { | |
| 20 | + CNLiveUserInfoDataTypeNickname = 0, | |
| 21 | + CNLiveUserInfoDataTypeHeader = 1, | |
| 22 | + CNLiveUserInfoDataTypeGender = 2, | |
| 23 | + CNLiveUserInfoDataTypeCode = 3, | |
| 24 | + CNLiveUserInfoDataTypeAddress = 4, | |
| 25 | + CNLiveUserInfoDataTypeIntroduction = 5 | |
| 26 | + | |
| 27 | +}; | |
| 28 | + | |
| 29 | + | |
| 30 | +@interface CNLiveUserInfoModel : NSObject | |
| 31 | +@property (nonatomic, copy) NSString *title; | |
| 32 | +@property (nonatomic, copy) NSString *info; | |
| 33 | +@property (nonatomic, copy) NSString *layout; | |
| 34 | +@property (nonatomic, copy) NSString *data; | |
| 35 | + | |
| 36 | +@property (nonatomic, assign) CNLiveUserInfoLayoutType layoutType; | |
| 37 | +@property (nonatomic, assign) CNLiveUserInfoDataType dataType; | |
| 38 | + | |
| 39 | +@property (nonatomic, assign) CGFloat height; | |
| 40 | +@property (nonatomic, assign) CGFloat lineHeight; | |
| 41 | + | |
| 42 | +@end | |
| 43 | + | |
| 44 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineController.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveUserInfoModel.h" | |
| 10 | + | |
| 11 | +@implementation CNLiveUserInfoModel | |
| 12 | +- (CNLiveUserInfoLayoutType)layoutType{ | |
| 13 | + if([self.layout isEqualToString:@"0"]){ | |
| 14 | + return CNLiveUserInfoLayoutTypeDefault; | |
| 15 | + } | |
| 16 | + else if([self.layout isEqualToString:@"1"]){ | |
| 17 | + return CNLiveUserInfoLayoutTypeText; | |
| 18 | + | |
| 19 | + } | |
| 20 | + else if([self.layout isEqualToString:@"2"]){ | |
| 21 | + return CNLiveUserInfoLayoutTypeImage; | |
| 22 | + | |
| 23 | + } | |
| 24 | + return CNLiveUserInfoLayoutTypeDefault; | |
| 25 | +} | |
| 26 | + | |
| 27 | +- (CNLiveUserInfoDataType)dataType{ | |
| 28 | + if([self.data isEqualToString:@"0"]){ | |
| 29 | + return CNLiveUserInfoDataTypeHeader; | |
| 30 | + } | |
| 31 | + else if([self.data isEqualToString:@"1"]){ | |
| 32 | + return CNLiveUserInfoDataTypeNickname; | |
| 33 | + | |
| 34 | + } | |
| 35 | + else if([self.data isEqualToString:@"2"]){ | |
| 36 | + return CNLiveUserInfoDataTypeGender; | |
| 37 | + | |
| 38 | + } | |
| 39 | + else if([self.data isEqualToString:@"3"]){ | |
| 40 | + return CNLiveUserInfoDataTypeCode; | |
| 41 | + | |
| 42 | + } | |
| 43 | + else if([self.data isEqualToString:@"4"]){ | |
| 44 | + return CNLiveUserInfoDataTypeAddress; | |
| 45 | + | |
| 46 | + } | |
| 47 | + else if([self.data isEqualToString:@"5"]){ | |
| 48 | + return CNLiveUserInfoDataTypeIntroduction; | |
| 49 | + | |
| 50 | + } | |
| 51 | + return CNLiveUserInfoDataTypeNickname; | |
| 52 | +} | |
| 53 | + | |
| 54 | +@end | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoNotification.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUserInfoNotification.m | |
| 3 | +// CNLiveBMineModule | |
| 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 | +#import "CNLiveUserInfoModel.h" | |
| 11 | + | |
| 12 | +NS_ASSUME_NONNULL_BEGIN | |
| 13 | +extern NSString * const kCNLiveUserInfoUpdateNotification; | |
| 14 | + | |
| 15 | +@interface CNLiveUserInfoNotification : NSObject | |
| 16 | ++ (void)postUserInfoUpdateNotificationType:(CNLiveUserInfoDataType)type info:(id)info; | |
| 17 | +//NSDictionary *dic = @{@"type":@(type),@"info":info}; | |
| 18 | ++ (void)addUserInfoUpdateObserver:(id)observer selector:(SEL)selector; | |
| 19 | + | |
| 20 | ++ (void)removeObserver:(id)observer; | |
| 21 | + | |
| 22 | +@end | |
| 23 | + | |
| 24 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/UserInfo/CNLiveUserInfoNotification.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveUserInfoNotification.m | |
| 3 | +// CNLiveBMineModule | |
| 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 "CNLiveUserInfoNotification.h" | |
| 10 | + | |
| 11 | +@implementation CNLiveUserInfoNotification | |
| 12 | + | |
| 13 | +NSString * const kCNLiveUserInfoUpdateNotification = @"CNLiveUserInfoUpdateNotification"; | |
| 14 | + | |
| 15 | ++ (void)postUserInfoUpdateNotificationType:(CNLiveUserInfoDataType)type info:(id)info{ | |
| 16 | + NSDictionary *dic = @{@"dataType":@(type),@"info":info}; | |
| 17 | + [[NSNotificationCenter defaultCenter] postNotificationName:kCNLiveUserInfoUpdateNotification object:nil userInfo:dic]; | |
| 18 | + | |
| 19 | +} | |
| 20 | + | |
| 21 | ++ (void)addUserInfoUpdateObserver:(id)observer selector:(SEL)selector{ | |
| 22 | + [[NSNotificationCenter defaultCenter] addObserver:observer selector:selector name:kCNLiveUserInfoUpdateNotification object:nil]; | |
| 23 | + | |
| 24 | +} | |
| 25 | + | |
| 26 | ++ (void)removeObserver:(id)observer{ | |
| 27 | + [[NSNotificationCenter defaultCenter] removeObserver:observer]; | |
| 28 | + | |
| 29 | +} | |
| 30 | + | |
| 31 | +@end | ... | ... |
CNLiveBMineModule/Classes/View/CNLiveBMineCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineCell.h | |
| 3 | +// CNLiveBMineModule | |
| 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 | +#import "CNLiveBMineModel.h" | |
| 11 | + | |
| 12 | +NS_ASSUME_NONNULL_BEGIN | |
| 13 | +@class CNLiveBMineCell; | |
| 14 | + | |
| 15 | +static NSString * const kCNLiveBMineCell = @"CNLiveBMineCell"; | |
| 16 | +@protocol CNLiveBMineCellDelegate <NSObject> | |
| 17 | +@optional | |
| 18 | +- (void)cell:(CNLiveBMineCell *)cell didSelectItemAtItem:(NSInteger)item; | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +@interface CNLiveBMineCell : UITableViewCell | |
| 23 | +@property (nonatomic, strong) CNLiveBMineModel *model; | |
| 24 | +@property (nonatomic, weak) id<CNLiveBMineCellDelegate> delegate; | |
| 25 | + | |
| 26 | +@end | |
| 27 | + | |
| 28 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/View/CNLiveBMineCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineCell.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | |
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveBMineCell.h" | |
| 10 | +#import <Masonry/Masonry.h> | |
| 11 | +#import "QMUIKit.h" | |
| 12 | +#import "CNLiveCategory.h" | |
| 13 | +#import "CNLiveBaseKit.h" | |
| 14 | + | |
| 15 | +@interface CNLiveBMineCell() | |
| 16 | +@property (nonatomic, strong) UIImageView *leftImage; | |
| 17 | +@property (nonatomic, strong) UILabel *title; | |
| 18 | +@property (nonatomic, strong) UIImageView *rightImage; | |
| 19 | +@property (nonatomic, strong) UIView *line; | |
| 20 | + | |
| 21 | +@end | |
| 22 | + | |
| 23 | +@implementation CNLiveBMineCell | |
| 24 | +static const CGFloat margin = 10; | |
| 25 | + | |
| 26 | +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ | |
| 27 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 28 | + if (self) { | |
| 29 | + self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 30 | + [self createSubviews]; | |
| 31 | + } | |
| 32 | + return self; | |
| 33 | +} | |
| 34 | + | |
| 35 | +- (void)createSubviews{ | |
| 36 | + [self.contentView addSubview:self.leftImage]; | |
| 37 | + [self.contentView addSubview:self.title]; | |
| 38 | + [self.contentView addSubview:self.rightImage]; | |
| 39 | + [self.contentView addSubview:self.line]; | |
| 40 | +} | |
| 41 | + | |
| 42 | +- (void)setModel:(CNLiveBMineModel *)model{ | |
| 43 | + _model = model; | |
| 44 | + | |
| 45 | + UIImage *xw_image = [self getImageWithImageName:model.image bundleName:@"CNLiveBMineModule" targetClass:[CNLiveBMineCell class]]; | |
| 46 | + _leftImage.image = xw_image; | |
| 47 | + | |
| 48 | + _title.text = model.name; | |
| 49 | + | |
| 50 | + [_leftImage mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 51 | + make.left.equalTo(self.contentView.mas_left).with.offset(margin); | |
| 52 | + make.top.equalTo(self.contentView.mas_top); | |
| 53 | + make.bottom.equalTo(self.contentView.mas_bottom); | |
| 54 | + make.width.with.offset(30); | |
| 55 | + }]; | |
| 56 | + | |
| 57 | + [_rightImage mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 58 | + make.right.equalTo(self.contentView.mas_right).with.offset(-margin); | |
| 59 | + make.top.equalTo(self.contentView.mas_top); | |
| 60 | + make.bottom.equalTo(self.contentView.mas_bottom); | |
| 61 | + make.width.with.offset(20); | |
| 62 | + }]; | |
| 63 | + | |
| 64 | + [_title mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 65 | + make.left.equalTo(self.leftImage.mas_right).with.offset(margin); | |
| 66 | + make.top.equalTo(self.contentView.mas_top); | |
| 67 | + make.bottom.equalTo(self.contentView.mas_bottom); | |
| 68 | + make.right.equalTo(self.rightImage.mas_left).with.offset(-margin); | |
| 69 | + }]; | |
| 70 | + | |
| 71 | + [_line mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 72 | + make.bottom.equalTo(self.contentView.mas_bottom).with.offset(0); | |
| 73 | + make.left.equalTo(self.contentView.mas_left); | |
| 74 | + make.right.equalTo(self.contentView.mas_right); | |
| 75 | + make.height.with.offset(0.5); | |
| 76 | + | |
| 77 | + }]; | |
| 78 | + | |
| 79 | +} | |
| 80 | + | |
| 81 | +- (void)awakeFromNib { | |
| 82 | + [super awakeFromNib]; | |
| 83 | + // Initialization code | |
| 84 | +} | |
| 85 | + | |
| 86 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 87 | + [super setSelected:selected animated:animated]; | |
| 88 | + | |
| 89 | + // Configure the view for the selected state | |
| 90 | +} | |
| 91 | + | |
| 92 | +#pragma mark - 响应方法 | |
| 93 | + | |
| 94 | +#pragma mark - 懒加载 | |
| 95 | +- (UIImageView *)leftImage{ | |
| 96 | + if (!_leftImage) { | |
| 97 | + _leftImage = [[UIImageView alloc] init]; | |
| 98 | + _leftImage.backgroundColor = [UIColor whiteColor]; | |
| 99 | + _leftImage.layer.masksToBounds = NO; | |
| 100 | + _leftImage.contentMode = UIViewContentModeCenter; | |
| 101 | + } | |
| 102 | + return _leftImage; | |
| 103 | +} | |
| 104 | + | |
| 105 | +- (UILabel *)title{ | |
| 106 | + if (!_title) { | |
| 107 | + _title = [[UILabel alloc] init]; | |
| 108 | + _title.userInteractionEnabled = YES; | |
| 109 | + _title.numberOfLines = 1; | |
| 110 | + _title.textColor = [UIColor blackColor]; | |
| 111 | + _title.font = [UIFont systemFontOfSize:16]; | |
| 112 | + } | |
| 113 | + return _title; | |
| 114 | + | |
| 115 | +} | |
| 116 | + | |
| 117 | +- (UIImageView *)rightImage{ | |
| 118 | + if (!_rightImage) { | |
| 119 | + _rightImage = [[UIImageView alloc] init]; | |
| 120 | + _rightImage.backgroundColor = [UIColor whiteColor]; | |
| 121 | + _rightImage.layer.masksToBounds = NO; | |
| 122 | + _rightImage.layer.shadowColor = [UIColor blackColor].CGColor; | |
| 123 | + UIImage *xw_image = [self getImageWithImageName:@"mine_into" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveBMineCell class]]; | |
| 124 | + _rightImage.image = xw_image; | |
| 125 | + _rightImage.contentMode = UIViewContentModeCenter; | |
| 126 | + } | |
| 127 | + return _rightImage; | |
| 128 | +} | |
| 129 | + | |
| 130 | +- (UIView *)line{ | |
| 131 | + if (!_line) { | |
| 132 | + _line = [[UIView alloc] init]; | |
| 133 | + _line.backgroundColor = [UIColor colorWithRed:235/255.0 green:235/255.0 blue:235/255.0 alpha:1.0]; | |
| 134 | + } | |
| 135 | + return _line; | |
| 136 | +} | |
| 137 | + | |
| 138 | +@end | ... | ... |
CNLiveBMineModule/Classes/View/CNLiveBMineHeaderView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineHeaderView.h | |
| 3 | +// CNLiveBMineModule | |
| 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 | +typedef NS_ENUM(NSInteger, CNLiveBMineHeaderViewType) { | |
| 13 | + CNLiveBMineHeaderViewTypeUerInfo = 0, | |
| 14 | + CNLiveBMineHeaderViewTypeWintess = 1 | |
| 15 | +}; | |
| 16 | +@class CNLiveBMineHeaderView; | |
| 17 | + | |
| 18 | +@protocol CNLiveBMineHeaderViewDelegate <NSObject> | |
| 19 | +@optional | |
| 20 | +- (void)headerView:(CNLiveBMineHeaderView *)headerView pushToController:(CNLiveBMineHeaderViewType)type; | |
| 21 | + | |
| 22 | +@end | |
| 23 | +@interface CNLiveBMineHeaderView : UIView | |
| 24 | +@property (nonatomic, weak) id<CNLiveBMineHeaderViewDelegate> delegate; | |
| 25 | +@property (nonatomic, assign) BOOL interactionEnabled; | |
| 26 | +@property (nonatomic, assign) BOOL isRefresh; | |
| 27 | + | |
| 28 | +@property (nonatomic, strong) NSArray *certificationImages; | |
| 29 | + | |
| 30 | +- (void)layoutSubviews; | |
| 31 | + | |
| 32 | +@end | |
| 33 | + | |
| 34 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBMineModule/Classes/View/CNLiveBMineHeaderView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBMineHeaderView.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by 153993236@qq.com on 11/12/2019. | |
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLiveBMineHeaderView.h" | |
| 10 | +#import <Masonry/Masonry.h> | |
| 11 | +#import <SDWebImage/SDWebImage.h> | |
| 12 | +#import "QMUIKit.h" | |
| 13 | +#import "CNLiveCategory.h" | |
| 14 | +#import "CNLiveBaseKit.h" | |
| 15 | + | |
| 16 | +#import "CNUserInfoManager.h" | |
| 17 | +#import "CNLiveUserInfoNotification.h" | |
| 18 | + | |
| 19 | +@interface CNLiveBMineHeaderView () | |
| 20 | +@property (nonatomic, strong) UIImageView *bgView; | |
| 21 | +@property (nonatomic, strong) UIButton *witness; | |
| 22 | + | |
| 23 | +@property (nonatomic, strong) UIImageView *header; | |
| 24 | +@property (nonatomic, strong) UILabel *name; | |
| 25 | +@property (nonatomic, strong) UILabel *certification; | |
| 26 | +@property (nonatomic, strong) UILabel *address; | |
| 27 | + | |
| 28 | +@end | |
| 29 | + | |
| 30 | +@implementation CNLiveBMineHeaderView | |
| 31 | +static const NSInteger margin = 20; | |
| 32 | + | |
| 33 | +- (instancetype)initWithFrame:(CGRect)frame{ | |
| 34 | + self = [super initWithFrame:frame]; | |
| 35 | + if(self){ | |
| 36 | + self.userInteractionEnabled = YES; | |
| 37 | + [CNLiveUserInfoNotification addUserInfoUpdateObserver:self selector:@selector(userInfoUpdateNotification:)]; | |
| 38 | + [self createSubViews]; | |
| 39 | + } | |
| 40 | + return self; | |
| 41 | +} | |
| 42 | +// 实现方法 | |
| 43 | +- (void)userInfoUpdateNotification:(NSNotification *)noti{ | |
| 44 | + //使用userInfo处理消息 | |
| 45 | + NSDictionary *dic = [noti userInfo]; | |
| 46 | + CNLiveUserInfoDataType type = [[dic objectForKey:@"dataType"] integerValue]; | |
| 47 | + NSString *info = [dic objectForKey:@"info"]; | |
| 48 | + if(type == CNLiveUserInfoDataTypeHeader){ | |
| 49 | + UIImage *xw_image = [self getImageWithImageName:@"default_avatar_y" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveBMineHeaderView class]]; | |
| 50 | + [_header sd_setImageWithURL:[NSURL URLWithString:info] placeholderImage:xw_image]; | |
| 51 | + | |
| 52 | + }else if(type == CNLiveUserInfoDataTypeNickname){ | |
| 53 | + _name.text = info; | |
| 54 | + | |
| 55 | + }else if(type == CNLiveUserInfoDataTypeAddress){ | |
| 56 | + _address.attributedText = [self createAttributedImageName:@"mine_location" string:info fontSize:13.0 isFront:YES]; | |
| 57 | + | |
| 58 | + } | |
| 59 | +} | |
| 60 | + | |
| 61 | +- (void)dealloc { | |
| 62 | + NSLog(@"CNLiveBMineHeaderView -- dealloc"); | |
| 63 | + [CNLiveUserInfoNotification removeObserver:self]; | |
| 64 | +} | |
| 65 | + | |
| 66 | +- (void)createSubViews { | |
| 67 | + [self addSubview:self.bgView]; | |
| 68 | + [self addSubview:self.witness]; | |
| 69 | + | |
| 70 | + [self addSubview:self.header]; | |
| 71 | + [self addSubview:self.name]; | |
| 72 | + [self addSubview:self.certification]; | |
| 73 | + [self addSubview:self.address]; | |
| 74 | + | |
| 75 | +} | |
| 76 | + | |
| 77 | +- (void)layoutSubviews{ | |
| 78 | + [super layoutSubviews]; | |
| 79 | + [_witness mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 80 | + make.left.equalTo(self.mas_left); | |
| 81 | + make.right.equalTo(self.mas_right); | |
| 82 | + make.height.offset(128); | |
| 83 | + make.bottom.equalTo(self.mas_bottom); | |
| 84 | + | |
| 85 | + }]; | |
| 86 | + | |
| 87 | + [_bgView mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 88 | + make.left.equalTo(self.mas_left).with.offset(0); | |
| 89 | + make.right.equalTo(self.mas_right).with.offset(-0); | |
| 90 | + make.top.equalTo(self.mas_top).with.offset(0); | |
| 91 | + make.bottom.equalTo(self.witness.mas_top).with.offset(40); | |
| 92 | + | |
| 93 | + }]; | |
| 94 | + | |
| 95 | + [_header mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 96 | + make.left.equalTo(self.mas_left).with.offset(margin); | |
| 97 | + make.centerY.equalTo(self.bgView.mas_centerY).with.offset(20); | |
| 98 | + make.width.height.offset(60); | |
| 99 | + | |
| 100 | + }]; | |
| 101 | + | |
| 102 | + [_certification mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 103 | + make.centerY.equalTo(self.header.mas_centerY); | |
| 104 | + make.left.equalTo(self.header.mas_right).with.offset(margin/2.0); | |
| 105 | + make.height.offset(25); | |
| 106 | + | |
| 107 | + }]; | |
| 108 | + | |
| 109 | + [_name mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 110 | + make.bottom.equalTo(self.certification.mas_top); | |
| 111 | + make.left.equalTo(self.certification.mas_left); | |
| 112 | + make.right.mas_lessThanOrEqualTo(self.bgView.mas_right).with.offset(-margin); | |
| 113 | + make.height.equalTo(self.certification.mas_height); | |
| 114 | + | |
| 115 | + }]; | |
| 116 | + | |
| 117 | + [_address mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 118 | + make.top.equalTo(self.certification.mas_bottom); | |
| 119 | + make.left.equalTo(self.name.mas_left); | |
| 120 | + make.right.equalTo(self.name.mas_right); | |
| 121 | + make.height.equalTo(self.name.mas_height); | |
| 122 | + | |
| 123 | + }]; | |
| 124 | + | |
| 125 | +} | |
| 126 | + | |
| 127 | +- (void)setInteractionEnabled:(BOOL)interactionEnabled{ | |
| 128 | + _interactionEnabled = interactionEnabled; | |
| 129 | + _witness.userInteractionEnabled = interactionEnabled; | |
| 130 | +} | |
| 131 | + | |
| 132 | +- (void)setIsRefresh:(BOOL)isRefresh{ | |
| 133 | + _isRefresh = isRefresh; | |
| 134 | + if(isRefresh){ | |
| 135 | + _name.text = CNUserShareModel.nickname; | |
| 136 | + _address.attributedText = [self createAttributedImageName:@"mine_location" string:CNUserShareModel.location fontSize:13.0 isFront:YES]; | |
| 137 | + } | |
| 138 | +} | |
| 139 | + | |
| 140 | +- (void)setCertificationImages:(NSArray *)certificationImages{ | |
| 141 | + _certificationImages = certificationImages; | |
| 142 | + _certification.attributedText = [self createAttributedImages:certificationImages]; | |
| 143 | +} | |
| 144 | +/* | |
| 145 | + // Only override drawRect: if you perform custom drawing. | |
| 146 | + // An empty implementation adversely affects performance during animation. | |
| 147 | + - (void)drawRect:(CGRect)rect { | |
| 148 | + // Drawing code | |
| 149 | + } | |
| 150 | + */ | |
| 151 | +#pragma mark - Private Methods | |
| 152 | +- (NSMutableAttributedString *)createAttributedImageName:(NSString *)imageName string:(NSString *)string fontSize:(CGFloat)fontSize isFront:(BOOL)isFront{ | |
| 153 | + if(isFront){ | |
| 154 | + string = [NSString stringWithFormat:@" %@",string]; | |
| 155 | + } | |
| 156 | + // 1.创建一个富文本 | |
| 157 | + NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:string]; | |
| 158 | + // 修改富文本中的不同文字的样式 | |
| 159 | +// [attri addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, string.length)]; | |
| 160 | + UIFont *font = UIFontCNMake(fontSize); | |
| 161 | + [attri addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, string.length)]; | |
| 162 | + // 2.添加表情图片 | |
| 163 | + NSTextAttachment *attch = [[NSTextAttachment alloc] init]; | |
| 164 | + // 表情图片 | |
| 165 | + UIImage *xw_image = [self getImageWithImageName:imageName bundleName:@"CNLiveBMineModule" targetClass:[self class]]; | |
| 166 | + attch.image = xw_image; | |
| 167 | + | |
| 168 | + CGFloat paddingTop = font.lineHeight - font.pointSize; | |
| 169 | + if(isFront){ | |
| 170 | + // 设置图片大小 | |
| 171 | + attch.bounds = CGRectMake(0, -paddingTop, font.pointSize*5/6.0, font.pointSize); | |
| 172 | + // 创建带有图片的富文本 | |
| 173 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | |
| 174 | + [attri insertAttributedString:str atIndex:0];// 插入某个位置 | |
| 175 | + }else{ | |
| 176 | + // 设置图片大小 | |
| 177 | + attch.bounds = CGRectMake(10, -paddingTop, font.pointSize, font.pointSize); | |
| 178 | + // 创建带有图片的富文本 | |
| 179 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | |
| 180 | + [attri insertAttributedString:str atIndex:string.length];// 插入某个位置 | |
| 181 | + | |
| 182 | + } | |
| 183 | + return attri; | |
| 184 | + | |
| 185 | +} | |
| 186 | + | |
| 187 | +- (NSMutableAttributedString *)createAttributedImages:(NSArray *)images { | |
| 188 | + // 1.创建一个富文本 | |
| 189 | + NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:@""]; | |
| 190 | + for(NSString *image in images){ | |
| 191 | + // 2.添加表情图片 | |
| 192 | + NSTextAttachment *attch = [[NSTextAttachment alloc] init]; | |
| 193 | + // 表情图片 | |
| 194 | + UIImage *xw_image = [self getImageWithImageName:image bundleName:@"CNLiveBMineModule" targetClass:[self class]]; | |
| 195 | + attch.image = xw_image; | |
| 196 | + // 创建带有图片的富文本 | |
| 197 | + NSAttributedString *str = [NSAttributedString attributedStringWithAttachment:attch]; | |
| 198 | + NSAttributedString *space = [[NSAttributedString alloc]initWithString:@" "]; | |
| 199 | + | |
| 200 | + [attri insertAttributedString:str atIndex:attri.length];// 插入某个位置 | |
| 201 | + [attri insertAttributedString:space atIndex:attri.length]; | |
| 202 | + | |
| 203 | + } | |
| 204 | + return attri; | |
| 205 | + | |
| 206 | +} | |
| 207 | + | |
| 208 | +#pragma mark - 响应方法 | |
| 209 | +- (void)headerTapDidClicked:(UITapGestureRecognizer *)tap{ | |
| 210 | + if (self.delegate && [self.delegate respondsToSelector:@selector(headerView:pushToController:)]) { | |
| 211 | + [self.delegate headerView:self pushToController:CNLiveBMineHeaderViewTypeUerInfo]; | |
| 212 | + } | |
| 213 | +} | |
| 214 | + | |
| 215 | +- (void)nameTapDidClicked:(UITapGestureRecognizer *)tap{ | |
| 216 | + if (self.delegate && [self.delegate respondsToSelector:@selector(headerView:pushToController:)]) { | |
| 217 | + [self.delegate headerView:self pushToController:CNLiveBMineHeaderViewTypeUerInfo]; | |
| 218 | + } | |
| 219 | +} | |
| 220 | + | |
| 221 | +- (void)witnessDidClicked:(UIButton *)btn{ | |
| 222 | + if (self.delegate && [self.delegate respondsToSelector:@selector(headerView:pushToController:)]) { | |
| 223 | + btn.userInteractionEnabled = NO; | |
| 224 | + [self.delegate headerView:self pushToController:CNLiveBMineHeaderViewTypeWintess]; | |
| 225 | + } | |
| 226 | +} | |
| 227 | + | |
| 228 | +#pragma mark - 懒加载 | |
| 229 | +- (UIButton *)witness { | |
| 230 | + if (!_witness) { | |
| 231 | + _witness = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 232 | + UIImage *xw_image = [self getImageWithImageName:@"mine_zy" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveBMineHeaderView class]]; | |
| 233 | + _witness.imageView.contentMode = UIViewContentModeScaleAspectFit; | |
| 234 | + [_witness setBackgroundImage:xw_image forState:UIControlStateNormal]; | |
| 235 | + _witness.adjustsImageWhenHighlighted = NO; | |
| 236 | + [_witness addTarget:self action:@selector(witnessDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
| 237 | + } | |
| 238 | + return _witness; | |
| 239 | +} | |
| 240 | +- (UIImageView *)bgView { | |
| 241 | + if (!_bgView) { | |
| 242 | + _bgView = [[UIImageView alloc] init]; | |
| 243 | + _bgView.userInteractionEnabled = YES; | |
| 244 | + UIImage *xw_image = [self getImageWithImageName:@"mine_bg" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveBMineHeaderView class]]; | |
| 245 | + _bgView.image = xw_image; | |
| 246 | + } | |
| 247 | + return _bgView; | |
| 248 | +} | |
| 249 | +- (UIImageView *)header { | |
| 250 | + if (!_header) { | |
| 251 | + _header = [[UIImageView alloc] init]; | |
| 252 | + _header.userInteractionEnabled = YES; | |
| 253 | + _header.layer.masksToBounds = YES; | |
| 254 | + _header.layer.cornerRadius = 28; | |
| 255 | + UIImage *xw_image = [self getImageWithImageName:@"default_avatar_y" bundleName:@"CNLiveBMineModule" targetClass:[CNLiveBMineHeaderView class]]; | |
| 256 | + [_header sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image]; | |
| 257 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(headerTapDidClicked:)]; | |
| 258 | + [_header addGestureRecognizer:tap]; | |
| 259 | + } | |
| 260 | + return _header; | |
| 261 | +} | |
| 262 | + | |
| 263 | +- (UILabel *)name { | |
| 264 | + if (!_name) { | |
| 265 | + _name = [[UILabel alloc] init]; | |
| 266 | + _name.userInteractionEnabled = YES; | |
| 267 | + _name.numberOfLines = 1; | |
| 268 | +// _name.backgroundColor = [UIColor blackColor]; | |
| 269 | + _name.textColor = [UIColor blackColor]; | |
| 270 | + _name.font = [UIFont systemFontOfSize:16]; | |
| 271 | + _name.text = CNUserShareModel.nickname; | |
| 272 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(nameTapDidClicked:)]; | |
| 273 | + [_name addGestureRecognizer:tap]; | |
| 274 | + | |
| 275 | + } | |
| 276 | + return _name; | |
| 277 | +} | |
| 278 | +- (UILabel *)certification { | |
| 279 | + if (!_certification) { | |
| 280 | + _certification = [[UILabel alloc] init]; | |
| 281 | + _certification.numberOfLines = 1; | |
| 282 | + _certification.textColor = [UIColor whiteColor]; | |
| 283 | + _certification.font = [UIFont systemFontOfSize:16]; | |
| 284 | + _certification.attributedText = [self createAttributedImages:@[@"mine_wjj_certification",@"mine_common",@"mine_overbadge"]]; | |
| 285 | + } | |
| 286 | + return _certification; | |
| 287 | +} | |
| 288 | +- (UILabel *)address { | |
| 289 | + if (!_address) { | |
| 290 | + _address = [[UILabel alloc] init]; | |
| 291 | + _address.numberOfLines = 1; | |
| 292 | + _address.textColor = [UIColor colorWithRed:140/255.0 green:140/255.0 blue:142/255.0 alpha:1.0]; | |
| 293 | + _address.font = [UIFont systemFontOfSize:13]; | |
| 294 | + _address.attributedText = [self createAttributedImageName:@"mine_location" string:CNUserShareModel.location fontSize:13.0 isFront:YES]; | |
| 295 | + } | |
| 296 | + return _address; | |
| 297 | +} | |
| 298 | + | |
| 299 | +@end | ... | ... |
Example/CNLiveBMineModule.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 | + 0294E0D813228630E8A748A3 /* Pods_CNLiveBMineModule_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DB23BCE044CC5F32AA1F954 /* Pods_CNLiveBMineModule_Example.framework */; }; | |
| 11 | + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | |
| 12 | + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; | |
| 13 | + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | |
| 14 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; | |
| 15 | + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; | |
| 16 | + 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */; }; | |
| 17 | + 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* CNLIVEViewController.m */; }; | |
| 18 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; | |
| 19 | + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; | |
| 20 | + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | |
| 21 | + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | |
| 22 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; | |
| 23 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; | |
| 24 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; | |
| 25 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; | |
| 26 | + A0B1D818E41EC01A24B44DA8 /* Pods_CNLiveBMineModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAC766ADFD686E9175534659 /* Pods_CNLiveBMineModule_Tests.framework */; }; | |
| 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 = CNLiveBMineModule; | |
| 36 | + }; | |
| 37 | +/* End PBXContainerItemProxy section */ | |
| 38 | + | |
| 39 | +/* Begin PBXFileReference section */ | |
| 40 | + 06508B373B63690317EEA2B7 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; | |
| 41 | + 3A2E7B13CAFC57961AB44487 /* Pods-CNLiveBMineModule_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBMineModule_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveBMineModule_Tests/Pods-CNLiveBMineModule_Tests.debug.xcconfig"; sourceTree = "<group>"; }; | |
| 42 | + 542BAE6708AF530FDE36965E /* Pods-CNLiveBMineModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBMineModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveBMineModule_Example/Pods-CNLiveBMineModule_Example.debug.xcconfig"; sourceTree = "<group>"; }; | |
| 43 | + 6003F58A195388D20070C39A /* CNLiveBMineModule_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveBMineModule_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 44 | + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; | |
| 45 | + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; | |
| 46 | + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; | |
| 47 | + 6003F595195388D20070C39A /* CNLiveBMineModule-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CNLiveBMineModule-Info.plist"; sourceTree = "<group>"; }; | |
| 48 | + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | |
| 49 | + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; | |
| 50 | + 6003F59B195388D20070C39A /* CNLiveBMineModule-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CNLiveBMineModule-Prefix.pch"; sourceTree = "<group>"; }; | |
| 51 | + 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEAppDelegate.h; sourceTree = "<group>"; }; | |
| 52 | + 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEAppDelegate.m; sourceTree = "<group>"; }; | |
| 53 | + 6003F5A5195388D20070C39A /* CNLIVEViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEViewController.h; sourceTree = "<group>"; }; | |
| 54 | + 6003F5A6195388D20070C39A /* CNLIVEViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEViewController.m; sourceTree = "<group>"; }; | |
| 55 | + 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; | |
| 56 | + 6003F5AE195388D20070C39A /* CNLiveBMineModule_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CNLiveBMineModule_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 57 | + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; | |
| 58 | + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; }; | |
| 59 | + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | |
| 60 | + 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; }; | |
| 61 | + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; }; | |
| 62 | + 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | |
| 63 | + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | |
| 64 | + 8DB23BCE044CC5F32AA1F954 /* Pods_CNLiveBMineModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveBMineModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 65 | + 8E77D18FECAC6C19ED69DAE9 /* Pods-CNLiveBMineModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBMineModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveBMineModule_Tests/Pods-CNLiveBMineModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; | |
| 66 | + A52E1E15483D5A1560C3A422 /* Pods-CNLiveBMineModule_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBMineModule_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveBMineModule_Example/Pods-CNLiveBMineModule_Example.release.xcconfig"; sourceTree = "<group>"; }; | |
| 67 | + B5CA9F64783195C73B200EF3 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; }; | |
| 68 | + BAC766ADFD686E9175534659 /* Pods_CNLiveBMineModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveBMineModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 69 | + EA98EFCED692B043C58EC0E0 /* CNLiveBMineModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveBMineModule.podspec; path = ../CNLiveBMineModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; | |
| 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 | + 0294E0D813228630E8A748A3 /* Pods_CNLiveBMineModule_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 | + A0B1D818E41EC01A24B44DA8 /* Pods_CNLiveBMineModule_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 CNLiveBMineModule */, | |
| 103 | + 6003F5B5195388D20070C39A /* Tests */, | |
| 104 | + 6003F58C195388D20070C39A /* Frameworks */, | |
| 105 | + 6003F58B195388D20070C39A /* Products */, | |
| 106 | + 9C8559C449666D6325E17759 /* Pods */, | |
| 107 | + ); | |
| 108 | + sourceTree = "<group>"; | |
| 109 | + }; | |
| 110 | + 6003F58B195388D20070C39A /* Products */ = { | |
| 111 | + isa = PBXGroup; | |
| 112 | + children = ( | |
| 113 | + 6003F58A195388D20070C39A /* CNLiveBMineModule_Example.app */, | |
| 114 | + 6003F5AE195388D20070C39A /* CNLiveBMineModule_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 | + 8DB23BCE044CC5F32AA1F954 /* Pods_CNLiveBMineModule_Example.framework */, | |
| 127 | + BAC766ADFD686E9175534659 /* Pods_CNLiveBMineModule_Tests.framework */, | |
| 128 | + ); | |
| 129 | + name = Frameworks; | |
| 130 | + sourceTree = "<group>"; | |
| 131 | + }; | |
| 132 | + 6003F593195388D20070C39A /* Example for CNLiveBMineModule */ = { | |
| 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 CNLiveBMineModule"; | |
| 145 | + path = CNLiveBMineModule; | |
| 146 | + sourceTree = "<group>"; | |
| 147 | + }; | |
| 148 | + 6003F594195388D20070C39A /* Supporting Files */ = { | |
| 149 | + isa = PBXGroup; | |
| 150 | + children = ( | |
| 151 | + 6003F595195388D20070C39A /* CNLiveBMineModule-Info.plist */, | |
| 152 | + 6003F596195388D20070C39A /* InfoPlist.strings */, | |
| 153 | + 6003F599195388D20070C39A /* main.m */, | |
| 154 | + 6003F59B195388D20070C39A /* CNLiveBMineModule-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 | + EA98EFCED692B043C58EC0E0 /* CNLiveBMineModule.podspec */, | |
| 182 | + 06508B373B63690317EEA2B7 /* README.md */, | |
| 183 | + B5CA9F64783195C73B200EF3 /* LICENSE */, | |
| 184 | + ); | |
| 185 | + name = "Podspec Metadata"; | |
| 186 | + sourceTree = "<group>"; | |
| 187 | + }; | |
| 188 | + 9C8559C449666D6325E17759 /* Pods */ = { | |
| 189 | + isa = PBXGroup; | |
| 190 | + children = ( | |
| 191 | + 542BAE6708AF530FDE36965E /* Pods-CNLiveBMineModule_Example.debug.xcconfig */, | |
| 192 | + A52E1E15483D5A1560C3A422 /* Pods-CNLiveBMineModule_Example.release.xcconfig */, | |
| 193 | + 3A2E7B13CAFC57961AB44487 /* Pods-CNLiveBMineModule_Tests.debug.xcconfig */, | |
| 194 | + 8E77D18FECAC6C19ED69DAE9 /* Pods-CNLiveBMineModule_Tests.release.xcconfig */, | |
| 195 | + ); | |
| 196 | + path = Pods; | |
| 197 | + sourceTree = "<group>"; | |
| 198 | + }; | |
| 199 | +/* End PBXGroup section */ | |
| 200 | + | |
| 201 | +/* Begin PBXNativeTarget section */ | |
| 202 | + 6003F589195388D20070C39A /* CNLiveBMineModule_Example */ = { | |
| 203 | + isa = PBXNativeTarget; | |
| 204 | + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveBMineModule_Example" */; | |
| 205 | + buildPhases = ( | |
| 206 | + 2A8336772A36DEB07525BA2F /* [CP] Check Pods Manifest.lock */, | |
| 207 | + 6003F586195388D20070C39A /* Sources */, | |
| 208 | + 6003F587195388D20070C39A /* Frameworks */, | |
| 209 | + 6003F588195388D20070C39A /* Resources */, | |
| 210 | + 7F2868A8838A138BFAEF325B /* [CP] Embed Pods Frameworks */, | |
| 211 | + A802B5426A66E6F7713552F1 /* [CP] Copy Pods Resources */, | |
| 212 | + ); | |
| 213 | + buildRules = ( | |
| 214 | + ); | |
| 215 | + dependencies = ( | |
| 216 | + ); | |
| 217 | + name = CNLiveBMineModule_Example; | |
| 218 | + productName = CNLiveBMineModule; | |
| 219 | + productReference = 6003F58A195388D20070C39A /* CNLiveBMineModule_Example.app */; | |
| 220 | + productType = "com.apple.product-type.application"; | |
| 221 | + }; | |
| 222 | + 6003F5AD195388D20070C39A /* CNLiveBMineModule_Tests */ = { | |
| 223 | + isa = PBXNativeTarget; | |
| 224 | + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveBMineModule_Tests" */; | |
| 225 | + buildPhases = ( | |
| 226 | + C07FCC71144256C0D7D38641 /* [CP] Check Pods Manifest.lock */, | |
| 227 | + 6003F5AA195388D20070C39A /* Sources */, | |
| 228 | + 6003F5AB195388D20070C39A /* Frameworks */, | |
| 229 | + 6003F5AC195388D20070C39A /* Resources */, | |
| 230 | + ); | |
| 231 | + buildRules = ( | |
| 232 | + ); | |
| 233 | + dependencies = ( | |
| 234 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */, | |
| 235 | + ); | |
| 236 | + name = CNLiveBMineModule_Tests; | |
| 237 | + productName = CNLiveBMineModuleTests; | |
| 238 | + productReference = 6003F5AE195388D20070C39A /* CNLiveBMineModule_Tests.xctest */; | |
| 239 | + productType = "com.apple.product-type.bundle.unit-test"; | |
| 240 | + }; | |
| 241 | +/* End PBXNativeTarget section */ | |
| 242 | + | |
| 243 | +/* Begin PBXProject section */ | |
| 244 | + 6003F582195388D10070C39A /* Project object */ = { | |
| 245 | + isa = PBXProject; | |
| 246 | + attributes = { | |
| 247 | + CLASSPREFIX = CNLIVE; | |
| 248 | + LastUpgradeCheck = 0720; | |
| 249 | + ORGANIZATIONNAME = "iOS-Xiaowen"; | |
| 250 | + TargetAttributes = { | |
| 251 | + 6003F589195388D20070C39A = { | |
| 252 | + DevelopmentTeam = 94X49GG3ZW; | |
| 253 | + }; | |
| 254 | + 6003F5AD195388D20070C39A = { | |
| 255 | + TestTargetID = 6003F589195388D20070C39A; | |
| 256 | + }; | |
| 257 | + }; | |
| 258 | + }; | |
| 259 | + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveBMineModule" */; | |
| 260 | + compatibilityVersion = "Xcode 3.2"; | |
| 261 | + developmentRegion = English; | |
| 262 | + hasScannedForEncodings = 0; | |
| 263 | + knownRegions = ( | |
| 264 | + English, | |
| 265 | + en, | |
| 266 | + Base, | |
| 267 | + ); | |
| 268 | + mainGroup = 6003F581195388D10070C39A; | |
| 269 | + productRefGroup = 6003F58B195388D20070C39A /* Products */; | |
| 270 | + projectDirPath = ""; | |
| 271 | + projectRoot = ""; | |
| 272 | + targets = ( | |
| 273 | + 6003F589195388D20070C39A /* CNLiveBMineModule_Example */, | |
| 274 | + 6003F5AD195388D20070C39A /* CNLiveBMineModule_Tests */, | |
| 275 | + ); | |
| 276 | + }; | |
| 277 | +/* End PBXProject section */ | |
| 278 | + | |
| 279 | +/* Begin PBXResourcesBuildPhase section */ | |
| 280 | + 6003F588195388D20070C39A /* Resources */ = { | |
| 281 | + isa = PBXResourcesBuildPhase; | |
| 282 | + buildActionMask = 2147483647; | |
| 283 | + files = ( | |
| 284 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, | |
| 285 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, | |
| 286 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, | |
| 287 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, | |
| 288 | + ); | |
| 289 | + runOnlyForDeploymentPostprocessing = 0; | |
| 290 | + }; | |
| 291 | + 6003F5AC195388D20070C39A /* Resources */ = { | |
| 292 | + isa = PBXResourcesBuildPhase; | |
| 293 | + buildActionMask = 2147483647; | |
| 294 | + files = ( | |
| 295 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, | |
| 296 | + ); | |
| 297 | + runOnlyForDeploymentPostprocessing = 0; | |
| 298 | + }; | |
| 299 | +/* End PBXResourcesBuildPhase section */ | |
| 300 | + | |
| 301 | +/* Begin PBXShellScriptBuildPhase section */ | |
| 302 | + 2A8336772A36DEB07525BA2F /* [CP] Check Pods Manifest.lock */ = { | |
| 303 | + isa = PBXShellScriptBuildPhase; | |
| 304 | + buildActionMask = 2147483647; | |
| 305 | + files = ( | |
| 306 | + ); | |
| 307 | + inputFileListPaths = ( | |
| 308 | + ); | |
| 309 | + inputPaths = ( | |
| 310 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 311 | + "${PODS_ROOT}/Manifest.lock", | |
| 312 | + ); | |
| 313 | + name = "[CP] Check Pods Manifest.lock"; | |
| 314 | + outputFileListPaths = ( | |
| 315 | + ); | |
| 316 | + outputPaths = ( | |
| 317 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveBMineModule_Example-checkManifestLockResult.txt", | |
| 318 | + ); | |
| 319 | + runOnlyForDeploymentPostprocessing = 0; | |
| 320 | + shellPath = /bin/sh; | |
| 321 | + 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"; | |
| 322 | + showEnvVarsInLog = 0; | |
| 323 | + }; | |
| 324 | + 7F2868A8838A138BFAEF325B /* [CP] Embed Pods Frameworks */ = { | |
| 325 | + isa = PBXShellScriptBuildPhase; | |
| 326 | + buildActionMask = 2147483647; | |
| 327 | + files = ( | |
| 328 | + ); | |
| 329 | + inputPaths = ( | |
| 330 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveBMineModule_Example/Pods-CNLiveBMineModule_Example-frameworks.sh", | |
| 331 | + "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", | |
| 332 | + "${BUILT_PRODUCTS_DIR}/CNLiveAVCamera/CNLiveAVCamera.framework", | |
| 333 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseClass/CNLiveBaseClass.framework", | |
| 334 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", | |
| 335 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseTools/CNLiveBaseTools.framework", | |
| 336 | + "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", | |
| 337 | + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.framework", | |
| 338 | + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework", | |
| 339 | + "${BUILT_PRODUCTS_DIR}/CNLiveCacheManagerKit/CNLiveCacheManagerKit.framework", | |
| 340 | + "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework", | |
| 341 | + "${BUILT_PRODUCTS_DIR}/CNLiveChooseCountry/CNLiveChooseCountry.framework", | |
| 342 | + "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", | |
| 343 | + "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework", | |
| 344 | + "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework", | |
| 345 | + "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", | |
| 346 | + "${BUILT_PRODUCTS_DIR}/CNLiveImagePickerController/CNLiveImagePickerController.framework", | |
| 347 | + "${BUILT_PRODUCTS_DIR}/CNLiveManager/CNLiveManager.framework", | |
| 348 | + "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", | |
| 349 | + "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", | |
| 350 | + "${BUILT_PRODUCTS_DIR}/CNLiveUploadManager/CNLiveUploadManager.framework", | |
| 351 | + "${BUILT_PRODUCTS_DIR}/CNLiveUserAgreementManager/CNLiveUserAgreementManager.framework", | |
| 352 | + "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", | |
| 353 | + "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", | |
| 354 | + "${BUILT_PRODUCTS_DIR}/HappyDNS/HappyDNS.framework", | |
| 355 | + "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", | |
| 356 | + "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", | |
| 357 | + "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", | |
| 358 | + "${BUILT_PRODUCTS_DIR}/Qiniu/Qiniu.framework", | |
| 359 | + "${BUILT_PRODUCTS_DIR}/SDAutoLayout/SDAutoLayout.framework", | |
| 360 | + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", | |
| 361 | + "${PODS_ROOT}/TXIMSDK_iOS/ImSDK.framework", | |
| 362 | + "${BUILT_PRODUCTS_DIR}/WebViewJavascriptBridge/WebViewJavascriptBridge.framework", | |
| 363 | + "${BUILT_PRODUCTS_DIR}/YYKit/YYKit.framework", | |
| 364 | + ); | |
| 365 | + name = "[CP] Embed Pods Frameworks"; | |
| 366 | + outputPaths = ( | |
| 367 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", | |
| 368 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveAVCamera.framework", | |
| 369 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseClass.framework", | |
| 370 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", | |
| 371 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseTools.framework", | |
| 372 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", | |
| 373 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessBaseModule.framework", | |
| 374 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework", | |
| 375 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCacheManagerKit.framework", | |
| 376 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework", | |
| 377 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveChooseCountry.framework", | |
| 378 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", | |
| 379 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework", | |
| 380 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework", | |
| 381 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", | |
| 382 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveImagePickerController.framework", | |
| 383 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveManager.framework", | |
| 384 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", | |
| 385 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", | |
| 386 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUploadManager.framework", | |
| 387 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserAgreementManager.framework", | |
| 388 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", | |
| 389 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", | |
| 390 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HappyDNS.framework", | |
| 391 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", | |
| 392 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", | |
| 393 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", | |
| 394 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Qiniu.framework", | |
| 395 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDAutoLayout.framework", | |
| 396 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", | |
| 397 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ImSDK.framework", | |
| 398 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebViewJavascriptBridge.framework", | |
| 399 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKit.framework", | |
| 400 | + ); | |
| 401 | + runOnlyForDeploymentPostprocessing = 0; | |
| 402 | + shellPath = /bin/sh; | |
| 403 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveBMineModule_Example/Pods-CNLiveBMineModule_Example-frameworks.sh\"\n"; | |
| 404 | + showEnvVarsInLog = 0; | |
| 405 | + }; | |
| 406 | + A802B5426A66E6F7713552F1 /* [CP] Copy Pods Resources */ = { | |
| 407 | + isa = PBXShellScriptBuildPhase; | |
| 408 | + buildActionMask = 2147483647; | |
| 409 | + files = ( | |
| 410 | + ); | |
| 411 | + inputPaths = ( | |
| 412 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveBMineModule_Example/Pods-CNLiveBMineModule_Example-resources.sh", | |
| 413 | + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveBMineModule/CNLiveBMineModule.bundle", | |
| 414 | + ); | |
| 415 | + name = "[CP] Copy Pods Resources"; | |
| 416 | + outputPaths = ( | |
| 417 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveBMineModule.bundle", | |
| 418 | + ); | |
| 419 | + runOnlyForDeploymentPostprocessing = 0; | |
| 420 | + shellPath = /bin/sh; | |
| 421 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveBMineModule_Example/Pods-CNLiveBMineModule_Example-resources.sh\"\n"; | |
| 422 | + showEnvVarsInLog = 0; | |
| 423 | + }; | |
| 424 | + C07FCC71144256C0D7D38641 /* [CP] Check Pods Manifest.lock */ = { | |
| 425 | + isa = PBXShellScriptBuildPhase; | |
| 426 | + buildActionMask = 2147483647; | |
| 427 | + files = ( | |
| 428 | + ); | |
| 429 | + inputFileListPaths = ( | |
| 430 | + ); | |
| 431 | + inputPaths = ( | |
| 432 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 433 | + "${PODS_ROOT}/Manifest.lock", | |
| 434 | + ); | |
| 435 | + name = "[CP] Check Pods Manifest.lock"; | |
| 436 | + outputFileListPaths = ( | |
| 437 | + ); | |
| 438 | + outputPaths = ( | |
| 439 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveBMineModule_Tests-checkManifestLockResult.txt", | |
| 440 | + ); | |
| 441 | + runOnlyForDeploymentPostprocessing = 0; | |
| 442 | + shellPath = /bin/sh; | |
| 443 | + 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"; | |
| 444 | + showEnvVarsInLog = 0; | |
| 445 | + }; | |
| 446 | +/* End PBXShellScriptBuildPhase section */ | |
| 447 | + | |
| 448 | +/* Begin PBXSourcesBuildPhase section */ | |
| 449 | + 6003F586195388D20070C39A /* Sources */ = { | |
| 450 | + isa = PBXSourcesBuildPhase; | |
| 451 | + buildActionMask = 2147483647; | |
| 452 | + files = ( | |
| 453 | + 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, | |
| 454 | + 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, | |
| 455 | + 6003F59A195388D20070C39A /* main.m in Sources */, | |
| 456 | + ); | |
| 457 | + runOnlyForDeploymentPostprocessing = 0; | |
| 458 | + }; | |
| 459 | + 6003F5AA195388D20070C39A /* Sources */ = { | |
| 460 | + isa = PBXSourcesBuildPhase; | |
| 461 | + buildActionMask = 2147483647; | |
| 462 | + files = ( | |
| 463 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */, | |
| 464 | + ); | |
| 465 | + runOnlyForDeploymentPostprocessing = 0; | |
| 466 | + }; | |
| 467 | +/* End PBXSourcesBuildPhase section */ | |
| 468 | + | |
| 469 | +/* Begin PBXTargetDependency section */ | |
| 470 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { | |
| 471 | + isa = PBXTargetDependency; | |
| 472 | + target = 6003F589195388D20070C39A /* CNLiveBMineModule_Example */; | |
| 473 | + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; | |
| 474 | + }; | |
| 475 | +/* End PBXTargetDependency section */ | |
| 476 | + | |
| 477 | +/* Begin PBXVariantGroup section */ | |
| 478 | + 6003F596195388D20070C39A /* InfoPlist.strings */ = { | |
| 479 | + isa = PBXVariantGroup; | |
| 480 | + children = ( | |
| 481 | + 6003F597195388D20070C39A /* en */, | |
| 482 | + ); | |
| 483 | + name = InfoPlist.strings; | |
| 484 | + sourceTree = "<group>"; | |
| 485 | + }; | |
| 486 | + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { | |
| 487 | + isa = PBXVariantGroup; | |
| 488 | + children = ( | |
| 489 | + 6003F5B9195388D20070C39A /* en */, | |
| 490 | + ); | |
| 491 | + name = InfoPlist.strings; | |
| 492 | + sourceTree = "<group>"; | |
| 493 | + }; | |
| 494 | + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { | |
| 495 | + isa = PBXVariantGroup; | |
| 496 | + children = ( | |
| 497 | + 71719F9E1E33DC2100824A3D /* Base */, | |
| 498 | + ); | |
| 499 | + name = LaunchScreen.storyboard; | |
| 500 | + sourceTree = "<group>"; | |
| 501 | + }; | |
| 502 | +/* End PBXVariantGroup section */ | |
| 503 | + | |
| 504 | +/* Begin XCBuildConfiguration section */ | |
| 505 | + 6003F5BD195388D20070C39A /* Debug */ = { | |
| 506 | + isa = XCBuildConfiguration; | |
| 507 | + buildSettings = { | |
| 508 | + ALWAYS_SEARCH_USER_PATHS = NO; | |
| 509 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | |
| 510 | + CLANG_CXX_LIBRARY = "libc++"; | |
| 511 | + CLANG_ENABLE_MODULES = YES; | |
| 512 | + CLANG_ENABLE_OBJC_ARC = YES; | |
| 513 | + CLANG_WARN_BOOL_CONVERSION = YES; | |
| 514 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | |
| 515 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | |
| 516 | + CLANG_WARN_EMPTY_BODY = YES; | |
| 517 | + CLANG_WARN_ENUM_CONVERSION = YES; | |
| 518 | + CLANG_WARN_INT_CONVERSION = YES; | |
| 519 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | |
| 520 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | |
| 521 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | |
| 522 | + COPY_PHASE_STRIP = NO; | |
| 523 | + ENABLE_TESTABILITY = YES; | |
| 524 | + GCC_C_LANGUAGE_STANDARD = gnu99; | |
| 525 | + GCC_DYNAMIC_NO_PIC = NO; | |
| 526 | + GCC_OPTIMIZATION_LEVEL = 0; | |
| 527 | + GCC_PREPROCESSOR_DEFINITIONS = ( | |
| 528 | + "DEBUG=1", | |
| 529 | + "$(inherited)", | |
| 530 | + ); | |
| 531 | + GCC_SYMBOLS_PRIVATE_EXTERN = NO; | |
| 532 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | |
| 533 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | |
| 534 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | |
| 535 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | |
| 536 | + GCC_WARN_UNUSED_FUNCTION = YES; | |
| 537 | + GCC_WARN_UNUSED_VARIABLE = YES; | |
| 538 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | |
| 539 | + ONLY_ACTIVE_ARCH = YES; | |
| 540 | + SDKROOT = iphoneos; | |
| 541 | + TARGETED_DEVICE_FAMILY = "1,2"; | |
| 542 | + }; | |
| 543 | + name = Debug; | |
| 544 | + }; | |
| 545 | + 6003F5BE195388D20070C39A /* Release */ = { | |
| 546 | + isa = XCBuildConfiguration; | |
| 547 | + buildSettings = { | |
| 548 | + ALWAYS_SEARCH_USER_PATHS = NO; | |
| 549 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | |
| 550 | + CLANG_CXX_LIBRARY = "libc++"; | |
| 551 | + CLANG_ENABLE_MODULES = YES; | |
| 552 | + CLANG_ENABLE_OBJC_ARC = YES; | |
| 553 | + CLANG_WARN_BOOL_CONVERSION = YES; | |
| 554 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | |
| 555 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | |
| 556 | + CLANG_WARN_EMPTY_BODY = YES; | |
| 557 | + CLANG_WARN_ENUM_CONVERSION = YES; | |
| 558 | + CLANG_WARN_INT_CONVERSION = YES; | |
| 559 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | |
| 560 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | |
| 561 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | |
| 562 | + COPY_PHASE_STRIP = YES; | |
| 563 | + ENABLE_NS_ASSERTIONS = NO; | |
| 564 | + GCC_C_LANGUAGE_STANDARD = gnu99; | |
| 565 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | |
| 566 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | |
| 567 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | |
| 568 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | |
| 569 | + GCC_WARN_UNUSED_FUNCTION = YES; | |
| 570 | + GCC_WARN_UNUSED_VARIABLE = YES; | |
| 571 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | |
| 572 | + SDKROOT = iphoneos; | |
| 573 | + TARGETED_DEVICE_FAMILY = "1,2"; | |
| 574 | + VALIDATE_PRODUCT = YES; | |
| 575 | + }; | |
| 576 | + name = Release; | |
| 577 | + }; | |
| 578 | + 6003F5C0195388D20070C39A /* Debug */ = { | |
| 579 | + isa = XCBuildConfiguration; | |
| 580 | + baseConfigurationReference = 542BAE6708AF530FDE36965E /* Pods-CNLiveBMineModule_Example.debug.xcconfig */; | |
| 581 | + buildSettings = { | |
| 582 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |
| 583 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | |
| 584 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 585 | + GCC_PREFIX_HEADER = "CNLiveBMineModule/CNLiveBMineModule-Prefix.pch"; | |
| 586 | + INFOPLIST_FILE = "CNLiveBMineModule/CNLiveBMineModule-Info.plist"; | |
| 587 | + MODULE_NAME = ExampleApp; | |
| 588 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 589 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 590 | + SWIFT_VERSION = 4.0; | |
| 591 | + WRAPPER_EXTENSION = app; | |
| 592 | + }; | |
| 593 | + name = Debug; | |
| 594 | + }; | |
| 595 | + 6003F5C1195388D20070C39A /* Release */ = { | |
| 596 | + isa = XCBuildConfiguration; | |
| 597 | + baseConfigurationReference = A52E1E15483D5A1560C3A422 /* Pods-CNLiveBMineModule_Example.release.xcconfig */; | |
| 598 | + buildSettings = { | |
| 599 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |
| 600 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | |
| 601 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 602 | + GCC_PREFIX_HEADER = "CNLiveBMineModule/CNLiveBMineModule-Prefix.pch"; | |
| 603 | + INFOPLIST_FILE = "CNLiveBMineModule/CNLiveBMineModule-Info.plist"; | |
| 604 | + MODULE_NAME = ExampleApp; | |
| 605 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 606 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 607 | + SWIFT_VERSION = 4.0; | |
| 608 | + WRAPPER_EXTENSION = app; | |
| 609 | + }; | |
| 610 | + name = Release; | |
| 611 | + }; | |
| 612 | + 6003F5C3195388D20070C39A /* Debug */ = { | |
| 613 | + isa = XCBuildConfiguration; | |
| 614 | + baseConfigurationReference = 3A2E7B13CAFC57961AB44487 /* Pods-CNLiveBMineModule_Tests.debug.xcconfig */; | |
| 615 | + buildSettings = { | |
| 616 | + BUNDLE_LOADER = "$(TEST_HOST)"; | |
| 617 | + FRAMEWORK_SEARCH_PATHS = ( | |
| 618 | + "$(PLATFORM_DIR)/Developer/Library/Frameworks", | |
| 619 | + "$(inherited)", | |
| 620 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | |
| 621 | + ); | |
| 622 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 623 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | |
| 624 | + GCC_PREPROCESSOR_DEFINITIONS = ( | |
| 625 | + "DEBUG=1", | |
| 626 | + "$(inherited)", | |
| 627 | + ); | |
| 628 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | |
| 629 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 630 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 631 | + SWIFT_VERSION = 4.0; | |
| 632 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveBMineModule_Example.app/CNLiveBMineModule_Example"; | |
| 633 | + WRAPPER_EXTENSION = xctest; | |
| 634 | + }; | |
| 635 | + name = Debug; | |
| 636 | + }; | |
| 637 | + 6003F5C4195388D20070C39A /* Release */ = { | |
| 638 | + isa = XCBuildConfiguration; | |
| 639 | + baseConfigurationReference = 8E77D18FECAC6C19ED69DAE9 /* Pods-CNLiveBMineModule_Tests.release.xcconfig */; | |
| 640 | + buildSettings = { | |
| 641 | + BUNDLE_LOADER = "$(TEST_HOST)"; | |
| 642 | + FRAMEWORK_SEARCH_PATHS = ( | |
| 643 | + "$(PLATFORM_DIR)/Developer/Library/Frameworks", | |
| 644 | + "$(inherited)", | |
| 645 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | |
| 646 | + ); | |
| 647 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | |
| 648 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | |
| 649 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | |
| 650 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 651 | + PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 652 | + SWIFT_VERSION = 4.0; | |
| 653 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveBMineModule_Example.app/CNLiveBMineModule_Example"; | |
| 654 | + WRAPPER_EXTENSION = xctest; | |
| 655 | + }; | |
| 656 | + name = Release; | |
| 657 | + }; | |
| 658 | +/* End XCBuildConfiguration section */ | |
| 659 | + | |
| 660 | +/* Begin XCConfigurationList section */ | |
| 661 | + 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveBMineModule" */ = { | |
| 662 | + isa = XCConfigurationList; | |
| 663 | + buildConfigurations = ( | |
| 664 | + 6003F5BD195388D20070C39A /* Debug */, | |
| 665 | + 6003F5BE195388D20070C39A /* Release */, | |
| 666 | + ); | |
| 667 | + defaultConfigurationIsVisible = 0; | |
| 668 | + defaultConfigurationName = Release; | |
| 669 | + }; | |
| 670 | + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveBMineModule_Example" */ = { | |
| 671 | + isa = XCConfigurationList; | |
| 672 | + buildConfigurations = ( | |
| 673 | + 6003F5C0195388D20070C39A /* Debug */, | |
| 674 | + 6003F5C1195388D20070C39A /* Release */, | |
| 675 | + ); | |
| 676 | + defaultConfigurationIsVisible = 0; | |
| 677 | + defaultConfigurationName = Release; | |
| 678 | + }; | |
| 679 | + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveBMineModule_Tests" */ = { | |
| 680 | + isa = XCConfigurationList; | |
| 681 | + buildConfigurations = ( | |
| 682 | + 6003F5C3195388D20070C39A /* Debug */, | |
| 683 | + 6003F5C4195388D20070C39A /* Release */, | |
| 684 | + ); | |
| 685 | + defaultConfigurationIsVisible = 0; | |
| 686 | + defaultConfigurationName = Release; | |
| 687 | + }; | |
| 688 | +/* End XCConfigurationList section */ | |
| 689 | + }; | |
| 690 | + rootObject = 6003F582195388D10070C39A /* Project object */; | |
| 691 | +} | ... | ... |
Example/CNLiveBMineModule.xcodeproj/xcshareddata/xcschemes/CNLiveBMineModule-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 = "CNLiveBMineModule_Example.app" | |
| 19 | + BlueprintName = "CNLiveBMineModule_Example" | |
| 20 | + ReferencedContainer = "container:CNLiveBMineModule.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 = "CNLiveBMineModule_Tests.xctest" | |
| 37 | + BlueprintName = "CNLiveBMineModule_Tests" | |
| 38 | + ReferencedContainer = "container:CNLiveBMineModule.xcodeproj"> | |
| 39 | + </BuildableReference> | |
| 40 | + </TestableReference> | |
| 41 | + </Testables> | |
| 42 | + <MacroExpansion> | |
| 43 | + <BuildableReference | |
| 44 | + BuildableIdentifier = "primary" | |
| 45 | + BlueprintIdentifier = "6003F589195388D20070C39A" | |
| 46 | + BuildableName = "CNLiveBMineModule_Example.app" | |
| 47 | + BlueprintName = "CNLiveBMineModule_Example" | |
| 48 | + ReferencedContainer = "container:CNLiveBMineModule.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 = "CNLiveBMineModule_Example.app" | |
| 70 | + BlueprintName = "CNLiveBMineModule_Example" | |
| 71 | + ReferencedContainer = "container:CNLiveBMineModule.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 = "CNLiveBMineModule_Example.app" | |
| 89 | + BlueprintName = "CNLiveBMineModule_Example" | |
| 90 | + ReferencedContainer = "container:CNLiveBMineModule.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/CNLiveBMineModule/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/CNLiveBMineModule/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/CNLiveBMineModule/CNLIVEAppDelegate.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLIVEAppDelegate.h | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS-Xiaowen on 04/09/2020. | |
| 6 | +// Copyright (c) 2020 iOS-Xiaowen. 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/CNLiveBMineModule/CNLIVEAppDelegate.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLIVEAppDelegate.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS-Xiaowen on 04/09/2020. | |
| 6 | +// Copyright (c) 2020 iOS-Xiaowen. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CNLIVEAppDelegate.h" | |
| 10 | +#import "CNLiveBMineController.h" | |
| 11 | +#import "CNUserInfoManager.h" | |
| 12 | +#import "CNLiveEnvironment.h" | |
| 13 | +#import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h> | |
| 14 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 15 | + | |
| 16 | +@implementation CNLIVEAppDelegate | |
| 17 | + | |
| 18 | +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| 19 | +{ | |
| 20 | + // Override point for customization after application launch. | |
| 21 | + | |
| 22 | + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
| 23 | + [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore]; | |
| 24 | + [CNLiveUserSystemCenter setAppId:AppId appKey:APPKey appSecret:AppSecret isTestEnvironment:TestEnvironment]; | |
| 25 | + if ([CNUserShareManager isLogin]) { | |
| 26 | + [CNLiveUserSystemCenter setUserId:CNUserShareModel.uid]; | |
| 27 | + } | |
| 28 | +// [self networkParamAction]; | |
| 29 | + | |
| 30 | + [CNUserInfoManager saveUserinfoDic:@{ | |
| 31 | + @"bigFaceUrl":@"http://yweb0.cnliveimg.com/images/headImg/2019/1030/1572439148697.jpg", | |
| 32 | + @"countryCode":@"86", | |
| 33 | + @"email":@"zhangxiaowen@cnlive.cn", | |
| 34 | + @"extInfo":@"", | |
| 35 | + @"faceUrl":@"http://yweb0.cnliveimg.com/images/headImg/2019/1030/1572439148697_small.jpg", | |
| 36 | + @"gender":@"m", | |
| 37 | + @"hUid":@"", | |
| 38 | + @"isNewUser":@"0", | |
| 39 | + @"location":@"北京 石景山", | |
| 40 | + @"mobile":@"17600922519", | |
| 41 | + @"nickName":@"金帝", | |
| 42 | + @"platformId":@"769_jetj7bq525", | |
| 43 | + @"qqUid":@"", | |
| 44 | + @"renrenUid":@"", | |
| 45 | + @"sinaUid":@"", | |
| 46 | + @"token":@"RkFYeLkl/u5S7tW8UcOkT3rfLTP/Ua8NIkdEsKlcolvl/yxTMNbAYXmmJyhKGpkj", | |
| 47 | + @"uid":@"10514405", | |
| 48 | + @"wxUid":@"" | |
| 49 | + }]; | |
| 50 | + [[NSUserDefaults standardUserDefaults] setObject:@"RkFYeLkl/u5S7tW8UcOkT3rfLTP/Ua8NIkdEsKlcolvl/yxTMNbAYXmmJyhKGpkj" forKey:@"CNLiveAuthToken"]; | |
| 51 | + CNLiveBMineController *vc = [[CNLiveBMineController alloc] init]; | |
| 52 | + UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; | |
| 53 | + self.window.rootViewController = nav;//设置根视图控制器 | |
| 54 | + [self.window makeKeyAndVisible]; | |
| 55 | + | |
| 56 | + return YES; | |
| 57 | +} | |
| 58 | + | |
| 59 | +- (void)applicationWillResignActive:(UIApplication *)application | |
| 60 | +{ | |
| 61 | + // 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. | |
| 62 | + // 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. | |
| 63 | +} | |
| 64 | + | |
| 65 | +- (void)applicationDidEnterBackground:(UIApplication *)application | |
| 66 | +{ | |
| 67 | + // 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. | |
| 68 | + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | |
| 69 | +} | |
| 70 | + | |
| 71 | +- (void)applicationWillEnterForeground:(UIApplication *)application | |
| 72 | +{ | |
| 73 | + // 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. | |
| 74 | +} | |
| 75 | + | |
| 76 | +- (void)applicationDidBecomeActive:(UIApplication *)application | |
| 77 | +{ | |
| 78 | + // 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. | |
| 79 | +} | |
| 80 | + | |
| 81 | +- (void)applicationWillTerminate:(UIApplication *)application | |
| 82 | +{ | |
| 83 | + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | |
| 84 | +} | |
| 85 | + | |
| 86 | +@end | ... | ... |
Example/CNLiveBMineModule/CNLIVEViewController.h
0 → 100644
Example/CNLiveBMineModule/CNLIVEViewController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLIVEViewController.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS-Xiaowen on 04/09/2020. | |
| 6 | +// Copyright (c) 2020 iOS-Xiaowen. 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/CNLiveBMineModule/CNLiveBMineModule-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>CFBundleDisplayName</key> | |
| 8 | + <string>${PRODUCT_NAME}</string> | |
| 9 | + <key>CFBundleExecutable</key> | |
| 10 | + <string>${EXECUTABLE_NAME}</string> | |
| 11 | + <key>CFBundleIdentifier</key> | |
| 12 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | |
| 13 | + <key>CFBundleInfoDictionaryVersion</key> | |
| 14 | + <string>6.0</string> | |
| 15 | + <key>CFBundleName</key> | |
| 16 | + <string>${PRODUCT_NAME}</string> | |
| 17 | + <key>CFBundlePackageType</key> | |
| 18 | + <string>APPL</string> | |
| 19 | + <key>CFBundleShortVersionString</key> | |
| 20 | + <string>1.0</string> | |
| 21 | + <key>CFBundleSignature</key> | |
| 22 | + <string>????</string> | |
| 23 | + <key>CFBundleVersion</key> | |
| 24 | + <string>1.0</string> | |
| 25 | + <key>LSRequiresIPhoneOS</key> | |
| 26 | + <true/> | |
| 27 | + <key>UILaunchStoryboardName</key> | |
| 28 | + <string>LaunchScreen</string> | |
| 29 | + <key>UIMainStoryboardFile</key> | |
| 30 | + <string>Main</string> | |
| 31 | + <key>UIRequiredDeviceCapabilities</key> | |
| 32 | + <array> | |
| 33 | + <string>armv7</string> | |
| 34 | + </array> | |
| 35 | + <key>UISupportedInterfaceOrientations</key> | |
| 36 | + <array> | |
| 37 | + <string>UIInterfaceOrientationPortrait</string> | |
| 38 | + <string>UIInterfaceOrientationLandscapeLeft</string> | |
| 39 | + <string>UIInterfaceOrientationLandscapeRight</string> | |
| 40 | + </array> | |
| 41 | + <key>UISupportedInterfaceOrientations~ipad</key> | |
| 42 | + <array> | |
| 43 | + <string>UIInterfaceOrientationPortrait</string> | |
| 44 | + <string>UIInterfaceOrientationPortraitUpsideDown</string> | |
| 45 | + <string>UIInterfaceOrientationLandscapeLeft</string> | |
| 46 | + <string>UIInterfaceOrientationLandscapeRight</string> | |
| 47 | + </array> | |
| 48 | +</dict> | |
| 49 | +</plist> | ... | ... |
Example/CNLiveBMineModule/CNLiveBMineModule-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/CNLiveBMineModule/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/CNLiveBMineModule/en.lproj/InfoPlist.strings
0 → 100644
Example/CNLiveBMineModule/main.m
0 → 100644
| 1 | +// | |
| 2 | +// main.m | |
| 3 | +// CNLiveBMineModule | |
| 4 | +// | |
| 5 | +// Created by iOS-Xiaowen on 04/09/2020. | |
| 6 | +// Copyright (c) 2020 iOS-Xiaowen. 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 'CNLiveBMineModule_Example' do | |
| 7 | + pod 'CNLiveBMineModule', :path => '../' | |
| 8 | + #依赖三方私有库,如果里面有.a的时候加上这个 | |
| 9 | + pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} | |
| 10 | + end | |
| 11 | + | |
| 12 | + target 'CNLiveBMineModule_Tests' do | |
| 13 | + inherit! :search_paths | |
| 14 | + | |
| 15 | + | |
| 16 | + end | |
| 17 | +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 | +// CNLiveBMineModuleTests.m | |
| 3 | +// CNLiveBMineModuleTests | |
| 4 | +// | |
| 5 | +// Created by iOS-Xiaowen on 04/09/2020. | |
| 6 | +// Copyright (c) 2020 iOS-Xiaowen. 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
| 1 | +Copyright (c) 2020 iOS-Xiaowen <153993236@qq.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 | -CNLiveBMineModule | |
| 2 | 1 | \ No newline at end of file |
| 2 | +# CNLiveBMineModule | |
| 3 | + | |
| 4 | +[](https://travis-ci.org/iOS-Xiaowen/CNLiveBMineModule) | |
| 5 | +[](https://cocoapods.org/pods/CNLiveBMineModule) | |
| 6 | +[](https://cocoapods.org/pods/CNLiveBMineModule) | |
| 7 | +[](https://cocoapods.org/pods/CNLiveBMineModule) | |
| 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 | +CNLiveBMineModule is available through [CocoaPods](https://cocoapods.org). To install | |
| 18 | +it, simply add the following line to your Podfile: | |
| 19 | + | |
| 20 | +```ruby | |
| 21 | +pod 'CNLiveBMineModule' | |
| 22 | +``` | |
| 23 | + | |
| 24 | +## Author | |
| 25 | + | |
| 26 | +iOS-Xiaowen, 153993236@qq.com | |
| 27 | + | |
| 28 | +## License | |
| 29 | + | |
| 30 | +CNLiveBMineModule is available under the MIT license. See the LICENSE file for more info. | ... | ... |
_Pods.xcodeproj
0 → 120000