Skip to content

Commit b335776

Browse files
author
Denis Bogatyrev
committed
Merge branch 'release/1.1.0'
2 parents f0e9efd + 79f11e0 commit b335776

31 files changed

+414
-32
lines changed

DBAttachmentPickerController.podspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'DBAttachmentPickerController'
3-
s.version = '1.0.1'
3+
s.version = '1.1.0'
44
s.authors = { 'Denis Bogatyrev' => '[email protected]' }
55
s.summary = 'This powerful component allows to select different types of files from different sources on your device'
66
s.homepage = 'https://github.com/d0ping/DBAttachmentPickerController'
@@ -10,5 +10,6 @@ Pod::Spec.new do |s|
1010
s.source = { :git => 'https://github.com/d0ping/DBAttachmentPickerController.git', :tag => "#{s.version}" }
1111
s.source_files = 'Source/**/*.{h,m}'
1212
s.resources = 'Source/**/*.{xib}'
13+
s.resource_bundle = { 'DBAttachmentPickerController' => ['Source/Localization/*.lproj'] }
1314
s.public_header_files = 'Source/**/*.h'
1415
end

Example/DBAttachmentPickerControllerExample.xcodeproj/project.pbxproj

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
A401D4F51D537AEC006B2909 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A401D4F71D537AEC006B2909 /* Localizable.strings */; };
11+
A401D4FE1D5545F5006B2909 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = A401D5001D5545F5006B2909 /* Localizable.stringsdict */; };
1012
C3134EB41C9C30990023B9E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C3134EB31C9C30990023B9E6 /* main.m */; };
1113
C3134EB71C9C30990023B9E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C3134EB61C9C30990023B9E6 /* AppDelegate.m */; };
1214
C3134EBD1C9C30990023B9E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3134EBB1C9C30990023B9E6 /* Main.storyboard */; };
@@ -33,6 +35,25 @@
3335
/* End PBXBuildFile section */
3436

3537
/* Begin PBXFileReference section */
38+
A401D4F41D537A13006B2909 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
39+
A401D4F81D537AEF006B2909 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
40+
A401D4F91D537AF0006B2909 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
41+
A401D4FF1D5545F5006B2909 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
42+
A401D5011D5545F7006B2909 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ru; path = ru.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
43+
A401D5021D554922006B2909 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
44+
A401D5041D554AD3006B2909 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.stringsdict"; sourceTree = "<group>"; };
45+
A401D5051D554BD0006B2909 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
46+
A401D5061D554BD0006B2909 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.stringsdict"; sourceTree = "<group>"; };
47+
A401D5071D554D71006B2909 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
48+
A401D5081D554D71006B2909 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = es; path = es.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
49+
A401D5091D554FCD006B2909 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
50+
A401D50A1D554FCD006B2909 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = de; path = de.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
51+
A401D50B1D555228006B2909 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
52+
A401D50C1D555228006B2909 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ja; path = ja.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
53+
A401D50D1D5553CA006B2909 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = "<group>"; };
54+
A401D50E1D5553ED006B2909 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = uk; path = uk.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
55+
A401D50F1D55560A006B2909 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
56+
A401D5101D55560A006B2909 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = fr; path = fr.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
3657
C3134EAF1C9C30990023B9E6 /* DBAttachmentPickerControllerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DBAttachmentPickerControllerExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
3758
C3134EB31C9C30990023B9E6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
3859
C3134EB51C9C30990023B9E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -87,6 +108,16 @@
87108
/* End PBXFrameworksBuildPhase section */
88109

