Skip to content

Commit

Permalink
Merge pull request #334 from Dongshanxu/master
Browse files Browse the repository at this point in the history
修改类作用域
  • Loading branch information
shine2008 authored May 26, 2022
2 parents 80ab262 + 58cce09 commit f46cf9d
Show file tree
Hide file tree
Showing 41 changed files with 243 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UIKit
import NIMSDK
import NEKitCoreIM

class GroupChatViewController: ChatViewController, TeamChatViewModelDelegate {
public class GroupChatViewController: ChatViewController, TeamChatViewModelDelegate {

// override init(session: NIMSession) {
// super.init(session: session)
Expand All @@ -27,12 +27,12 @@ class GroupChatViewController: ChatViewController, TeamChatViewModelDelegate {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()

}

override func getSessionInfo(session: NIMSession) {
public override func getSessionInfo(session: NIMSession) {
if let vm = self.viewmodel as? TeamChatViewModel {
if let t = vm.getTeam(teamId: session.sessionId) {
self.updateTeamInfo(team: t)
Expand All @@ -53,13 +53,13 @@ class GroupChatViewController: ChatViewController, TeamChatViewModelDelegate {
}

// MARK: TeamChatViewModelDelegate
func onTeamRemoved(team: NIMTeam) {
public func onTeamRemoved(team: NIMTeam) {
showSingleAlert(message: localizable("team_has_been_removed")) {
self.navigationController?.popViewController(animated: true)
}
}

func onTeamUpdate(team: NIMTeam) {
public func onTeamUpdate(team: NIMTeam) {
self.updateTeamInfo(team: team)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

import UIKit
import NIMSDK
class P2PChatViewController: ChatViewController {
public class P2PChatViewController: ChatViewController {

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
}

override func getSessionInfo(session: NIMSession) {
public override func getSessionInfo(session: NIMSession) {
viewmodel.getUserInfo(userId: session.sessionId)
let user = viewmodel.getUserInfo(userId: session.sessionId)
let title = user?.showName() ?? ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import NIMSDK
import NEKitCoreIM
import NEKitCommonUI

class ReadViewController: NEBaseViewController, UIScrollViewDelegate, UITableViewDelegate, UITableViewDataSource {
public class ReadViewController: NEBaseViewController, UIScrollViewDelegate, UITableViewDelegate, UITableViewDataSource {

public var read: Bool = true
public var line: UIView = UIView()
Expand All @@ -27,7 +27,7 @@ class ReadViewController: NEBaseViewController, UIScrollViewDelegate, UITableVie
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()
commonUI()
loadData(message: self.message)
Expand Down Expand Up @@ -201,15 +201,15 @@ class ReadViewController: NEBaseViewController, UIScrollViewDelegate, UITableVie
}
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if self.read {
return self.readUsers.count
}else {
return self.unReadUsers.count
}
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "\(UserTableViewCell.self)", for: indexPath) as! UserTableViewCell
if self.read {
let model = self.readUsers[indexPath.row]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import UIKit
import NEKitChat

typealias didSelectedAtRow = ( _ index: Int, _ model: ChatTeamMemberInfoModel?) -> ()
public typealias didSelectedAtRow = ( _ index: Int, _ model: ChatTeamMemberInfoModel?) -> ()

class SelectUserViewController: NEBaseViewController, UITableViewDelegate, UITableViewDataSource {
public class SelectUserViewController: NEBaseViewController, UITableViewDelegate, UITableViewDataSource {

public var tableView = UITableView.init(frame: .zero, style: .plain)
public var sessionId: String
Expand All @@ -24,7 +24,7 @@ class SelectUserViewController: NEBaseViewController, UITableViewDelegate, UITab
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()
commonUI()
loadData()
Expand Down Expand Up @@ -109,14 +109,14 @@ class SelectUserViewController: NEBaseViewController, UITableViewDelegate, UITab
}
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if let count = self.teamInfo?.users.count {
return count + 1
}
return 0
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "\(ChatTeamMemberCell.self)", for: indexPath) as! ChatTeamMemberCell
if indexPath.row == 0 {
cell.headerView.image = UIImage.ne_imageNamed(name: "chat_team")
Expand All @@ -129,7 +129,7 @@ class SelectUserViewController: NEBaseViewController, UITableViewDelegate, UITab
return cell
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

if indexPath.row == 0 {
if let block = self.selectedBlock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UIKit
import NEKitCommon
import NIMSDK

class UserSettingViewController: NEBaseViewController, UserSettingViewModelDelegate {
public class UserSettingViewController: NEBaseViewController, UserSettingViewModelDelegate {

var userId: String?

Expand Down Expand Up @@ -53,7 +53,7 @@ class UserSettingViewController: NEBaseViewController, UserSettingViewModelDeleg
return table
}()

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()
viewmodel.delegate = self
setupUI()
Expand Down Expand Up @@ -205,11 +205,11 @@ class UserSettingViewController: NEBaseViewController, UserSettingViewModelDeleg

extension UserSettingViewController: UITableViewDataSource, UITableViewDelegate {

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return viewmodel.cellDatas.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let model = viewmodel.cellDatas[indexPath.row]
if let cell = tableView.dequeueReusableCell(withIdentifier: "\(UserSettingSwitchCell.self)", for: indexPath) as? UserSettingBaseCell {
cell.configure(model)
Expand All @@ -218,7 +218,7 @@ extension UserSettingViewController: UITableViewDataSource, UITableViewDelegate
return UITableViewCell()
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// let model = viewmodel.cellDatas[indexPath.row]

}
Expand Down
2 changes: 1 addition & 1 deletion NEKitCommon/NEKitCommonUI/NEKitCommonUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TODO: Add long description of the pod here.

# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'Alamofire', '4.9.1'
s.dependency 'NECommonKit'
s.dependency 'Toast-Swift'
s.dependency 'SDWebImage'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ open class ContactBaseViewCell: UITableViewCell {
contentView.addSubview(avatarImage)
leftConstraint = avatarImage.leftAnchor.constraint(equalTo: self.contentView.leftAnchor, constant: 20)
leftConstraint?.isActive = true

NSLayoutConstraint.activate([
avatarImage.widthAnchor.constraint(equalToConstant: 36),
avatarImage.heightAnchor.constraint(equalToConstant: 36),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import UIKit
import NEKitCoreIM
import NEKitCommon
class BlackListViewController: UIViewController, UITableViewDelegate, UITableViewDataSource,TeamTableViewCellDelegate {
public class BlackListViewController: UIViewController, UITableViewDelegate, UITableViewDataSource,TeamTableViewCellDelegate {
var tableView = UITableView(frame: .zero, style: .plain)
var viewModel = BlackListViewModel()
public var blackList: [User]?

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()
commonUI()
loadData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import UIKit
import NIMSDK
import NEKitCore

class TeamListViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
public class TeamListViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var tableView = UITableView(frame: .zero, style: .plain)
var viewModel = TeamListViewModel()
var isClickCallBack = false

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()
commonUI()
loadData()
Expand Down Expand Up @@ -54,7 +54,7 @@ class TeamListViewController: UIViewController, UITableViewDelegate, UITableView
return cell
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = viewModel.teamList[indexPath.row]
if isClickCallBack == true {
Router.shared.use(ContactTeamDataRouter, parameters: ["team": model.nimTeam as Any], closure: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UIKit
import NEKitCoreIM
import NEKitCore

class ContactRemakNameViewController: ContactBaseViewController, UITextFieldDelegate {
public class ContactRemakNameViewController: ContactBaseViewController, UITextFieldDelegate {

typealias ModifyBlock = (_ user: User) -> Void

Expand All @@ -29,7 +29,7 @@ class ContactRemakNameViewController: ContactBaseViewController, UITextFieldDele
// return btn
// }()

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
Expand Down Expand Up @@ -106,7 +106,7 @@ class ContactRemakNameViewController: ContactBaseViewController, UITextFieldDele
}
*/

func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let text = "\(textField.text ?? "")\(string)"
print("text count : ", text.count)
if text.count > 30 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public class ValiationMessageConfig {

}

class ValidationMessageViewController: ContactBaseViewController {
public class ValidationMessageViewController: ContactBaseViewController {

let viewModel = ValidationMessageViewModel()

let tableView = UITableView()
private let tag = "ValidationMessageViewController"

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
Expand Down Expand Up @@ -68,11 +68,11 @@ class ValidationMessageViewController: ContactBaseViewController {

extension ValidationMessageViewController: UITableViewDelegate, UITableViewDataSource {

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return viewModel.datas.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

let noti = viewModel.datas[indexPath.row]
let reuseIdentifier = "\(SystemNotificationCell.self)"
Expand All @@ -82,7 +82,7 @@ extension ValidationMessageViewController: UITableViewDelegate, UITableViewDataS
return cell
}

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 60
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import UIKit

class FindFriendViewController: ContactBaseViewController, UITextFieldDelegate {
public class FindFriendViewController: ContactBaseViewController, UITextFieldDelegate {

let viewModel = FindFriendViewModel()
let noResultView = UIView()
Expand All @@ -30,13 +30,13 @@ class FindFriendViewController: ContactBaseViewController, UITextFieldDelegate {
return label
}()

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()
self.title = "添加好友"
setupUI()
}

override func viewWillAppear(_ animated: Bool) {
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.isNavigationBarHidden = false
}
Expand Down Expand Up @@ -99,7 +99,7 @@ class FindFriendViewController: ContactBaseViewController, UITextFieldDelegate {
userLabel.isHidden = true
}

func textFieldShouldReturn(_ textField: UITextField) -> Bool {
public func textFieldShouldReturn(_ textField: UITextField) -> Bool {

guard let text = textField.text else {
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import UIKit
import NIMSDK

class SearchSessionHeaderView:UITableViewHeaderFooterView {
class SearchSessionHeaderView:UITableViewHeaderFooterView {

override init(reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class NEMessageUtil {
text = "[图片]"
break
case .video:
text = "[视屏]"
text = "[视频]"
break
case .location:
text = "[位置]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CoreAudio
import MJRefresh

typealias AddMemberRoleBlock = (_ memberRole: MemberRole?) -> Void
class QChatAddMemberVC: QChatSearchVC {
public class QChatAddMemberVC: QChatSearchVC {
public var channel: ChatChannel?
private var serverMembers:[ServerMemeber]?
private var channelMembers:[ServerMemeber]?
Expand All @@ -24,7 +24,7 @@ class QChatAddMemberVC: QChatSearchVC {
super.init(coder: coder)
}

override func viewDidLoad() {
public override func viewDidLoad() {
super.viewDidLoad()
self.title = localizable("add_member")
self.tableView.register(QChatImageTextCell.self, forCellReuseIdentifier: "\(QChatImageTextCell.self)")
Expand Down Expand Up @@ -149,11 +149,11 @@ class QChatAddMemberVC: QChatSearchVC {
}
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
public override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.serverMembers?.count ?? 0
}

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
public override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "\(QChatImageTextCell.self)", for: indexPath) as! QChatImageTextCell
cell.backgroundColor = .white
cell.rightStyle = .indicate
Expand Down
Loading

0 comments on commit f46cf9d

Please sign in to comment.