替换imagePicker库

1.原先为WPMediaPicker 替换为QBImagePickerController
2.以解决添加图片崩溃 内存泄漏 问题.
This commit is contained in:
Pikachuode
2015-12-22 13:21:33 +08:00
parent 81ae6a4752
commit e4bb7d3d94
27 changed files with 779 additions and 741 deletions

View File

@@ -3,10 +3,10 @@
#import "NoteController.h"
#import "Common.h"
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/UIColor+Helpers.h>
#import <WordPress-iOS-Shared/WordPressShared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/UIColor+Helpers.h>
#import "SVProgressHUD.h"
#import "WXApi.h"

View File

@@ -1,80 +1,85 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x",
"filename" : "Icon-Small@2x.png"
"idiom" : "iphone",
"filename" : "Icon-Small@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x",
"filename" : "Icon-Small@3x.png"
"idiom" : "iphone",
"filename" : "Icon-Small@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x",
"filename" : "Icon-40@2x.png"
"idiom" : "iphone",
"filename" : "Icon-40@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x",
"filename" : "Icon-40@3x.png"
"idiom" : "iphone",
"filename" : "Icon-40@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x",
"filename" : "Icon-60@2x.png"
},
{
"idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"scale" : "3x",
"filename" : "Icon-60@3x.png"
"idiom" : "iphone",
"filename" : "Icon-60@3x.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x",
"filename" : "Icon-Small.png"
"idiom" : "ipad",
"filename" : "Icon-Small.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x",
"filename" : "Icon-Small@2x.png"
"idiom" : "ipad",
"filename" : "Icon-Small@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x",
"filename" : "Icon-40.png"
"idiom" : "ipad",
"filename" : "Icon-40.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x",
"filename" : "Icon-40@2x.png"
"idiom" : "ipad",
"filename" : "Icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x",
"filename" : "Icon-76.png"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x",
"filename" : "Icon-76@2x.png"
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "makeappicon"
"author" : "xcode"
}
}

View File

@@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1323</string>
<string>1371</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>

View File

@@ -18,7 +18,7 @@
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string>1.3 (1323)</string>
<string>1.3 (1371)</string>
<key>IsSecure</key>
<false/>
<key>Key</key>

View File

@@ -11,8 +11,7 @@
#import "ApiMsg.h"
#import "Common.h"
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <objc/runtime.h>
NSString const *key = @"isSelectOnSearchKey";

View File

@@ -13,10 +13,10 @@
#import "RegisterController.h"
#import "WPWalkthroughOverlayView.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/UIColor+Helpers.h>
#import <WordPress-iOS-Shared/WPNUXUtility.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/UIColor+Helpers.h>
#import <WordPress-iOS-Shared/WordPressShared/WPNUXUtility.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import "ReachabilityUtils.h"
#import "LeaAlert.h"

View File

@@ -14,11 +14,11 @@
#import "RegisterController.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/UIColor+Helpers.h>
#import <WordPress-iOS-Shared/WPNUXUtility.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/NSString+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/UIColor+Helpers.h>
#import <WordPress-iOS-Shared/WordPressShared/WPNUXUtility.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/NSString+Util.h>
#import "UILabel+SuggestSize.h"

View File

@@ -1,5 +1,5 @@
#import "WPNUXBackButton.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
@implementation WPNUXBackButton

View File

@@ -1,5 +1,5 @@
#import "WPNUXMainButton.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
@implementation WPNUXMainButton {
UIActivityIndicatorView *activityIndicator;

View File

@@ -1,5 +1,5 @@
#import "WPNUXPrimaryButton.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
@implementation WPNUXPrimaryButton

View File

@@ -1,5 +1,5 @@
#import "WPNUXSecondaryButton.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
@implementation WPNUXSecondaryButton

View File

@@ -1,9 +1,15 @@
#import "WPWalkthroughOverlayView.h"
#import "WPNUXPrimaryButton.h"
#import "WPNUXSecondaryButton.h"
#import "WPNUXUtility.h"
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import "UILabel+SuggestSize.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
//#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPNUXUtility.h>
@interface WPWalkthroughOverlayView() {
UIImageView *_logo;

View File

@@ -8,13 +8,13 @@
#import "MeController.h"
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/UITableViewTextFieldCell.h>
#import <WordPress-iOS-Shared/WPTableViewSectionHeaderView.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTextFieldTableViewCell.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTableViewSectionHeaderFooterView.h>
#import "LoginViewController.h"
#import "UserService.h"
@@ -362,7 +362,7 @@ NSArray *users;
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
WPTableViewSectionHeaderView *header = [[WPTableViewSectionHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.view.bounds), 0.0f)];
WPTableViewSectionHeaderFooterView *header = [[WPTableViewSectionHeaderFooterView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.view.bounds), 0.0f)];
header.title = [self titleForHeaderInSection:section];
header.backgroundColor = self.tableView.backgroundColor;
return header;

View File

@@ -13,11 +13,11 @@
#import "Leas.h"
#import "LeaButtonForNavigationBar.h"
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/UITableViewTextFieldCell.h>
#import <WordPress-iOS-Shared/WordPressShared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTextFieldTableViewCell.h>
typedef enum {
PostSettingsSectionTaxonomy = 0,
@@ -191,7 +191,7 @@ typedef enum {
} else if (indexPath.row == PostSettingsRowTags) {
// Tags, ,
UITableViewTextFieldCell *textCell = [self getTextFieldCell];
WPTextFieldTableViewCell *textCell = [self getTextFieldCell];
textCell.textLabel.text = NSLocalizedString(@"Tags", nil);
textCell.textField.text = self.note.tags;
textCell.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:(NSLocalizedString(@"Comma separated", nil)) attributes:(@{NSForegroundColorAttributeName: [WPStyleGuide textFieldPlaceholderGrey]})];
@@ -258,12 +258,12 @@ typedef enum {
}
// cell
- (UITableViewTextFieldCell *)getTextFieldCell
- (WPTextFieldTableViewCell *)getTextFieldCell
{
static NSString *textFieldCellIdentifier = @"textFieldCellIdentifier";
UITableViewTextFieldCell *cell = [self.tableView dequeueReusableCellWithIdentifier:textFieldCellIdentifier];
WPTextFieldTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:textFieldCellIdentifier];
if (!cell) {
cell = [[UITableViewTextFieldCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:textFieldCellIdentifier];
cell = [[WPTextFieldTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:textFieldCellIdentifier];
cell.textField.returnKeyType = UIReturnKeyDone;
cell.textField.delegate = self;
[WPStyleGuide configureTableViewTextCell:cell];

View File

@@ -21,10 +21,10 @@
#import "LeaAlert.h"
#import "LeaButtonForNavigationBar.h"
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WPMediaPicker/WPMediaPicker.h>
#import <WordPress-iOS-Shared/WordPressShared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <QBImagePickerController/QBImagePickerController.h>
#import "NoteSettingsTableViewController.h"
#import "LeaWebViewController.h"
@@ -43,6 +43,9 @@
#import "LeaImagePagerViewController.h"
#import "LeaImageSliderViewController.h"
#import <MobileCoreServices/MobileCoreServices.h>
typedef NS_ENUM(NSUInteger, WPViewControllerActionSheet) {
WPViewControllerActionSheetImageUploadStop = 200,
WPViewControllerActionSheetImageUploadRetry = 201,
@@ -64,7 +67,7 @@ static NSDictionary *EnabledButtonBarStyle;
static NSInteger const MaximumNumberOfPictures = 10;
@interface NoteViewController () <CTAssetsPickerControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate, WPMediaPickerViewControllerDelegate>
@interface NoteViewController () <CTAssetsPickerControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate, QBImagePickerControllerDelegate, UIAlertViewDelegate>
@property(nonatomic, strong) NSMutableDictionary *mediaAdded;
@property(nonatomic, strong) NSString *selectedMediaID;
@@ -344,8 +347,8 @@ BOOL hiddenBar = NO;
hiddenBar = YES;
}
// [self prefersStatusBarHidden];
// [self setNeedsStatusBarAppearanceUpdate];
// [self prefersStatusBarHidden];
// [self setNeedsStatusBarAppearanceUpdate];
[[UIApplication sharedApplication] setStatusBarHidden:hiddenBar withAnimation:UIStatusBarAnimationSlide];
@@ -381,14 +384,14 @@ BOOL hiddenBar = NO;
- (void)editorDidBeginEditing:(WPEditorViewController *)editorController
{
// DDLogInfo(@"Editor did begin editing.");
// DDLogInfo(@"Editor did begin editing.");
[self refreshNavigationBarRightButtons:YES];
}
- (void)editorDidEndEditing:(WPEditorViewController *)editorController
{
// DDLogInfo(@"Editor did end editing.");
// DDLogInfo(self.bodyText);
// DDLogInfo(@"Editor did end editing.");
// DDLogInfo(self.bodyText);
[self saveNote:NO];
}
@@ -397,8 +400,8 @@ BOOL hiddenBar = NO;
{
// NSString *path = [[NSBundle mainBundle] pathForResource:@"content" ofType:@"html"];
// NSString *htmlParam = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
// self.titleText = self.note.title;
// self.bodyText = self.note.content;
// self.titleText = self.note.title;
// self.bodyText = self.note.content;
if(self.note) {
[self setTitleText:self.note.title];
@@ -440,23 +443,42 @@ BOOL hiddenBar = NO;
- (void)editorDidPressMedia:(WPEditorViewController *)editorController
{
// DDLogInfo(@"Pressed Media!");
[self showPhotoPicker];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"添加照片" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"从相册选择",@"拍照", nil];
[alert show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
switch (buttonIndex) {
case 0:
//
break;
case 1:
//
[self showPhotoPicker];
break;
case 2:
//
[self takePhoto];
break;
default:
break;
}
}
- (void)editorTitleDidChange:(WPEditorViewController *)editorController
{
// DDLogInfo(@"Editor title did change: %@", self.titleText);
// DDLogInfo(@"Editor title did change: %@", self.titleText);
}
- (void)editorTextDidChange:(WPEditorViewController *)editorController
{
// DDLogInfo(@"Editor body text changed: %@", self.bodyText);
// DDLogInfo(@"Editor body text changed: %@", self.bodyText);
}
- (void)editorViewController:(WPEditorViewController *)editorViewController fieldCreated:(WPEditorField*)field
{
// DDLogInfo(@"Editor field created: %@", field.nodeId);
// DDLogInfo(@"Editor field created: %@", field.nodeId);
}
//
@@ -480,7 +502,7 @@ BOOL hiddenBar = NO;
{
LeaWebViewController *webViewController = [[LeaWebViewController alloc] init];
webViewController.url = [NSURL URLWithString:url];
// [self.navigationController pushViewController:webViewController animated:YES];
// [self.navigationController pushViewController:webViewController animated:YES];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:webViewController];
[self.navigationController presentViewController:navController animated:YES completion:nil];
@@ -523,8 +545,8 @@ BOOL hiddenBar = NO;
//
/*
- (void)showImageDetailsForImageMeta:(WPImageMeta *)imageMeta
{
- (void)showImageDetailsForImageMeta:(WPImageMeta *)imageMeta
{
return;
WPImageMetaViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"WPImageMetaViewController"];
@@ -532,8 +554,8 @@ BOOL hiddenBar = NO;
controller.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
[self.navigationController presentViewController:navController animated:YES completion:nil];
}
*/
}
*/
// image gallery
- (void)showActionTapImage:(NSString *)url
@@ -550,10 +572,10 @@ BOOL hiddenBar = NO;
NSString *each = urlArr[i];
// , , .png
// NSString *fileId = [Common getFileIdFromUrl:each];
// if(fileId || [LeaImageViewController isUrlSupported:[NSURL URLWithString:each]]) {
// NSString *fileId = [Common getFileIdFromUrl:each];
// if(fileId || [LeaImageViewController isUrlSupported:[NSURL URLWithString:each]]) {
[realUrls addObject:each];
// }
// }
}
// url
@@ -591,9 +613,9 @@ BOOL hiddenBar = NO;
NSString *fileId = [Common getFileIdFromUrl:url];
if (!fileId) {
// return;
// return;
}
// self.selectedMediaID = fileId;
// self.selectedMediaID = fileId;
/*
//
if(self.actionSheet) {
@@ -631,7 +653,7 @@ BOOL hiddenBar = NO;
controller.modalPresentationStyle = UIModalPresentationFullScreen;
}
// LeaImagePagerViewController *vc = [[LeaImagePagerViewController alloc] init];
// LeaImagePagerViewController *vc = [[LeaImagePagerViewController alloc] init];
LeaImageSliderViewController *vc = [[LeaImageSliderViewController alloc] init];
[self presentViewController:vc animated:YES completion:nil];
}
@@ -658,11 +680,13 @@ BOOL hiddenBar = NO;
- (void)showPhotoPicker
{
[self.editorView saveSelection];
WPMediaPickerViewController * mediaPicker = [[WPMediaPickerViewController alloc] init];
mediaPicker.showMostRecentFirst = YES; //
mediaPicker.delegate = self;
[self presentViewController:mediaPicker animated:YES completion:nil];
QBImagePickerController *imagePickerController = [QBImagePickerController new];
imagePickerController.delegate = self;
imagePickerController.allowsMultipleSelection = YES;
imagePickerController.maximumNumberOfSelection = 6;
imagePickerController.showsNumberOfSelectedAssets = YES;
imagePickerController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:imagePickerController animated:YES completion:NULL];
/*
@@ -695,32 +719,32 @@ BOOL hiddenBar = NO;
}
#pragma mark - WPMediaPickerViewControllerDelegate
- (void)mediaPickerController:(WPMediaPickerViewController *)picker didFinishPickingAssets:(NSArray *)assets
{
-(void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didSelectAsset:(ALAsset *)asset{
[self dismissViewControllerAnimated:YES completion:nil];
[self addMediaAssets:@[asset]];
}
-(void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didSelectAssets:(NSArray *)assets{
[self dismissViewControllerAnimated:YES completion:nil];
// assets contains WPMediaAsset objects.
[self addMediaAssets:assets];
}
//
- (void)mediaPickerControllerDidCancel:(id)picker
{
-(void)qb_imagePickerControllerDidCancel:(QBImagePickerController *)imagePickerController{
[self dismissViewControllerAnimated:YES completion:nil];
}
/*
#pragma mark - CTAssetsPickerControllerDelegate
- (void)assetsPickerController:(CTAssetsPickerController *)picker didFinishPickingAssets:(NSArray *)assets
{
/*
#pragma mark - CTAssetsPickerControllerDelegate
- (void)assetsPickerController:(CTAssetsPickerController *)picker didFinishPickingAssets:(NSArray *)assets
{
[self dismissViewControllerAnimated:YES completion:^{
[self addMediaAssets:assets];
}];
}
}
- (BOOL)assetsPickerController:(CTAssetsPickerController *)picker shouldSelectAsset:(ALAsset *)asset
{
- (BOOL)assetsPickerController:(CTAssetsPickerController *)picker shouldSelectAsset:(ALAsset *)asset
{
if ([asset valueForProperty:ALAssetPropertyType] == ALAssetTypePhoto) {
// If the image is from a shared photo stream it may not be available locally to be used
if (!asset.defaultRepresentation) {
@@ -737,8 +761,8 @@ BOOL hiddenBar = NO;
} else {
return NO;
}
}
*/
}
*/
- (NSString *) getImageUrl:(NSString *) fileId
{
@@ -816,24 +840,6 @@ BOOL hiddenBar = NO;
}
*/
//
- (void)addAssetToContent:(NSURL *)assetURL
{
ALAssetsLibrary *assetsLibrary = [[ALAssetsLibrary alloc] init];
[assetsLibrary assetForURL:assetURL resultBlock:^(ALAsset *asset) {
if ([asset valueForProperty:ALAssetPropertyType] == ALAssetTypeVideo) {
NSLog(@"视频不允许添加");
// [self addVideoAssetToContent:asset];
} if ([asset valueForProperty:ALAssetPropertyType] == ALAssetTypePhoto) {
NSLog(@"图片插入成功!");
[self addImageAssetToContent:asset];
}
} failureBlock:^(NSError *error) {
NSLog(@"图片插入失败!");
DDLogInfo(@"Failed to insert media: %@", [error localizedDescription]);
}];
}
- (void)timerFireMethod:(NSTimer *)timer
{
@@ -887,13 +893,21 @@ BOOL hiddenBar = NO;
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self.navigationController dismissViewControllerAnimated:YES completion:^{
NSURL *assetURL = info[UIImagePickerControllerReferenceURL];
[self addAssetToContent:assetURL];
if ([info[UIImagePickerControllerMediaType] isEqualToString:(NSString*)kUTTypeImage]) {
UIImage *theImage = info[UIImagePickerControllerOriginalImage];
//
ALAssetsLibrary *library = [[ALAssetsLibrary alloc]init];
[library writeImageToSavedPhotosAlbum:theImage.CGImage metadata:info[UIImagePickerControllerMediaMetadata] completionBlock:^(NSURL *assetURL, NSError *error) {
//
[library assetForURL:assetURL resultBlock:^(ALAsset *asset) {
[self addMediaAssets:@[asset]];
} failureBlock:nil];
}];
}
}];
}
//
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
@@ -908,7 +922,7 @@ BOOL hiddenBar = NO;
//
} else if (actionSheet.tag == WPViewControllerActionSheetImageUploadRetry){
if (buttonIndex == actionSheet.destructiveButtonIndex) {
// [self.editorView removeImage:self.selectedMediaID];
// [self.editorView removeImage:self.selectedMediaID];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex) {
NSString *absPath = [FileService getFileAbsPathByFileIdOrServerFileId:self.selectedMediaID];
@@ -942,6 +956,21 @@ BOOL hiddenBar = NO;
[self.editorView unmarkVideoFailedUpload:self.selectedMediaID];
}
}
}
-(void)takePhoto{
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;
if (![UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self showPhotoPicker];
}else{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];//
picker.delegate = self;
picker.allowsEditing = NO;//
[picker setSourceType:sourceType];
[self presentViewController:picker animated:YES completion:nil];//
}
}

View File

@@ -13,12 +13,12 @@
#import "Leas.h"
#import "LeaButtonForNavigationBar.h"
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/UITableViewTextFieldCell.h>
#import <WordPress-iOS-Shared/WPTableViewSectionHeaderView.h>
#import <WordPress-iOS-Shared/WordPressShared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTextFieldTableViewCell.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTableViewSectionHeaderFooterView.h>
typedef enum {
PostSettingsSectionTaxonomy = 0,
@@ -225,7 +225,7 @@ typedef enum {
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
WPTableViewSectionHeaderView *header = [[WPTableViewSectionHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.view.bounds), 0.0f)];
WPTableViewSectionHeaderFooterView *header = [[WPTableViewSectionHeaderFooterView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.view.bounds), 0.0f)];
header.title = [self titleForHeaderInSection:section];
header.backgroundColor = self.tableView.backgroundColor;
return header;

View File

@@ -1,8 +1,7 @@
#import "WPEditorToolbarView.h"
#import "WPDeviceIdentification.h"
#import "WPEditorToolbarButton.h"
#import "ZSSBarButtonItem.h"
#import <WordPress-iOS-Shared/WordPressShared/WPDeviceIdentification.h>
// life
#ifdef __OBJC__

View File

@@ -5,9 +5,9 @@
#import "WPEditorField.h"
#import "WPImageMeta.h"
#import "ZSSTextView.h"
#import "WPDeviceIdentification.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPDeviceIdentification.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
// life
#import "NSURLProtocolCustom.h"

View File

@@ -3,11 +3,11 @@
#import <UIAlertView+Blocks/UIAlertView+Blocks.h>
#import <UIKit/UIKit.h>
#import <WordPressCom-Analytics-iOS/WPAnalytics.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/UIColor+Helpers.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/WordPressShared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/UIColor+Helpers.h>
#import "WPEditorField.h"
#import "WPEditorToolbarButton.h"
@@ -19,7 +19,7 @@
#import "DRColorPicker.h"
#import "DRColorPickerHomeViewController.h"
#import "WPDeviceIdentification.h"
#import <WordPress-iOS-Shared/WordPressShared/WPDeviceIdentification.h>
CGFloat const EPVCStandardOffset = 10.0;
NSInteger const WPImageAlertViewTag = 91;

View File

@@ -2,9 +2,9 @@
#import "WPLegacyKeyboardToolbarBase.h"
#import "WPLegacyKeyboardToolbarDone.h"
#import <WordPressCom-Analytics-iOS/WPAnalytics.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/WordPressShared/UIImage+Util.h>
#import <UIAlertView+Blocks/UIAlertView+Blocks.h>
CGFloat const WPLegacyEPVCTextfieldHeight = 44.0f;

View File

@@ -1,6 +1,6 @@
#import "WPLegacyKeyboardToolbarButtonItem.h"
#import <QuartzCore/QuartzCore.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
@implementation WPLegacyKeyboardToolbarButtonItem
@synthesize actionTag, actionName;

