diff --git a/Leanote/AppDelegate.m b/Leanote/AppDelegate.m index 3592354..6a30ca3 100755 --- a/Leanote/AppDelegate.m +++ b/Leanote/AppDelegate.m @@ -3,10 +3,10 @@ #import "NoteController.h" #import "Common.h" -#import -#import -#import -#import +#import +#import +#import +#import #import "SVProgressHUD.h" #import "WXApi.h" diff --git a/Leanote/Images.xcassets/AppIcon.appiconset/Contents.json b/Leanote/Images.xcassets/AppIcon.appiconset/Contents.json index 1b34a14..a7fe4fc 100644 --- a/Leanote/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Leanote/Images.xcassets/AppIcon.appiconset/Contents.json @@ -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" } } \ No newline at end of file diff --git a/Leanote/Leanote-Info.plist b/Leanote/Leanote-Info.plist index 4ee75b9..88c9146 100755 --- a/Leanote/Leanote-Info.plist +++ b/Leanote/Leanote-Info.plist @@ -38,7 +38,7 @@ CFBundleVersion - 1323 + 1371 LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/Leanote/Settings.bundle/Root.plist b/Leanote/Settings.bundle/Root.plist index d6dd5a4..68c1ebe 100755 --- a/Leanote/Settings.bundle/Root.plist +++ b/Leanote/Settings.bundle/Root.plist @@ -18,7 +18,7 @@ AutocorrectionType No DefaultValue - 1.3 (1323) + 1.3 (1371) IsSecure Key diff --git a/Leanote/controller/BaseViewController.m b/Leanote/controller/BaseViewController.m index 4d58a9c..db16abf 100644 --- a/Leanote/controller/BaseViewController.m +++ b/Leanote/controller/BaseViewController.m @@ -11,8 +11,7 @@ #import "ApiMsg.h" #import "Common.h" -#import - +#import #import NSString const *key = @"isSelectOnSearchKey"; diff --git a/Leanote/controller/auth/LoginViewController.m b/Leanote/controller/auth/LoginViewController.m index e4897c5..9860789 100755 --- a/Leanote/controller/auth/LoginViewController.m +++ b/Leanote/controller/auth/LoginViewController.m @@ -13,10 +13,10 @@ #import "RegisterController.h" #import "WPWalkthroughOverlayView.h" -#import -#import -#import -#import +#import +#import +#import +#import #import "ReachabilityUtils.h" #import "LeaAlert.h" diff --git a/Leanote/controller/auth/RegisterController.m b/Leanote/controller/auth/RegisterController.m index 198987d..c339fa1 100755 --- a/Leanote/controller/auth/RegisterController.m +++ b/Leanote/controller/auth/RegisterController.m @@ -14,11 +14,11 @@ #import "RegisterController.h" -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import #import "UILabel+SuggestSize.h" diff --git a/Leanote/controller/auth/WPNUXBackButton.m b/Leanote/controller/auth/WPNUXBackButton.m index 3658727..bffb9d1 100755 --- a/Leanote/controller/auth/WPNUXBackButton.m +++ b/Leanote/controller/auth/WPNUXBackButton.m @@ -1,5 +1,5 @@ #import "WPNUXBackButton.h" -#import +#import @implementation WPNUXBackButton diff --git a/Leanote/controller/auth/WPNUXMainButton.m b/Leanote/controller/auth/WPNUXMainButton.m index 54e6e51..e77102f 100755 --- a/Leanote/controller/auth/WPNUXMainButton.m +++ b/Leanote/controller/auth/WPNUXMainButton.m @@ -1,5 +1,5 @@ #import "WPNUXMainButton.h" -#import +#import @implementation WPNUXMainButton { UIActivityIndicatorView *activityIndicator; diff --git a/Leanote/controller/auth/WPNUXPrimaryButton.m b/Leanote/controller/auth/WPNUXPrimaryButton.m index dbdaef7..f0fcefb 100755 --- a/Leanote/controller/auth/WPNUXPrimaryButton.m +++ b/Leanote/controller/auth/WPNUXPrimaryButton.m @@ -1,5 +1,5 @@ #import "WPNUXPrimaryButton.h" -#import +#import @implementation WPNUXPrimaryButton diff --git a/Leanote/controller/auth/WPNUXSecondaryButton.m b/Leanote/controller/auth/WPNUXSecondaryButton.m index bbe406c..b6b5be3 100755 --- a/Leanote/controller/auth/WPNUXSecondaryButton.m +++ b/Leanote/controller/auth/WPNUXSecondaryButton.m @@ -1,5 +1,5 @@ #import "WPNUXSecondaryButton.h" -#import +#import @implementation WPNUXSecondaryButton diff --git a/Leanote/controller/auth/WPWalkthroughOverlayView.m b/Leanote/controller/auth/WPWalkthroughOverlayView.m index d27db9e..4559838 100755 --- a/Leanote/controller/auth/WPWalkthroughOverlayView.m +++ b/Leanote/controller/auth/WPWalkthroughOverlayView.m @@ -1,9 +1,15 @@ #import "WPWalkthroughOverlayView.h" #import "WPNUXPrimaryButton.h" #import "WPNUXSecondaryButton.h" -#import "WPNUXUtility.h" + +#import + + + #import "UILabel+SuggestSize.h" -#import + +//#import +#import @interface WPWalkthroughOverlayView() { UIImageView *_logo; diff --git a/Leanote/controller/me/MeController.m b/Leanote/controller/me/MeController.m index 3cabca2..a363df9 100755 --- a/Leanote/controller/me/MeController.m +++ b/Leanote/controller/me/MeController.m @@ -8,13 +8,13 @@ #import "MeController.h" -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import #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; diff --git a/Leanote/controller/note/NoteSettingsTableViewController.m b/Leanote/controller/note/NoteSettingsTableViewController.m index b1186da..b0496bc 100644 --- a/Leanote/controller/note/NoteSettingsTableViewController.m +++ b/Leanote/controller/note/NoteSettingsTableViewController.m @@ -13,11 +13,11 @@ #import "Leas.h" #import "LeaButtonForNavigationBar.h" -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import 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]; diff --git a/Leanote/controller/note/NoteViewController.m b/Leanote/controller/note/NoteViewController.m index 6d949c2..86accaf 100644 --- a/Leanote/controller/note/NoteViewController.m +++ b/Leanote/controller/note/NoteViewController.m @@ -21,10 +21,10 @@ #import "LeaAlert.h" #import "LeaButtonForNavigationBar.h" -#import -#import -#import -#import +#import +#import +#import +#import #import "NoteSettingsTableViewController.h" #import "LeaWebViewController.h" @@ -43,19 +43,22 @@ #import "LeaImagePagerViewController.h" #import "LeaImageSliderViewController.h" +#import + + typedef NS_ENUM(NSUInteger, WPViewControllerActionSheet) { - WPViewControllerActionSheetImageUploadStop = 200, - WPViewControllerActionSheetImageUploadRetry = 201, - WPViewControllerActionSheetVideoUploadStop = 202, - WPViewControllerActionSheetVideoUploadRetry = 203 + WPViewControllerActionSheetImageUploadStop = 200, + WPViewControllerActionSheetImageUploadRetry = 201, + WPViewControllerActionSheetVideoUploadStop = 202, + WPViewControllerActionSheetVideoUploadRetry = 203 }; // 按钮大小, 间距 const CGRect NavigationBarButtonRect = { - .origin.x = 0.0f, - .origin.y = 0.0f, - .size.width = 30.0f, - .size.height = 30.0f + .origin.x = 0.0f, + .origin.y = 0.0f, + .size.width = 30.0f, + .size.height = 30.0f }; static CGFloat const SpacingBetweeenNavbarButtons = 20.0f; //static CGFloat const RightSpacingOnExitNavbarButton = 5.0f; @@ -64,7 +67,7 @@ static NSDictionary *EnabledButtonBarStyle; static NSInteger const MaximumNumberOfPictures = 10; -@interface NoteViewController () +@interface NoteViewController () @property(nonatomic, strong) NSMutableDictionary *mediaAdded; @property(nonatomic, strong) NSString *selectedMediaID; @@ -102,39 +105,39 @@ static NSInteger const MaximumNumberOfPictures = 10; // force, 强制保存, 不管title, content有没有变化 - (BOOL)saveNote:(BOOL)force { - NSString *title = [Common trimNewLine:[self titleText]]; - NSString *content = [self bodyText]; - - // 更新笔记 - if(self.note != nil) { - if(self.edited) { - BOOL contentIsDirty = ![self.note.content isEqualToString:content]; - BOOL titleIsDirty = ![self.note.title isEqualToString:title]; - if(contentIsDirty || titleIsDirty) - { - [Leas.note updateNote:self.note title:title content:content]; - } - else { - NSLog(@" not need UPDATE"); - return NO; - } - } - else { - NSLog(@" not need UPDATE readonly"); - return NO; - } - - // 新建一个笔记 - } else { - if(force || (![Common isBlankString:title] || ![Common isBlankString:content])) { - NSLog(@"add note"); - - self.note = [Leas.note addNote:title content:content - notebook:self.notebook tag:self.tag]; - } - } - - return YES; + NSString *title = [Common trimNewLine:[self titleText]]; + NSString *content = [self bodyText]; + + // 更新笔记 + if(self.note != nil) { + if(self.edited) { + BOOL contentIsDirty = ![self.note.content isEqualToString:content]; + BOOL titleIsDirty = ![self.note.title isEqualToString:title]; + if(contentIsDirty || titleIsDirty) + { + [Leas.note updateNote:self.note title:title content:content]; + } + else { + NSLog(@" not need UPDATE"); + return NO; + } + } + else { + NSLog(@" not need UPDATE readonly"); + return NO; + } + + // 新建一个笔记 + } else { + if(force || (![Common isBlankString:title] || ![Common isBlankString:content])) { + NSLog(@"add note"); + + self.note = [Leas.note addNote:title content:content + notebook:self.notebook tag:self.tag]; + } + } + + return YES; } @@ -143,108 +146,108 @@ static NSInteger const MaximumNumberOfPictures = 10; // Master View调用 - (void)setNote:(Note *)note { - if (_note != note) - { - _note = note; - // Update the view. - // [self configureView]; - } + if (_note != note) + { + _note = note; + // Update the view. + // [self configureView]; + } } - (void)viewDidLoad { - self.isMarkdown = NO; - if(self.note) { - self.isMarkdown = [self.note.isMarkdown boolValue]; - } - // 表示是新增, hide status bar - else { - self.isMarkdown = ![UserService isNormalEditor]; - [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; - // kWPEditorViewControllerModeEdit - } - [super initWithMode:kWPEditorViewControllerModePreview isMarkdown:self.isMarkdown]; - - [super viewDidLoad]; - - self.delegate = self; - - [self restoreBarStyle]; - - // 按钮初始化 - [self initNavigationBarRightButtons]; + self.isMarkdown = NO; + if(self.note) { + self.isMarkdown = [self.note.isMarkdown boolValue]; + } + // 表示是新增, hide status bar + else { + self.isMarkdown = ![UserService isNormalEditor]; + [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; + // kWPEditorViewControllerModeEdit + } + [super initWithMode:kWPEditorViewControllerModePreview isMarkdown:self.isMarkdown]; + + [super viewDidLoad]; + + self.delegate = self; + + [self restoreBarStyle]; + + // 按钮初始化 + [self initNavigationBarRightButtons]; } // 这里, 有大问题, 如果是新建的 // 图片pick消失后还是会执行这个, 会startEditing, 会focus title - (void)viewDidAppear:(BOOL)animated { - // 必须要, 不然插入图片会找不到selection问题 - [super viewDidAppear:animated]; - - // 当都显示完后, 才开始编辑, 显示键盘 - if(!self.note && !self.isInited) { - [self startEditing]; - [self enableRightButtons]; - } - - // 确保只执行一次 - // 放这里, 为了速度快 - if(!self.isInited) { - self.mediaAdded = [NSMutableDictionary dictionary]; - self.videoPressCache = [[NSCache alloc] init]; - - // 样式缓存 - DisabledButtonBarStyle = @{NSFontAttributeName: [WPStyleGuide regularTextFontSemiBold], NSForegroundColorAttributeName: [UIColor colorWithWhite:1.0 alpha:0.25]}; - EnabledButtonBarStyle = @{NSFontAttributeName: [WPStyleGuide regularTextFontSemiBold], NSForegroundColorAttributeName: [UIColor whiteColor]}; - } - - self.isInited = YES; + // 必须要, 不然插入图片会找不到selection问题 + [super viewDidAppear:animated]; + + // 当都显示完后, 才开始编辑, 显示键盘 + if(!self.note && !self.isInited) { + [self startEditing]; + [self enableRightButtons]; + } + + // 确保只执行一次 + // 放这里, 为了速度快 + if(!self.isInited) { + self.mediaAdded = [NSMutableDictionary dictionary]; + self.videoPressCache = [[NSCache alloc] init]; + + // 样式缓存 + DisabledButtonBarStyle = @{NSFontAttributeName: [WPStyleGuide regularTextFontSemiBold], NSForegroundColorAttributeName: [UIColor colorWithWhite:1.0 alpha:0.25]}; + EnabledButtonBarStyle = @{NSFontAttributeName: [WPStyleGuide regularTextFontSemiBold], NSForegroundColorAttributeName: [UIColor whiteColor]}; + } + + self.isInited = YES; } // 消失后再save, 笔记内容会消失吗? -(void) viewWillDisappear:(BOOL)animated { - // 是从本view消息的 - if ([self.navigationController.viewControllers indexOfObject:self] == NSNotFound) { - // back button was pressed. We know this is true because self is no longer - // in the navigation stack. - - NSLog(@"pop"); - - [self saveNote:NO]; - - [Leas.note pushNoteAndWrite:self.note success:^{ - // tips 提示同步成功 - [self showSuccessMsg:NSLocalizedString(@"Synchronize note successful", @"")]; - } fail:^(id ret) { - [self showErrorMsg:NSLocalizedString(@"Synchronize note failed", @"") ret:ret]; - }]; - } - - // 一直在loading 内容 - [self hideProgress]; - self.isClosed = YES; - [super viewWillDisappear:animated]; + // 是从本view消息的 + if ([self.navigationController.viewControllers indexOfObject:self] == NSNotFound) { + // back button was pressed. We know this is true because self is no longer + // in the navigation stack. + + NSLog(@"pop"); + + [self saveNote:NO]; + + [Leas.note pushNoteAndWrite:self.note success:^{ + // tips 提示同步成功 + [self showSuccessMsg:NSLocalizedString(@"Synchronize note successful", @"")]; + } fail:^(id ret) { + [self showErrorMsg:NSLocalizedString(@"Synchronize note failed", @"") ret:ret]; + }]; + } + + // 一直在loading 内容 + [self hideProgress]; + self.isClosed = YES; + [super viewWillDisappear:animated]; } // 当笔记内容load后才enable - (void) enableRightButtons { - self.saveBarButtonItem.enabled = YES; - self.optionsBarButtonItem.enabled = YES; + self.saveBarButtonItem.enabled = YES; + self.optionsBarButtonItem.enabled = YES; } - (void)initNavigationBarRightButtons { - NSArray* rightBarButtons = @[ - [self saveBarButtonItem], - [self optionsBarButtonItem], - ]; - // 初始时disable - self.saveBarButtonItem.enabled = NO; - self.optionsBarButtonItem.enabled = NO; - - [self.navigationItem setRightBarButtonItems:rightBarButtons animated:YES]; + NSArray* rightBarButtons = @[ + [self saveBarButtonItem], + [self optionsBarButtonItem], + ]; + // 初始时disable + self.saveBarButtonItem.enabled = NO; + self.optionsBarButtonItem.enabled = NO; + + [self.navigationItem setRightBarButtonItems:rightBarButtons animated:YES]; } # pragma mark - Custom UI elements @@ -252,76 +255,76 @@ static NSInteger const MaximumNumberOfPictures = 10; // 保存之后 -> 只读状态 - (void)refreshNavigationBarRightButtons:(BOOL)editingChanged { - if ([self isEditing]) { - self.edited = YES; - self.saveBarButtonItem.title = NSLocalizedString(@"Save", @""); - } else { - self.saveBarButtonItem.title = NSLocalizedString(@"Edit", @""); - if (!self.saveBarButtonItem.enabled) { - self.saveBarButtonItem.enabled = YES; - } - } + if ([self isEditing]) { + self.edited = YES; + self.saveBarButtonItem.title = NSLocalizedString(@"Save", @""); + } else { + self.saveBarButtonItem.title = NSLocalizedString(@"Edit", @""); + if (!self.saveBarButtonItem.enabled) { + self.saveBarButtonItem.enabled = YES; + } + } } // 生成按钮通用方法 - (LeaButtonForNavigationBar*)buttonForBarWithImageNamed:(NSString*)imageName - frame:(CGRect)frame - target:(id)target - selector:(SEL)selector + frame:(CGRect)frame + target:(id)target + selector:(SEL)selector { - NSAssert([imageName isKindOfClass:[NSString class]], - @"Expected imageName to be a non nil string."); - - UIImage* image = [UIImage imageNamed:imageName]; - - LeaButtonForNavigationBar* button = [[LeaButtonForNavigationBar alloc] initWithFrame:frame]; - - [button setImage:image forState:UIControlStateNormal]; - [button addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; - - return button; + NSAssert([imageName isKindOfClass:[NSString class]], + @"Expected imageName to be a non nil string."); + + UIImage* image = [UIImage imageNamed:imageName]; + + LeaButtonForNavigationBar* button = [[LeaButtonForNavigationBar alloc] initWithFrame:frame]; + + [button setImage:image forState:UIControlStateNormal]; + [button addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; + + return button; } // 配置按钮 - (UIBarButtonItem *)optionsBarButtonItem { - if (!_optionsBarButtonItem) { - LeaButtonForNavigationBar *button = [self buttonForBarWithImageNamed:@"icon-posts-editor-options" - frame:NavigationBarButtonRect - target:self - selector:@selector(showSettings)]; - - button.removeDefaultRightSpacing = YES; - button.rightSpacing = SpacingBetweeenNavbarButtons / 2.0f; - button.removeDefaultLeftSpacing = YES; - button.leftSpacing = SpacingBetweeenNavbarButtons / 2.0f; - NSString *optionsTitle = NSLocalizedString(@"Options", @"Title of the Post Settings navigation button in the Post Editor. Tapping shows settings and options related to the post being edited."); - button.accessibilityLabel = optionsTitle; - button.accessibilityIdentifier = @"Options"; - _optionsBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button]; - } - - return _optionsBarButtonItem; + if (!_optionsBarButtonItem) { + LeaButtonForNavigationBar *button = [self buttonForBarWithImageNamed:@"icon-posts-editor-options" + frame:NavigationBarButtonRect + target:self + selector:@selector(showSettings)]; + + button.removeDefaultRightSpacing = YES; + button.rightSpacing = SpacingBetweeenNavbarButtons / 2.0f; + button.removeDefaultLeftSpacing = YES; + button.leftSpacing = SpacingBetweeenNavbarButtons / 2.0f; + NSString *optionsTitle = NSLocalizedString(@"Options", @"Title of the Post Settings navigation button in the Post Editor. Tapping shows settings and options related to the post being edited."); + button.accessibilityLabel = optionsTitle; + button.accessibilityIdentifier = @"Options"; + _optionsBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button]; + } + + return _optionsBarButtonItem; } // 编辑/完成按钮 - (UIBarButtonItem *)saveBarButtonItem { - if (!_saveBarButtonItem) { - NSString *buttonTitle = NSLocalizedString(@"Edit", @""); - - UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:buttonTitle - style:[WPStyleGuide barButtonStyleForDone] - target:self - action:@selector(editTouchedUpInside)]; - - // Seems to be an issue witht the appearance proxy not being respected, so resetting these here - [saveButton setTitleTextAttributes:EnabledButtonBarStyle forState:UIControlStateNormal]; - [saveButton setTitleTextAttributes:DisabledButtonBarStyle forState:UIControlStateDisabled]; - _saveBarButtonItem = saveButton; - } - - return _saveBarButtonItem; + if (!_saveBarButtonItem) { + NSString *buttonTitle = NSLocalizedString(@"Edit", @""); + + UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:buttonTitle + style:[WPStyleGuide barButtonStyleForDone] + target:self + action:@selector(editTouchedUpInside)]; + + // Seems to be an issue witht the appearance proxy not being respected, so resetting these here + [saveButton setTitleTextAttributes:EnabledButtonBarStyle forState:UIControlStateNormal]; + [saveButton setTitleTextAttributes:DisabledButtonBarStyle forState:UIControlStateDisabled]; + _saveBarButtonItem = saveButton; + } + + return _saveBarButtonItem; } #pragma mark - Navigation Bar @@ -335,39 +338,39 @@ BOOL hiddenBar = NO; - (void)editTouchedUpInside { - // isEditting, stopEditing是继承过来的 - if (self.isEditing) { - [self stopEditing]; - hiddenBar = NO; - } else { - [self startEditing]; - hiddenBar = YES; - } - -// [self prefersStatusBarHidden]; -// [self setNeedsStatusBarAppearanceUpdate]; - - [[UIApplication sharedApplication] setStatusBarHidden:hiddenBar withAnimation:UIStatusBarAnimationSlide]; - - [self refreshNavigationBarRightButtons:YES]; + // isEditting, stopEditing是继承过来的 + if (self.isEditing) { + [self stopEditing]; + hiddenBar = NO; + } else { + [self startEditing]; + hiddenBar = YES; + } + + // [self prefersStatusBarHidden]; + // [self setNeedsStatusBarAppearanceUpdate]; + + [[UIApplication sharedApplication] setStatusBarHidden:hiddenBar withAnimation:UIStatusBarAnimationSlide]; + + [self refreshNavigationBarRightButtons:YES]; } // 显示配置 - (void)showSettings { - [self saveNote:YES]; - NoteSettingsTableViewController *vc = [[[NoteSettingsTableViewController class] alloc] initWithNote:self.note shouldHideStatusBar:YES]; - - vc.hidesBottomBarWhenPushed = YES; - - [self.editorView saveSelection]; - - [self.navigationController pushViewController:vc animated:YES]; + [self saveNote:YES]; + NoteSettingsTableViewController *vc = [[[NoteSettingsTableViewController class] alloc] initWithNote:self.note shouldHideStatusBar:YES]; + + vc.hidesBottomBarWhenPushed = YES; + + [self.editorView saveSelection]; + + [self.navigationController pushViewController:vc animated:YES]; } -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - [self.editorView saveSelection]; - [super prepareForSegue:segue sender:sender]; + [self.editorView saveSelection]; + [super prepareForSegue:segue sender:sender]; } #pragma mark - IBActions @@ -381,150 +384,169 @@ BOOL hiddenBar = NO; - (void)editorDidBeginEditing:(WPEditorViewController *)editorController { -// DDLogInfo(@"Editor did begin editing."); - [self refreshNavigationBarRightButtons:YES]; + // DDLogInfo(@"Editor did begin editing."); + [self refreshNavigationBarRightButtons:YES]; } - (void)editorDidEndEditing:(WPEditorViewController *)editorController { -// DDLogInfo(@"Editor did end editing."); -// DDLogInfo(self.bodyText); - [self saveNote:NO]; + // DDLogInfo(@"Editor did end editing."); + // DDLogInfo(self.bodyText); + [self saveNote:NO]; } // 编辑器加载后设置内容 - (void)editorDidFinishLoadingDOM:(WPEditorViewController *)editorController { - // 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; - - if(self.note) { - [self setTitleText:self.note.title]; - - [self showProgress]; - - [Leas.note getNoteContent:self.note success:^(NSString * content) { - // 如果已经不在本页了 不要设置 - if(self.isClosed) { - return; - } - [self setBodyText:content]; - [self enableRightButtons]; - [self hideProgress]; - } fail:^{ - // 如果已经不在本页了, 不要alert - if(self.isClosed) { - return; - } - [self hideProgress]; - - [LeaAlert showAlertWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Cannot fetch note's content", nil) withSupportButton:NO okPressedBlock:^() { - if(self.isClosed) { - return; - } - // 返回 - // 这里, 可能已不是本页 - [self.navigationController popViewControllerAnimated:YES]; - }]; - }]; - } + // 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; + + if(self.note) { + [self setTitleText:self.note.title]; + + [self showProgress]; + + [Leas.note getNoteContent:self.note success:^(NSString * content) { + // 如果已经不在本页了 不要设置 + if(self.isClosed) { + return; + } + [self setBodyText:content]; + [self enableRightButtons]; + [self hideProgress]; + } fail:^{ + // 如果已经不在本页了, 不要alert + if(self.isClosed) { + return; + } + [self hideProgress]; + + [LeaAlert showAlertWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Cannot fetch note's content", nil) withSupportButton:NO okPressedBlock:^() { + if(self.isClosed) { + return; + } + // 返回 + // 这里, 可能已不是本页 + [self.navigationController popViewControllerAnimated:YES]; + }]; + }]; + } } - (BOOL)editorShouldDisplaySourceView:(WPEditorViewController *)editorController { - [self.editorView pauseAllVideos]; - return YES; + [self.editorView pauseAllVideos]; + return YES; } - (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); } // 点击图片时的操作 // 怎么让图片不可点? - (void)editorViewController:(WPEditorViewController*)editorViewController - imageTapped:(NSString *)imageId - url:(NSURL *)url - imageMeta:(WPImageMeta *)imageMeta + imageTapped:(NSString *)imageId + url:(NSURL *)url + imageMeta:(WPImageMeta *)imageMeta { - // 1表示是editable的, 0表示不可editable - if ([imageId isEqualToString:@"1"]) { - // [self showImageDetailsForImageMeta:imageMeta]; - } else { - [self showActionTapImage:[url absoluteString]]; - } + // 1表示是editable的, 0表示不可editable + if ([imageId isEqualToString:@"1"]) { + // [self showImageDetailsForImageMeta:imageMeta]; + } else { + [self showActionTapImage:[url absoluteString]]; + } } // 非编辑模式下点击链接 - (void)editorViewController:(WPEditorViewController*)editorViewController - linkTapped:(NSString *)url + linkTapped:(NSString *)url { - LeaWebViewController *webViewController = [[LeaWebViewController alloc] init]; - webViewController.url = [NSURL URLWithString:url]; -// [self.navigationController pushViewController:webViewController animated:YES]; - - UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:webViewController]; - [self.navigationController presentViewController:navController animated:YES completion:nil]; + LeaWebViewController *webViewController = [[LeaWebViewController alloc] init]; + webViewController.url = [NSURL URLWithString:url]; + // [self.navigationController pushViewController:webViewController animated:YES]; + + UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:webViewController]; + [self.navigationController presentViewController:navController animated:YES completion:nil]; } - (void)editorViewController:(WPEditorViewController*)editorViewController - videoTapped:(NSString *)videoId - url:(NSURL *)url + videoTapped:(NSString *)videoId + url:(NSURL *)url { - [self showPromptForVideoWithID:videoId]; + [self showPromptForVideoWithID:videoId]; } - (void)editorViewController:(WPEditorViewController *)editorViewController imageReplaced:(NSString *)imageId { - [self.mediaAdded removeObjectForKey:imageId]; + [self.mediaAdded removeObjectForKey:imageId]; } - (void)editorViewController:(WPEditorViewController *)editorViewController videoReplaced:(NSString *)videoId { - [self.mediaAdded removeObjectForKey:videoId]; + [self.mediaAdded removeObjectForKey:videoId]; } - (void)editorViewController:(WPEditorViewController *)editorViewController videoPressInfoRequest:(NSString *)videoID { - NSDictionary * videoPressInfo = [self.videoPressCache objectForKey:videoID]; - NSString * videoURL = videoPressInfo[@"source"]; - NSString * posterURL = videoPressInfo[@"poster"]; - if (videoURL) { - [self.editorView setVideoPress:videoID source:videoURL poster:posterURL]; - } + NSDictionary * videoPressInfo = [self.videoPressCache objectForKey:videoID]; + NSString * videoURL = videoPressInfo[@"source"]; + NSString * posterURL = videoPressInfo[@"poster"]; + if (videoURL) { + [self.editorView setVideoPress:videoID source:videoURL poster:posterURL]; + } } - (void)editorViewController:(WPEditorViewController *)editorViewController mediaRemoved:(NSString *)mediaID { - NSProgress * progress = self.mediaAdded[mediaID]; - [progress cancel]; + NSProgress * progress = self.mediaAdded[mediaID]; + [progress cancel]; } #pragma mark - Media actions // 查看图片的详细信息 /* -- (void)showImageDetailsForImageMeta:(WPImageMeta *)imageMeta -{ + - (void)showImageDetailsForImageMeta:(WPImageMeta *)imageMeta + { return; WPImageMetaViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"WPImageMetaViewController"]; @@ -532,249 +554,251 @@ 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 { - NSArray *urlArr = [url componentsSeparatedByString:@"L$L"]; // 以'L$L'分隔, 最后一个是当前url - - // 最后一个是当前位置 - int curUrlIndex = [[urlArr lastObject] intValue]; - - NSMutableArray *realUrls = [[NSMutableArray alloc] init]; - - // fix url, 整理出可以显示的图片 - for(int i = 0; i < [urlArr count] - 1; ++i) { - NSString *each = urlArr[i]; - - // 只要是图片, 都行, 因为有些图片是没有.png后缀的 -// NSString *fileId = [Common getFileIdFromUrl:each]; -// if(fileId || [LeaImageViewController isUrlSupported:[NSURL URLWithString:each]]) { - [realUrls addObject:each]; -// } - } - - // 得到当前的url - NSUInteger count = [realUrls count]; - if(count < 1) { - return; - } - if (curUrlIndex > count) { - curUrlIndex = 0; - } - - /* - int curIndex = 0; - // 如果有多张图片是一样的url呢? - NSString *curUrl = realUrls[0]; - for(int i = 0; i < count; ++i) { - NSString *each = realUrls[i]; - if([each isEqualToString:curUrlStr]) { - curUrl = each; - curIndex = i; - break; - } - } - */ - - LeaImageSliderViewController *vc2 = [[LeaImageSliderViewController alloc] init]; - vc2.curUrl = realUrls[curUrlIndex]; - [vc2 setUrlArr:realUrls]; - vc2.curIndex = curUrlIndex; - vc2.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; - vc2.modalPresentationStyle = UIModalPresentationFullScreen; - [self presentViewController:vc2 animated:YES completion:nil]; - - return; - - NSString *fileId = [Common getFileIdFromUrl:url]; - if (!fileId) { -// return; - } -// self.selectedMediaID = fileId; - /* - // 表示已经有了 - if(self.actionSheet) { - return; - } - UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"Save Image", nil), nil]; - [actionSheet showInView:self.view]; - actionSheet.tag = WPViewControllerActionSheetImageUploadRetry; - self.actionSheet = actionSheet; - */ - - NSURL *urlU = [NSURL URLWithString:url]; - UIViewController *controller = nil; - BOOL isSupportedNatively = [LeaImageViewController isUrlSupported:urlU]; - - UIImage *img; - if(fileId) { - NSString *absPath = [FileService getFileAbsPathByFileIdOrServerFileId:fileId]; - img = [[UIImage alloc] initWithContentsOfFile:absPath]; - } - if (isSupportedNatively) { - controller = [[LeaImageViewController alloc] initWithImage:img andURL:urlU]; - } - /* - else if (imageControl.linkURL) { - LeaWebViewController *webViewController = [LeaWebViewController webViewControllerWithURL:imageControl.linkURL]; - controller = [[UINavigationController alloc] initWithRootViewController:webViewController]; - }*/ - else { - controller = [[LeaImageViewController alloc] initWithImage:img]; - } - - if ([controller isKindOfClass:[LeaImageViewController class]]) { - controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; - controller.modalPresentationStyle = UIModalPresentationFullScreen; - } - -// LeaImagePagerViewController *vc = [[LeaImagePagerViewController alloc] init]; - LeaImageSliderViewController *vc = [[LeaImageSliderViewController alloc] init]; - [self presentViewController:vc animated:YES completion:nil]; + NSArray *urlArr = [url componentsSeparatedByString:@"L$L"]; // 以'L$L'分隔, 最后一个是当前url + + // 最后一个是当前位置 + int curUrlIndex = [[urlArr lastObject] intValue]; + + NSMutableArray *realUrls = [[NSMutableArray alloc] init]; + + // fix url, 整理出可以显示的图片 + for(int i = 0; i < [urlArr count] - 1; ++i) { + NSString *each = urlArr[i]; + + // 只要是图片, 都行, 因为有些图片是没有.png后缀的 + // NSString *fileId = [Common getFileIdFromUrl:each]; + // if(fileId || [LeaImageViewController isUrlSupported:[NSURL URLWithString:each]]) { + [realUrls addObject:each]; + // } + } + + // 得到当前的url + NSUInteger count = [realUrls count]; + if(count < 1) { + return; + } + if (curUrlIndex > count) { + curUrlIndex = 0; + } + + /* + int curIndex = 0; + // 如果有多张图片是一样的url呢? + NSString *curUrl = realUrls[0]; + for(int i = 0; i < count; ++i) { + NSString *each = realUrls[i]; + if([each isEqualToString:curUrlStr]) { + curUrl = each; + curIndex = i; + break; + } + } + */ + + LeaImageSliderViewController *vc2 = [[LeaImageSliderViewController alloc] init]; + vc2.curUrl = realUrls[curUrlIndex]; + [vc2 setUrlArr:realUrls]; + vc2.curIndex = curUrlIndex; + vc2.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + vc2.modalPresentationStyle = UIModalPresentationFullScreen; + [self presentViewController:vc2 animated:YES completion:nil]; + + return; + + NSString *fileId = [Common getFileIdFromUrl:url]; + if (!fileId) { + // return; + } + // self.selectedMediaID = fileId; + /* + // 表示已经有了 + if(self.actionSheet) { + return; + } + UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"Save Image", nil), nil]; + [actionSheet showInView:self.view]; + actionSheet.tag = WPViewControllerActionSheetImageUploadRetry; + self.actionSheet = actionSheet; + */ + + NSURL *urlU = [NSURL URLWithString:url]; + UIViewController *controller = nil; + BOOL isSupportedNatively = [LeaImageViewController isUrlSupported:urlU]; + + UIImage *img; + if(fileId) { + NSString *absPath = [FileService getFileAbsPathByFileIdOrServerFileId:fileId]; + img = [[UIImage alloc] initWithContentsOfFile:absPath]; + } + if (isSupportedNatively) { + controller = [[LeaImageViewController alloc] initWithImage:img andURL:urlU]; + } + /* + else if (imageControl.linkURL) { + LeaWebViewController *webViewController = [LeaWebViewController webViewControllerWithURL:imageControl.linkURL]; + controller = [[UINavigationController alloc] initWithRootViewController:webViewController]; + }*/ + else { + controller = [[LeaImageViewController alloc] initWithImage:img]; + } + + if ([controller isKindOfClass:[LeaImageViewController class]]) { + controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + controller.modalPresentationStyle = UIModalPresentationFullScreen; + } + + // LeaImagePagerViewController *vc = [[LeaImagePagerViewController alloc] init]; + LeaImageSliderViewController *vc = [[LeaImageSliderViewController alloc] init]; + [self presentViewController:vc animated:YES completion:nil]; } - (void)showPromptForVideoWithID:(NSString *)videoId { - if (videoId.length == 0){ - return; - } - NSProgress *progress = self.mediaAdded[videoId]; - if (!progress.cancelled){ - UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Stop Upload" otherButtonTitles:nil]; - [actionSheet showInView:self.view]; - actionSheet.tag = WPViewControllerActionSheetVideoUploadStop; - } else { - UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove Video" otherButtonTitles:@"Retry Upload", nil]; - [actionSheet showInView:self.view]; - actionSheet.tag = WPViewControllerActionSheetVideoUploadRetry; - } - self.selectedMediaID = videoId; + if (videoId.length == 0){ + return; + } + NSProgress *progress = self.mediaAdded[videoId]; + if (!progress.cancelled){ + UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Stop Upload" otherButtonTitles:nil]; + [actionSheet showInView:self.view]; + actionSheet.tag = WPViewControllerActionSheetVideoUploadStop; + } else { + UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove Video" otherButtonTitles:@"Retry Upload", nil]; + [actionSheet showInView:self.view]; + actionSheet.tag = WPViewControllerActionSheetVideoUploadRetry; + } + self.selectedMediaID = videoId; } // 选择图片 - (void)showPhotoPicker { - [self.editorView saveSelection]; - - WPMediaPickerViewController * mediaPicker = [[WPMediaPickerViewController alloc] init]; - mediaPicker.showMostRecentFirst = YES; // 防止拍照后崩溃 - mediaPicker.delegate = self; - [self presentViewController:mediaPicker animated:YES completion:nil]; - - /* - - CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init]; - picker.delegate = self; - - UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class], [CTAssetsPickerController class], nil]; - [barButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateNormal]; - [barButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateDisabled]; - - // Only show photos for now (not videos) - picker.assetsFilter = [ALAssetsFilter allPhotos]; - - [self presentViewController:picker animated:YES completion:nil]; - picker.childNavigationController.navigationBar.translucent = NO; - */ - - /* - - UIImagePickerController *picker = [[UIImagePickerController alloc] init]; - picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; - picker.delegate = self; - picker.allowsEditing = NO; - picker.navigationBar.translucent = NO; - picker.modalPresentationStyle = UIModalPresentationCurrentContext; - picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; - [self.navigationController presentViewController:picker animated:YES completion:nil]; - - */ + [self.editorView saveSelection]; + 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]; + + /* + + CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init]; + picker.delegate = self; + + UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class], [CTAssetsPickerController class], nil]; + [barButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateNormal]; + [barButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateDisabled]; + + // Only show photos for now (not videos) + picker.assetsFilter = [ALAssetsFilter allPhotos]; + + [self presentViewController:picker animated:YES completion:nil]; + picker.childNavigationController.navigationBar.translucent = NO; + */ + + /* + + UIImagePickerController *picker = [[UIImagePickerController alloc] init]; + picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + picker.delegate = self; + picker.allowsEditing = NO; + picker.navigationBar.translucent = NO; + picker.modalPresentationStyle = UIModalPresentationCurrentContext; + picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; + [self.navigationController presentViewController:picker animated:YES completion:nil]; + + */ } #pragma mark - WPMediaPickerViewControllerDelegate - -- (void)mediaPickerController:(WPMediaPickerViewController *)picker didFinishPickingAssets:(NSArray *)assets -{ - [self dismissViewControllerAnimated:YES completion:nil]; - // assets contains WPMediaAsset objects. - [self addMediaAssets:assets]; +-(void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didSelectAsset:(ALAsset *)asset{ + [self dismissViewControllerAnimated:YES completion:nil]; + [self addMediaAssets:@[asset]]; } -// 点击取消 -- (void)mediaPickerControllerDidCancel:(id)picker -{ - [self dismissViewControllerAnimated:YES completion:nil]; +-(void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didSelectAssets:(NSArray *)assets{ + [self dismissViewControllerAnimated:YES completion:nil]; + [self addMediaAssets:assets]; } +-(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]; + [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) { - [LeaAlert showAlertWithTitle:NSLocalizedString(@"Image unavailable", @"The title for an alert that says the image the user selected isn't available.") - message:NSLocalizedString(@"This Photo Stream image cannot be added to note. Try saving it to your Camera Roll before.", @"User information explaining that the image is not available locally. This is normally related to share photo stream images.") withSupportButton:NO]; - return NO; - } - if (picker.selectedAssets.count >= MaximumNumberOfPictures) { - [LeaAlert showAlertWithTitle:nil - message:[NSString stringWithFormat:NSLocalizedString(@"You can only add %i photos at a time.", @"User information explaining that you can only select an x number of images."), MaximumNumberOfPictures] withSupportButton:NO]; - return NO; - } - return YES; + // If the image is from a shared photo stream it may not be available locally to be used + if (!asset.defaultRepresentation) { + [LeaAlert showAlertWithTitle:NSLocalizedString(@"Image unavailable", @"The title for an alert that says the image the user selected isn't available.") + message:NSLocalizedString(@"This Photo Stream image cannot be added to note. Try saving it to your Camera Roll before.", @"User information explaining that the image is not available locally. This is normally related to share photo stream images.") withSupportButton:NO]; + return NO; + } + if (picker.selectedAssets.count >= MaximumNumberOfPictures) { + [LeaAlert showAlertWithTitle:nil + message:[NSString stringWithFormat:NSLocalizedString(@"You can only add %i photos at a time.", @"User information explaining that you can only select an x number of images."), MaximumNumberOfPictures] withSupportButton:NO]; + return NO; + } + return YES; } else { - return NO; + return NO; } -} -*/ + } + */ - (NSString *) getImageUrl:(NSString *) fileId { - return [NSString stringWithFormat:@"leanote://getImage?fileId=%@", fileId]; + return [NSString stringWithFormat:@"leanote://getImage?fileId=%@", fileId]; } - (void)addMediaAssets:(NSArray *)assets { - NSString *urls = @"["; - for (ALAsset *asset in assets) { - NSString *fileId = [self addImageAssetToContent:asset]; - urls = [NSString stringWithFormat:@"%@'%@',", urls, [self getImageUrl:fileId]]; - } - urls = [NSString stringWithFormat:@"%@]", urls]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self.editorView insertImage:urls alt:@""]; - }); + NSString *urls = @"["; + for (ALAsset *asset in assets) { + NSString *fileId = [self addImageAssetToContent:asset]; + urls = [NSString stringWithFormat:@"%@'%@',", urls, [self getImageUrl:fileId]]; + } + urls = [NSString stringWithFormat:@"%@]", urls]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self.editorView insertImage:urls alt:@""]; + }); } // 添加图片到内容中 - (NSString *)addImageAssetToContent:(ALAsset *)asset { - UIImage *image = [UIImage imageWithCGImage:asset.defaultRepresentation.fullScreenImage]; - NSData *data = UIImageJPEGRepresentation(image, 0.7); - NSString *imageID = [Common newObjectId]; - - NSString *relativePath = [NSString stringWithFormat:@"%@/%@.jpg", @"images", imageID]; - - // 图片写到doc/images目录下 - NSString *path = [NSString stringWithFormat:@"%@/%@", [Common getDocPath], relativePath]; - [data writeToFile:path atomically:YES]; - - // 一条本地记录 - File *file = [FileService addLocalFile:relativePath]; - - return file.fileId; + UIImage *image = [UIImage imageWithCGImage:asset.defaultRepresentation.fullScreenImage]; + NSData *data = UIImageJPEGRepresentation(image, 0.7); + NSString *imageID = [Common newObjectId]; + + NSString *relativePath = [NSString stringWithFormat:@"%@/%@.jpg", @"images", imageID]; + + // 图片写到doc/images目录下 + NSString *path = [NSString stringWithFormat:@"%@/%@", [Common getDocPath], relativePath]; + [data writeToFile:path atomically:YES]; + + // 一条本地记录 + File *file = [FileService addLocalFile:relativePath]; + + return file.fileId; } // 视频, 不允许!! @@ -816,69 +840,51 @@ 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 { - NSProgress *progress = (NSProgress *)timer.userInfo; - progress.completedUnitCount++; - NSString *imageID = progress.userInfo[@"imageID"]; - if (imageID) { - [self.editorView setProgress:progress.fractionCompleted onImage:imageID]; - // Uncomment this code if you need to test a failed image upload - // if (progress.fractionCompleted >= 0.15){ - // [progress cancel]; - // [self.editorView markImage:imageID failedUploadWithMessage:@"Failed"]; - // [timer invalidate]; - // } - if (progress.fractionCompleted >= 1) { - [self.editorView replaceLocalImageWithRemoteImage:[[NSURL fileURLWithPath:progress.userInfo[@"url"]] absoluteString] uniqueId:imageID]; - [timer invalidate]; - } - return; - } - - return; - // 以下是视频 - - NSString *videoID = progress.userInfo[@"videoID"]; - if (videoID) { - [self.editorView setProgress:progress.fractionCompleted onVideo:videoID]; - // Uncomment this code if you need to test a failed video upload - // if (progress.fractionCompleted >= 0.15) { - // [progress cancel]; - // [self.editorView markVideo:videoID failedUploadWithMessage:@"Failed"]; - // [timer invalidate]; - // } - if (progress.fractionCompleted >= 1) { - NSString * videoURL = [[NSURL fileURLWithPath:progress.userInfo[@"url"]] absoluteString]; - NSString * posterURL = [[NSURL fileURLWithPath:progress.userInfo[@"poster"]] absoluteString]; - [self.editorView replaceLocalVideoWithID:videoID - forRemoteVideo:videoURL - remotePoster:posterURL - videoPress:videoID]; - [self.videoPressCache setObject:@ {@"source":videoURL, @"poster":posterURL} forKey:videoID]; - [timer invalidate]; - } - return; - } + NSProgress *progress = (NSProgress *)timer.userInfo; + progress.completedUnitCount++; + NSString *imageID = progress.userInfo[@"imageID"]; + if (imageID) { + [self.editorView setProgress:progress.fractionCompleted onImage:imageID]; + // Uncomment this code if you need to test a failed image upload + // if (progress.fractionCompleted >= 0.15){ + // [progress cancel]; + // [self.editorView markImage:imageID failedUploadWithMessage:@"Failed"]; + // [timer invalidate]; + // } + if (progress.fractionCompleted >= 1) { + [self.editorView replaceLocalImageWithRemoteImage:[[NSURL fileURLWithPath:progress.userInfo[@"url"]] absoluteString] uniqueId:imageID]; + [timer invalidate]; + } + return; + } + + return; + // 以下是视频 + + NSString *videoID = progress.userInfo[@"videoID"]; + if (videoID) { + [self.editorView setProgress:progress.fractionCompleted onVideo:videoID]; + // Uncomment this code if you need to test a failed video upload + // if (progress.fractionCompleted >= 0.15) { + // [progress cancel]; + // [self.editorView markVideo:videoID failedUploadWithMessage:@"Failed"]; + // [timer invalidate]; + // } + if (progress.fractionCompleted >= 1) { + NSString * videoURL = [[NSURL fileURLWithPath:progress.userInfo[@"url"]] absoluteString]; + NSString * posterURL = [[NSURL fileURLWithPath:progress.userInfo[@"poster"]] absoluteString]; + [self.editorView replaceLocalVideoWithID:videoID + forRemoteVideo:videoURL + remotePoster:posterURL + videoPress:videoID]; + [self.videoPressCache setObject:@ {@"source":videoURL, @"poster":posterURL} forKey:videoID]; + [timer invalidate]; + } + return; + } } // 选择图片代理 @@ -886,62 +892,85 @@ BOOL hiddenBar = NO; - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { - [self.navigationController dismissViewControllerAnimated:YES completion:^{ - NSURL *assetURL = info[UIImagePickerControllerReferenceURL]; - [self addAssetToContent:assetURL]; - }]; + [self.navigationController dismissViewControllerAnimated:YES completion:^{ + 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 { - self.actionSheet = nil; - - if (actionSheet.tag == WPViewControllerActionSheetImageUploadStop){ - if (buttonIndex == actionSheet.destructiveButtonIndex) { - [self.editorView removeImage:self.selectedMediaID]; - } - - // 下载图片 - } else if (actionSheet.tag == WPViewControllerActionSheetImageUploadRetry){ - if (buttonIndex == actionSheet.destructiveButtonIndex) { -// [self.editorView removeImage:self.selectedMediaID]; - } - else if (buttonIndex == actionSheet.firstOtherButtonIndex) { - NSString *absPath = [FileService getFileAbsPathByFileIdOrServerFileId:self.selectedMediaID]; - if(!absPath) { - [self showErrorMsg:NSLocalizedString(@"Save image failed", nil) ret:nil]; - return; - } - UIImage *image = [UIImage imageWithContentsOfFile:absPath]; - - UIImageWriteToSavedPhotosAlbum(image, nil, nil,nil); - - [self showSuccessMsg:NSLocalizedString(@"Save image successful", nil)]; - } - - } else if (actionSheet.tag == WPViewControllerActionSheetVideoUploadStop){ - if (buttonIndex == actionSheet.destructiveButtonIndex) { - [self.editorView removeVideo:self.selectedMediaID]; - } - } else if (actionSheet.tag == WPViewControllerActionSheetVideoUploadRetry){ - if (buttonIndex == actionSheet.destructiveButtonIndex) { - [self.editorView removeVideo:self.selectedMediaID]; - } else if (buttonIndex == actionSheet.firstOtherButtonIndex) { - NSProgress * progress = [[NSProgress alloc] initWithParent:nil userInfo:@{@"videoID":self.selectedMediaID}]; - progress.totalUnitCount = 100; - [NSTimer scheduledTimerWithTimeInterval:0.1 - target:self - selector:@selector(timerFireMethod:) - userInfo:progress - repeats:YES]; - self.mediaAdded[self.selectedMediaID] = progress; - [self.editorView unmarkVideoFailedUpload:self.selectedMediaID]; - } - } + self.actionSheet = nil; + + if (actionSheet.tag == WPViewControllerActionSheetImageUploadStop){ + if (buttonIndex == actionSheet.destructiveButtonIndex) { + [self.editorView removeImage:self.selectedMediaID]; + } + + // 下载图片 + } else if (actionSheet.tag == WPViewControllerActionSheetImageUploadRetry){ + if (buttonIndex == actionSheet.destructiveButtonIndex) { + // [self.editorView removeImage:self.selectedMediaID]; + } + else if (buttonIndex == actionSheet.firstOtherButtonIndex) { + NSString *absPath = [FileService getFileAbsPathByFileIdOrServerFileId:self.selectedMediaID]; + if(!absPath) { + [self showErrorMsg:NSLocalizedString(@"Save image failed", nil) ret:nil]; + return; + } + UIImage *image = [UIImage imageWithContentsOfFile:absPath]; + + UIImageWriteToSavedPhotosAlbum(image, nil, nil,nil); + + [self showSuccessMsg:NSLocalizedString(@"Save image successful", nil)]; + } + + } else if (actionSheet.tag == WPViewControllerActionSheetVideoUploadStop){ + if (buttonIndex == actionSheet.destructiveButtonIndex) { + [self.editorView removeVideo:self.selectedMediaID]; + } + } else if (actionSheet.tag == WPViewControllerActionSheetVideoUploadRetry){ + if (buttonIndex == actionSheet.destructiveButtonIndex) { + [self.editorView removeVideo:self.selectedMediaID]; + } else if (buttonIndex == actionSheet.firstOtherButtonIndex) { + NSProgress * progress = [[NSProgress alloc] initWithParent:nil userInfo:@{@"videoID":self.selectedMediaID}]; + progress.totalUnitCount = 100; + [NSTimer scheduledTimerWithTimeInterval:0.1 + target:self + selector:@selector(timerFireMethod:) + userInfo:progress + repeats:YES]; + self.mediaAdded[self.selectedMediaID] = progress; + [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];//进入照相界面 + } } diff --git a/Leanote/controller/notebook/AddNotebookViewController.m b/Leanote/controller/notebook/AddNotebookViewController.m index 4d0a5b8..f06f70b 100644 --- a/Leanote/controller/notebook/AddNotebookViewController.m +++ b/Leanote/controller/notebook/AddNotebookViewController.m @@ -13,12 +13,12 @@ #import "Leas.h" #import "LeaButtonForNavigationBar.h" -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import 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; diff --git a/Leanote/editor/EditorClasses/WPEditorToolbarView.m b/Leanote/editor/EditorClasses/WPEditorToolbarView.m index be01c58..42dac39 100755 --- a/Leanote/editor/EditorClasses/WPEditorToolbarView.m +++ b/Leanote/editor/EditorClasses/WPEditorToolbarView.m @@ -1,8 +1,7 @@ #import "WPEditorToolbarView.h" -#import "WPDeviceIdentification.h" #import "WPEditorToolbarButton.h" #import "ZSSBarButtonItem.h" - +#import // life #ifdef __OBJC__ diff --git a/Leanote/editor/EditorClasses/WPEditorView.m b/Leanote/editor/EditorClasses/WPEditorView.m index a55ba4e..e339ecc 100755 --- a/Leanote/editor/EditorClasses/WPEditorView.m +++ b/Leanote/editor/EditorClasses/WPEditorView.m @@ -5,9 +5,9 @@ #import "WPEditorField.h" #import "WPImageMeta.h" #import "ZSSTextView.h" -#import "WPDeviceIdentification.h" -#import -#import +#import +#import +#import // life #import "NSURLProtocolCustom.h" diff --git a/Leanote/editor/EditorClasses/WPEditorViewController.m b/Leanote/editor/EditorClasses/WPEditorViewController.m index 0ba4bb0..c66c1a6 100755 --- a/Leanote/editor/EditorClasses/WPEditorViewController.m +++ b/Leanote/editor/EditorClasses/WPEditorViewController.m @@ -3,11 +3,11 @@ #import #import #import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import #import "WPEditorField.h" #import "WPEditorToolbarButton.h" @@ -19,7 +19,7 @@ #import "DRColorPicker.h" #import "DRColorPickerHomeViewController.h" -#import "WPDeviceIdentification.h" +#import CGFloat const EPVCStandardOffset = 10.0; NSInteger const WPImageAlertViewTag = 91; diff --git a/Leanote/editor/EditorClasses/WPLegacyEditorViewController.m b/Leanote/editor/EditorClasses/WPLegacyEditorViewController.m index d60ad07..12d1521 100755 --- a/Leanote/editor/EditorClasses/WPLegacyEditorViewController.m +++ b/Leanote/editor/EditorClasses/WPLegacyEditorViewController.m @@ -2,9 +2,9 @@ #import "WPLegacyKeyboardToolbarBase.h" #import "WPLegacyKeyboardToolbarDone.h" #import -#import -#import -#import +#import +#import +#import #import CGFloat const WPLegacyEPVCTextfieldHeight = 44.0f; diff --git a/Leanote/editor/EditorClasses/WPLegacyKeyboardToolbarButtonItem.m b/Leanote/editor/EditorClasses/WPLegacyKeyboardToolbarButtonItem.m index c283658..a466a0d 100755 --- a/Leanote/editor/EditorClasses/WPLegacyKeyboardToolbarButtonItem.m +++ b/Leanote/editor/EditorClasses/WPLegacyKeyboardToolbarButtonItem.m @@ -1,6 +1,6 @@ #import "WPLegacyKeyboardToolbarButtonItem.h" #import -#import +#import @implementation WPLegacyKeyboardToolbarButtonItem @synthesize actionTag, actionName; diff --git a/Leanote/util/Common.m b/Leanote/util/Common.m index ecfac17..8069174 100644 --- a/Leanote/util/Common.m +++ b/Leanote/util/Common.m @@ -10,7 +10,7 @@ #import "MongoID.h" #import "SVProgressHUD.h" -#import +#import @implementation Common diff --git a/Leanote/view/LeaWebViewController.m b/Leanote/view/LeaWebViewController.m index 291afee..889d496 100755 --- a/Leanote/view/LeaWebViewController.m +++ b/Leanote/view/LeaWebViewController.m @@ -15,8 +15,8 @@ // https://github.com/iDay/WeixinActivity #import "WeixinActivity.h" -#import -#import +#import +#import @class WPReaderDetailViewController; diff --git a/Leanote/view/cells/NoteCell.m b/Leanote/view/cells/NoteCell.m index bcd6740..fc60d21 100644 --- a/Leanote/view/cells/NoteCell.m +++ b/Leanote/view/cells/NoteCell.m @@ -7,8 +7,8 @@ // #import "NoteCell.h" -#import -#import +#import +#import //#import "NotebookService.h" #import "Leas.h" diff --git a/Leanote/view/cells/NotebookTagCell.m b/Leanote/view/cells/NotebookTagCell.m index 6d2856e..0186dee 100644 --- a/Leanote/view/cells/NotebookTagCell.m +++ b/Leanote/view/cells/NotebookTagCell.m @@ -7,8 +7,8 @@ // #import "NotebookTagCell.h" -#import -#import +#import +#import #import "NotebookService.h" @interface NotebookTagCell() diff --git a/Podfile b/Podfile index a66be3b..2fd4edb 100755 --- a/Podfile +++ b/Podfile @@ -13,4 +13,4 @@ pod 'SWTableViewCell', '~> 0.3.7' pod 'SGNavigationProgress' -pod "WPMediaPicker" +pod 'QBImagePickerController', '< 3.0.0' \ No newline at end of file diff --git a/Podfile.lock b/Podfile.lock index 42001f2..a92e1a6 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -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