Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
xffruit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
xffruit
Commits
12500c01
Commit
12500c01
authored
Aug 27, 2015
by
freecui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页界面
parent
1f30d9b8
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
573 additions
and
125 deletions
+573
-125
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+30
-0
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+1
-0
GXFDisplayFunction.h
XFFruit/ViewControllers/Home/GXFDisplayFunction.h
+19
-0
GXFDisplayFunction.m
XFFruit/ViewControllers/Home/GXFDisplayFunction.m
+26
-0
GXFFunction.h
XFFruit/ViewControllers/Home/GXFFunction.h
+19
-0
GXFFunction.m
XFFruit/ViewControllers/Home/GXFFunction.m
+13
-0
GXFFunctionCollectionViewCell.h
XFFruit/ViewControllers/Home/GXFFunctionCollectionViewCell.h
+19
-0
GXFFunctionCollectionViewCell.m
XFFruit/ViewControllers/Home/GXFFunctionCollectionViewCell.m
+39
-0
GXFFunctionsViewController.h
XFFruit/ViewControllers/Home/GXFFunctionsViewController.h
+13
-0
GXFFunctionsViewController.m
XFFruit/ViewControllers/Home/GXFFunctionsViewController.m
+169
-0
GXFNoticeFunctionTableViewCell.h
...uit/ViewControllers/Home/GXFNoticeFunctionTableViewCell.h
+15
-0
GXFNoticeFunctionTableViewCell.m
...uit/ViewControllers/Home/GXFNoticeFunctionTableViewCell.m
+48
-0
ICRHomeViewController.m
XFFruit/ViewControllers/Home/ICRHomeViewController.m
+162
-125
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
12500c01
...
...
@@ -41,6 +41,11 @@
30ECD6251B00948A0088C57A
/* ICRPatrolPlanCellContentView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
30ECD6231B00948A0088C57A
/* ICRPatrolPlanCellContentView.m */
;
};
30F7F5711ADE723100A9B24E
/* ICRAttachmentCellContentView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
30F7F5701ADE723100A9B24E
/* ICRAttachmentCellContentView.m */
;
};
30F7F5721ADE723100A9B24E
/* ICRAttachmentCellContentView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
30F7F5701ADE723100A9B24E
/* ICRAttachmentCellContentView.m */
;
};
35A1C3451B8EA7A4004AC9F7
/* GXFFunctionsViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35A1C3441B8EA7A4004AC9F7
/* GXFFunctionsViewController.m */
;
};
35A1C3481B8EB33B004AC9F7
/* GXFFunction.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35A1C3471B8EB33B004AC9F7
/* GXFFunction.m */
;
};
35A1C34B1B8EB35D004AC9F7
/* GXFDisplayFunction.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35A1C34A1B8EB35D004AC9F7
/* GXFDisplayFunction.m */
;
};
35A1C34E1B8ECBCA004AC9F7
/* GXFNoticeFunctionTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35A1C34D1B8ECBCA004AC9F7
/* GXFNoticeFunctionTableViewCell.m */
;
};
35A1C3511B8ED609004AC9F7
/* GXFFunctionCollectionViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35A1C3501B8ED609004AC9F7
/* GXFFunctionCollectionViewCell.m */
;
};
35C3C0AC1AE956040035AC8A
/* Security.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35C3C0AB1AE956040035AC8A
/* Security.framework */
;
};
35C3C0AE1AE9560E0035AC8A
/* CoreGraphics.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35C3C0AD1AE9560E0035AC8A
/* CoreGraphics.framework */
;
};
35C3C0B01AE9561E0035AC8A
/* SystemConfiguration.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
35C3C0AF1AE9561E0035AC8A
/* SystemConfiguration.framework */
;
};
...
...
@@ -427,6 +432,16 @@
30ECD6231B00948A0088C57A
/* ICRPatrolPlanCellContentView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ICRPatrolPlanCellContentView.m
;
sourceTree
=
"<group>"
;
};
30F7F56F1ADE723100A9B24E
/* ICRAttachmentCellContentView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ICRAttachmentCellContentView.h
;
sourceTree
=
"<group>"
;
};
30F7F5701ADE723100A9B24E
/* ICRAttachmentCellContentView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ICRAttachmentCellContentView.m
;
sourceTree
=
"<group>"
;
};
35A1C3431B8EA7A4004AC9F7
/* GXFFunctionsViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFFunctionsViewController.h
;
sourceTree
=
"<group>"
;
};
35A1C3441B8EA7A4004AC9F7
/* GXFFunctionsViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFFunctionsViewController.m
;
sourceTree
=
"<group>"
;
};
35A1C3461B8EB33B004AC9F7
/* GXFFunction.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFFunction.h
;
sourceTree
=
"<group>"
;
};
35A1C3471B8EB33B004AC9F7
/* GXFFunction.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFFunction.m
;
sourceTree
=
"<group>"
;
};
35A1C3491B8EB35D004AC9F7
/* GXFDisplayFunction.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFDisplayFunction.h
;
sourceTree
=
"<group>"
;
};
35A1C34A1B8EB35D004AC9F7
/* GXFDisplayFunction.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFDisplayFunction.m
;
sourceTree
=
"<group>"
;
};
35A1C34C1B8ECBCA004AC9F7
/* GXFNoticeFunctionTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFNoticeFunctionTableViewCell.h
;
sourceTree
=
"<group>"
;
};
35A1C34D1B8ECBCA004AC9F7
/* GXFNoticeFunctionTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFNoticeFunctionTableViewCell.m
;
sourceTree
=
"<group>"
;
};
35A1C34F1B8ED609004AC9F7
/* GXFFunctionCollectionViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GXFFunctionCollectionViewCell.h
;
sourceTree
=
"<group>"
;
};
35A1C3501B8ED609004AC9F7
/* GXFFunctionCollectionViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GXFFunctionCollectionViewCell.m
;
sourceTree
=
"<group>"
;
};
35C3C0AB1AE956040035AC8A
/* Security.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Security.framework
;
path
=
System/Library/Frameworks/Security.framework
;
sourceTree
=
SDKROOT
;
};
35C3C0AD1AE9560E0035AC8A
/* CoreGraphics.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreGraphics.framework
;
path
=
System/Library/Frameworks/CoreGraphics.framework
;
sourceTree
=
SDKROOT
;
};
35C3C0AF1AE9561E0035AC8A
/* SystemConfiguration.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
SystemConfiguration.framework
;
path
=
System/Library/Frameworks/SystemConfiguration.framework
;
sourceTree
=
SDKROOT
;
};
...
...
@@ -1536,8 +1551,18 @@
C159185D1AC078020013B391
/* Home */
=
{
isa
=
PBXGroup
;
children
=
(
35A1C3491B8EB35D004AC9F7
/* GXFDisplayFunction.h */
,
35A1C34A1B8EB35D004AC9F7
/* GXFDisplayFunction.m */
,
35A1C3461B8EB33B004AC9F7
/* GXFFunction.h */
,
35A1C3471B8EB33B004AC9F7
/* GXFFunction.m */
,
35A1C3431B8EA7A4004AC9F7
/* GXFFunctionsViewController.h */
,
35A1C3441B8EA7A4004AC9F7
/* GXFFunctionsViewController.m */
,
C15918611AC19FB30013B391
/* ICRHomeViewController.h */
,
C15918621AC19FB30013B391
/* ICRHomeViewController.m */
,
35A1C34C1B8ECBCA004AC9F7
/* GXFNoticeFunctionTableViewCell.h */
,
35A1C34D1B8ECBCA004AC9F7
/* GXFNoticeFunctionTableViewCell.m */
,
35A1C34F1B8ED609004AC9F7
/* GXFFunctionCollectionViewCell.h */
,
35A1C3501B8ED609004AC9F7
/* GXFFunctionCollectionViewCell.m */
,
C10214E11AD9140C0024637E
/* Announcement */
,
);
path
=
Home
;
...
...
@@ -2180,6 +2205,7 @@
C1E9F5731B2E411900BF1356
/* IBTFileManager.m in Sources */
,
C15295B71B24450A00DF60D1
/* ICRQAViewController.m in Sources */
,
30D7FE5D1AD4F941003D92EE
/* ICRAboutViewController.m in Sources */
,
35A1C3481B8EB33B004AC9F7
/* GXFFunction.m in Sources */
,
7281A0B31B8974120052B1AC
/* NewPurchaseViewController.m in Sources */
,
C10214DF1AD90A3F0024637E
/* ICRFunctionItemControl.m in Sources */
,
C15918431AC062460013B391
/* IBTTableViewUserInfo.m in Sources */
,
...
...
@@ -2203,6 +2229,7 @@
C11A346B1B2451D500079129
/* NALLabelsMatrix.m in Sources */
,
C17DE85A1AD81D1600581AA6
/* NSMutableArray+SafeInsert.m in Sources */
,
35C3C0B91AE9567B0035AC8A
/* ICRNavigationViewController.mm in Sources */
,
35A1C3511B8ED609004AC9F7
/* GXFFunctionCollectionViewCell.m in Sources */
,
C123A8FB1B2561E1003C0C36
/* JTPopOverWindow.m in Sources */
,
72F56CB21B76EC200077F0C9
/* SurveyUser.m in Sources */
,
FE17F6861B85CA5B0078CE96
/* ShopDetaileViewController.m in Sources */
,
...
...
@@ -2231,6 +2258,7 @@
30D3C1251ADF6451004AC54E
/* ICRAnnouncementDetailContentView.m in Sources */
,
FEAE16E91B79C9F9009D9E01
/* ResultView.m in Sources */
,
FEA2F30C1B84687D00D64735
/* FooterCell.m in Sources */
,
35A1C34B1B8EB35D004AC9F7
/* GXFDisplayFunction.m in Sources */
,
C142D2C01AC3A155000109A7
/* UIView+ViewFrameGeometry.m in Sources */
,
FE17F6851B85CA5B0078CE96
/* SeePurchaseNoticeViewController.m in Sources */
,
C1FE50451AE0249A00C18080
/* IBTImagePicker.m in Sources */
,
...
...
@@ -2242,6 +2270,7 @@
7217E9F21B72364300FE5C1D
/* StartTimeView.m in Sources */
,
C1FE50351AE020D400C18080
/* IBTAudioController.m in Sources */
,
7281A0C21B898A040052B1AC
/* PurchaseDetailViewController.m in Sources */
,
35A1C34E1B8ECBCA004AC9F7
/* GXFNoticeFunctionTableViewCell.m in Sources */
,
FEA2F3061B8453DE00D64735
/* CostViewController.m in Sources */
,
C14BE3061ADB84350049F1AA
/* IBTTextFieldCell.m in Sources */
,
30F7F5711ADE723100A9B24E
/* ICRAttachmentCellContentView.m in Sources */
,
...
...
@@ -2254,6 +2283,7 @@
C1FE503D1AE0235D00C18080
/* IBTAudioServicesManager.m in Sources */
,
7217E9F41B72364300FE5C1D
/* SurveyListCell.m in Sources */
,
C10214D21AD904F30024637E
/* ICRPatrolPlanViewController.m in Sources */
,
35A1C3451B8EA7A4004AC9F7
/* GXFFunctionsViewController.m in Sources */
,
72C8034F1B7B735300990363
/* TopSheetView.m in Sources */
,
C1E108591ADA53C700620375
/* ICRTaskResultViewController.m in Sources */
,
FEAE16EF1B79CAE3009D9E01
/* SingleScrollView.m in Sources */
,
...
...
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
12500c01
...
...
@@ -402,6 +402,7 @@ acceptTypeJson:(BOOL)bAcceptJson
userUtil
.
orgName
=
dictResult
[
@"enterprise_name"
];
userUtil
.
orgId
=
dictResult
[
@"enterprise_uuid"
];
userUtil
.
authenticode
=
dictResult
[
@"authenticode"
];
userUtil
.
permissions
=
dictResult
[
@"permissions"
];
[
userUtil
saveArchive
];
if
(
succ
)
{
succ
(
dictResult
);
...
...
XFFruit/ViewControllers/Home/GXFDisplayFunction.h
0 → 100644
View file @
12500c01
//
// GXFDisplayActions.h
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface
GXFDisplayFunction
:
IBTObject
@property
(
nonatomic
,
assign
)
NSInteger
Id
;
//
@property
(
nonatomic
,
copy
)
NSString
*
functionName
;
//
@property
(
nonatomic
,
copy
)
NSString
*
imgName
;
//
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
//选中
+
(
instancetype
)
initClassWithDictionary
:
(
NSDictionary
*
)
dict
;
-
(
instancetype
)
initWithDictionary
:
(
NSDictionary
*
)
dict
;
@end
XFFruit/ViewControllers/Home/GXFDisplayFunction.m
0 → 100644
View file @
12500c01
//
// GXFDisplayActions.m
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFDisplayFunction.h"
@implementation
GXFDisplayFunction
+
(
instancetype
)
initClassWithDictionary
:(
NSDictionary
*
)
dict
{
return
[
self
initClassWithDictionary
:
dict
];
}
-
(
instancetype
)
initWithDictionary
:(
NSDictionary
*
)
dict
{
self
=
[
super
init
];
if
(
!
self
)
{
return
nil
;
}
else
{
[
self
setValuesForKeysWithDictionary
:
dict
];
}
return
self
;
}
@end
XFFruit/ViewControllers/Home/GXFFunction.h
0 → 100644
View file @
12500c01
//
// GXFActions.h
// XFFruit
// 后台返回的json权限文件的内容:选择权限和是否选择
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface
GXFFunction
:
IBTObject
@property
(
nonatomic
,
assign
)
NSInteger
Id
;
@property
(
nonatomic
,
copy
)
NSString
*
name
;
//权限
@property
(
nonatomic
,
copy
)
NSString
*
captions
;
//权限的名称
@property
(
nonatomic
,
assign
)
BOOL
hasPermission
;
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
//@property (nonatomic, assign) BOOL isPublic; 是否公共部分功能
@end
XFFruit/ViewControllers/Home/GXFFunction.m
0 → 100644
View file @
12500c01
//
// GXFActions.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunction.h"
@implementation
GXFFunction
@end
XFFruit/ViewControllers/Home/GXFFunctionCollectionViewCell.h
0 → 100644
View file @
12500c01
//
// GXFNoticeCollectionViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_WIDTH (65)
#define ICRFUNCTION_LABEL_HEIGHT (15)
#define ICRFUNCTION_INNER_GAP (7)
#define RIGHT_LINE_WIDTH (0.5)
@interface
GXFFunctionCollectionViewCell
:
UICollectionViewCell
@property
(
nonatomic
,
strong
,
readonly
)
UIImageView
*
functionImage
;
@property
(
nonatomic
,
strong
,
readonly
)
UILabel
*
functionNameLabel
;
@end
XFFruit/ViewControllers/Home/GXFFunctionCollectionViewCell.m
0 → 100644
View file @
12500c01
//
// GXFNoticeCollectionViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionCollectionViewCell.h"
@implementation
GXFFunctionCollectionViewCell
-
(
id
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
!
self
)
{
return
nil
;
}
_functionImage
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
((
CGRectGetWidth
(
self
.
frame
)
-
ICRFUNCTION_IMG_WIDTH
)
/
2
,
ICRFUNCTION_IMG_TOP_PADDING
,
ICRFUNCTION_IMG_WIDTH
,
ICRFUNCTION_IMG_WIDTH
)];
_functionImage
.
backgroundColor
=
[
UIColor
clearColor
];
[
self
.
contentView
addSubview
:
_functionImage
];
_functionNameLabel
=
[[
UILabel
alloc
]
init
];
CGSize
labelSize
=
CGSizeMake
(
CGRectGetWidth
(
self
.
frame
),
ICRFUNCTION_LABEL_HEIGHT
);
labelSize
=
[
_functionNameLabel
sizeThatFits
:
labelSize
];
_functionNameLabel
.
frame
=
(
CGRect
){
.
origin
.
x
=
(
CGRectGetWidth
(
self
.
frame
)
-
labelSize
.
width
)
/
2
,
.
origin
.
y
=
CGRectGetMaxY
(
_functionImage
.
frame
)
+
ICRFUNCTION_INNER_GAP
,
.
size
.
width
=
labelSize
.
width
,
.
size
.
height
=
ICRFUNCTION_LABEL_HEIGHT
};
_functionNameLabel
.
textColor
=
[
UIColor
colorWithRed
:
0
.
596
f
green
:
0
.
596
f
blue
:
0
.
596
f
alpha
:
1
.
00
f
];
_functionNameLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_functionNameLabel
.
font
=
[
UIFont
systemFontOfSize
:
13
];
[
self
.
contentView
addSubview
:
_functionNameLabel
];
self
.
backgroundColor
=
[
UIColor
whiteColor
];
return
self
;
}
@end
XFFruit/ViewControllers/Home/GXFFunctionsViewController.h
0 → 100644
View file @
12500c01
//
// GXFFunctionsViewController.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIViewController.h"
@interface
GXFFunctionsViewController
:
IBTUIViewController
@end
XFFruit/ViewControllers/Home/GXFFunctionsViewController.m
0 → 100644
View file @
12500c01
//
// GXFFunctionsViewController.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
#import "GXFFunction.h"
@interface
GXFFunctionsViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
//@property (nonatomic, strong) NSArray *
@property
(
nonatomic
,
strong
)
UITableView
*
f_tableView
;
@property
(
nonatomic
,
strong
)
NSArray
*
firstSectionArr
;
@property
(
nonatomic
,
strong
)
NSArray
*
secondSectionArr
;
@end
@implementation
GXFFunctionsViewController
static
NSString
*
cellID
=
@"cell"
;
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
initData
];
[
self
setupSubViews
];
}
-
(
void
)
initData
{
NSDictionary
*
dictOne
=
@{
@"Id"
:
@
(
1
),
@"functionName"
:
@"新建行情反馈"
,
@"imgName"
:
@"RefreshBtn"
,
@"isSelected"
:
@
(
0
)};
NSDictionary
*
dictTwo
=
@{
@"Id"
:
@
(
2
),
@"functionName"
:
@"查询行情反馈"
,
@"imgName"
:
@"RefreshBtn"
,
@"isSelected"
:
@
(
1
)};
GXFDisplayFunction
*
dFuntionOne
=
[[
GXFDisplayFunction
alloc
]
initWithDictionary
:
dictOne
];
GXFDisplayFunction
*
dFuntionTwo
=
[[
GXFDisplayFunction
alloc
]
initWithDictionary
:
dictTwo
];
self
.
firstSectionArr
=
@[
dFuntionOne
,
dFuntionTwo
];
self
.
secondSectionArr
=
@[
dFuntionOne
,
dFuntionTwo
];
//self.firstSection =
}
-
(
void
)
setupSubViews
{
[
self
setupRightBarBtn
];
[
self
setupTableView
];
}
-
(
void
)
setupRightBarBtn
{
UIBarButtonItem
*
rightBarBtn
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"确定"
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
selectedFunctions
)];
self
.
navigationItem
.
rightBarButtonItem
=
rightBarBtn
;
}
-
(
void
)
setupTableView
{
self
.
f_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
self
.
view
.
frame
style
:
UITableViewStyleGrouped
];
self
.
f_tableView
.
dataSource
=
self
;
self
.
f_tableView
.
delegate
=
self
;
//[self.f_tableView dequeueReusableCellWithIdentifier ]
[
self
.
view
addSubview
:
_f_tableView
];
}
#pragma BarButton Action
-
(
void
)
selectedFunctions
{
[
self
PopViewControllerAnimated
:
YES
];
}
#pragma UITablewViewDataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
2
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
if
(
section
==
0
)
{
return
_firstSectionArr
.
count
;
}
else
{
return
_secondSectionArr
.
count
;
}
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
!
cell
)
{
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
}
switch
(
indexPath
.
section
)
{
case
0
:
{
[
self
p_contentToTableViewCell
:
cell
andArray
:
_firstSectionArr
];
}
break
;
case
1
:
{
[
self
p_contentToTableViewCell
:
cell
andArray
:
_secondSectionArr
];
}
break
;
default
:
break
;
}
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
return
cell
;
}
-
(
NSString
*
)
tableView
:
(
UITableView
*
)
tableView
titleForDeleteConfirmationButtonForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
NSString
*
sectionTitle
=
[
NSString
string
];
switch
(
indexPath
.
section
)
{
case
0
:
{
sectionTitle
=
@"提示选择"
;
}
break
;
case
1
:
{
sectionTitle
=
@"功能选择"
;
}
break
;
}
return
sectionTitle
;
}
#pragma UITableViewDelegate
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
_f_tableView
cellForRowAtIndexPath
:
indexPath
];
if
(
cell
.
accessoryType
==
UITableViewCellAccessoryNone
)
{
cell
.
accessoryType
=
UITableViewCellAccessoryCheckmark
;
// if (indexPath.section == 0) {
// _firstSectionArr
// }
}
else
{
cell
.
accessoryType
=
UITableViewCellAccessoryNone
;
}
switch
(
indexPath
.
section
)
{
case
0
:
{
}
break
;
case
1
:
{
}
break
;
}
}
#pragma 给cell的内容赋值
-
(
void
)
p_contentToTableViewCell
:
(
UITableViewCell
*
)
cell
andArray
:
(
NSArray
*
)
array
{
for
(
int
count
=
0
;
count
<
array
.
count
;
count
++
)
{
GXFDisplayFunction
*
dFunction
=
(
GXFDisplayFunction
*
)
array
[
count
];
cell
.
imageView
.
image
=
[
UIImage
imageNamed
:
dFunction
.
imgName
];
cell
.
textLabel
.
text
=
dFunction
.
functionName
;
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
XFFruit/ViewControllers/Home/GXFNoticeFunctionTableViewCell.h
0 → 100644
View file @
12500c01
//
// GXFNoticeFunctionTableViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
GXFNoticeFunctionTableViewCell
:
UITableViewCell
@property
(
nonatomic
,
strong
,
readonly
)
UIImageView
*
functionImg
;
@property
(
nonatomic
,
strong
,
readonly
)
UILabel
*
noticeLabel
;
@property
(
nonatomic
,
strong
,
readonly
)
UILabel
*
unReadLabel
;
@end
XFFruit/ViewControllers/Home/GXFNoticeFunctionTableViewCell.m
0 → 100644
View file @
12500c01
//
// GXFNoticeFunctionTableViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFNoticeFunctionTableViewCell.h"
@implementation
GXFNoticeFunctionTableViewCell
-
(
id
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
if
(
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
])
{
_functionImg
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
20
.
f
,
10
.
f
,
45
.
f
,
45
.
f
)];
_functionImg
.
image
=
[
UIImage
imageNamed
:
@""
];
[
self
.
contentView
addSubview
:
_functionImg
];
_unReadLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
self
.
width
-
60
.
f
,(
self
.
height
-
20
.
0
f
)
/
2
.
0
,
25
.
0
f
,
20
.
0
f
)];
_unReadLabel
.
backgroundColor
=
[
UIColor
redColor
];
_unReadLabel
.
textColor
=
[
UIColor
whiteColor
];
_unReadLabel
.
font
=
[
UIFont
systemFontOfSize
:
13
];
_unReadLabel
.
layer
.
cornerRadius
=
10
;
_unReadLabel
.
layer
.
masksToBounds
=
YES
;
[
self
.
contentView
addSubview
:
_unReadLabel
];
_noticeLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
_functionImg
.
right
,
_functionImg
.
x
,
self
.
width
-
_functionImg
.
right
-
40
,
self
.
height
)];
_noticeLabel
.
font
=
[
UIFont
systemFontOfSize
:
13
.
0
f
];
[
_noticeLabel
setTextAlignment
:
NSTextAlignmentRight
];
_noticeLabel
.
textColor
=
[
UIColor
blackColor
];
[
self
.
contentView
addSubview
:
_noticeLabel
];
}
return
self
;
}
-
(
void
)
awakeFromNib
{
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
XFFruit/ViewControllers/Home/ICRHomeViewController.m
View file @
12500c01
...
...
@@ -27,156 +27,193 @@
#import "AddWorkSheetViewController.h"
#import "NewPurchaseViewController.h"
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
#import "GXFFunction.h"
#import "GXFNoticeFunctionTableViewCell.h"
#import "GXFFunctionCollectionViewCell.h"
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_WIDTH (65)
#define ICRFUNCTION_LABEL_HEIGHT (15)
#define ICRFUNCTION_INNER_GAP (5)
#define RIGHT_LINE_WIDTH (0.5)
@interface
ICRHomeViewController
()
<
ICRFunctionBaseViewDelegate
,
ICRStoreListViewDelegate
>
<
UITableViewDataSource
,
UITableViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegate
>
//,UICollectionViewDelegateFlowLayout>
@property
(
strong
,
nonatomic
)
UIImageView
*
m_headImageView
;
@property
(
strong
,
nonatomic
)
UILabel
*
m_headViewTextLabel
;
@property
(
nonatomic
,
strong
)
UITableView
*
f_tableView
;
@property
(
nonatomic
,
strong
)
NSArray
*
firstSectionArr
;
@property
(
nonatomic
,
strong
)
NSArray
*
secondSectionArr
;
@property
(
nonatomic
,
strong
)
UICollectionView
*
f_collectionView
;
@end
@implementation
ICRHomeViewController
static
NSString
*
cellID
=
@"cell"
;
static
NSString
*
collectionCellID
=
@"collectionCell"
;
//static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0
#pragma mark - Life Cycle
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
initData
];
[
self
setupSubviews
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
-
(
void
)
setupSubviews
{
[
self
setupRightBarBtn
];
[
self
setupTableView
];
[
self
setupColletionView
];
}
-
(
void
)
initData
{
NSDictionary
*
dictOne
=
@{
@"Id"
:
@
(
1
),
@"functionName"
:
@"新建行情反馈"
,
@"imgName"
:
@"RefreshBtn"
,
@"isSelected"
:
@
(
0
)};
NSDictionary
*
dictTwo
=
@{
@"Id"
:
@
(
2
),
@"functionName"
:
@"查询行情反馈"
,
@"imgName"
:
@"RefreshBtn"
,
@"isSelected"
:
@
(
1
)};
GXFDisplayFunction
*
dFuntionOne
=
[[
GXFDisplayFunction
alloc
]
initWithDictionary
:
dictOne
];
GXFDisplayFunction
*
dFuntionTwo
=
[[
GXFDisplayFunction
alloc
]
initWithDictionary
:
dictTwo
];
self
.
firstSectionArr
=
@[
dFuntionOne
,
dFuntionTwo
];
self
.
secondSectionArr
=
@[
dFuntionOne
,
dFuntionTwo
];
//self.firstSection =
}
-
(
void
)
setupRightBarBtn
{
UIBarButtonItem
*
rightBarBtn
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"自定义功能"
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
defineFunctions
)];
#pragma mark - Private Method
-
(
void
)
setupSubviews
{
self
.
navigationItem
.
rightBarButtonItem
=
rightBarBtn
;
}
-
(
void
)
setupTableView
{
self
.
f_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
self
.
view
.
frame
style
:
UITableViewStyleGrouped
];
self
.
f_tableView
.
dataSource
=
self
;
self
.
f_tableView
.
delegate
=
self
;
//[self.f_tableView dequeueReusableCellWithIdentifier ]
[
self
.
view
addSubview
:
_f_tableView
];
}
-
(
void
)
setupColletionView
{
UICollectionViewFlowLayout
*
flowLayout
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
[
flowLayout
setScrollDirection
:
UICollectionViewScrollDirectionVertical
];
// [flowLayout setItemSize:CGSizeMake(MODULE_VIEW_WIDTH, MODULE_VIEW_WIDTH)];
self
.
m_headImageView
=
[[
UIImageView
alloc
]
initWithFrame
:(
CGRect
){
.
origin
.
x
=
0
,
.
origin
.
y
=
0
,
.
size
.
width
=
self
.
view
.
width
,
.
size
.
height
=
self
.
view
.
width
*
M_HEAD_IMG_HEIGHT_WIDTH_PROPORTION
}];
_m_headImageView
.
image
=
[
UIImage
imageNamed
:
@"HomeDisplayImage"
];
self
.
f_collectionView
=
[[
UICollectionView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
self
.
view
.
width
,
600
)
collectionViewLayout
:
flowLayout
];
//self.f_collectionView.collectionViewLayout = flowLayout;
[
self
.
f_collectionView
registerClass
:[
UICollectionViewCell
class
]
forCellWithReuseIdentifier
:
collectionCellID
];
_f_collectionView
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
f_collectionView
.
dataSource
=
self
;
self
.
f_collectionView
.
delegate
=
self
;
}
#pragma BarButton Action
-
(
void
)
defineFunctions
{
GXFFunctionsViewController
*
functionsVc
=
[[
GXFFunctionsViewController
alloc
]
init
];
[
self
PushViewController
:
functionsVc
animated
:
YES
];
self
.
m_headViewTextLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRect
){
.
origin
.
x
=
0
,
.
origin
.
y
=
CGRectGetHeight
(
self
.
m_headImageView
.
frame
)
-
M_HEAD_VIEW_TITLE_LABEL_HEIGHT
,
.
size
.
width
=
CGRectGetWidth
(
self
.
m_headImageView
.
frame
),
.
size
.
height
=
M_HEAD_VIEW_TITLE_LABEL_HEIGHT
}];
_m_headViewTextLabel
.
backgroundColor
=
[
UIColor
colorWithRed
:
0
.
310
f
green
:
0
.
345
f
blue
:
0
.
392
f
alpha
:
0
.
5
f
];
_m_headViewTextLabel
.
textColor
=
[
UIColor
whiteColor
];
_m_headViewTextLabel
.
font
=
[
UIFont
systemFontOfSize
:
13
];
_m_headViewTextLabel
.
textAlignment
=
NSTextAlignmentCenter
;
// _m_headViewTextLabel.text = @"我是文字我是文字我是文字我是文字";
}
#pragma UITablewViewDataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
2
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
if
(
section
==
0
)
{
return
_firstSectionArr
.
count
;
}
else
{
return
1
;
}
[
_m_headImageView
addSubview
:
_m_headViewTextLabel
];
[
self
.
view
addSubview
:
_m_headImageView
];
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
section
==
1
)
{
return
900
;
}
else
{
return
44
;
}
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
NSMutableArray
*
arrFunctionEntities
=
[
NSMutableArray
array
];
if
(
!
cell
)
{
if
(
indexPath
.
section
==
0
)
{
cell
=
[[
GXFNoticeFunctionTableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
else
{
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
@"secondCell"
];
//self.f_collectionView.size =
[
cell
.
contentView
addSubview
:
_f_collectionView
];
NSLog
(
@"%@"
,
NSStringFromCGRect
(
cell
.
frame
));
}
}
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
NSArray
*
functionImageNames
=
@[
@"AnnouncementIcon"
,
@"TaskManageIcon"
,
@"PatrolPlanIcon"
,
@"MyStoreIcon"
,
@"MyStoreIcon"
,
@"MyStoreIcon"
];
NSArray
*
fuctionNames
=
@[
[
IBTCommon
localizableString
:
@"Announcement"
],
[
IBTCommon
localizableString
:
@"TaskManage"
],
[
IBTCommon
localizableString
:
@"PatrolPlan"
],
[
IBTCommon
localizableString
:
@"MyStore"
],
[
IBTCommon
localizableString
:
@"Survey"
],[
IBTCommon
localizableString
:
@"AddSurvey"
]];
NSArray
*
functionTags
=
@[
@
(
kFunctionAnnouncement
),
@
(
kFunctionTaskManagement
),
@
(
kFunctionPatrolPlan
),
@
(
kFunctionMyShop
),
@
(
kFunctionNavigation
),
@
(
kFunctionComeShopReg
)];
int
i
=
0
;
for
(
NSString
*
functionName
in
fuctionNames
)
{
ICRFunctionEntity
*
funtionEntity
=
[[
ICRFunctionEntity
alloc
]
init
];
funtionEntity
.
functionName
=
functionName
;
funtionEntity
.
iconName
=
[
functionImageNames
objectAtIndex
:
i
];
funtionEntity
.
functionItemTag
=
[[
functionTags
objectAtIndex
:
i
]
integerValue
];
[
arrFunctionEntities
addObject
:
funtionEntity
];
i
++
;
return
cell
;
}
#pragma UITableViewDelegate
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
}
#pragma 给cell的内容赋值
-
(
void
)
p_contentToTableViewCell
:
(
UITableViewCell
*
)
cell
andArray
:
(
NSArray
*
)
array
{
for
(
int
count
=
0
;
count
<
array
.
count
;
count
++
)
{
GXFDisplayFunction
*
dFunction
=
(
GXFDisplayFunction
*
)
array
[
count
];
cell
.
imageView
.
image
=
[
UIImage
imageNamed
:
dFunction
.
imgName
];
cell
.
textLabel
.
text
=
dFunction
.
functionName
;
}
}
#pragma UICollectionViewDataSource,UICollectionViewDelegate
-
(
NSInteger
)
numberOfSectionsInCollectionView
:
(
UICollectionView
*
)
collectionView
{
return
1
;
}
-
(
NSInteger
)
collectionView
:
(
UICollectionView
*
)
collectionView
numberOfItemsInSection
:
(
NSInteger
)
section
{
return
6
;
}
-
(
UICollectionViewCell
*
)
collectionView
:
(
UICollectionView
*
)
collectionView
cellForItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
ICRFunctionBaseView
*
baseView
=
[
ICRFunctionBaseView
initWithFunctionData
:
arrFunctionEntities
];
UICollectionViewCell
*
collectionCell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
collectionCellID
forIndexPath
:
indexPath
];
baseView
.
frame
=
(
CGRect
){
UIImageView
*
functionImg
=
[[
UIImageView
alloc
]
initWithFrame
:(
CGRect
){
.
origin
.
x
=
(
CGRectGetWidth
(
collectionCell
.
frame
)
-
ICRFUNCTION_IMG_WIDTH
)
/
2
,
.
origin
.
y
=
ICRFUNCTION_IMG_TOP_PADDING
,
.
size
.
width
=
ICRFUNCTION_IMG_WIDTH
,
.
size
.
height
=
ICRFUNCTION_IMG_WIDTH
}];
functionImg
.
image
=
[
UIImage
imageNamed
:
@"create_purchase"
];
[
collectionCell
.
contentView
addSubview
:
functionImg
];
UILabel
*
lbl
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRect
){
.
origin
.
x
=
0
,
.
origin
.
y
=
CGRectGetMaxY
(
_m_headImageView
.
frame
),
.
size
.
width
=
CGRectGetWidth
(
self
.
view
.
frame
),
.
size
.
height
=
CGRectGetHeight
(
self
.
view
.
frame
)
-
CGRectGetHeight
(
_m_headImageView
.
frame
)
};
baseView
.
backgroundColor
=
[
UIColor
clearColor
];
baseView
.
m_delegate
=
self
;
[
self
.
view
addSubview
:
baseView
];
}
#pragma mark - ICRFunctionBaseViewDelegate
-
(
void
)
ICRFunctionBaseView
:
(
ICRFunctionItemControl
*
)
imageView
{
/*
kFunctionAnnouncement = 0,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
*/
switch
(
imageView
.
tag
)
{
case
kFunctionAnnouncement
:
{
ICRAnnouncementViewController
*
aVC
=
[[
ICRAnnouncementViewController
alloc
]
init
];
[
self
PushViewController
:
aVC
animated
:
YES
];
}
break
;
case
kFunctionTaskManagement
:
{
ICRTaskListViewController
*
tVC
=
[[
ICRTaskListViewController
alloc
]
init
];
[
self
PushViewController
:
tVC
animated
:
YES
];
}
break
;
case
kFunctionPatrolPlan
:
{
ICRPatrolPlanViewController
*
pVC
=
[[
ICRPatrolPlanViewController
alloc
]
initWithStore
:
nil
isHomeShow
:
YES
];
[
self
PushViewController
:
pVC
animated
:
YES
];
}
break
;
case
kFunctionMyShop
:
{
// ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// sVC.title = [IBTCommon localizableString:@"MyStore"];
// sVC.m_delegate = self;
// [self PushViewController:sVC animated:YES];
// AddWorkSheetViewController *sVC = [[AddWorkSheetViewController alloc] init];
NewPurchaseViewController
*
sVC
=
[[
NewPurchaseViewController
alloc
]
init
];
[
self
PushViewController
:
sVC
animated
:
YES
];
}
break
;
case
kFunctionNavigation
:
{
SurveyViewController
*
svc
=
[[
SurveyViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionComeShopReg
:
{
NewSurveyViewController
*
svc
=
[[
NewSurveyViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"AddSurvey"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
default
:
break
;
}
.
origin
.
y
=
CGRectGetMaxY
(
functionImg
.
frame
)
+
ICRFUNCTION_INNER_GAP
,
.
size
.
width
=
collectionCell
.
width
,
.
size
.
height
=
ICRFUNCTION_LABEL_HEIGHT
}];
lbl
.
textAlignment
=
NSTextAlignmentCenter
;
lbl
.
tintColor
=
[
UIColor
blackColor
];
lbl
.
text
=
@"kkk"
;
[
collectionCell
.
contentView
addSubview
:
lbl
];
//collectionCell.backgroundColor = [UIColor yellowColor];
return
collectionCell
;
}
#pragma mark - ICRStoreListViewDelegate
-
(
void
)
storeListViewCtrl
:
(
ICRStoreListViewController
*
)
vCtrl
didSelectedStore
:
(
ICRStore
*
)
store
{
ICRStoreDetailViewController
*
dVC
=
[[
ICRStoreDetailViewController
alloc
]
initWithStoreData
:
store
];
[
vCtrl
PushViewController
:
dVC
animated
:
YES
];
//UICollectionViewDelegateFlowLayout是UICollectionViewDelegate的子协议
-
(
CGSize
)
collectionView
:
(
UICollectionView
*
)
collectionView
layout
:
(
UICollectionViewLayout
*
)
collectionViewLayout
sizeForItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
CGFloat
width
=
self
.
view
.
width
/
3
.
0
;
return
CGSizeMake
((
self
.
view
.
width
-
30
)
/
3
.
0
,
width
);
}
-
(
UIEdgeInsets
)
collectionView
:
(
UICollectionView
*
)
collectionView
layout
:
(
UICollectionViewLayout
*
)
collectionViewLayout
insetForSectionAtIndex
:
(
NSInteger
)
section
{
//top, CGFloat left, CGFloat bottom, CGFloat right
return
UIEdgeInsetsMake
(
0
,
5
,
0
,
5
);
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment