Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
cf73f295
Commit
cf73f295
authored
May 09, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加相册选择器,并测试完成(待自定义)
parent
43b4a8a5
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
844 additions
and
3 deletions
+844
-3
GeliBusinessPlatform.xcodeproj/project.pbxproj
GeliBusinessPlatform.xcodeproj/project.pbxproj
+36
-0
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Info.plist
GeliBusinessPlatform/Info.plist
+1
-1
GeliBusinessPlatform/Other/HGImage/HGImage.storyboard
GeliBusinessPlatform/Other/HGImage/HGImage.storyboard
+169
-0
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/Contents.json
...nessPlatform/Other/HGImage/HGImage.xcassets/Contents.json
+6
-0
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_not_selected.imageset/CellGreySelected@2x.png
...ts/hg_image_not_selected.imageset/CellGreySelected@2x.png
+0
-0
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_not_selected.imageset/Contents.json
...age.xcassets/hg_image_not_selected.imageset/Contents.json
+21
-0
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_selected.imageset/CellBlueSelected@2x.png
...assets/hg_image_selected.imageset/CellBlueSelected@2x.png
+0
-0
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_selected.imageset/Contents.json
...HGImage.xcassets/hg_image_selected.imageset/Contents.json
+21
-0
GeliBusinessPlatform/Other/HGImage/HGImageCollectionViewCell.swift
...essPlatform/Other/HGImage/HGImageCollectionViewCell.swift
+51
-0
GeliBusinessPlatform/Other/HGImage/HGImageCollectionViewController.swift
...tform/Other/HGImage/HGImageCollectionViewController.swift
+200
-0
GeliBusinessPlatform/Other/HGImage/HGImageCompleteButton.swift
...usinessPlatform/Other/HGImage/HGImageCompleteButton.swift
+101
-0
GeliBusinessPlatform/Other/HGImage/HGImagePickerCell.swift
GeliBusinessPlatform/Other/HGImage/HGImagePickerCell.swift
+19
-0
GeliBusinessPlatform/Other/HGImage/HGImagePickerController.swift
...inessPlatform/Other/HGImage/HGImagePickerController.swift
+205
-0
GeliBusinessPlatform/ViewController/个人中心/PersonCenterViewController.swift
...form/ViewController/个人中心/PersonCenterViewController.swift
+14
-2
No files found.
GeliBusinessPlatform.xcodeproj/project.pbxproj
View file @
cf73f295
...
@@ -356,6 +356,13 @@
...
@@ -356,6 +356,13 @@
F969BF08244EC38000C79953
/* GoodsCollectionViewCell.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F969BF06244EC38000C79953
/* GoodsCollectionViewCell.xib */
;
};
F969BF08244EC38000C79953
/* GoodsCollectionViewCell.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F969BF06244EC38000C79953
/* GoodsCollectionViewCell.xib */
;
};
F969BF1E244EE67900C79953
/* GoodsManageListVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F969BF1C244EE67900C79953
/* GoodsManageListVC.swift */
;
};
F969BF1E244EE67900C79953
/* GoodsManageListVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F969BF1C244EE67900C79953
/* GoodsManageListVC.swift */
;
};
F969BF1F244EE67900C79953
/* GoodsManageListVC.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F969BF1D244EE67900C79953
/* GoodsManageListVC.xib */
;
};
F969BF1F244EE67900C79953
/* GoodsManageListVC.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F969BF1D244EE67900C79953
/* GoodsManageListVC.xib */
;
};
F96E9D59246656A700B5B94A
/* HGImageCompleteButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F96E9D54246656A700B5B94A
/* HGImageCompleteButton.swift */
;
};
F96E9D5A246656A700B5B94A
/* HGImageCollectionViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F96E9D55246656A700B5B94A
/* HGImageCollectionViewController.swift */
;
};
F96E9D5B246656A700B5B94A
/* HGImageCollectionViewCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F96E9D56246656A700B5B94A
/* HGImageCollectionViewCell.swift */
;
};
F96E9D5C246656A700B5B94A
/* HGImagePickerCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F96E9D57246656A700B5B94A
/* HGImagePickerCell.swift */
;
};
F96E9D5D246656A700B5B94A
/* HGImagePickerController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F96E9D58246656A700B5B94A
/* HGImagePickerController.swift */
;
};
F96E9D60246657B500B5B94A
/* HGImage.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F96E9D5E246657B500B5B94A
/* HGImage.xcassets */
;
};
F96E9D61246657B500B5B94A
/* HGImage.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F96E9D5F246657B500B5B94A
/* HGImage.storyboard */
;
};
F9956B1C2463D941001A617D
/* WorkSelectTimeView.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F9956B1B2463D941001A617D
/* WorkSelectTimeView.xib */
;
};
F9956B1C2463D941001A617D
/* WorkSelectTimeView.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F9956B1B2463D941001A617D
/* WorkSelectTimeView.xib */
;
};
F9956B1E2463D94E001A617D
/* WorkSelectTimeView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F9956B1D2463D94E001A617D
/* WorkSelectTimeView.swift */
;
};
F9956B1E2463D94E001A617D
/* WorkSelectTimeView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F9956B1D2463D94E001A617D
/* WorkSelectTimeView.swift */
;
};
F9956B22246408A6001A617D
/* GoodsClassViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F9956B20246408A6001A617D
/* GoodsClassViewController.swift */
;
};
F9956B22246408A6001A617D
/* GoodsClassViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F9956B20246408A6001A617D
/* GoodsClassViewController.swift */
;
};
...
@@ -766,6 +773,13 @@
...
@@ -766,6 +773,13 @@
F969BF06244EC38000C79953
/* GoodsCollectionViewCell.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
GoodsCollectionViewCell.xib
;
sourceTree
=
"<group>"
;
};
F969BF06244EC38000C79953
/* GoodsCollectionViewCell.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
GoodsCollectionViewCell.xib
;
sourceTree
=
"<group>"
;
};
F969BF1C244EE67900C79953
/* GoodsManageListVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GoodsManageListVC.swift
;
sourceTree
=
"<group>"
;
};
F969BF1C244EE67900C79953
/* GoodsManageListVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GoodsManageListVC.swift
;
sourceTree
=
"<group>"
;
};
F969BF1D244EE67900C79953
/* GoodsManageListVC.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
GoodsManageListVC.xib
;
sourceTree
=
"<group>"
;
};
F969BF1D244EE67900C79953
/* GoodsManageListVC.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
GoodsManageListVC.xib
;
sourceTree
=
"<group>"
;
};
F96E9D54246656A700B5B94A
/* HGImageCompleteButton.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HGImageCompleteButton.swift
;
sourceTree
=
"<group>"
;
};
F96E9D55246656A700B5B94A
/* HGImageCollectionViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HGImageCollectionViewController.swift
;
sourceTree
=
"<group>"
;
};
F96E9D56246656A700B5B94A
/* HGImageCollectionViewCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HGImageCollectionViewCell.swift
;
sourceTree
=
"<group>"
;
};
F96E9D57246656A700B5B94A
/* HGImagePickerCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HGImagePickerCell.swift
;
sourceTree
=
"<group>"
;
};
F96E9D58246656A700B5B94A
/* HGImagePickerController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HGImagePickerController.swift
;
sourceTree
=
"<group>"
;
};
F96E9D5E246657B500B5B94A
/* HGImage.xcassets */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
folder.assetcatalog
;
path
=
HGImage.xcassets
;
sourceTree
=
"<group>"
;
};
F96E9D5F246657B500B5B94A
/* HGImage.storyboard */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.storyboard
;
path
=
HGImage.storyboard
;
sourceTree
=
"<group>"
;
};
F9956B1B2463D941001A617D
/* WorkSelectTimeView.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
WorkSelectTimeView.xib
;
sourceTree
=
"<group>"
;
};
F9956B1B2463D941001A617D
/* WorkSelectTimeView.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
WorkSelectTimeView.xib
;
sourceTree
=
"<group>"
;
};
F9956B1D2463D94E001A617D
/* WorkSelectTimeView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
WorkSelectTimeView.swift
;
sourceTree
=
"<group>"
;
};
F9956B1D2463D94E001A617D
/* WorkSelectTimeView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
WorkSelectTimeView.swift
;
sourceTree
=
"<group>"
;
};
F9956B20246408A6001A617D
/* GoodsClassViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GoodsClassViewController.swift
;
sourceTree
=
"<group>"
;
};
F9956B20246408A6001A617D
/* GoodsClassViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GoodsClassViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -1141,6 +1155,7 @@
...
@@ -1141,6 +1155,7 @@
E088CC882446FFA1000DAA8A
/* Other */
=
{
E088CC882446FFA1000DAA8A
/* Other */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
F96E9D53246656A700B5B94A
/* HGImage */
,
F9531F2A2465108800724BEE
/* JXPhotoBrowser */
,
F9531F2A2465108800724BEE
/* JXPhotoBrowser */
,
F9DDBE932457D3CB00A32CB2
/* Web */
,
F9DDBE932457D3CB00A32CB2
/* Web */
,
F95A9ED324551DDC00867849
/* Parchment */
,
F95A9ED324551DDC00867849
/* Parchment */
,
...
@@ -1857,6 +1872,20 @@
...
@@ -1857,6 +1872,20 @@
path
=
"商品管理"
;
path
=
"商品管理"
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
F96E9D53246656A700B5B94A
/* HGImage */
=
{
isa
=
PBXGroup
;
children
=
(
F96E9D5F246657B500B5B94A
/* HGImage.storyboard */
,
F96E9D5E246657B500B5B94A
/* HGImage.xcassets */
,
F96E9D54246656A700B5B94A
/* HGImageCompleteButton.swift */
,
F96E9D55246656A700B5B94A
/* HGImageCollectionViewController.swift */
,
F96E9D56246656A700B5B94A
/* HGImageCollectionViewCell.swift */
,
F96E9D57246656A700B5B94A
/* HGImagePickerCell.swift */
,
F96E9D58246656A700B5B94A
/* HGImagePickerController.swift */
,
);
path
=
HGImage
;
sourceTree
=
"<group>"
;
};
F9956B1F24640865001A617D
/* 商品分类 */
=
{
F9956B1F24640865001A617D
/* 商品分类 */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -2005,6 +2034,7 @@
...
@@ -2005,6 +2034,7 @@
E02DDD92244FE55400ABB707
/* NewCreateHeader.xib in Resources */
,
E02DDD92244FE55400ABB707
/* NewCreateHeader.xib in Resources */
,
F9956B1C2463D941001A617D
/* WorkSelectTimeView.xib in Resources */
,
F9956B1C2463D941001A617D
/* WorkSelectTimeView.xib in Resources */
,
E09B03B72445B85A00211A51
/* LoginViewController.xib in Resources */
,
E09B03B72445B85A00211A51
/* LoginViewController.xib in Resources */
,
F96E9D61246657B500B5B94A
/* HGImage.storyboard in Resources */
,
E09F4C9E2452BEBB00BE033D
/* JiPaiFangShiViewController.xib in Resources */
,
E09F4C9E2452BEBB00BE033D
/* JiPaiFangShiViewController.xib in Resources */
,
E0A409D12464041200CFF109
/* ThirdCell.xib in Resources */
,
E0A409D12464041200CFF109
/* ThirdCell.xib in Resources */
,
E09B03C12445B96500211A51
/* FgPassViewController.xib in Resources */
,
E09B03C12445B96500211A51
/* FgPassViewController.xib in Resources */
,
...
@@ -2077,6 +2107,7 @@
...
@@ -2077,6 +2107,7 @@
E09F4CA32452D18800BE033D
/* ZengZhiServicesViewController.xib in Resources */
,
E09F4CA32452D18800BE033D
/* ZengZhiServicesViewController.xib in Resources */
,
F95D9CA524493E840080D6E3
/* ShopInfoViewController.xib in Resources */
,
F95D9CA524493E840080D6E3
/* ShopInfoViewController.xib in Resources */
,
F961D26F245015D6007FBE70
/* SelectContentView.xib in Resources */
,
F961D26F245015D6007FBE70
/* SelectContentView.xib in Resources */
,
F96E9D60246657B500B5B94A
/* HGImage.xcassets in Resources */
,
F961D27524503CCF007FBE70
/* OrderSelectMoreView.xib in Resources */
,
F961D27524503CCF007FBE70
/* OrderSelectMoreView.xib in Resources */
,
E042F74524529B8500CDFA12
/* JiTuoWuXinXiView.xib in Resources */
,
E042F74524529B8500CDFA12
/* JiTuoWuXinXiView.xib in Resources */
,
E01C26B12446989700ADCC70
/* Interface_Z.plist in Resources */
,
E01C26B12446989700ADCC70
/* Interface_Z.plist in Resources */
,
...
@@ -2194,6 +2225,7 @@
...
@@ -2194,6 +2225,7 @@
F933F6C82452C68B00189561
/* PKHUDTextView.swift in Sources */
,
F933F6C82452C68B00189561
/* PKHUDTextView.swift in Sources */
,
E0A409C82464010D00CFF109
/* FirstCell.swift in Sources */
,
E0A409C82464010D00CFF109
/* FirstCell.swift in Sources */
,
F9531F422465108800724BEE
/* JXPhotoBrowserDefaultPageIndicator.swift in Sources */
,
F9531F422465108800724BEE
/* JXPhotoBrowserDefaultPageIndicator.swift in Sources */
,
F96E9D59246656A700B5B94A
/* HGImageCompleteButton.swift in Sources */
,
E0B6036E244D376900A56B38
/* KuWeiCell.swift in Sources */
,
E0B6036E244D376900A56B38
/* KuWeiCell.swift in Sources */
,
E0D197BA2448431C002B080C
/* BabyDefine.m in Sources */
,
E0D197BA2448431C002B080C
/* BabyDefine.m in Sources */
,
F94A314924624FA400FEC38E
/* ShopAdministratorInfoModel.swift in Sources */
,
F94A314924624FA400FEC38E
/* ShopAdministratorInfoModel.swift in Sources */
,
...
@@ -2255,6 +2287,7 @@
...
@@ -2255,6 +2287,7 @@
E02DDD85244FDC6A00ABB707
/* TitleAndSwitchHeaderView.swift in Sources */
,
E02DDD85244FDC6A00ABB707
/* TitleAndSwitchHeaderView.swift in Sources */
,
E0F3C2CB24590C86006F0D1F
/* XinZengAndBianJiKeHuViewController.swift in Sources */
,
E0F3C2CB24590C86006F0D1F
/* XinZengAndBianJiKeHuViewController.swift in Sources */
,
F9531F412465108800724BEE
/* JXPhotoBrowserView.swift in Sources */
,
F9531F412465108800724BEE
/* JXPhotoBrowserView.swift in Sources */
,
F96E9D5B246656A700B5B94A
/* HGImageCollectionViewCell.swift in Sources */
,
E0D197C02448431C002B080C
/* BabyCentralManager.m in Sources */
,
E0D197C02448431C002B080C
/* BabyCentralManager.m in Sources */
,
F95D9CA424493E840080D6E3
/* ShopInfoViewController.swift in Sources */
,
F95D9CA424493E840080D6E3
/* ShopInfoViewController.swift in Sources */
,
F9171EFC245128B200359C2B
/* Interface.swift in Sources */
,
F9171EFC245128B200359C2B
/* Interface.swift in Sources */
,
...
@@ -2303,9 +2336,11 @@
...
@@ -2303,9 +2336,11 @@
E00D85E1244561FD00F5F816
/* SceneDelegate.swift in Sources */
,
E00D85E1244561FD00F5F816
/* SceneDelegate.swift in Sources */
,
F9956B22246408A6001A617D
/* GoodsClassViewController.swift in Sources */
,
F9956B22246408A6001A617D
/* GoodsClassViewController.swift in Sources */
,
F950FDDA24518B9500C40530
/* FSCalendarCell.m in Sources */
,
F950FDDA24518B9500C40530
/* FSCalendarCell.m in Sources */
,
F96E9D5D246656A700B5B94A
/* HGImagePickerController.swift in Sources */
,
F969BF1E244EE67900C79953
/* GoodsManageListVC.swift in Sources */
,
F969BF1E244EE67900C79953
/* GoodsManageListVC.swift in Sources */
,
E0273DD824551B4C00B3FCAE
/* SendTimeSelectView.swift in Sources */
,
E0273DD824551B4C00B3FCAE
/* SendTimeSelectView.swift in Sources */
,
E08A7AE024652E2C00F934F2
/* BingDingKeHuViewController.swift in Sources */
,
E08A7AE024652E2C00F934F2
/* BingDingKeHuViewController.swift in Sources */
,
F96E9D5A246656A700B5B94A
/* HGImageCollectionViewController.swift in Sources */
,
E09B03A12445AF7100211A51
/* Define.swift in Sources */
,
E09B03A12445AF7100211A51
/* Define.swift in Sources */
,
F961D271245016B7007FBE70
/* SelectContentView.swift in Sources */
,
F961D271245016B7007FBE70
/* SelectContentView.swift in Sources */
,
F933F6C02452C68B00189561
/* PKHUDSystemActivityIndicatorView.swift in Sources */
,
F933F6C02452C68B00189561
/* PKHUDSystemActivityIndicatorView.swift in Sources */
,
...
@@ -2377,6 +2412,7 @@
...
@@ -2377,6 +2412,7 @@
E09B03A32445AF9500211A51
/* NetworkRequest.swift in Sources */
,
E09B03A32445AF9500211A51
/* NetworkRequest.swift in Sources */
,
E0D46C5624503EC50087B564
/* TitleAndSelectCell.swift in Sources */
,
E0D46C5624503EC50087B564
/* TitleAndSelectCell.swift in Sources */
,
E0F97B022451228A001BD600
/* GLAlertSelectView.swift in Sources */
,
E0F97B022451228A001BD600
/* GLAlertSelectView.swift in Sources */
,
F96E9D5C246656A700B5B94A
/* HGImagePickerCell.swift in Sources */
,
F95567AB2453E40B009674AB
/* OrderListViewController.swift in Sources */
,
F95567AB2453E40B009674AB
/* OrderListViewController.swift in Sources */
,
E00E48C22457C0D600F16545
/* XuanZeShangPinViewController.swift in Sources */
,
E00E48C22457C0D600F16545
/* XuanZeShangPinViewController.swift in Sources */
,
E0BE8A83245A76AF00E80134
/* XiaDanCGDiZhiCell.swift in Sources */
,
E0BE8A83245A76AF00E80134
/* XiaDanCGDiZhiCell.swift in Sources */
,
...
...
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
cf73f295
No preview for this file type
GeliBusinessPlatform/Info.plist
View file @
cf73f295
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<key>
NSMicrophoneUsageDescription
</key>
<key>
NSMicrophoneUsageDescription
</key>
<string>
我们需要通过您同意使用麦克风,才能与你进行语音交流
</string>
<string>
我们需要通过您同意使用麦克风,才能与你进行语音交流
</string>
<key>
NSPhotoLibraryUsageDescription
</key>
<key>
NSPhotoLibraryUsageDescription
</key>
<string>
我们需要通过您同意使用相册,才能
修改图片
</string>
<string>
我们需要通过您同意使用相册,才能
获取相关数据
</string>
<key>
UIApplicationSceneManifest
</key>
<key>
UIApplicationSceneManifest
</key>
<dict>
<dict>
<key>
UIApplicationSupportsMultipleScenes
</key>
<key>
UIApplicationSupportsMultipleScenes
</key>
...
...
GeliBusinessPlatform/Other/HGImage/HGImage.storyboard
0 → 100755
View file @
cf73f295
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"11201"
systemVersion=
"16C67"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"T2V-4B-Rlc"
>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"11161"
/>
<capability
name=
"Constraints to layout margins"
minToolsVersion=
"6.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
<!--Image Picker Controller-->
<scene
sceneID=
"BVR-mv-Kbb"
>
<objects>
<viewController
storyboardIdentifier=
"imagePickerVC"
id=
"T2V-4B-Rlc"
customClass=
"HGImagePickerController"
customModule=
"hangge_1512"
customModuleProvider=
"target"
sceneMemberID=
"viewController"
>
<layoutGuides>
<viewControllerLayoutGuide
type=
"top"
id=
"4Y5-34-3d0"
/>
<viewControllerLayoutGuide
type=
"bottom"
id=
"e8n-UT-KXs"
/>
</layoutGuides>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"aed-4U-dCO"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"667"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<tableView
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
alwaysBounceVertical=
"YES"
dataMode=
"prototypes"
style=
"plain"
separatorStyle=
"default"
rowHeight=
"58"
sectionHeaderHeight=
"28"
sectionFooterHeight=
"28"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"695-4F-dam"
>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<prototypes>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"cell"
rowHeight=
"58"
id=
"S6N-Q4-drh"
customClass=
"HGImagePickerCell"
customModule=
"hangge_1512"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"28"
width=
"375"
height=
"58"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"S6N-Q4-drh"
id=
"akc-Sf-MNq"
>
<frame
key=
"frameInset"
width=
"375"
height=
"57"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"mgg-Ea-kOz"
>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"21"
id=
"4zA-PW-No0"
/>
</constraints>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"15"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"RWG-AS-vSa"
>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"21"
id=
"fgt-nn-uS6"
/>
</constraints>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
white=
"0.33333333333333331"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<constraints>
<constraint
firstItem=
"RWG-AS-vSa"
firstAttribute=
"centerY"
secondItem=
"akc-Sf-MNq"
secondAttribute=
"centerY"
id=
"59O-Dh-QO5"
/>
<constraint
firstItem=
"mgg-Ea-kOz"
firstAttribute=
"centerY"
secondItem=
"akc-Sf-MNq"
secondAttribute=
"centerY"
id=
"TeM-3g-ILU"
/>
<constraint
firstItem=
"RWG-AS-vSa"
firstAttribute=
"leading"
secondItem=
"mgg-Ea-kOz"
secondAttribute=
"trailing"
id=
"Zya-OY-Ot1"
/>
<constraint
firstItem=
"mgg-Ea-kOz"
firstAttribute=
"leading"
secondItem=
"akc-Sf-MNq"
secondAttribute=
"leadingMargin"
constant=
"10"
id=
"hNT-C2-Urm"
/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet
property=
"countLabel"
destination=
"RWG-AS-vSa"
id=
"nPe-Jq-cY6"
/>
<outlet
property=
"titleLabel"
destination=
"mgg-Ea-kOz"
id=
"ESQ-1g-rHz"
/>
<segue
destination=
"ybE-mT-bfT"
kind=
"show"
identifier=
"showImages"
id=
"ebb-RO-ekM"
/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet
property=
"dataSource"
destination=
"T2V-4B-Rlc"
id=
"HQF-c1-Lyi"
/>
<outlet
property=
"delegate"
destination=
"T2V-4B-Rlc"
id=
"dRG-lB-iaE"
/>
</connections>
</tableView>
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<constraints>
<constraint
firstItem=
"695-4F-dam"
firstAttribute=
"leading"
secondItem=
"aed-4U-dCO"
secondAttribute=
"leading"
id=
"Aif-UQ-KT9"
/>
<constraint
firstItem=
"e8n-UT-KXs"
firstAttribute=
"top"
secondItem=
"695-4F-dam"
secondAttribute=
"bottom"
id=
"BHA-Da-k82"
/>
<constraint
firstItem=
"695-4F-dam"
firstAttribute=
"top"
secondItem=
"aed-4U-dCO"
secondAttribute=
"top"
id=
"JoV-aw-8w7"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"695-4F-dam"
secondAttribute=
"trailing"
id=
"y0e-Ly-dlC"
/>
</constraints>
</view>
<connections>
<outlet
property=
"tableView"
destination=
"695-4F-dam"
id=
"6zi-4M-d8A"
/>
</connections>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"Wn1-aW-bIi"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"1048.8"
y=
"547.37631184407803"
/>
</scene>
<!--Image Collection View Controller-->
<scene
sceneID=
"xff-8l-RP9"
>
<objects>
<viewController
storyboardIdentifier=
"hgImageCollectionVC"
id=
"ybE-mT-bfT"
customClass=
"HGImageCollectionViewController"
customModule=
"hangge_1512"
customModuleProvider=
"target"
sceneMemberID=
"viewController"
>
<layoutGuides>
<viewControllerLayoutGuide
type=
"top"
id=
"eJc-Du-Q6U"
/>
<viewControllerLayoutGuide
type=
"bottom"
id=
"Zws-CJ-rtL"
/>
</layoutGuides>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"GVK-7L-Fs8"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"667"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
dataMode=
"prototypes"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"7ZZ-Yj-QTv"
>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<collectionViewFlowLayout
key=
"collectionViewLayout"
minimumLineSpacing=
"1"
minimumInteritemSpacing=
"1"
id=
"rwi-h3-hSX"
>
<size
key=
"itemSize"
width=
"80"
height=
"80"
/>
<size
key=
"headerReferenceSize"
width=
"0.0"
height=
"0.0"
/>
<size
key=
"footerReferenceSize"
width=
"0.0"
height=
"0.0"
/>
<inset
key=
"sectionInset"
minX=
"0.0"
minY=
"0.0"
maxX=
"0.0"
maxY=
"0.0"
/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
reuseIdentifier=
"cell"
id=
"xGF-2R-csA"
customClass=
"HGImageCollectionViewCell"
customModule=
"hangge_1512"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"80"
height=
"80"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<view
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"80"
height=
"80"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6g8-le-Aax"
/>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"hg_image_not_selected"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"ym3-2Y-K4b"
>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"30"
id=
"6qL-qA-j3A"
/>
<constraint
firstAttribute=
"width"
constant=
"30"
id=
"NdX-z7-daj"
/>
</constraints>
</imageView>
</subviews>
</view>
<constraints>
<constraint
firstAttribute=
"trailing"
secondItem=
"6g8-le-Aax"
secondAttribute=
"trailing"
id=
"1CX-YA-gBU"
/>
<constraint
firstItem=
"ym3-2Y-K4b"
firstAttribute=
"top"
secondItem=
"xGF-2R-csA"
secondAttribute=
"top"
id=
"DAm-by-sWR"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"ym3-2Y-K4b"
secondAttribute=
"trailing"
id=
"EHJ-f5-Sj1"
/>
<constraint
firstItem=
"6g8-le-Aax"
firstAttribute=
"top"
secondItem=
"xGF-2R-csA"
secondAttribute=
"top"
id=
"UDz-lr-IH9"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"6g8-le-Aax"
secondAttribute=
"bottom"
id=
"hCI-an-B11"
/>
<constraint
firstItem=
"6g8-le-Aax"
firstAttribute=
"leading"
secondItem=
"xGF-2R-csA"
secondAttribute=
"leading"
id=
"iTD-VX-259"
/>
</constraints>
<connections>
<outlet
property=
"imageView"
destination=
"6g8-le-Aax"
id=
"Urm-1s-ay6"
/>
<outlet
property=
"selectedIcon"
destination=
"ym3-2Y-K4b"
id=
"evG-eP-buM"
/>
</connections>
</collectionViewCell>
</cells>
<connections>
<outlet
property=
"dataSource"
destination=
"ybE-mT-bfT"
id=
"51g-Ey-BQD"
/>
<outlet
property=
"delegate"
destination=
"ybE-mT-bfT"
id=
"DD0-Sh-2Pw"
/>
</connections>
</collectionView>
<toolbar
opaque=
"NO"
clearsContextBeforeDrawing=
"NO"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"BUV-FR-Ce4"
>
<items/>
</toolbar>
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<constraints>
<constraint
firstItem=
"BUV-FR-Ce4"
firstAttribute=
"leading"
secondItem=
"GVK-7L-Fs8"
secondAttribute=
"leading"
id=
"B5b-ZL-aXy"
/>
<constraint
firstItem=
"BUV-FR-Ce4"
firstAttribute=
"top"
secondItem=
"7ZZ-Yj-QTv"
secondAttribute=
"bottom"
id=
"FGC-7L-Qgg"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"BUV-FR-Ce4"
secondAttribute=
"trailing"
id=
"Hws-q3-9x4"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"7ZZ-Yj-QTv"
secondAttribute=
"trailing"
id=
"S53-X3-aSi"
/>
<constraint
firstItem=
"7ZZ-Yj-QTv"
firstAttribute=
"leading"
secondItem=
"GVK-7L-Fs8"
secondAttribute=
"leading"
id=
"aQa-NV-7qY"
/>
<constraint
firstItem=
"Zws-CJ-rtL"
firstAttribute=
"top"
secondItem=
"BUV-FR-Ce4"
secondAttribute=
"bottom"
id=
"ey9-xA-ip6"
/>
<constraint
firstItem=
"7ZZ-Yj-QTv"
firstAttribute=
"top"
secondItem=
"GVK-7L-Fs8"
secondAttribute=
"top"
id=
"gkS-DG-IQX"
/>
</constraints>
</view>
<connections>
<outlet
property=
"collectionView"
destination=
"7ZZ-Yj-QTv"
id=
"Pes-iP-Wnb"
/>
<outlet
property=
"toolBar"
destination=
"BUV-FR-Ce4"
id=
"dnj-BG-nMR"
/>
</connections>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"3HS-bz-Pof"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"1773.5999999999999"
y=
"546.47676161919048"
/>
</scene>
</scenes>
<resources>
<image
name=
"hg_image_not_selected"
width=
"30"
height=
"30"
/>
</resources>
</document>
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/Contents.json
0 → 100755
View file @
cf73f295
{
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_not_selected.imageset/CellGreySelected@2x.png
0 → 100755
View file @
cf73f295
781 Bytes
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_not_selected.imageset/Contents.json
0 → 100755
View file @
cf73f295
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"CellGreySelected@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_selected.imageset/CellBlueSelected@2x.png
0 → 100755
View file @
cf73f295
1 KB
GeliBusinessPlatform/Other/HGImage/HGImage.xcassets/hg_image_selected.imageset/Contents.json
0 → 100755
View file @
cf73f295
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"CellBlueSelected@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
GeliBusinessPlatform/Other/HGImage/HGImageCollectionViewCell.swift
0 → 100755
View file @
cf73f295
//
// HGImageCollectionViewCell.swift
// hangge_1512
//
// Created by hangge on 2017/1/7.
// Copyright © 2017年 hangge.com. All rights reserved.
//
import
UIKit
//图片缩略图集合页单元格
open
class
HGImageCollectionViewCell
:
UICollectionViewCell
{
//显示缩略图
@IBOutlet
weak
var
imageView
:
UIImageView
!
//显示选中状态的图标
@IBOutlet
weak
var
selectedIcon
:
UIImageView
!
//设置是否选中
open
override
var
isSelected
:
Bool
{
didSet
{
if
isSelected
{
selectedIcon
.
image
=
UIImage
(
named
:
"hg_image_selected"
)
}
else
{
selectedIcon
.
image
=
UIImage
(
named
:
"hg_image_not_selected"
)
}
}
}
//播放动画,是否选中的图标改变时使用
func
playAnimate
()
{
//图标先缩小,再放大
UIView
.
animateKeyframes
(
withDuration
:
0.4
,
delay
:
0
,
options
:
.
allowUserInteraction
,
animations
:
{
UIView
.
addKeyframe
(
withRelativeStartTime
:
0
,
relativeDuration
:
0.2
,
animations
:
{
self
.
selectedIcon
.
transform
=
CGAffineTransform
(
scaleX
:
0.7
,
y
:
0.7
)
})
UIView
.
addKeyframe
(
withRelativeStartTime
:
0.2
,
relativeDuration
:
0.4
,
animations
:
{
self
.
selectedIcon
.
transform
=
CGAffineTransform
.
identity
})
},
completion
:
nil
)
}
open
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
imageView
.
contentMode
=
.
scaleAspectFill
imageView
.
clipsToBounds
=
true
}
}
GeliBusinessPlatform/Other/HGImage/HGImageCollectionViewController.swift
0 → 100755
View file @
cf73f295
//
// HGImageCollectionViewController.swift
// hangge_1512
//
// Created by hangge on 2017/1/7.
// Copyright © 2017年 hangge.com. All rights reserved.
//
import
UIKit
import
Photos
//图片缩略图集合页控制器
class
HGImageCollectionViewController
:
UIViewController
{
//用于显示所有图片缩略图的collectionView
@IBOutlet
weak
var
collectionView
:
UICollectionView
!
//下方工具栏
@IBOutlet
weak
var
toolBar
:
UIToolbar
!
//取得的资源结果,用了存放的PHAsset
var
assetsFetchResults
:
PHFetchResult
<
PHAsset
>
?
//带缓存的图片管理对象
var
imageManager
:
PHCachingImageManager
!
//缩略图大小
var
assetGridThumbnailSize
:
CGSize
!
//每次最多可选择的照片数量
var
maxSelected
:
Int
=
Int
.
max
//照片选择完毕后的回调
var
completeHandler
:((
_
assets
:[
PHAsset
])
->
())?
//完成按钮
var
completeButton
:
HGImageCompleteButton
!
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
//根据单元格的尺寸计算我们需要的缩略图大小
let
scale
=
UIScreen
.
main
.
scale
let
cellSize
=
(
self
.
collectionView
.
collectionViewLayout
as!
UICollectionViewFlowLayout
)
.
itemSize
assetGridThumbnailSize
=
CGSize
(
width
:
cellSize
.
width
*
scale
,
height
:
cellSize
.
height
*
scale
)
}
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
//背景色设置为白色(默认是黑色)
self
.
collectionView
.
backgroundColor
=
UIColor
.
white
//初始化和重置缓存
self
.
imageManager
=
PHCachingImageManager
()
self
.
resetCachedAssets
()
//设置单元格尺寸
let
layout
=
(
self
.
collectionView
.
collectionViewLayout
as!
UICollectionViewFlowLayout
)
layout
.
itemSize
=
CGSize
(
width
:
UIScreen
.
main
.
bounds
.
size
.
width
/
4
-
1
,
height
:
UIScreen
.
main
.
bounds
.
size
.
width
/
4
-
1
)
//允许多选
self
.
collectionView
.
allowsMultipleSelection
=
true
//添加导航栏右侧的取消按钮
let
rightBarItem
=
UIBarButtonItem
(
title
:
"取消"
,
style
:
.
plain
,
target
:
self
,
action
:
#selector(
cancel
)
)
self
.
navigationItem
.
rightBarButtonItem
=
rightBarItem
//添加下方工具栏的完成按钮
completeButton
=
HGImageCompleteButton
()
completeButton
.
addTarget
(
target
:
self
,
action
:
#selector(
finishSelect
)
)
completeButton
.
center
=
CGPoint
(
x
:
UIScreen
.
main
.
bounds
.
width
-
50
,
y
:
22
)
completeButton
.
isEnabled
=
false
toolBar
.
addSubview
(
completeButton
)
}
//重置缓存
func
resetCachedAssets
(){
self
.
imageManager
.
stopCachingImagesForAllAssets
()
}
//取消按钮点击
@objc
func
cancel
()
{
//退出当前视图控制器
self
.
navigationController
?
.
dismiss
(
animated
:
true
,
completion
:
nil
)
}
//获取已选择个数
func
selectedCount
()
->
Int
{
return
self
.
collectionView
.
indexPathsForSelectedItems
?
.
count
??
0
}
//完成按钮点击
@objc
func
finishSelect
(){
//取出已选择的图片资源
var
assets
:[
PHAsset
]
=
[]
if
let
indexPaths
=
self
.
collectionView
.
indexPathsForSelectedItems
{
for
indexPath
in
indexPaths
{
assets
.
append
(
assetsFetchResults
!
[
indexPath
.
row
]
)
}
}
//调用回调函数
self
.
navigationController
?
.
dismiss
(
animated
:
true
,
completion
:
{
self
.
completeHandler
?(
assets
)
})
}
}
//图片缩略图集合页控制器UICollectionViewDataSource,UICollectionViewDelegate协议方法的实现
extension
HGImageCollectionViewController
:
UICollectionViewDataSource
,
UICollectionViewDelegate
{
//CollectionView项目
func
collectionView
(
_
collectionView
:
UICollectionView
,
numberOfItemsInSection
section
:
Int
)
->
Int
{
return
self
.
assetsFetchResults
?
.
count
??
0
}
// 获取单元格
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
//获取storyboard里设计的单元格,不需要再动态添加界面元素
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"cell"
,
for
:
indexPath
)
as!
HGImageCollectionViewCell
let
asset
=
self
.
assetsFetchResults
!
[
indexPath
.
row
]
//获取缩略图
let
option
=
PHImageRequestOptions
()
option
.
isSynchronous
=
true
option
.
isNetworkAccessAllowed
=
true
self
.
imageManager
.
requestImage
(
for
:
asset
,
targetSize
:
CGSize
(
width
:
100
,
height
:
100
),
contentMode
:
.
aspectFill
,
options
:
option
)
{
(
image
,
nfo
)
in
cell
.
imageView
.
image
=
image
}
// requestImage()方法的参数说明:
// asset:图像对应的 PHAsset
// targetSize:需要获取的图像的尺寸,如果输入的尺寸大于资源原图的尺寸,则只返回原图。(如果需要返回原图尺寸,可以传入 PhotoKit 中预先定义好的常量 PHImageManagerMaximumSize ,表示返回可选范围内的最大的尺寸,即原图尺寸。)
// contentMode:图像的剪裁方式,与 UIView 的 contentMode 参数相似,控制照片应该以按比例缩放还是按比例填充的方式放到最终展示的容器内。(注意:如果 targetSize 传入 PHImageManagerMaximumSize,则 contentMode 无论传入什么值都会被视为 PHImageContentModeDefault )
// options:一个 PHImageRequestOptions 的实例,可以控制的内容相当丰富,包括图像的质量、版本,也会有参数控制图像的剪裁。
// resultHandler:请求结束后被调用的 block,返回一个包含资源对于图像的 UIImage 和包含图像信息的一个 NSDictionary,在整个请求的周期中,这个 block 可能会被多次调用。
return
cell
}
//单元格选中响应
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
if
let
cell
=
collectionView
.
cellForItem
(
at
:
indexPath
)
as?
HGImageCollectionViewCell
{
//获取选中的数量
let
count
=
self
.
selectedCount
()
//如果选择的个数大于最大选择数
if
count
>
self
.
maxSelected
{
//设置为不选中状态
collectionView
.
deselectItem
(
at
:
indexPath
,
animated
:
false
)
//弹出提示
let
title
=
"你最多只能选择
\(
self
.
maxSelected
)
张照片"
let
alertController
=
UIAlertController
(
title
:
title
,
message
:
nil
,
preferredStyle
:
.
alert
)
let
cancelAction
=
UIAlertAction
(
title
:
"我知道了"
,
style
:
.
cancel
,
handler
:
nil
)
alertController
.
addAction
(
cancelAction
)
self
.
present
(
alertController
,
animated
:
true
,
completion
:
nil
)
}
//如果不超过最大选择数
else
{
//改变完成按钮数字,并播放动画
completeButton
.
num
=
count
if
count
>
0
&&
!
self
.
completeButton
.
isEnabled
{
completeButton
.
isEnabled
=
true
}
cell
.
playAnimate
()
}
}
}
//单元格取消选中响应
func
collectionView
(
_
collectionView
:
UICollectionView
,
didDeselectItemAt
indexPath
:
IndexPath
)
{
if
let
cell
=
collectionView
.
cellForItem
(
at
:
indexPath
)
as?
HGImageCollectionViewCell
{
//获取选中的数量
let
count
=
self
.
selectedCount
()
completeButton
.
num
=
count
//改变完成按钮数字,并播放动画
if
count
==
0
{
completeButton
.
isEnabled
=
false
}
cell
.
playAnimate
()
}
}
}
GeliBusinessPlatform/Other/HGImage/HGImageCompleteButton.swift
0 → 100755
View file @
cf73f295
//
// HGImageCompleteButton.swift
// hangge_1512
//
// Created by hangge on 2017/1/7.
// Copyright © 2017年 hangge.com. All rights reserved.
//
import
UIKit
//照片选择页下方工具栏的“完成”按钮
class
HGImageCompleteButton
:
UIView
{
//已选照片数量标签
var
numLabel
:
UILabel
!
//按钮标题标签“完成”
var
titleLabel
:
UILabel
!
//按钮的默认尺寸
let
defaultFrame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
70
,
height
:
20
)
//文字颜色(同时也是数字背景颜色)
let
titleColor
=
UIColor
(
red
:
0x09
/
255
,
green
:
0xbb
/
255
,
blue
:
0x07
/
255
,
alpha
:
1
)
//点击点击手势
var
tapSingle
:
UITapGestureRecognizer
?
//设置数量
var
num
:
Int
=
0
{
didSet
{
if
num
==
0
{
numLabel
.
isHidden
=
true
}
else
{
numLabel
.
isHidden
=
false
numLabel
.
text
=
"
\(
num
)
"
playAnimate
()
}
}
}
//是否可用
var
isEnabled
:
Bool
=
true
{
didSet
{
if
isEnabled
{
titleLabel
.
textColor
=
titleColor
tapSingle
?
.
isEnabled
=
true
}
else
{
titleLabel
.
textColor
=
UIColor
.
gray
tapSingle
?
.
isEnabled
=
false
}
}
}
init
(){
super
.
init
(
frame
:
defaultFrame
)
//已选照片数量标签初始化
numLabel
=
UILabel
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
20
,
height
:
20
))
numLabel
.
backgroundColor
=
titleColor
numLabel
.
layer
.
cornerRadius
=
10
numLabel
.
layer
.
masksToBounds
=
true
numLabel
.
textAlignment
=
.
center
numLabel
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
)
numLabel
.
textColor
=
UIColor
.
white
numLabel
.
isHidden
=
true
self
.
addSubview
(
numLabel
)
//按钮标题标签初始化
titleLabel
=
UILabel
(
frame
:
CGRect
(
x
:
20
,
y
:
0
,
width
:
defaultFrame
.
width
-
20
,
height
:
20
))
titleLabel
.
text
=
"完成"
titleLabel
.
textAlignment
=
.
center
titleLabel
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
)
titleLabel
.
textColor
=
titleColor
self
.
addSubview
(
titleLabel
)
}
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
//用户数字改变时播放的动画
func
playAnimate
()
{
//从小变大,且有弹性效果
self
.
numLabel
.
transform
=
CGAffineTransform
(
scaleX
:
0.1
,
y
:
0.1
)
UIView
.
animate
(
withDuration
:
0.5
,
delay
:
0
,
usingSpringWithDamping
:
0.5
,
initialSpringVelocity
:
0.5
,
options
:
UIView
.
AnimationOptions
(),
animations
:
{
self
.
numLabel
.
transform
=
CGAffineTransform
.
identity
},
completion
:
nil
)
}
//添加事件响应
func
addTarget
(
target
:
Any
?,
action
:
Selector
?)
{
//单击监听
tapSingle
=
UITapGestureRecognizer
(
target
:
target
,
action
:
action
)
tapSingle
!.
numberOfTapsRequired
=
1
tapSingle
!.
numberOfTouchesRequired
=
1
self
.
addGestureRecognizer
(
tapSingle
!
)
}
}
GeliBusinessPlatform/Other/HGImage/HGImagePickerCell.swift
0 → 100755
View file @
cf73f295
import
UIKit
//相簿列表单元格
class
HGImagePickerCell
:
UITableViewCell
{
//相簿名称标签
@IBOutlet
weak
var
titleLabel
:
UILabel
!
//照片数量标签
@IBOutlet
weak
var
countLabel
:
UILabel
!
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
self
.
layoutMargins
=
UIEdgeInsets
.
zero
}
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
super
.
setSelected
(
selected
,
animated
:
animated
)
}
}
GeliBusinessPlatform/Other/HGImage/HGImagePickerController.swift
0 → 100755
View file @
cf73f295
import
UIKit
import
Photos
//相簿列表项
struct
HGImageAlbumItem
{
//相簿名称
var
title
:
String
?
//相簿内的资源
var
fetchResult
:
PHFetchResult
<
PHAsset
>
}
//相簿列表页控制器
class
HGImagePickerController
:
UIViewController
{
//显示相簿列表项的表格
@IBOutlet
weak
var
tableView
:
UITableView
!
//相簿列表项集合
var
items
:[
HGImageAlbumItem
]
=
[]
//每次最多可选择的照片数量
var
maxSelected
:
Int
=
Int
.
max
//照片选择完毕后的回调
var
completeHandler
:((
_
assets
:[
PHAsset
])
->
())?
//从xib或者storyboard加载完毕就会调用
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
//申请权限
PHPhotoLibrary
.
requestAuthorization
({
(
status
)
in
if
status
!=
.
authorized
{
return
}
// 列出所有系统的智能相册
let
smartOptions
=
PHFetchOptions
()
let
smartAlbums
=
PHAssetCollection
.
fetchAssetCollections
(
with
:
.
smartAlbum
,
subtype
:
.
albumRegular
,
options
:
smartOptions
)
self
.
convertCollection
(
collection
:
smartAlbums
)
//列出所有用户创建的相册
let
userCollections
=
PHCollectionList
.
fetchTopLevelUserCollections
(
with
:
nil
)
self
.
convertCollection
(
collection
:
userCollections
as!
PHFetchResult
<
PHAssetCollection
>
)
//相册按包含的照片数量排序(降序)
self
.
items
.
sort
{
(
item1
,
item2
)
->
Bool
in
return
item1
.
fetchResult
.
count
>
item2
.
fetchResult
.
count
}
//异步加载表格数据,需要在主线程中调用reloadData() 方法
DispatchQueue
.
main
.
async
{
self
.
tableView
?
.
reloadData
()
//首次进来后直接进入第一个相册图片展示页面(相机胶卷)
if
let
imageCollectionVC
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"hgImageCollectionVC"
)
as?
HGImageCollectionViewController
{
imageCollectionVC
.
title
=
self
.
items
.
first
?
.
title
imageCollectionVC
.
assetsFetchResults
=
self
.
items
.
first
?
.
fetchResult
imageCollectionVC
.
completeHandler
=
self
.
completeHandler
imageCollectionVC
.
maxSelected
=
self
.
maxSelected
self
.
navigationController
?
.
pushViewController
(
imageCollectionVC
,
animated
:
false
)
}
}
})
}
//页面加载完毕
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
//设置标题
title
=
"相簿"
//设置表格相关样式属性
self
.
tableView
.
separatorInset
=
UIEdgeInsets
(
top
:
0
,
left
:
0
,
bottom
:
0
,
right
:
0
)
self
.
tableView
.
rowHeight
=
55
//添加导航栏右侧的取消按钮
let
rightBarItem
=
UIBarButtonItem
(
title
:
"取消"
,
style
:
.
plain
,
target
:
self
,
action
:
#selector(
cancel
)
)
self
.
navigationItem
.
rightBarButtonItem
=
rightBarItem
}
//转化处理获取到的相簿
private
func
convertCollection
(
collection
:
PHFetchResult
<
PHAssetCollection
>
){
for
i
in
0
..<
collection
.
count
{
//获取出但前相簿内的图片
let
resultsOptions
=
PHFetchOptions
()
resultsOptions
.
sortDescriptors
=
[
NSSortDescriptor
(
key
:
"creationDate"
,
ascending
:
false
)]
resultsOptions
.
predicate
=
NSPredicate
(
format
:
"mediaType = %d"
,
PHAssetMediaType
.
image
.
rawValue
)
let
c
=
collection
[
i
]
let
assetsFetchResult
=
PHAsset
.
fetchAssets
(
in
:
c
,
options
:
resultsOptions
)
//没有图片的空相簿不显示
if
assetsFetchResult
.
count
>
0
{
let
title
=
titleOfAlbumForChinse
(
title
:
c
.
localizedTitle
)
items
.
append
(
HGImageAlbumItem
(
title
:
title
,
fetchResult
:
assetsFetchResult
))
}
}
}
//由于系统返回的相册集名称为英文,我们需要转换为中文
private
func
titleOfAlbumForChinse
(
title
:
String
?)
->
String
?
{
if
title
==
"Slo-mo"
{
return
"慢动作"
}
else
if
title
==
"Recently Added"
{
return
"最近添加"
}
else
if
title
==
"Favorites"
{
return
"个人收藏"
}
else
if
title
==
"Recently Deleted"
{
return
"最近删除"
}
else
if
title
==
"Videos"
{
return
"视频"
}
else
if
title
==
"All Photos"
{
return
"所有照片"
}
else
if
title
==
"Selfies"
{
return
"自拍"
}
else
if
title
==
"Screenshots"
{
return
"屏幕快照"
}
else
if
title
==
"Camera Roll"
{
return
"相机胶卷"
}
return
title
}
//取消按钮点击
@objc
func
cancel
()
{
//退出当前视图控制器
self
.
dismiss
(
animated
:
true
,
completion
:
nil
)
}
//页面跳转
override
func
prepare
(
for
segue
:
UIStoryboardSegue
,
sender
:
Any
?)
{
//如果是跳转到展示相簿缩略图页面
if
segue
.
identifier
==
"showImages"
{
//获取照片展示控制器
guard
let
imageCollectionVC
=
segue
.
destination
as?
HGImageCollectionViewController
,
let
cell
=
sender
as?
HGImagePickerCell
else
{
return
}
//设置回调函数
imageCollectionVC
.
completeHandler
=
completeHandler
//设置标题
imageCollectionVC
.
title
=
cell
.
titleLabel
.
text
//设置最多可选图片数量
imageCollectionVC
.
maxSelected
=
self
.
maxSelected
guard
let
indexPath
=
self
.
tableView
.
indexPath
(
for
:
cell
)
else
{
return
}
//获取选中的相簿信息
let
fetchResult
=
self
.
items
[
indexPath
.
row
]
.
fetchResult
//传递相簿内的图片资源
imageCollectionVC
.
assetsFetchResults
=
fetchResult
}
}
override
func
didReceiveMemoryWarning
()
{
super
.
didReceiveMemoryWarning
()
}
}
//相簿列表页控制器UITableViewDelegate,UITableViewDataSource协议方法的实现
extension
HGImagePickerController
:
UITableViewDelegate
,
UITableViewDataSource
{
//设置单元格内容
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
//同一形式的单元格重复使用,在声明时已注册
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"cell"
,
for
:
indexPath
)
as!
HGImagePickerCell
let
item
=
self
.
items
[
indexPath
.
row
]
cell
.
titleLabel
.
text
=
"
\(
item
.
title
??
""
)
"
cell
.
countLabel
.
text
=
"(
\(
item
.
fetchResult
.
count
)
)"
return
cell
}
//表格单元格数量
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
self
.
items
.
count
}
//表格单元格选中
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
tableView
.
deselectRow
(
at
:
indexPath
,
animated
:
true
)
}
}
extension
UIViewController
{
//HGImagePicker提供给外部调用的接口,同于显示图片选择页面
func
presentHGImagePicker
(
maxSelected
:
Int
=
Int
.
max
,
completeHandler
:((
_
assets
:[
PHAsset
])
->
())?)
->
HGImagePickerController
?{
//获取图片选择视图控制器
if
let
vc
=
UIStoryboard
(
name
:
"HGImage"
,
bundle
:
Bundle
.
main
)
.
instantiateViewController
(
withIdentifier
:
"imagePickerVC"
)
as?
HGImagePickerController
{
//设置选择完毕后的回调
vc
.
completeHandler
=
completeHandler
//设置图片最多选择的数量
vc
.
maxSelected
=
maxSelected
//将图片选择视图控制器外添加个导航控制器,并显示
let
nav
=
UINavigationController
(
rootViewController
:
vc
)
self
.
present
(
nav
,
animated
:
true
,
completion
:
nil
)
return
vc
}
return
nil
}
}
GeliBusinessPlatform/ViewController/个人中心/PersonCenterViewController.swift
View file @
cf73f295
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
//
//
import
UIKit
import
UIKit
import
Photos
class
PersonCenterViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
class
PersonCenterViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
...
@@ -98,8 +99,19 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
...
@@ -98,8 +99,19 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
else
if
indexPath
.
row
==
2
{
}
else
if
indexPath
.
row
==
2
{
//权限设置-弹窗
//权限设置-弹窗
let
vc
=
WebViewController
()
// let vc = WebViewController()
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
// self.navigationController?.pushViewController(vc, animated: true)
_
=
self
.
presentHGImagePicker
(
maxSelected
:
2
)
{
(
assets
)
in
//结果处理
print
(
"共选择了
\(
assets
.
count
)
张图片,分别如下:"
)
for
asset
in
assets
{
print
(
asset
)
PHImageManager
.
default
()
.
requestImage
(
for
:
asset
,
targetSize
:
PHImageManagerMaximumSize
,
contentMode
:
.
default
,
options
:
nil
,
resultHandler
:
{
(
imge
,
_
:
[
AnyHashable
:
Any
]?)
in
})
}
}
}
}
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
...
...
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