89110
/* Begin PBXGroup section */
111+
A401D4F11D5378F2006B2909 /* Localization */ = {
112+
isa = PBXGroup;
113+
children = (
114+
A401D4F71D537AEC006B2909 /* Localizable.strings */,
115+
A401D5001D5545F5006B2909 /* Localizable.stringsdict */,
116+
);
117+
name = Localization;
118+
path = ../../Source/Localization;
119+
sourceTree = "<group>";
120+
};
90121
C3134EA61C9C30990023B9E6 = {
91122
isa = PBXGroup;
92123
children = (
@@ -138,6 +169,7 @@
138169
C3134ED01C9C323C0023B9E6 /* Cells */,
139170
C3849AB21C9C3D8C00D12EEF /* DBAttachmentAlertController */,
140171
C3849AA91C9C3D8C00D12EEF /* DBAssetPickerController */,
172+
A401D4F11D5378F2006B2909 /* Localization */,
141173
);
142174
name = DBAttachmentPickerController;
143175
path = ../DBAttachmentPickerControllerExample;
@@ -281,6 +313,14 @@
281313
knownRegions = (
282314
en,
283315
Base,
316+
ru,
317+
"zh-Hans",
318+
"zh-Hant",
319+
es,
320+
de,
321+
ja,
322+
uk,
323+
fr,
284324
);
285325
mainGroup = C3134EA61C9C30990023B9E6;
286326
productRefGroup = C3134EB01C9C30990023B9E6 /* Products */;
@@ -301,7 +341,9 @@
301341
C3134EC21C9C30990023B9E6 /* LaunchScreen.storyboard in Resources */,
302342
C3849AB61C9C3D8C00D12EEF /* DBAssetGroupsViewController.xib in Resources */,
303343
C3134EEB1C9C323C0023B9E6 /* DBAssetGroupCell.xib in Resources */,
344+
A401D4FE1D5545F5006B2909 /* Localizable.stringsdict in Resources */,
304345
C3134EED1C9C323C0023B9E6 /* DBThumbnailPhotoCell.xib in Resources */,
346+
A401D4F51D537AEC006B2909 /* Localizable.strings in Resources */,
305347
C3134EFC1C9C34340023B9E6 /* Assets.xcassets in Resources */,
306348
C3134EBD1C9C30990023B9E6 /* Main.storyboard in Resources */,
307349
);
@@ -335,6 +377,38 @@
335377
/* End PBXSourcesBuildPhase section */
336378

337379
/* Begin PBXVariantGroup section */
380+
A401D4F71D537AEC006B2909 /* Localizable.strings */ = {
381+
isa = PBXVariantGroup;
382+
children = (
383+
A401D4F81D537AEF006B2909 /* en */,
384+
A401D4F91D537AF0006B2909 /* ru */,
385+
A401D5021D554922006B2909 /* zh-Hans */,
386+
A401D5051D554BD0006B2909 /* zh-Hant */,
387+
A401D5071D554D71006B2909 /* es */,
388+
A401D5091D554FCD006B2909 /* de */,
389+
A401D50B1D555228006B2909 /* ja */,
390+
A401D50D1D5553CA006B2909 /* uk */,
391+
A401D50F1D55560A006B2909 /* fr */,
392+
);
393+
name = Localizable.strings;
394+
sourceTree = "<group>";
395+
};
396+
A401D5001D5545F5006B2909 /* Localizable.stringsdict */ = {
397+
isa = PBXVariantGroup;
398+
children = (
399+
A401D4FF1D5545F5006B2909 /* en */,
400+
A401D5011D5545F7006B2909 /* ru */,
401+
A401D5041D554AD3006B2909 /* zh-Hans */,
402+
A401D5061D554BD0006B2909 /* zh-Hant */,
403+
A401D5081D554D71006B2909 /* es */,
404+
A401D50A1D554FCD006B2909 /* de */,
405+
A401D50C1D555228006B2909 /* ja */,
406+
A401D50E1D5553ED006B2909 /* uk */,
407+
A401D5101D55560A006B2909 /* fr */,
408+
);
409+
name = Localizable.stringsdict;
410+
sourceTree = "<group>";
411+
};
338412
C3134EBB1C9C30990023B9E6 /* Main.storyboard */ = {
339413
isa = PBXVariantGroup;
340414
children = (
@@ -348,6 +422,7 @@
348422
isa = PBXVariantGroup;
349423
children = (
350424
C3134EC11C9C30990023B9E6 /* Base */,
425+
A401D4F41D537A13006B2909 /* ru */,
351426
);
352427
name = LaunchScreen.storyboard;
353428
sourceTree = "<group>";

Example/DBAttachmentPickerControllerExample/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="cLE-FB-o3O">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="cLE-FB-o3O">
33
<dependencies>
44
<deployment identifier="iOS"/>
55
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
@@ -20,7 +20,7 @@
2020
<rect key="frame" x="0.0" y="92" width="375" height="60"/>
2121
<autoresizingMask key="autoresizingMask"/>
2222
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ZPV-BD-Xan" id="3FB-lf-K7T">
23-
<rect key="frame" x="0.0" y="0.0" width="375" height="59"/>
23+
<rect key="frame" x="0.0" y="0.0" width="375" height="59.5"/>
2424
<autoresizingMask key="autoresizingMask"/>
2525
<subviews>
2626
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kEi-aA-7Ke">

Example/DBAttachmentPickerControllerExample/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.1</string>
18+
<string>1.1.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This powerful component allows to select different types of files from different
1818

1919
To add DBAttachmentPickerController via [CocoaPods](http://cocoapods.org/) into your project:
2020

21-
1. Add a pod entry for DBAttachmentPickerController to your Podfile `pod 'DBAttachmentPickerController', '~> 1.0.0'`
21+
1. Add a pod entry for DBAttachmentPickerController to your Podfile `pod 'DBAttachmentPickerController', '~> 1.1.0'`
2222
2. Install the pod by running `pod install`
2323

2424
### Source Files
@@ -91,12 +91,23 @@ To usage Document Picker you must:
9191

9292
The class contain metadata about selected item.
9393

94-
You can use following properties to get metadata of file: `NSString *fileName`, `NSDate *creationDate`, `NSUInteger fileSize`, `NSString *fileSizeStr`.
94+
You can use following properties to get metadata of file:
95+
96+
- `NSString *fileName` - The name of the file. Can be empty;
97+
- `NSDate *creationDate` - Creation date of the file. Can be nil;
98+
- `NSUInteger fileSize` - Size of the file in byte. Available only for existing files. ATTENTION: If you want get file size for PHAsset or something like that, you should calculate it after getting file data;
99+
- `NSString *fileSizeStr` - Formatted string of file size. Can be empty.
95100

96101
To get thumbnail image you should call folowing method: `-loadThumbnailImageWithTargetSize:completion:`. Or you can get original image through method `-loadOriginalImageWithCompletion:`.
97102

98103
Also you can get original file data if call appropriate method `-originalFileResource`.
99104

105+
## Version history
106+
107+
### 1.1.0
108+
- Added localization. Available following languages: English (Default), Russian, Spanish, German, French, Ukrainian, Chinese (Simplified and Traditional) and Japanese.
109+
- Added description for methods and properties on DBAttachment class.
110+
100111
## Contact
101112

102113
Denis Bogatyrev (maintainer)
@@ -112,4 +123,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
112123

113124
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
114125

115-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
126+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Source/DBAssetPickerController/DBAssetGroupsViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ @implementation DBAssetGroupsViewController
4040
- (void)viewDidLoad {
4141
[super viewDidLoad];
4242

43-
self.navigationItem.title = @"Albums";
43+
self.navigationItem.title = NSLocalizedString(@"Albums", nil);
4444
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonDidSelect:)];
4545

4646
[self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([DBAssetGroupCell class]) bundle:nil] forCellReuseIdentifier:kAssetGroupsCellIdentifier];

Source/DBAssetPickerController/DBAssetGroupsViewController.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
33
<dependencies>
44
<deployment identifier="iOS"/>
55
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>

Source/DBAssetPickerController/DBAssetItemsViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ - (void)viewDidLoad {
4646

4747
self.selectedIndexPathArray = [NSMutableArray arrayWithCapacity:100];
4848

49-
self.navigationItem.title = @"Camera roll";
49+
self.navigationItem.title = self.assetCollection.localizedTitle;
5050

5151
if ([self.assetItemsDelegate respondsToSelector:@selector(DBAssetImageViewControllerAllowsMultipleSelection:)]) {
5252
if ( [self.assetItemsDelegate DBAssetImageViewControllerAllowsMultipleSelection:self] ) {
53-
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Attach" style:UIBarButtonItemStyleDone target:self action:@selector(attachButtonDidSelect:)];
53+
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Attach", nil) style:UIBarButtonItemStyleDone target:self action:@selector(attachButtonDidSelect:)];
5454
}
5555
}
5656

Source/DBAssetPickerController/DBAssetItemsViewController.xib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
66
</dependencies>
77
<objects>
88
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DBAssetItemsViewController">

0 commit comments

Comments
 (0)