Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 68e42a59
由
cgx
编写于
2022-09-02 17:55:33 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
导航栏隐藏手动开启侧滑,编写文章咨询请求接口
1 个父辈
c82a945d
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
83 行增加
和
28 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/Basement/Category/DSNavigationTools/NaviBarHandlerProtocol.h
DreamSleep/DreamSleep/Basement/Category/DSNavigationTools/UIViewController+Swizzling.h
DreamSleep/DreamSleep/Basement/Category/DSNavigationTools/UIViewController+Swizzling.m
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
DreamSleep/DreamSleep/Class/AISleepModule/SleepCoach/Controller/AISleepCoachController.m
DreamSleep/DreamSleep/Class/CommunityModule/ArticleRequestModel.h
DreamSleep/DreamSleep/Class/CommunityModule/ArticleRequestModel.m
DreamSleep/DreamSleep/Class/CommunityModule/CommunityController.m
DreamSleep/DreamSleep/Class/HomeModule/Course/Controller/MusicPlayerController.m
DreamSleep/DreamSleep/Class/HomeModule/UnityGame/UnityGameController.m
DreamSleep/DreamSleep/Class/Start/Root/DSBaseViewController.m
DreamSleep/DreamSleep/Class/Start/Root/DSNaviBarViewController.m
DreamSleep/DreamSleep/Flutter/BaseFlutterController.m
DreamSleep/DreamSleep/Flutter/TestFlutterController.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
68e42a5
...
...
@@ -154,6 +154,7 @@
D0A1C48C28C1A42A000975DC /* BaseFlutterController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A1C48828C1A42A000975DC /* BaseFlutterController.m */; };
D0A1C48D28C1A42A000975DC /* TestFlutterController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A1C48B28C1A42A000975DC /* TestFlutterController.m */; };
D0A1C48F28C1A9E1000975DC /* Info_Debug.plist in Resources */ = {isa = PBXBuildFile; fileRef = D0A1C48E28C1A9E1000975DC /* Info_Debug.plist */; };
D0A1C49228C2084B000975DC /* ArticleRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A1C49128C2084B000975DC /* ArticleRequestModel.m */; };
D0A245F6283DB12100FB49AA /* WKWebView+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A245F5283DB12100FB49AA /* WKWebView+Extras.m */; };
D0A72E39282B566200EED7BE /* HomeBasicCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E38282B566200EED7BE /* HomeBasicCell.m */; };
D0A72E3F282B89AD00EED7BE /* DSHomeView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E3E282B89AD00EED7BE /* DSHomeView.m */; };
...
...
@@ -547,6 +548,8 @@
D0A1C48A28C1A42A000975DC /* BaseFlutterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseFlutterController.h; sourceTree = "<group>"; };
D0A1C48B28C1A42A000975DC /* TestFlutterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestFlutterController.m; sourceTree = "<group>"; };
D0A1C48E28C1A9E1000975DC /* Info_Debug.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info_Debug.plist; sourceTree = "<group>"; };
D0A1C49028C2084B000975DC /* ArticleRequestModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ArticleRequestModel.h; sourceTree = "<group>"; };
D0A1C49128C2084B000975DC /* ArticleRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ArticleRequestModel.m; sourceTree = "<group>"; };
D0A245F4283DB12100FB49AA /* WKWebView+Extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WKWebView+Extras.h"; sourceTree = "<group>"; };
D0A245F5283DB12100FB49AA /* WKWebView+Extras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WKWebView+Extras.m"; sourceTree = "<group>"; };
D0A72E37282B566200EED7BE /* HomeBasicCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeBasicCell.h; sourceTree = "<group>"; };
...
...
@@ -1372,6 +1375,8 @@
D0A1C48428C197B3000975DC /* Community.storyboard */,
D0A1C48128C195CD000975DC /* CommunityController.h */,
D0A1C48228C195CD000975DC /* CommunityController.m */,
D0A1C49028C2084B000975DC /* ArticleRequestModel.h */,
D0A1C49128C2084B000975DC /* ArticleRequestModel.m */,
);
path = CommunityModule;
sourceTree = "<group>";
...
...
@@ -2282,6 +2287,7 @@
D07257F6286C2F110080F458 /* SignCollectionViewCell.m in Sources */,
D00291892816CD4500C0573B /* DsCacheUtils.m in Sources */,
D07DAC902810546A0067A1BF /* DSImagePickerController.m in Sources */,
D0A1C49228C2084B000975DC /* ArticleRequestModel.m in Sources */,
D0DF90AE2814390000FC0F64 /* BannerModel.m in Sources */,
D0E65FFF2807AC5E006562F2 /* DSProgressHUD.m in Sources */,
D0496798283484CC00FB81E5 /* ProfileTableView.m in Sources */,
...
...
DreamSleep/DreamSleep/Basement/Category/DSNavigationTools/NaviBarHandlerProtocol.h
查看文件 @
68e42a5
...
...
@@ -33,11 +33,11 @@ typedef NS_ENUM(NSUInteger, NaviStyle) {
@optional
/**
是否
显示
导航栏
是否
隐藏
导航栏
@return 默认显示
,YES
@return 默认显示
导航栏,NO
*/
-
(
BOOL
)
is
Show
NavigationBar
;
-
(
BOOL
)
is
Hide
NavigationBar
;
/**
页面侧滑状态
...
...
DreamSleep/DreamSleep/Basement/Category/DSNavigationTools/UIViewController+Swizzling.h
查看文件 @
68e42a5
...
...
@@ -8,6 +8,6 @@
#import <UIKit/UIKit.h>
@interface
UIViewController
(
Swizzling
)
<
NaviBarHandlerProtocol
>
@interface
UIViewController
(
Swizzling
)
<
NaviBarHandlerProtocol
,
UIGestureRecognizerDelegate
>
@end
DreamSleep/DreamSleep/Basement/Category/DSNavigationTools/UIViewController+Swizzling.m
查看文件 @
68e42a5
...
...
@@ -12,8 +12,7 @@
@implementation
UIViewController
(
Swizzling
)
+
(
void
)
load
{
+
(
void
)
load
{
// 拦截viewWillAppear:事件
SEL
origSel0
=
@selector
(
viewWillAppear
:
);
SEL
swizSel0
=
@selector
(
swiz_viewWillAppear
:
);
...
...
@@ -31,8 +30,7 @@
}
// exchange implementation of two methods
+
(
void
)
swizzleMethods
:
(
Class
)
class
originalSelector
:
(
SEL
)
origSel
swizzledSelector
:
(
SEL
)
swizSel
{
+
(
void
)
swizzleMethods
:
(
Class
)
class
originalSelector
:
(
SEL
)
origSel
swizzledSelector
:
(
SEL
)
swizSel
{
Method
origMethod
=
class_getInstanceMethod
(
class
,
origSel
);
Method
swizMethod
=
class_getInstanceMethod
(
class
,
swizSel
);
...
...
@@ -49,19 +47,17 @@
#pragma mark - 响应自定义viewWillAppear:事件
-
(
void
)
swiz_viewWillAppear
:
(
BOOL
)
animated
{
#pragma mark - 处理导航栏显示/隐藏
self
.
navigationController
.
navigationBarHidden
=
([
self
respondsToSelector
:
@selector
(
isShowNavigationBar
)]
&&
[
self
isShowNavigationBar
]
==
YES
)
?
YES
:
NO
;
self
.
navigationController
.
navigationBarHidden
=
([
self
respondsToSelector
:
@selector
(
isHideNavigationBar
)]
&&
[
self
isHideNavigationBar
]
==
YES
)
?
YES
:
NO
;
// 隐藏导航栏的手动开启侧滑
if
(
self
.
navigationController
.
navigationBarHidden
)
{
self
.
navigationController
.
interactivePopGestureRecognizer
.
delegate
=
self
;
}
#pragma mark - 根据不同页面设置不同的导航栏风格
if
([
self
respondsToSelector
:
@selector
(
navigationBarStyle
)])
{
[
BaseNaviController
setNavigationBarStyle
:[
self
navigationBarStyle
]
vc
:
self
];
}
// 系统拍照和相册页面调试
// NSString *className = NSStringFromClass([self class]);
// NSArray *classArrary = @[@"JWMImagePickerController",
// @"CAMImagePickerCameraViewController", @"CAMViewfinderViewController", @"CAMPreviewViewController",
// @"UIInputWindowController", @"UIEditingOverlayViewController", @"PUPhotoPickerHostViewController",
// @"PLPhotoTileViewController"];
#pragma mark - 处理用户打开自动切换主题按钮,根据设定好的时间段进行主题切换
if
(
kGetUserDefaultsBOOL
(
ThemeAutoSwitch
))
{
if
([
NSDate
judgeTimeWithStartTime
:
StartTime1
expireTime
:
ExpireTime1
]
||
[
NSDate
judgeTimeWithStartTime
:
StartTime2
expireTime
:
ExpireTime2
])
{
...
...
@@ -76,8 +72,7 @@
}
#pragma mark - 响应自定义viewDidLoad事件
-
(
void
)
swiz_viewDidLoad
:
(
BOOL
)
animated
{
-
(
void
)
swiz_viewDidLoad
:
(
BOOL
)
animated
{
#pragma mark - 处理返回按钮显示/隐藏
self
.
navigationItem
.
hidesBackButton
=
([
self
respondsToSelector
:
@selector
(
isHideBackButton
)]
&&
[
self
isHideBackButton
]
==
YES
)
?
YES
:
NO
;
...
...
@@ -92,8 +87,7 @@
}
#pragma mark - 响应自定义viewDidAppear:事件
-
(
void
)
swiz_viewDidAppear
:
(
BOOL
)
animated
{
-
(
void
)
swiz_viewDidAppear
:
(
BOOL
)
animated
{
#pragma mark - 处理侧滑
// 默认打开侧滑
BOOL
enabled
=
YES
;
...
...
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
查看文件 @
68e42a5
...
...
@@ -334,7 +334,7 @@
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
is
Show
NavigationBar
{
-
(
BOOL
)
is
Hide
NavigationBar
{
return
!
self
.
isShowNavi
;
}
...
...
DreamSleep/DreamSleep/Class/AISleepModule/SleepCoach/Controller/AISleepCoachController.m
查看文件 @
68e42a5
...
...
@@ -315,7 +315,7 @@
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
is
Show
NavigationBar
{
-
(
BOOL
)
is
Hide
NavigationBar
{
return
YES
;
}
...
...
DreamSleep/DreamSleep/Class/CommunityModule/ArticleRequestModel.h
0 → 100644
查看文件 @
68e42a5
//
// ArticleRequestModel.h
// DreamSleep
//
// Created by peter on 2022/9/2.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
/// 文章咨询数据请求model
@interface
ArticleRequestModel
:
DSNetworkTool
/// 获取文章咨询列表接口
/// @param type_id 类型(4,5)
/// @param completion completion
+
(
NSURLSessionDataTask
*
)
querySsmianKnowledgeListWithTypeID
:(
int
)
type_id
WithCompletion
:(
void
(
^
)(
ArticleRequestModel
*
requestModel
))
completion
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/CommunityModule/ArticleRequestModel.m
0 → 100644
查看文件 @
68e42a5
//
// ArticleRequestModel.m
// DreamSleep
//
// Created by peter on 2022/9/2.
//
#import "ArticleRequestModel.h"
@implementation
ArticleRequestModel
+
(
NSURLSessionDataTask
*
)
querySsmianKnowledgeListWithTypeID
:(
int
)
type_id
WithCompletion
:(
void
(
^
)(
ArticleRequestModel
*
requestModel
))
completion
{
ArticleRequestModel
*
requestModel
=
[[
ArticleRequestModel
alloc
]
init
];
NSString
*
api
=
@"query_ssmian_knowledge_list"
;
NSString
*
argStr
=
[
NSString
stringWithFormat
:
@"query{%@(type_id:%d)}"
,
api
,
type_id
];
return
[
self
httpPostBodyRequestWithAPI
:
api
params
:@{
@"query"
:
argStr
}
view
:
nil
hasNetActivity
:
YES
loadingInfo
:
nil
hasFailInfo
:
NO
success
:^
(
NSDictionary
*
_Nonnull
apiDic
)
{
DSLog
(
@"文章咨询数据接口apiDic:%@"
,
apiDic
);
requestModel
.
resCode
=
DSResCodeSuccess
;
NSDictionary
*
resultDic
=
apiDic
[
@"result"
];
completion
(
requestModel
);
}
failure
:^
(
id
_Nonnull
failureInfo
)
{
requestModel
.
resCode
=
[
failureInfo
[
@"errorCode"
]
integerValue
];
requestModel
.
errMessage
=
failureInfo
[
@"errMessage"
];
completion
(
requestModel
);
}];
}
@end
DreamSleep/DreamSleep/Class/CommunityModule/CommunityController.m
查看文件 @
68e42a5
...
...
@@ -7,6 +7,7 @@
#import "CommunityController.h"
#import "TestFlutterController.h"
#import "ArticleRequestModel.h"
@interface
CommunityController
()
@property
(
nonatomic
,
strong
)
TestFlutterController
*
flutterEngine
;
...
...
@@ -18,6 +19,10 @@
[
super
viewDidLoad
];
self
.
flutterEngine
=
[
TestFlutterController
new
];
[
ArticleRequestModel
querySsmianKnowledgeListWithTypeID
:
4
WithCompletion
:
^
(
ArticleRequestModel
*
_Nonnull
requestModel
)
{
}];
}
-
(
void
)
touchesBegan
:
(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:
(
UIEvent
*
)
event
{
...
...
DreamSleep/DreamSleep/Class/HomeModule/Course/Controller/MusicPlayerController.m
查看文件 @
68e42a5
...
...
@@ -421,7 +421,7 @@
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
is
Show
NavigationBar
{
-
(
BOOL
)
is
Hide
NavigationBar
{
return
YES
;
}
...
...
DreamSleep/DreamSleep/Class/HomeModule/UnityGame/UnityGameController.m
查看文件 @
68e42a5
...
...
@@ -140,7 +140,7 @@ extern char** gArgv;
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
is
Show
NavigationBar
{
-
(
BOOL
)
is
Hide
NavigationBar
{
return
YES
;
}
...
...
DreamSleep/DreamSleep/Class/Start/Root/DSBaseViewController.m
查看文件 @
68e42a5
...
...
@@ -36,7 +36,7 @@
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
is
Show
NavigationBar
{
-
(
BOOL
)
is
Hide
NavigationBar
{
return
YES
;
}
...
...
DreamSleep/DreamSleep/Class/Start/Root/DSNaviBarViewController.m
查看文件 @
68e42a5
...
...
@@ -40,7 +40,7 @@
}
#pragma mark - 隐藏系统导航栏
-
(
BOOL
)
is
Show
NavigationBar
{
-
(
BOOL
)
is
Hide
NavigationBar
{
return
YES
;
}
...
...
DreamSleep/DreamSleep/Flutter/BaseFlutterController.m
查看文件 @
68e42a5
...
...
@@ -21,7 +21,7 @@
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
is
Show
NavigationBar
{
-
(
BOOL
)
is
Hide
NavigationBar
{
return
YES
;
}
...
...
DreamSleep/DreamSleep/Flutter/TestFlutterController.m
查看文件 @
68e42a5
...
...
@@ -16,7 +16,6 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
}
@end
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论