Commit 0558fef1 by ludi

通知测试版本

parent 0a9300d2
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import RxCocoa import RxCocoa
import RxSwift import RxSwift
import SwiftyJSON
@objcMembers open class FUSSwiftCacheDataShare: NSObject { @objcMembers open class FUSSwiftCacheDataShare: NSObject {
...@@ -82,6 +83,16 @@ import RxSwift ...@@ -82,6 +83,16 @@ import RxSwift
set { FUSSwiftCacheDataShare.share.isNewRegister.accept(newValue) } set { FUSSwiftCacheDataShare.share.isNewRegister.accept(newValue) }
} }
/// 测试数据
@objc public var oc_testDataList: [String] = .init()
/// 添加测试数据
@objc public static func fus_addTestLog(msg: String) {
FUSSwiftCacheDataShare.share.oc_testDataList.append(msg)
}
@objc public static func fus_addTestLog(title: String, object: [AnyHashable: Any]){
FUSSwiftCacheDataShare.share.oc_testDataList.append(title + (JSON(object).rawString() ?? ""))
}
// - swift PART // - swift PART
/// 当前是否登录 /// 当前是否登录
public let isLogin: BehaviorRelay<Bool> = .init(value: false) public let isLogin: BehaviorRelay<Bool> = .init(value: false)
......
...@@ -672,7 +672,7 @@ ...@@ -672,7 +672,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260014; CURRENT_PROJECT_VERSION = 202506260015;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
...@@ -940,7 +940,7 @@ ...@@ -940,7 +940,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260014; CURRENT_PROJECT_VERSION = 202506260015;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
......
...@@ -306,7 +306,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -306,7 +306,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
// iOS 10: 点击通知进入App时触发,在该方法内统计有效用户点击数 // iOS 10: 点击通知进入App时触发,在该方法内统计有效用户点击数
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler { - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"111111111"];
[self handleNotificationEventWithContent:response.notification.request.content.userInfo notificontent:response.notification.request.content]; [self handleNotificationEventWithContent:response.notification.request.content.userInfo notificontent:response.notification.request.content];
[self fus_handleChatLocalAPNsNotification:response]; [self fus_handleChatLocalAPNsNotification:response];
// [ GTSdk ]:将收到的APNs信息传给个推统计 // [ GTSdk ]:将收到的APNs信息传给个推统计
...@@ -335,6 +335,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -335,6 +335,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
- (void)handleNotificationEventWithContent:(NSDictionary *)content notificontent:(UNNotificationContent *)notificontent{ - (void)handleNotificationEventWithContent:(NSDictionary *)content notificontent:(UNNotificationContent *)notificontent{
[FUSSwiftCacheDataShare fus_addTestLogWithTitle:@"22222content:" object:content];
// 个推 // 个推
__block NSDictionary *transmissionContent = [content[@"transmissionContent"] converToDictionary]; __block NSDictionary *transmissionContent = [content[@"transmissionContent"] converToDictionary];
...@@ -367,12 +368,14 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -367,12 +368,14 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
} }
if ([NSDictionary isNull:transmissionContent] == NO) { if ([NSDictionary isNull:transmissionContent] == NO) {
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"333333333"];
MJWeakSelf MJWeakSelf
[FUSRouter.userRouter fus_loginSucceedListener:^{ [FUSRouter.userRouter fus_loginSucceedListener:^{
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"444444444444"];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (FUSCacheDataShare.shareStore.userDetailInfo.uid) { if (FUSCacheDataShare.shareStore.userDetailInfo.uid) {
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"555555555555"];
// 准备上报的材料 // 准备上报的材料
NSMutableDictionary *reqDataJSON = [[NSMutableDictionary alloc] initWithDictionary:[transmissionContent copy]]; NSMutableDictionary *reqDataJSON = [[NSMutableDictionary alloc] initWithDictionary:[transmissionContent copy]];
reqDataJSON[@"data"][@"title"] = notificontent.title ?: @""; reqDataJSON[@"data"][@"title"] = notificontent.title ?: @"";
...@@ -410,11 +413,12 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -410,11 +413,12 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
} }
- (void)startJumpIntoPage:(NSDictionary *)content logExtraJson:(NSString *)logExtraJson{ - (void)startJumpIntoPage:(NSDictionary *)content logExtraJson:(NSString *)logExtraJson{
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:[NSString stringWithFormat:@"6666666666logExtraJson:%@",logExtraJson]];
// 如果还没登录的话,不需要做跳转操作 // 如果还没登录的话,不需要做跳转操作
if (FUSCacheDataShare.shareStore.userDetailInfo.uid == nil) { if (FUSCacheDataShare.shareStore.userDetailInfo.uid == nil) {
return; return;
} }
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"77777777777"];
NSInteger type = [content[@"type"] integerValue]; NSInteger type = [content[@"type"] integerValue];
NSDictionary *info = content[@"data"]; NSDictionary *info = content[@"data"];
if ([NSDictionary isNull:info] == NO) { if ([NSDictionary isNull:info] == NO) {
...@@ -427,7 +431,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -427,7 +431,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
} else if (info[@"userId"]) { } else if (info[@"userId"]) {
userId = info[@"userId"]; userId = info[@"userId"];
} }
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"888888888888"];
[FUSAlertView fus_dismissAllAlertViewWithAnimate:YES]; [FUSAlertView fus_dismissAllAlertViewWithAnimate:YES];
...@@ -458,7 +462,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -458,7 +462,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
NSString *cacheUDKey = [FUSLiveUDKeys fus_LiveRoomPasswordCacheUDKEY:userId]; NSString *cacheUDKey = [FUSLiveUDKeys fus_LiveRoomPasswordCacheUDKEY:userId];
[[NSUserDefaults standardUserDefaults] setValue:password forKey:cacheUDKey]; [[NSUserDefaults standardUserDefaults] setValue:password forKey:cacheUDKey];
} }
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"9999999999999"];
[FUSRouter.liveRouter fus_enterLiveRoom:userId]; [FUSRouter.liveRouter fus_enterLiveRoom:userId];
[FUSDataStatisticsManager fus_behaviorJoinRoomLogWithReqType:5 reqEventType:1 extraInfo:@"" extraJson:logExtraJson roomId:userId]; [FUSDataStatisticsManager fus_behaviorJoinRoomLogWithReqType:5 reqEventType:1 extraInfo:@"" extraJson:logExtraJson roomId:userId];
break; break;
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>FUSChatCenterBundle.xcscheme_^#shared#^_</key> <key>FUSChatCenterBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>85</integer> <integer>89</integer>
</dict> </dict>
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key> <key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>89</integer> <integer>85</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key> <key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>87</integer> <integer>83</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
00E502302E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E5022F2E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift */; }; 00E502302E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E5022F2E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift */; };
00E502322E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E502312E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift */; }; 00E502322E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E502312E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift */; };
00E502342E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E502332E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift */; }; 00E502342E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E502332E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift */; };
00E502EA2E162B0D00579DB0 /* FUSNotificationTestController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E502E92E162B0D00579DB0 /* FUSNotificationTestController.swift */; };
9E8D0BED6061C8C88FBF8686 /* Pods_FUSUserCenterModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BED3EAC4EA2F921CB5B2FEE8 /* Pods_FUSUserCenterModule.framework */; }; 9E8D0BED6061C8C88FBF8686 /* Pods_FUSUserCenterModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BED3EAC4EA2F921CB5B2FEE8 /* Pods_FUSUserCenterModule.framework */; };
BE189A2D2C7323FE0008418B /* FSRDynamicImModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */; }; BE189A2D2C7323FE0008418B /* FSRDynamicImModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */; };
BE189A2E2C7323FE0008418B /* FSRDynamicImModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */; }; BE189A2E2C7323FE0008418B /* FSRDynamicImModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */; };
...@@ -1079,6 +1080,7 @@ ...@@ -1079,6 +1080,7 @@
00E5022F2E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSMyInviteQRCodeDownloadView.swift; sourceTree = "<group>"; }; 00E5022F2E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSMyInviteQRCodeDownloadView.swift; sourceTree = "<group>"; };
00E502312E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteRecallWellcomeAlertView.swift; sourceTree = "<group>"; }; 00E502312E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteRecallWellcomeAlertView.swift; sourceTree = "<group>"; };
00E502332E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteConfigHalfWebAlertView.swift; sourceTree = "<group>"; }; 00E502332E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteConfigHalfWebAlertView.swift; sourceTree = "<group>"; };
00E502E92E162B0D00579DB0 /* FUSNotificationTestController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSNotificationTestController.swift; sourceTree = "<group>"; };
29DC17A1A1D4B29CA3BB6003 /* Pods-FUSUserCenterModule.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FUSUserCenterModule.debug.xcconfig"; path = "Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule.debug.xcconfig"; sourceTree = "<group>"; }; 29DC17A1A1D4B29CA3BB6003 /* Pods-FUSUserCenterModule.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FUSUserCenterModule.debug.xcconfig"; path = "Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule.debug.xcconfig"; sourceTree = "<group>"; };
BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSRDynamicImModel.h; sourceTree = "<group>"; }; BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSRDynamicImModel.h; sourceTree = "<group>"; };
BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSRDynamicImModel.m; sourceTree = "<group>"; }; BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSRDynamicImModel.m; sourceTree = "<group>"; };
...@@ -2196,6 +2198,7 @@ ...@@ -2196,6 +2198,7 @@
00B45E4C2D9401CE00FF138F /* FUSInviteRewardController.swift */, 00B45E4C2D9401CE00FF138F /* FUSInviteRewardController.swift */,
00B45E4D2D9401CE00FF138F /* FUSMyEmissaryQRCodeController.swift */, 00B45E4D2D9401CE00FF138F /* FUSMyEmissaryQRCodeController.swift */,
00E502252E0A947100579DB0 /* FUSInviteEmissaryRewardController.swift */, 00E502252E0A947100579DB0 /* FUSInviteEmissaryRewardController.swift */,
00E502E92E162B0D00579DB0 /* FUSNotificationTestController.swift */,
); );
path = InviteReward; path = InviteReward;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -4528,10 +4531,14 @@ ...@@ -4528,10 +4531,14 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule-resources-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule-resources-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule-resources.sh\"\n";
...@@ -4897,6 +4904,7 @@ ...@@ -4897,6 +4904,7 @@
BE189A402C7323FE0008418B /* FSRPrivacyModel.m in Sources */, BE189A402C7323FE0008418B /* FSRPrivacyModel.m in Sources */,
BE78CCE82C538D8000F38855 /* FUSImAnchorViewController.m in Sources */, BE78CCE82C538D8000F38855 /* FUSImAnchorViewController.m in Sources */,
BE78CC612C538D7F00F38855 /* UIControl+WGButtonExtension.m in Sources */, BE78CC612C538D7F00F38855 /* UIControl+WGButtonExtension.m in Sources */,
00E502EA2E162B0D00579DB0 /* FUSNotificationTestController.swift in Sources */,
BE78CB1E2C538D7E00F38855 /* FUSSetUserInfoViewController.m in Sources */, BE78CB1E2C538D7E00F38855 /* FUSSetUserInfoViewController.m in Sources */,
BE78CC3B2C538D7F00F38855 /* FUSNewsFeedLikeListViewController.m in Sources */, BE78CC3B2C538D7F00F38855 /* FUSNewsFeedLikeListViewController.m in Sources */,
BE189A542C7323FE0008418B /* FSRLoginViewController.m in Sources */, BE189A542C7323FE0008418B /* FSRLoginViewController.m in Sources */,
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>FUSUserCenterModule.xcscheme_^#shared#^_</key> <key>FUSUserCenterModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>86</integer> <integer>87</integer>
</dict> </dict>
<key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key> <key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>83</integer> <integer>86</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -205,11 +205,13 @@ public class FUSInviteRewardController: FUSBaseViewController { ...@@ -205,11 +205,13 @@ public class FUSInviteRewardController: FUSBaseViewController {
let scanBtn = UIButton(type: .custom) let scanBtn = UIButton(type: .custom)
scanBtn.setImage(FUSUserCenterBunble.imageNamed("inviteReward_navi_scan_icon"), for: .normal) scanBtn.setImage(FUSUserCenterBunble.imageNamed("inviteReward_navi_scan_icon"), for: .normal)
scanBtn.rx.tap.subscribe(onNext: { scanBtn.rx.tap.subscribe(onNext: {
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false) { // FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false) {
FUSRouter.userRouter().fus_showBindAgentSuccessPopView { // FUSRouter.userRouter().fus_showBindAgentSuccessPopView {
//
} // }
} // }
let vc = FUSNotificationTestController()
self.navigationController?.pushViewController(vc, animated: true)
}) })
.disposed(by: disposeBag) .disposed(by: disposeBag)
......
//
// FUSNotificationTestController.swift
// FUSUserCenterModule
//
// Created by aaa on 2025/7/3.
//
import UIKit
class FUSNotificationTestController: FUSBaseViewController {
private let tableView = UITableView(frame: .zero)
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.title = .fus_localString("notification")
self.showBackBtn = true
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.showsVerticalScrollIndicator = false
tableView.showsHorizontalScrollIndicator = false
tableView.delegate = self
tableView.dataSource = self
tableView.register(FUSNotificationTestCell.self, forCellReuseIdentifier: FUSNotificationTestCell.cellID)
self.view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
tableView.mj_header = .init(refreshingBlock: {[weak self] in
self?.tableView.reloadData()
})
}
}
extension FUSNotificationTestController: UITableViewDelegate, UITableViewDataSource{
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return FUSSwiftCacheDataShare.share.oc_testDataList.count
}
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return 44
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if let cell = tableView.dequeueReusableCell(withIdentifier: FUSNotificationTestCell.cellID, for: indexPath) as? FUSNotificationTestCell{
cell.titleLabel.text = FUSSwiftCacheDataShare.share.oc_testDataList[indexPath.row]
return cell
}
return .init()
}
}
class FUSNotificationTestCell: UITableViewCell{
static public let cellID: String = "FUSNotificationTestCell_cellid"
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = UITableViewCell.SelectionStyle.none
self.makeUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
let titleLabel = UILabel()
func makeUI() {
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
titleLabel.font = .fus_themeFont(14)
titleLabel.textColor = .fus_textColorRich()
titleLabel.numberOfLines = 0
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.top.bottom.right.equalToSuperview().inset(20)
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment