|
|
@ -41,7 +41,6 @@ class DemoListViewController: UITableViewController, NohanaImagePickerController
|
|||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
ColorConfig.backgroundColor = UIColor.white
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
|
|
@ -66,8 +65,6 @@ class DemoListViewController: UITableViewController, NohanaImagePickerController
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Photos
|
||||
|
|
@ -131,11 +128,9 @@ class DemoListViewController: UITableViewController, NohanaImagePickerController
|
|||
|
||||
@objc
|
||||
func showCustomUIPicker() {
|
||||
ColorConfig.backgroundColor = UIColor.lightGray
|
||||
|
||||
let picker = NohanaImagePickerController()
|
||||
picker.delegate = self
|
||||
picker.assetBundle = Bundle.main
|
||||
picker.config.color.background = .lightGray
|
||||
present(picker, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_select_l@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_select_l@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_selected_l@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_selected_l@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_alert_s@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_alert_s@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_low_s@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_low_s@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016 nohana, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
"albumlist.title" = "Photos📗";
|
||||
"albumlist.empty.message" = "No Photos🤔";
|
||||
"albumlist.empty.description" = "Take some photos with Camera app.";
|
||||
"albumlist.moment.title" = "Moment";
|
||||
"toolbar.title.nolimit" = "Selected : %ld";
|
||||
"toolbar.title.haslimit" = "Selected Items: %ld / %ld";
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016 nohana, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
"albumlist.title" = "アルバム📗";
|
||||
"albumlist.empty.message" = "アルバムに\n写真がありません🤔";
|
||||
"albumlist.empty.description" = "カメラで写真を撮影しましょう";
|
||||
"albumlist.moment.title" = "日付から選択";
|
||||
"toolbar.title.nolimit" = "%ld枚選択中";
|
||||
"toolbar.title.haslimit" = "%ld枚選択中(最大%ld枚)";
|
||||
|
|
@ -7,9 +7,7 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
3569CAA81EC1918E000C41C0 /* NohanaImagePicker.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3569CAA41EC1918E000C41C0 /* NohanaImagePicker.strings */; };
|
||||
3569CAA91EC1918E000C41C0 /* NohanaImagePicker.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3569CAA61EC1918E000C41C0 /* NohanaImagePicker.xcassets */; };
|
||||
F202573A1C7343D20069B33A /* ImageName.swift in Sources */ = {isa = PBXBuildFile; fileRef = F20257391C7343D20069B33A /* ImageName.swift */; };
|
||||
F202573C1C7418920069B33A /* PickedAssetList.swift in Sources */ = {isa = PBXBuildFile; fileRef = F202573B1C7418920069B33A /* PickedAssetList.swift */; };
|
||||
F208E5541CD7370B00FFC9F6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F208E5531CD7370B00FFC9F6 /* AppDelegate.swift */; };
|
||||
F208E5591CD7370B00FFC9F6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F208E5571CD7370B00FFC9F6 /* Main.storyboard */; };
|
||||
|
|
@ -30,7 +28,6 @@
|
|||
F25C69881CA23A0A005935D6 /* MomentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25C69871CA23A0A005935D6 /* MomentCell.swift */; };
|
||||
F25C69901CA27311005935D6 /* EmptyIndicatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25C698F1CA27311005935D6 /* EmptyIndicatable.swift */; };
|
||||
F25C69921CA28728005935D6 /* AlbumListEmptyIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25C69911CA28728005935D6 /* AlbumListEmptyIndicator.swift */; };
|
||||
F25C699B1CA2B79A005935D6 /* ColorConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25C699A1CA2B79A005935D6 /* ColorConfig.swift */; };
|
||||
F26775DE1C701FA7002E786C /* ItemList.swift in Sources */ = {isa = PBXBuildFile; fileRef = F26775DD1C701FA7002E786C /* ItemList.swift */; };
|
||||
F26775E11C7046C7002E786C /* ExpandingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F26775E01C7046C7002E786C /* ExpandingAnimationController.swift */; };
|
||||
F26775E51C70574F002E786C /* AnimatableNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F26775E41C70574F002E786C /* AnimatableNavigationController.swift */; };
|
||||
|
|
@ -73,11 +70,8 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
3569CAA51EC1918E000C41C0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/NohanaImagePicker.strings; sourceTree = "<group>"; };
|
||||
3569CAA61EC1918E000C41C0 /* NohanaImagePicker.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = NohanaImagePicker.xcassets; sourceTree = "<group>"; };
|
||||
3569CAA71EC1918E000C41C0 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/NohanaImagePicker.strings; sourceTree = "<group>"; };
|
||||
3590F1F51EC1A79400F32E06 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/NohanaImagePicker.strings; sourceTree = "<group>"; };
|
||||
F20257391C7343D20069B33A /* ImageName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageName.swift; sourceTree = "<group>"; };
|
||||
F202573B1C7418920069B33A /* PickedAssetList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PickedAssetList.swift; sourceTree = "<group>"; };
|
||||
F208E5511CD7370B00FFC9F6 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F208E5531CD7370B00FFC9F6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -98,7 +92,6 @@
|
|||
F25C69871CA23A0A005935D6 /* MomentCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MomentCell.swift; sourceTree = "<group>"; };
|
||||
F25C698F1CA27311005935D6 /* EmptyIndicatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmptyIndicatable.swift; sourceTree = "<group>"; };
|
||||
F25C69911CA28728005935D6 /* AlbumListEmptyIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlbumListEmptyIndicator.swift; sourceTree = "<group>"; };
|
||||
F25C699A1CA2B79A005935D6 /* ColorConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorConfig.swift; sourceTree = "<group>"; };
|
||||
F26775DD1C701FA7002E786C /* ItemList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemList.swift; sourceTree = "<group>"; };
|
||||
F26775E01C7046C7002E786C /* ExpandingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExpandingAnimationController.swift; sourceTree = "<group>"; };
|
||||
F26775E41C70574F002E786C /* AnimatableNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimatableNavigationController.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -141,7 +134,6 @@
|
|||
3569CAA31EC1918E000C41C0 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3569CAA41EC1918E000C41C0 /* NohanaImagePicker.strings */,
|
||||
3569CAA61EC1918E000C41C0 /* NohanaImagePicker.xcassets */,
|
||||
);
|
||||
path = Resources;
|
||||
|
|
@ -210,12 +202,10 @@
|
|||
children = (
|
||||
F26775DD1C701FA7002E786C /* ItemList.swift */,
|
||||
F202573B1C7418920069B33A /* PickedAssetList.swift */,
|
||||
F20257391C7343D20069B33A /* ImageName.swift */,
|
||||
F26775E71C7073CD002E786C /* Size.swift */,
|
||||
F2DA29761C7749D600B0A8E3 /* NotificationInfo.swift */,
|
||||
F25C698F1CA27311005935D6 /* EmptyIndicatable.swift */,
|
||||
F23CC89D1CB745C800BCE443 /* ActivityIndicatable.swift */,
|
||||
F25C699A1CA2B79A005935D6 /* ColorConfig.swift */,
|
||||
);
|
||||
name = Common;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -366,7 +356,6 @@
|
|||
3569CAA91EC1918E000C41C0 /* NohanaImagePicker.xcassets in Resources */,
|
||||
F208E55B1CD7370B00FFC9F6 /* Assets.xcassets in Resources */,
|
||||
F208E5591CD7370B00FFC9F6 /* Main.storyboard in Resources */,
|
||||
3569CAA81EC1918E000C41C0 /* NohanaImagePicker.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -404,7 +393,6 @@
|
|||
F25C10C21C8ED9BF007453C3 /* MomentViewController.swift in Sources */,
|
||||
F25C69881CA23A0A005935D6 /* MomentCell.swift in Sources */,
|
||||
F2FE1F781C901D9400FDBE7B /* MomentSectionHeaderView.swift in Sources */,
|
||||
F202573A1C7343D20069B33A /* ImageName.swift in Sources */,
|
||||
F23554281C69D5DB00796DCA /* NohanaImagePickerController.swift in Sources */,
|
||||
F25C69921CA28728005935D6 /* AlbumListEmptyIndicator.swift in Sources */,
|
||||
F2131F431C79615700797887 /* SwipeInteractionController.swift in Sources */,
|
||||
|
|
@ -419,7 +407,6 @@
|
|||
F2DF3B2B1C6CC4DB00C1C0E4 /* AssetDetailListViewController.swift in Sources */,
|
||||
F218D7D61C6B3D22001FCED1 /* PhotoKitAlbumList.swift in Sources */,
|
||||
F24EB6901C68AEED0002EC86 /* AlbumListViewController.swift in Sources */,
|
||||
F25C699B1CA2B79A005935D6 /* ColorConfig.swift in Sources */,
|
||||
F28F4AC31C6C49EE00B7D725 /* PhotoKitAssetList.swift in Sources */,
|
||||
F26775EA1C71645A002E786C /* ContractingAnimationController.swift in Sources */,
|
||||
);
|
||||
|
|
@ -436,15 +423,6 @@
|
|||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
3569CAA41EC1918E000C41C0 /* NohanaImagePicker.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
3569CAA51EC1918E000C41C0 /* en */,
|
||||
3569CAA71EC1918E000C41C0 /* ja */,
|
||||
);
|
||||
name = NohanaImagePicker.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F208E5571CD7370B00FFC9F6 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
|
|
|
|||
|
|
@ -16,21 +16,21 @@
|
|||
|
||||
class AlbumListEmptyIndicator: UILabel {
|
||||
|
||||
init(message: String, description: String, frame: CGRect) {
|
||||
init(message: String, description: String, frame: CGRect, config: NohanaImagePickerController.Config) {
|
||||
super.init(frame: frame)
|
||||
|
||||
let centerStyle = NSMutableParagraphStyle()
|
||||
centerStyle.alignment = NSTextAlignment.center
|
||||
|
||||
let messageAttributes = [
|
||||
NSForegroundColorAttributeName : ColorConfig.emptyIndicator,
|
||||
NSForegroundColorAttributeName : config.color.empty,
|
||||
NSFontAttributeName : UIFont.systemFont(ofSize: 26),
|
||||
NSParagraphStyleAttributeName : centerStyle
|
||||
]
|
||||
let messageText = NSAttributedString(string: message, attributes: messageAttributes)
|
||||
|
||||
let descriptionAttributes = [
|
||||
NSForegroundColorAttributeName : ColorConfig.emptyIndicator,
|
||||
NSForegroundColorAttributeName : config.color.empty,
|
||||
NSFontAttributeName : UIFont.systemFont(ofSize: 14),
|
||||
NSParagraphStyleAttributeName : centerStyle
|
||||
]
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class AlbumListViewController: UITableViewController, EmptyIndicatable, Activity
|
|||
}
|
||||
setUpEmptyIndicator()
|
||||
setUpActivityIndicator()
|
||||
self.view.backgroundColor = ColorConfig.backgroundColor
|
||||
self.view.backgroundColor = nohanaImagePickerController?.config.color.background
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
|
@ -135,10 +135,11 @@ class AlbumListViewController: UITableViewController, EmptyIndicatable, Activity
|
|||
|
||||
switch sectionType {
|
||||
case .moment:
|
||||
guard let cell = tableView.dequeueReusableCell(withIdentifier: "MomentAlbumCell") as? AlbumCell else {
|
||||
guard let cell = tableView.dequeueReusableCell(withIdentifier: "MomentAlbumCell") as? MomentCell else {
|
||||
fatalError("failed to dequeueReusableCellWithIdentifier(\"MomentAlbumCell\")")
|
||||
}
|
||||
if let nohanaImagePickerController = nohanaImagePickerController {
|
||||
cell.config = nohanaImagePickerController.config
|
||||
cell.titleLabel?.text = NSLocalizedString("albumlist.moment.title", tableName: "NohanaImagePicker", bundle: nohanaImagePickerController.assetBundle, comment: "")
|
||||
}
|
||||
return cell
|
||||
|
|
@ -222,7 +223,8 @@ class AlbumListViewController: UITableViewController, EmptyIndicatable, Activity
|
|||
emptyIndicator = AlbumListEmptyIndicator(
|
||||
message: NSLocalizedString("albumlist.empty.message", tableName: "NohanaImagePicker", bundle: nohanaImagePickerController.assetBundle, comment: ""),
|
||||
description: NSLocalizedString("albumlist.empty.description", tableName: "NohanaImagePicker", bundle: nohanaImagePickerController.assetBundle, comment: ""),
|
||||
frame: frame)
|
||||
frame: frame,
|
||||
config: nohanaImagePickerController.config)
|
||||
}
|
||||
|
||||
func isEmpty() -> Bool {
|
||||
|
|
|
|||
|
|
@ -27,12 +27,11 @@ class AssetCell: UICollectionViewCell {
|
|||
override func willMove(toSuperview newSuperview: UIView?) {
|
||||
super.willMove(toSuperview: newSuperview)
|
||||
if let nohanaImagePickerController = nohanaImagePickerController {
|
||||
pickButton.setImage(
|
||||
UIImage(named: ImageName.AssetCell.PickButton.SizeM.dropped, in: nohanaImagePickerController.assetBundle, compatibleWith: nil),
|
||||
for: UIControlState())
|
||||
pickButton.setImage(
|
||||
UIImage(named: ImageName.AssetCell.PickButton.SizeM.picked, in: nohanaImagePickerController.assetBundle, compatibleWith: nil),
|
||||
for: .selected)
|
||||
let droppedImage: UIImage? = nohanaImagePickerController.config.image.droppedSmall ?? UIImage(named: "btn_select_m", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
|
||||
let pickedImage: UIImage? = nohanaImagePickerController.config.image.pickedSmall ?? UIImage(named: "btn_selected_m", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
|
||||
|
||||
pickButton.setImage(droppedImage, for: UIControlState())
|
||||
pickButton.setImage(pickedImage, for: .selected)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,12 +35,11 @@ class AssetDetailListViewController: AssetListViewController {
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
if let nohanaImagePickerController = nohanaImagePickerController {
|
||||
pickButton.setImage(
|
||||
UIImage(named: ImageName.AssetCell.PickButton.SizeL.dropped, in: nohanaImagePickerController.assetBundle, compatibleWith: nil),
|
||||
for: UIControlState())
|
||||
pickButton.setImage(
|
||||
UIImage(named: ImageName.AssetCell.PickButton.SizeL.picked, in: nohanaImagePickerController.assetBundle, compatibleWith: nil),
|
||||
for: .selected)
|
||||
let droppedImage: UIImage? = nohanaImagePickerController.config.image.droppedLarge ?? UIImage(named: "btn_select_l", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
|
||||
let pickedImage: UIImage? = nohanaImagePickerController.config.image.pickedLarge ?? UIImage(named: "btn_selected_l", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
|
||||
|
||||
pickButton.setImage(droppedImage, for: UIControlState())
|
||||
pickButton.setImage(pickedImage, for: .selected)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class AssetListViewController: UICollectionViewController {
|
|||
updateTitle()
|
||||
setUpToolbarItems()
|
||||
addPickPhotoKitAssetNotificationObservers()
|
||||
self.view.backgroundColor = ColorConfig.backgroundColor
|
||||
self.view.backgroundColor = nohanaImagePickerController?.config.color.background
|
||||
}
|
||||
|
||||
var cellSize: CGSize {
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016 nohana, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
public struct ColorConfig {
|
||||
public static var backgroundColor = UIColor.white
|
||||
public static var emptyIndicator = UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1)
|
||||
|
||||
public struct AlbumList {
|
||||
public static var momentCellSeparator = UIColor(red: 0xbb/0xff, green: 0xbb/0xff, blue: 0xbb/0xff, alpha: 1)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016 nohana, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
struct ImageName {
|
||||
struct AssetCell {
|
||||
struct PickButton {
|
||||
struct SizeM {
|
||||
static let picked = "btn_selected_m"
|
||||
static let dropped = "btn_select_m"
|
||||
}
|
||||
struct SizeL {
|
||||
static let picked = "btn_selected_l"
|
||||
static let dropped = "btn_select_l"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,11 +17,12 @@
|
|||
import UIKit
|
||||
|
||||
class MomentCell: AlbumCell {
|
||||
var config: NohanaImagePickerController.Config!
|
||||
|
||||
override func draw(_ rect: CGRect) {
|
||||
super.draw(rect)
|
||||
let lineWidth: CGFloat = 1 / UIScreen.main.scale
|
||||
ColorConfig.AlbumList.momentCellSeparator.setFill()
|
||||
config.color.separator.setFill()
|
||||
UIRectFill(CGRect(x: 16, y: frame.size.height - lineWidth, width: frame.size.width, height:lineWidth))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_0" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Album List View Controller-->
|
||||
|
|
@ -13,10 +17,10 @@
|
|||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Nh8-55-S0b">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="AlbumCell" rowHeight="82" id="HiQ-6b-xqZ" customClass="AlbumCell" customModule="NohanaImagePicker" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="92" width="320" height="82"/>
|
||||
<rect key="frame" x="0.0" y="28" width="320" height="82"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="HiQ-6b-xqZ" id="Nuf-ja-Ajg">
|
||||
<rect key="frame" x="0.0" y="0.0" width="287" height="82"/>
|
||||
|
|
@ -35,7 +39,7 @@
|
|||
<constraint firstAttribute="height" constant="16" id="X2y-hP-9aM"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -47,7 +51,7 @@
|
|||
<constraint firstAttribute="trailingMargin" secondItem="YSz-MM-h6f" secondAttribute="trailing" constant="-8" id="tee-FS-sAo"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<outlet property="thumbnailImageView" destination="Igm-UH-WUI" id="RZo-Jd-deA"/>
|
||||
<outlet property="titleLabel" destination="YSz-MM-h6f" id="bA5-m7-lwo"/>
|
||||
|
|
@ -55,7 +59,7 @@
|
|||
</connections>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="MomentAlbumCell" rowHeight="52" id="URZ-ke-kYw" customClass="MomentCell" customModule="NohanaImagePicker" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="174" width="320" height="52"/>
|
||||
<rect key="frame" x="0.0" y="110" width="320" height="52"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="URZ-ke-kYw" id="ZzC-oj-tew">
|
||||
<rect key="frame" x="0.0" y="0.0" width="287" height="52"/>
|
||||
|
|
@ -67,7 +71,7 @@
|
|||
<constraint firstAttribute="height" constant="16" id="tPC-2Q-2pd"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -77,7 +81,7 @@
|
|||
<constraint firstItem="nzC-P1-sBf" firstAttribute="centerY" secondItem="ZzC-oj-tew" secondAttribute="centerY" id="SZH-em-zj3"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<outlet property="titleLabel" destination="nzC-P1-sBf" id="XE1-Qw-Xid"/>
|
||||
<segue destination="FOz-K3-QuR" kind="show" id="oPR-kG-SaF"/>
|
||||
|
|
@ -110,7 +114,7 @@
|
|||
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="cLH-x9-2VN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="2" minimumInteritemSpacing="2" id="xXL-vg-bZb">
|
||||
<size key="itemSize" width="50" height="50"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
|
|
@ -119,7 +123,7 @@
|
|||
</collectionViewFlowLayout>
|
||||
<cells>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="AssetCell" id="gNu-ad-t1d" customClass="AssetCell" customModule="NohanaImagePicker" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="72" width="78" height="78"/>
|
||||
<rect key="frame" x="0.0" y="8" width="78" height="78"/>
|
||||
<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="78" height="78"/>
|
||||
|
|
@ -130,7 +134,7 @@
|
|||
</imageView>
|
||||
<view hidden="YES" alpha="0.29999999999999999" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MT5-kg-1gq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="78" height="78"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oDB-be-mWY">
|
||||
<rect key="frame" x="34" y="0.0" width="44" height="44"/>
|
||||
|
|
@ -138,13 +142,11 @@
|
|||
<constraint firstAttribute="width" constant="44" id="7Yd-sj-A9c"/>
|
||||
<constraint firstAttribute="height" constant="44" id="Biw-rC-p8x"/>
|
||||
</constraints>
|
||||
<state key="normal" image="btn_select_m"/>
|
||||
<connections>
|
||||
<action selector="didPushPickButton:" destination="gNu-ad-t1d" eventType="touchUpInside" id="gAj-yS-7xL"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="oDB-be-mWY" secondAttribute="trailing" constant="-8" id="0u6-oO-0PG"/>
|
||||
|
|
@ -168,7 +170,7 @@
|
|||
</collectionViewCell>
|
||||
</cells>
|
||||
<collectionReusableView key="sectionFooterView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="AssetListFooter" id="N6q-ob-hkI">
|
||||
<rect key="frame" x="0.0" y="152" width="320" height="44"/>
|
||||
<rect key="frame" x="0.0" y="88" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</collectionReusableView>
|
||||
<connections>
|
||||
|
|
@ -188,7 +190,7 @@
|
|||
</collectionViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="1SX-Sl-Deo" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1156" y="267"/>
|
||||
<point key="canvasLocation" x="1749" y="214"/>
|
||||
</scene>
|
||||
<!--Asset Detail List View Controller-->
|
||||
<scene sceneID="jjo-0p-7dH">
|
||||
|
|
@ -205,7 +207,7 @@
|
|||
</collectionViewFlowLayout>
|
||||
<cells>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="AssetDetailCell" id="Sux-7h-iE6" customClass="AssetDetailCell" customModule="NohanaImagePicker" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="156" width="320" height="320"/>
|
||||
<rect key="frame" x="0.0" y="92" width="320" height="320"/>
|
||||
<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="320" height="320"/>
|
||||
|
|
@ -234,7 +236,6 @@
|
|||
</connections>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<gestureRecognizers/>
|
||||
<constraints>
|
||||
|
|
@ -261,7 +262,6 @@
|
|||
<button key="customView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="c4C-Sf-Krj">
|
||||
<rect key="frame" x="276" y="8" width="28" height="28"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" image="btn_select_l"/>
|
||||
<connections>
|
||||
<action selector="didPushPickButton:" destination="r7t-t8-AuE" eventType="touchUpInside" id="vWF-yZ-1NC"/>
|
||||
</connections>
|
||||
|
|
@ -276,7 +276,7 @@
|
|||
</collectionViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="u84-ka-8a6" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1598" y="456"/>
|
||||
<point key="canvasLocation" x="2741" y="449"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="RR9-zr-Qlw">
|
||||
|
|
@ -296,7 +296,7 @@
|
|||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="3iI-ph-cZF" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="259" y="219"/>
|
||||
<point key="canvasLocation" x="-456" y="215"/>
|
||||
</scene>
|
||||
<!--Animatable Navigation Controller-->
|
||||
<scene sceneID="Zpb-f1-dmj">
|
||||
|
|
@ -314,7 +314,7 @@
|
|||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Sfb-mw-QnO" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="259" y="882"/>
|
||||
<point key="canvasLocation" x="-458" y="935"/>
|
||||
</scene>
|
||||
<!--Moment View Controller-->
|
||||
<scene sceneID="kJ6-NP-kmc">
|
||||
|
|
@ -323,7 +323,7 @@
|
|||
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="J9r-MB-y52">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="2" minimumInteritemSpacing="2" id="smE-Ti-qUX">
|
||||
<size key="itemSize" width="50" height="50"/>
|
||||
<size key="headerReferenceSize" width="50" height="44"/>
|
||||
|
|
@ -332,7 +332,7 @@
|
|||
</collectionViewFlowLayout>
|
||||
<cells>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="AssetCell" id="hn9-bM-eId" customClass="AssetCell" customModule="NohanaImagePicker" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="110" width="78" height="78"/>
|
||||
<rect key="frame" x="0.0" y="46" width="78" height="78"/>
|
||||
<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="78" height="78"/>
|
||||
|
|
@ -343,7 +343,7 @@
|
|||
</imageView>
|
||||
<view hidden="YES" alpha="0.30000001192092896" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SnZ-bd-Zia">
|
||||
<rect key="frame" x="0.0" y="0.0" width="78" height="78"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vrt-tc-b54">
|
||||
<rect key="frame" x="34" y="0.0" width="44" height="44"/>
|
||||
|
|
@ -351,13 +351,11 @@
|
|||
<constraint firstAttribute="width" constant="44" id="BX8-gP-86t"/>
|
||||
<constraint firstAttribute="height" constant="44" id="RUG-gG-ieX"/>
|
||||
</constraints>
|
||||
<state key="normal" image="btn_select_m"/>
|
||||
<connections>
|
||||
<action selector="didPushPickButton:" destination="hn9-bM-eId" eventType="touchUpInside" id="g70-dv-o5C"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="SnZ-bd-Zia" secondAttribute="bottom" constant="-8" id="1hA-eS-4fw"/>
|
||||
|
|
@ -381,7 +379,7 @@
|
|||
</collectionViewCell>
|
||||
</cells>
|
||||
<collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="MomentHeader" id="BCa-t3-9XW" customClass="MomentSectionHeaderView" customModule="NohanaImagePicker" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="44"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aNJ-Oh-VhZ">
|
||||
|
|
@ -392,7 +390,7 @@
|
|||
<constraint firstAttribute="height" constant="21" id="XMh-5E-eAL"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
|
|
@ -406,7 +404,7 @@
|
|||
<constraint firstAttribute="height" constant="21" id="QVr-qn-Rz7"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -447,15 +445,11 @@
|
|||
</collectionViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="A16-1a-z3b" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1156" y="914"/>
|
||||
<point key="canvasLocation" x="1751" y="965"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="btn_select_l" width="28" height="28"/>
|
||||
<image name="btn_select_m" width="44" height="44"/>
|
||||
</resources>
|
||||
<inferredMetricsTieBreakers>
|
||||
<segue reference="vma-iJ-kti"/>
|
||||
<segue reference="tQI-o9-h2w"/>
|
||||
<segue reference="Bed-w3-B1Q"/>
|
||||
</inferredMetricsTieBreakers>
|
||||
</document>
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_alert_s@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_alert_s@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_low_s@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_photosize_low_s@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
|
@ -39,7 +39,7 @@ public enum MediaType: Int {
|
|||
|
||||
open class NohanaImagePickerController: UIViewController {
|
||||
|
||||
open var maximumNumberOfSelection: Int = 21 // set 0 to set no limit
|
||||
open var maximumNumberOfSelection: Int = 21 // set 0 to no limit
|
||||
open var numberOfColumnsInPortrait: Int = 4
|
||||
open var numberOfColumnsInLandscape: Int = 7
|
||||
open weak var delegate: NohanaImagePickerControllerDelegate?
|
||||
|
|
@ -49,15 +49,15 @@ open class NohanaImagePickerController: UIViewController {
|
|||
open var canPickAsset = { (asset:Asset) -> Bool in
|
||||
return true
|
||||
}
|
||||
open lazy var assetBundle: Bundle = self.selectAssetBundle()
|
||||
func selectAssetBundle () -> Bundle {
|
||||
open var config: Config = Config()
|
||||
|
||||
lazy var assetBundle:Bundle = {
|
||||
let bundle = Bundle(for: type(of: self))
|
||||
if let path = bundle.path(forResource: "NohanaImagePicker", ofType: "bundle") {
|
||||
return Bundle(path: path)!
|
||||
}
|
||||
return bundle
|
||||
}
|
||||
|
||||
}()
|
||||
let pickedAssetList: PickedAssetList
|
||||
let mediaType: MediaType
|
||||
let enableExpandingPhotoAnimation: Bool
|
||||
|
|
@ -101,7 +101,7 @@ open class NohanaImagePickerController: UIViewController {
|
|||
super.viewDidLoad()
|
||||
|
||||
// show albumListViewController
|
||||
let storyboard = UIStoryboard(name: "NohanaImagePicker", bundle: selectAssetBundle())
|
||||
let storyboard = UIStoryboard(name: "NohanaImagePicker", bundle: assetBundle)
|
||||
let viewControllerId = enableExpandingPhotoAnimation ? "EnableAnimationNavigationController" : "DisableAnimationNavigationController"
|
||||
guard let navigationController = storyboard.instantiateViewController(withIdentifier: viewControllerId) as? UINavigationController else {
|
||||
fatalError("navigationController init failed.")
|
||||
|
|
@ -138,3 +138,22 @@ open class NohanaImagePickerController: UIViewController {
|
|||
}
|
||||
}
|
||||
|
||||
extension NohanaImagePickerController {
|
||||
public struct Config {
|
||||
public struct Color {
|
||||
public var background: UIColor = .white
|
||||
public var empty: UIColor = UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1)
|
||||
public var separator: UIColor = UIColor(red: 0xbb/0xff, green: 0xbb/0xff, blue: 0xbb/0xff, alpha: 1)
|
||||
}
|
||||
public var color: Color = Color()
|
||||
|
||||
public struct Image {
|
||||
public var pickedSmall: UIImage?
|
||||
public var pickedLarge: UIImage?
|
||||
public var droppedSmall: UIImage?
|
||||
public var droppedLarge: UIImage?
|
||||
}
|
||||
public var image: Image = Image()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||