Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
94049834
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
大约 1 年 前同步成功
通知
166
Star
19623
Fork
3062
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DoraemonKit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
94049834
编写于
9月 04, 2019
作者:
C
CC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CCAutoTag push : 用UICollectionView简化处理
上级
8167f5ec
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
463 addition
and
17 deletion
+463
-17
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
+14
-8
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCell.h
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCell.h
+18
-0
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCell.m
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCell.m
+55
-0
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCloseCell.h
...aemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCloseCell.h
+16
-0
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCloseCell.m
...aemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCloseCell.m
+62
-0
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeFootCell.h
...raemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeFootCell.h
+16
-0
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeFootCell.m
...raemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeFootCell.m
+12
-0
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeHeadCell.h
...raemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeHeadCell.h
+18
-0
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeHeadCell.m
...raemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeHeadCell.m
+35
-0
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeEntry.h
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeEntry.h
+19
-0
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeEntry.m
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeEntry.m
+189
-0
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeWindow.m
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeWindow.m
+2
-2
iOS/DoraemonKitDemo/Podfile.lock
iOS/DoraemonKitDemo/Podfile.lock
+7
-7
未找到文件。
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
浏览文件 @
94049834
...
...
@@ -14,9 +14,9 @@
#import "DoraemonDefine.h"
#import "DoraemonHomeWindow.h"
#import "DoraemonStatusBarViewController.h"
@interface
DoraemonEntryView
()
@property
(
nonatomic
,
assign
)
BOOL
isOpen
;
@property
(
nonatomic
,
strong
)
UIButton
*
entryBtn
;
@property
(
nonatomic
,
assign
)
CGFloat
kEntryViewSize
;
...
...
@@ -24,6 +24,18 @@
@implementation
DoraemonEntryView
-
(
UIButton
*
)
entryBtn
{
if
(
!
_entryBtn
)
{
_entryBtn
=
[[
UIButton
alloc
]
initWithFrame
:
self
.
bounds
];
_entryBtn
.
backgroundColor
=
[
UIColor
clearColor
];
[
_entryBtn
setImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_logo"
]
forState
:
UIControlStateNormal
];
_entryBtn
.
layer
.
cornerRadius
=
20
.;
[
_entryBtn
addTarget
:
self
action
:
@selector
(
entryClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
}
return
_entryBtn
;
}
-
(
instancetype
)
init
{
_kEntryViewSize
=
58
;
CGFloat
x
=
self
.
startingPosition
.
x
;
...
...
@@ -54,13 +66,7 @@
}
}
UIButton
*
entryBtn
=
[[
UIButton
alloc
]
initWithFrame
:
self
.
bounds
];
entryBtn
.
backgroundColor
=
[
UIColor
clearColor
];
[
entryBtn
setImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_logo"
]
forState
:
UIControlStateNormal
];
entryBtn
.
layer
.
cornerRadius
=
20
.;
[
entryBtn
addTarget
:
self
action
:
@selector
(
entryClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
rootViewController
.
view
addSubview
:
entryBtn
];
_entryBtn
=
entryBtn
;
[
self
.
rootViewController
.
view
addSubview
:
self
.
entryBtn
];
UIPanGestureRecognizer
*
pan
=
[[
UIPanGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
pan
:
)];
[
self
addGestureRecognizer
:
pan
];
}
...
...
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCell.h
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeCell.h
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
DoraemonHomeCell
:
UICollectionViewCell
-
(
void
)
update
:(
NSString
*
)
image
name
:(
NSString
*
)
name
;
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCell.m
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeCell.m
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import "DoraemonHomeCell.h"
@interface
DoraemonHomeCell
()
@property
(
nonatomic
,
strong
)
UIImageView
*
icon
;
@property
(
nonatomic
,
strong
)
UILabel
*
name
;
@end
@implementation
DoraemonHomeCell
-
(
UIImageView
*
)
icon
{
if
(
!
_icon
)
{
CGFloat
size
=
34
;
_icon
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
((
self
.
doraemon_width
-
size
)
/
2
.
0
,
4
,
size
,
size
)];
}
return
_icon
;
}
-
(
UILabel
*
)
name
{
if
(
!
_name
)
{
CGFloat
height
=
16
;
_name
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
self
.
doraemon_height
-
height
-
4
,
self
.
doraemon_width
,
height
)];
_name
.
textAlignment
=
NSTextAlignmentCenter
;
_name
.
font
=
[
UIFont
systemFontOfSize
:
12
];
_name
.
adjustsFontSizeToFitWidth
=
YES
;
}
return
_name
;
}
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addSubview
:
self
.
icon
];
[
self
addSubview
:
self
.
name
];
}
return
self
;
}
-
(
void
)
update
:(
NSString
*
)
image
name
:(
NSString
*
)
name
{
self
.
icon
.
image
=
[
UIImage
doraemon_imageNamed
:
image
];
self
.
name
.
text
=
name
;
}
@end
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCloseCell.h
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeCloseCell.h
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
DoraemonHomeCloseCell
:
UICollectionViewCell
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeCloseCell.m
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeCloseCell.m
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import "DoraemonHomeCloseCell.h"
#import "DoraemonManager.h"
#import "DoraemonUtil.h"
#import "DoraemonHomeWindow.h"
@interface
DoraemonHomeCloseCell
()
@property
(
nonatomic
,
strong
)
UIButton
*
closeButton
;
@end
@implementation
DoraemonHomeCloseCell
-
(
void
)
closeButtonHandle
{
UIAlertController
*
alertController
=
[
UIAlertController
alertControllerWithTitle
:
DoraemonLocalizedString
(
@"提示"
)
message
:
DoraemonLocalizedString
(
@"Doraemon关闭之后需要重启App才能重新打开"
)
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertAction
*
cancelAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"取消"
)
style
:
UIAlertActionStyleCancel
handler
:
nil
];
UIAlertAction
*
okAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"确定"
)
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
[[
DoraemonManager
shareInstance
]
hiddenDoraemon
];
}];
[
alertController
addAction
:
cancelAction
];
[
alertController
addAction
:
okAction
];
[[
DoraemonUtil
topViewControllerForKeyWindow
]
presentViewController
:
alertController
animated
:
YES
completion
:
nil
];
[[
DoraemonHomeWindow
shareInstance
]
hide
];
}
-
(
UIButton
*
)
closeButton
{
if
(
!
_closeButton
)
{
_closeButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
_closeButton
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_closeButton
setTitle
:
DoraemonLocalizedString
(
@"关闭DoraemonKit"
)
forState
:
UIControlStateNormal
];
[
_closeButton
setTitleColor
:[
UIColor
doraemon_colorWithString
:
@"#CC3A4B"
]
forState
:
UIControlStateNormal
];
[
_closeButton
addTarget
:
self
action
:
@selector
(
closeButtonHandle
)
forControlEvents
:
UIControlEventTouchUpInside
];
}
return
_closeButton
;
}
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
[
self
addSubview
:
self
.
closeButton
];
}
return
self
;
}
-
(
void
)
layoutSubviews
{
[
super
layoutSubviews
];
CGFloat
x
=
5
;
self
.
closeButton
.
frame
=
CGRectMake
(
x
,
x
,
self
.
doraemon_width
-
x
*
2
,
50
);
}
@end
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeFootCell.h
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeFootCell.h
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
DoraemonHomeFootCell
:
UICollectionReusableView
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeFootCell.m
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeFootCell.m
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import "DoraemonHomeFootCell.h"
@implementation
DoraemonHomeFootCell
@end
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeHeadCell.h
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeHeadCell.h
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
DoraemonHomeHeadCell
:
UICollectionReusableView
@property
(
nonatomic
,
strong
)
UILabel
*
title
;
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/Entry/Home/Cell/DoraemonHomeHeadCell.m
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeHeadCell.m
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import "DoraemonHomeHeadCell.h"
@implementation
DoraemonHomeHeadCell
-
(
UILabel
*
)
title
{
if
(
!
_title
)
{
_title
=
[
UILabel
new
];
}
return
_title
;
}
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addSubview
:
self
.
title
];
}
return
self
;
}
-
(
void
)
layoutSubviews
{
[
super
layoutSubviews
];
self
.
title
.
frame
=
UIEdgeInsetsInsetRect
(
self
.
bounds
,
UIEdgeInsetsMake
(
0
,
15
,
0
,
15
));
}
@end
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeEntry.h
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeEntry.h
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import "DoraemonBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
/**
* DoraemonHomeEntry | 新主界面入口
*/
@interface
DoraemonHomeEntry
:
DoraemonBaseViewController
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeEntry.m
0 → 100644
浏览文件 @
94049834
//
// DoraemonHomeEntry.m
// DoraemonKit
//
// Created by dengyouhua on 2019/9/4.
//
#import "DoraemonHomeEntry.h"
#import "UIView+Doraemon.h"
#import "DoraemonUtil.h"
#import "UIColor+Doraemon.h"
#import "DoraemonManager.h"
#import "DoraemonPluginProtocol.h"
#import "DoraemonHomeWindow.h"
#import "DoraemonDefine.h"
#import "DoraemonHomeCell.h"
#import "DoraemonHomeHeadCell.h"
#import "DoraemonHomeFootCell.h"
#import "DoraemonHomeCloseCell.h"
static
NSString
*
DoraemonHomeCellID
=
@"DoraemonHomeCellID"
;
static
NSString
*
DoraemonHomeHeadCellID
=
@"DoraemonHomeHeadCellID"
;
static
NSString
*
DoraemonHomeFootCellID
=
@"DoraemonHomeFootCellID"
;
static
NSString
*
DoraemonHomeCloseCellID
=
@"DoraemonHomeCloseCellID"
;
@interface
DoraemonHomeEntry
()
<
UICollectionViewDelegate
,
UICollectionViewDataSource
>
@property
(
nonatomic
,
strong
)
UICollectionView
*
collectionView
;
@property
(
nonatomic
,
strong
)
UIScrollView
*
scrollView
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArray
;
@end
@implementation
DoraemonHomeEntry
-
(
UICollectionView
*
)
collectionView
{
if
(
!
_collectionView
)
{
UICollectionViewFlowLayout
*
fl
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
_collectionView
=
[[
UICollectionView
alloc
]
initWithFrame
:
CGRectZero
collectionViewLayout
:
fl
];
_collectionView
.
backgroundColor
=
[
UIColor
whiteColor
];
_collectionView
.
delegate
=
self
;
_collectionView
.
dataSource
=
self
;
[
_collectionView
registerClass
:[
DoraemonHomeCell
class
]
forCellWithReuseIdentifier
:
DoraemonHomeCellID
];
[
_collectionView
registerClass
:[
DoraemonHomeCloseCell
class
]
forCellWithReuseIdentifier
:
DoraemonHomeCloseCellID
];
[
_collectionView
registerClass
:[
DoraemonHomeHeadCell
class
]
forSupplementaryViewOfKind
:
UICollectionElementKindSectionHeader
withReuseIdentifier
:
DoraemonHomeHeadCellID
];
[
_collectionView
registerClass
:[
DoraemonHomeFootCell
class
]
forSupplementaryViewOfKind
:
UICollectionElementKindSectionFooter
withReuseIdentifier
:
DoraemonHomeFootCellID
];
}
return
_collectionView
;
}
-
(
CGSize
)
collectionView
:(
UICollectionView
*
)
collectionView
layout
:(
UICollectionViewLayout
*
)
collectionViewLayout
sizeForItemAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
section
<
_dataArray
.
count
)
{
return
CGSizeMake
(
80
,
64
);
}
else
{
return
CGSizeMake
(
DoraemonScreenHeight
,
60
);
}
}
-
(
CGSize
)
collectionView
:(
UICollectionView
*
)
collectionView
layout
:(
UICollectionViewLayout
*
)
collectionViewLayout
referenceSizeForHeaderInSection
:(
NSInteger
)
section
{
if
(
section
<
_dataArray
.
count
)
{
return
CGSizeMake
(
DoraemonScreenHeight
,
44
);
}
else
{
return
CGSizeMake
(
DoraemonScreenHeight
,
0
);
}
}
-
(
CGSize
)
collectionView
:(
UICollectionView
*
)
collectionView
layout
:(
UICollectionViewLayout
*
)
collectionViewLayout
referenceSizeForFooterInSection
:(
NSInteger
)
section
{
return
CGSizeMake
(
DoraemonScreenHeight
,
20
);
}
-
(
void
)
collectionView
:(
UICollectionView
*
)
collectionView
willDisplaySupplementaryView
:(
UICollectionReusableView
*
)
view
forElementKind
:(
NSString
*
)
elementKind
atIndexPath
:(
NSIndexPath
*
)
indexPath
{
view
.
layer
.
zPosition
=
0
.
0
;
}
-
(
NSInteger
)
numberOfSectionsInCollectionView
:(
UICollectionView
*
)
collectionView
{
return
_dataArray
.
count
+
1
;
}
-
(
NSInteger
)
collectionView
:(
UICollectionView
*
)
collectionView
numberOfItemsInSection
:(
NSInteger
)
section
{
if
(
section
<
self
.
dataArray
.
count
)
{
NSDictionary
*
dict
=
_dataArray
[
section
];
NSArray
*
pluginArray
=
dict
[
@"pluginArray"
];
return
pluginArray
.
count
;
}
else
{
return
1
;
}
}
-
(
UICollectionViewCell
*
)
collectionView
:(
UICollectionView
*
)
collectionView
cellForItemAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
DoraemonHomeCell
*
cell
=
[
self
.
collectionView
dequeueReusableCellWithReuseIdentifier
:
DoraemonHomeCellID
forIndexPath
:
indexPath
];
NSInteger
row
=
indexPath
.
row
;
NSInteger
section
=
indexPath
.
section
;
if
(
section
<
_dataArray
.
count
)
{
NSDictionary
*
dict
=
_dataArray
[
section
];
NSArray
*
pluginArray
=
dict
[
@"pluginArray"
];
NSDictionary
*
item
=
pluginArray
[
row
];
[
cell
update
:
item
[
@"icon"
]
name
:
item
[
@"name"
]];
return
cell
;
}
else
{
DoraemonHomeCloseCell
*
closeCell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
DoraemonHomeCloseCellID
forIndexPath
:
indexPath
];
return
closeCell
;
}
}
-
(
UICollectionReusableView
*
)
collectionView
:(
UICollectionView
*
)
collectionView
viewForSupplementaryElementOfKind
:(
NSString
*
)
kind
atIndexPath
:(
NSIndexPath
*
)
indexPath
{
UICollectionReusableView
*
view
=
nil
;
if
([
kind
isEqualToString
:
UICollectionElementKindSectionHeader
])
{
DoraemonHomeHeadCell
*
head
=
[
collectionView
dequeueReusableSupplementaryViewOfKind
:
UICollectionElementKindSectionHeader
withReuseIdentifier
:
DoraemonHomeHeadCellID
forIndexPath
:
indexPath
];
head
.
title
.
text
=
@""
;
NSInteger
section
=
indexPath
.
section
;
if
(
section
<
_dataArray
.
count
)
{
NSDictionary
*
dict
=
_dataArray
[
section
];
head
.
title
.
text
=
dict
[
@"moduleName"
];
}
view
=
head
;
}
else
if
([
kind
isEqualToString
:
UICollectionElementKindSectionFooter
])
{
DoraemonHomeFootCell
*
foot
=
[
collectionView
dequeueReusableSupplementaryViewOfKind
:
UICollectionElementKindSectionFooter
withReuseIdentifier
:
DoraemonHomeFootCellID
forIndexPath
:
indexPath
];
foot
.
backgroundColor
=
[
UIColor
doraemon_colorWithString
:
@"#F4F5F6"
];
view
=
foot
;
}
return
view
;
}
-
(
void
)
collectionView
:(
UICollectionView
*
)
collectionView
didSelectItemAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
NSInteger
section
=
indexPath
.
section
;
if
(
section
<
self
.
dataArray
.
count
)
{
NSDictionary
*
dict
=
_dataArray
[
section
];
NSArray
*
pluginArray
=
dict
[
@"pluginArray"
];
NSDictionary
*
itemData
=
pluginArray
[
indexPath
.
row
];
NSString
*
pluginName
=
itemData
[
@"pluginName"
];
if
(
pluginName
){
Class
pluginClass
=
NSClassFromString
(
pluginName
);
id
<
DoraemonPluginProtocol
>
plugin
=
[[
pluginClass
alloc
]
init
];
if
([
plugin
respondsToSelector
:
@selector
(
pluginDidLoad
)])
{
[
plugin
pluginDidLoad
];
}
if
([
plugin
respondsToSelector
:
@selector
(
pluginDidLoad
:)])
{
[
plugin
pluginDidLoad
:(
NSDictionary
*
)
itemData
];
}
void
(
^
handleBlock
)(
NSDictionary
*
itemData
)
=
itemData
[
@"handleBlock"
];
if
(
handleBlock
)
{
handleBlock
(
itemData
);
}
}
}
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
_dataArray
=
[
DoraemonManager
shareInstance
].
dataArray
;
[
self
.
view
addSubview
:
self
.
collectionView
];
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
self
.
navigationController
.
navigationBarHidden
=
YES
;
}
+
(
UIEdgeInsets
)
safeAreaInset
:(
UIView
*
)
view
{
if
(
@available
(
iOS
11
.
0
,
*
))
{
return
view
.
safeAreaInsets
;
}
return
UIEdgeInsetsZero
;
}
-
(
void
)
viewDidLayoutSubviews
{
[
super
viewDidLayoutSubviews
];
// self.collectionView.frame = self.view.frame;
UIEdgeInsets
safeAreaInsets
=
[
self
.
class
safeAreaInset
:
self
.
view
];
CGFloat
height
=
self
.
view
.
doraemon_height
-
safeAreaInsets
.
left
-
safeAreaInsets
.
right
;
// self.collectionView.frame = CGRectMake(safeAreaInsets.left, safeAreaInsets.top, self.view.doraemon_width, self.view.doraemon_height);
// self.collectionView.frame = CGRectMake(safeAreaInsets.left, safeAreaInsets.top, self.view.doraemon_width, height);
self
.
collectionView
.
frame
=
self
.
view
.
frame
;
}
@end
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeWindow.m
浏览文件 @
94049834
...
...
@@ -8,7 +8,7 @@
#import "DoraemonHomeWindow.h"
#import "DoraemonDefine.h"
#import "UIColor+Doraemon.h"
#import "DoraemonHome
ViewController
.h"
#import "DoraemonHome
Entry
.h"
@implementation
DoraemonHomeWindow
...
...
@@ -37,7 +37,7 @@
}
-
(
void
)
show
{
DoraemonHome
ViewController
*
vc
=
[[
DoraemonHomeViewController
alloc
]
init
];
DoraemonHome
Entry
*
vc
=
[[
DoraemonHomeEntry
alloc
]
init
];
[
self
setRootVc
:
vc
];
self
.
hidden
=
NO
;
...
...
iOS/DoraemonKitDemo/Podfile.lock
浏览文件 @
94049834
...
...
@@ -24,33 +24,33 @@ PODS:
- CocoaLumberjack (3.5.3):
- CocoaLumberjack/Core (= 3.5.3)
- CocoaLumberjack/Core (3.5.3)
- DoraemonKit/Core (1.2.
2
):
- DoraemonKit/Core (1.2.
3
):
- BSBacktraceLogger
- fishhook
- PNChart
- DoraemonKit/WithDatabase (1.2.
2
):
- DoraemonKit/WithDatabase (1.2.
3
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
- PNChart
- YYDebugDatabase
- DoraemonKit/WithGPS (1.2.
2
):
- DoraemonKit/WithGPS (1.2.
3
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
- PNChart
- DoraemonKit/WithLoad (1.2.
2
):
- DoraemonKit/WithLoad (1.2.
3
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
- PNChart
- DoraemonKit/WithLogger (1.2.
2
):
- DoraemonKit/WithLogger (1.2.
3
):
- BSBacktraceLogger
- CocoaLumberjack
- DoraemonKit/Core
- fishhook
- PNChart
- DoraemonKit/WithWeex (1.2.
2
):
- DoraemonKit/WithWeex (1.2.
3
):
- BSBacktraceLogger
- DoraemonKit/Core
- fishhook
...
...
@@ -113,7 +113,7 @@ SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
BSBacktraceLogger: 06b983ee93a9f87d957960e9c73d660d5966b447
CocoaLumberjack: 2f44e60eb91c176d471fdba43b9e3eae6a721947
DoraemonKit:
ea50d30db95bd7ce978e964b2bb90c588a19a2a3
DoraemonKit:
c1e675735a94db6ca7ad6ffac256d6baddc00afb
fishhook: ea19933abfe8f2f52c55fd8b6e2718467d3ebc89
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GCDWebServer: ead88cd14596dd4eae4f5830b8877c87c8728990
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录