View File

@@ -10,7 +10,7 @@
#import "MongoID.h"
#import "SVProgressHUD.h"
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
@implementation Common

View File

@@ -15,8 +15,8 @@
// https://github.com/iDay/WeixinActivity
#import "WeixinActivity.h"
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/NSString+Util.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/NSString+Util.h>
@class WPReaderDetailViewController;

View File

@@ -7,8 +7,8 @@
//
#import "NoteCell.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
//#import "NotebookService.h"
#import "Leas.h"

View File

@@ -7,8 +7,8 @@
//
#import "NotebookTagCell.h"
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WordPressShared/WPFontManager.h>
#import <WordPress-iOS-Shared/WordPressShared/WPStyleGuide.h>
#import "NotebookService.h"
@interface NotebookTagCell()

View File

@@ -13,4 +13,4 @@ pod 'SWTableViewCell', '~> 0.3.7'
pod 'SGNavigationProgress'
pod "WPMediaPicker"
pod 'QBImagePickerController', '< 3.0.0'

View File

@@ -1,66 +1,66 @@
PODS:
- AFNetworking (2.5.4):
- AFNetworking/NSURLConnection (= 2.5.4)
- AFNetworking/NSURLSession (= 2.5.4)
- AFNetworking/Reachability (= 2.5.4)
- AFNetworking/Security (= 2.5.4)
- AFNetworking/Serialization (= 2.5.4)
- AFNetworking/UIKit (= 2.5.4)
- AFNetworking/NSURLConnection (2.5.4):
- AFNetworking (2.6.3):
- AFNetworking/NSURLConnection (= 2.6.3)
- AFNetworking/NSURLSession (= 2.6.3)
- AFNetworking/Reachability (= 2.6.3)
- AFNetworking/Security (= 2.6.3)
- AFNetworking/Serialization (= 2.6.3)
- AFNetworking/UIKit (= 2.6.3)
- AFNetworking/NSURLConnection (2.6.3):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/NSURLSession (2.5.4):
- AFNetworking/NSURLSession (2.6.3):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.5.4)
- AFNetworking/Security (2.5.4)
- AFNetworking/Serialization (2.5.4)
- AFNetworking/UIKit (2.5.4):
- AFNetworking/Reachability (2.6.3)
- AFNetworking/Security (2.6.3)
- AFNetworking/Serialization (2.6.3)
- AFNetworking/UIKit (2.6.3):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- CocoaLumberjack (2.0.0):
- CocoaLumberjack/Default (= 2.0.0)
- CocoaLumberjack/Extensions (= 2.0.0)
- CocoaLumberjack/Core (2.0.0)
- CocoaLumberjack/Default (2.0.0):
- CocoaLumberjack (2.2.0):
- CocoaLumberjack/Default (= 2.2.0)
- CocoaLumberjack/Extensions (= 2.2.0)
- CocoaLumberjack/Core (2.2.0)
- CocoaLumberjack/Default (2.2.0):
- CocoaLumberjack/Core
- CocoaLumberjack/Extensions (2.0.0):
- CocoaLumberjack/Extensions (2.2.0):
- CocoaLumberjack/Default
- CTAssetsPickerController (2.9.4)
- CTAssetsPickerController (2.9.5)
- NSObject-SafeExpectations (0.0.2)
- QBImagePickerController (2.6.0)
- SGNavigationProgress (1.2)
- SWTableViewCell (0.3.7)
- UIAlertView+Blocks (0.8.1)
- WordPress-iOS-Shared (0.3.2):
- WordPress-iOS-Shared (0.5.2):
- AFNetworking (~> 2.5)
- CocoaLumberjack (~> 2.0)
- WordPressCom-Analytics-iOS (0.0.32)
- WPMediaPicker (0.5.0)
- CocoaLumberjack (~> 2.2.0)
- WordPressCom-Analytics-iOS (0.0.41)
DEPENDENCIES:
- AFNetworking
- CocoaLumberjack (~> 2.0)
- CTAssetsPickerController (~> 2.9.0)
- NSObject-SafeExpectations
- QBImagePickerController (< 3.0.0)
- SGNavigationProgress
- SWTableViewCell (~> 0.3.7)
- UIAlertView+Blocks (~> 0.8.1)
- WordPress-iOS-Shared (~> 0.3)
- WordPressCom-Analytics-iOS (~> 0.0.4)
- WPMediaPicker
SPEC CHECKSUMS:
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
CocoaLumberjack: a6f77d987d65dc7ba86b0f84db7d0b9084f77bcb
CTAssetsPickerController: 3030dc60f5d1a3c4e5b1c0aa9f069220d5bf7008
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
CocoaLumberjack: 17fe8581f84914d5d7e6360f7c70022b173c3ae0
CTAssetsPickerController: b413fece2194ae3dbf22fbc544cf6f2a6d516a4d
NSObject-SafeExpectations: 7d7f48df90df4e11da7cfe86b64f45eff7a7f521
QBImagePickerController: 095c2b2973de4da267334d2cfcac989c2eb5cdc2
SGNavigationProgress: f04e3bd0058c53e1172ee020b5239f22aa9e4a0f
SWTableViewCell: 2a94aadc9d47b2b611fa064566bf57948b95b579
UIAlertView+Blocks: 45c3d3b7194906702d3e9a14c7ece5581505646d
WordPress-iOS-Shared: bd0506db9b824611246f35e774832ecbc18fc45e
WordPressCom-Analytics-iOS: cfa514e1c2ded6256bf2864d871e0866e38cc668
WPMediaPicker: 0757988f1519c20b92c91f470c41633ac42e3a0e
WordPress-iOS-Shared: af84c229bd1cb0206f6015fd8fec9e262a88c780
WordPressCom-Analytics-iOS: 73de8c9a0f1a43bac03fd2fcd881389be73ee820
COCOAPODS: 0.35.0
COCOAPODS: 0.39.0