mirror of
https://github.com/leanote/leanote-ios.git
synced 2025-10-16 16:14:10 +00:00
@@ -142,6 +142,7 @@
|
|||||||
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
{
|
{
|
||||||
[self customizeAppearance];
|
[self customizeAppearance];
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全局样式设置
|
// 全局样式设置
|
||||||
|
@@ -42,7 +42,7 @@ static CGPoint const LoginOnePasswordPadding = {9.0, 0.0f};
|
|||||||
static NSInteger const LoginVerificationCodeNumberOfLines = 2;
|
static NSInteger const LoginVerificationCodeNumberOfLines = 2;
|
||||||
|
|
||||||
|
|
||||||
@interface LoginViewController ()
|
@interface LoginViewController ()<UITextFieldDelegate>
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL isFromAddAccount;
|
@property (nonatomic, assign) BOOL isFromAddAccount;
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#import <SGNavigationProgress/UINavigationController+SGProgress.h>
|
#import <SGNavigationProgress/UINavigationController+SGProgress.h>
|
||||||
|
|
||||||
@interface NoteController ()
|
@interface NoteController ()<SWTableViewCellDelegate>
|
||||||
|
|
||||||
@property (strong, nonatomic) NSIndexPath *indexPathToBeDeleted;
|
@property (strong, nonatomic) NSIndexPath *indexPathToBeDeleted;
|
||||||
@property (strong, nonatomic) NSFetchedResultsController *searchedResultsController;
|
@property (strong, nonatomic) NSFetchedResultsController *searchedResultsController;
|
||||||
@@ -724,7 +724,10 @@
|
|||||||
case NSFetchedResultsChangeDelete:
|
case NSFetchedResultsChangeDelete:
|
||||||
[tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex]
|
[tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex]
|
||||||
withRowAnimation:UITableViewRowAnimationFade];
|
withRowAnimation:UITableViewRowAnimationFade];
|
||||||
break;
|
break;
|
||||||
|
case NSFetchedResultsChangeUpdate:
|
||||||
|
case NSFetchedResultsChangeMove:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,7 @@ typedef enum {
|
|||||||
} PostSettingsRow;
|
} PostSettingsRow;
|
||||||
|
|
||||||
|
|
||||||
@interface NoteSettingsTableViewController ()
|
@interface NoteSettingsTableViewController ()<UITextFieldDelegate>
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL preIsBlog;
|
@property (nonatomic, assign) BOOL preIsBlog;
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ static NSDictionary *EnabledButtonBarStyle;
|
|||||||
static NSInteger const MaximumNumberOfPictures = 10;
|
static NSInteger const MaximumNumberOfPictures = 10;
|
||||||
|
|
||||||
|
|
||||||
@interface NoteViewController () <CTAssetsPickerControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate>
|
@interface NoteViewController () <CTAssetsPickerControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate, WPMediaPickerViewControllerDelegate>
|
||||||
|
|
||||||
@property(nonatomic, strong) NSMutableDictionary *mediaAdded;
|
@property(nonatomic, strong) NSMutableDictionary *mediaAdded;
|
||||||
@property(nonatomic, strong) NSString *selectedMediaID;
|
@property(nonatomic, strong) NSString *selectedMediaID;
|
||||||
@@ -539,7 +539,7 @@ BOOL hiddenBar = NO;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 得到当前的url
|
// 得到当前的url
|
||||||
int count = [realUrls count];
|
NSUInteger count = [realUrls count];
|
||||||
if(count < 1) {
|
if(count < 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@ typedef enum {
|
|||||||
@property UIBarButtonItem *doneButton;
|
@property UIBarButtonItem *doneButton;
|
||||||
@property UIBarButtonItem *cancelButton;
|
@property UIBarButtonItem *cancelButton;
|
||||||
|
|
||||||
@property (assign) BOOL *textFieldDidHaveFocusBeforeOrientationChange;
|
@property (assign) BOOL textFieldDidHaveFocusBeforeOrientationChange;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@@ -693,6 +693,9 @@
|
|||||||
[tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex]
|
[tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex]
|
||||||
withRowAnimation:UITableViewRowAnimationFade];
|
withRowAnimation:UITableViewRowAnimationFade];
|
||||||
break;
|
break;
|
||||||
|
case NSFetchedResultsChangeMove:
|
||||||
|
case NSFetchedResultsChangeUpdate:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
#import "Leas.h"
|
#import "Leas.h"
|
||||||
#import "NoteController.h"
|
#import "NoteController.h"
|
||||||
|
|
||||||
@interface TagController ()
|
@interface TagController ()<SWTableViewCellDelegate>
|
||||||
|
|
||||||
// 从setting过来要用
|
// 从setting过来要用
|
||||||
@property (nonatomic, strong) Note *note;
|
@property (nonatomic, strong) Note *note;
|
||||||
@@ -573,6 +573,9 @@
|
|||||||
[tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex]
|
[tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex]
|
||||||
withRowAnimation:UITableViewRowAnimationFade];
|
withRowAnimation:UITableViewRowAnimationFade];
|
||||||
break;
|
break;
|
||||||
|
case NSFetchedResultsChangeMove:
|
||||||
|
case NSFetchedResultsChangeUpdate:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
// 把关于数据库操作的抽出来放到这里
|
// 把关于数据库操作的抽出来放到这里
|
||||||
|
|
||||||
- (NSFetchedResultsController *) fetchedResultsControllerWithPredicate:(NSString *)predicateStr
|
- (NSFetchedResultsController *) fetchedResultsControllerWithPredicate:(NSString *)predicateStr
|
||||||
withController:(UIViewController *)controller
|
withController:(UIViewController<NSFetchedResultsControllerDelegate> *)controller
|
||||||
notebook:(Notebook *)notebook
|
notebook:(Notebook *)notebook
|
||||||
tag:(Tag *)tag
|
tag:(Tag *)tag
|
||||||
isBlog:(BOOL)isBlog
|
isBlog:(BOOL)isBlog
|
||||||
|
@@ -92,7 +92,7 @@ BOOL inSyncing = NO;
|
|||||||
// 同步笔记本
|
// 同步笔记本
|
||||||
- (void) syncNotebook:(NSNumber *)afterUsn callback:(void (^)(BOOL))callback
|
- (void) syncNotebook:(NSNumber *)afterUsn callback:(void (^)(BOOL))callback
|
||||||
{
|
{
|
||||||
NSNumber *maxEntry = [NSNumber numberWithInt:maxEntryInt];
|
NSNumber *maxEntry = [NSNumber numberWithUnsignedInteger:maxEntryInt];
|
||||||
[ApiService getSyncNotebooks:afterUsn maxEntry:maxEntry success:^(NSArray * notebookObjs) {
|
[ApiService getSyncNotebooks:afterUsn maxEntry:maxEntry success:^(NSArray * notebookObjs) {
|
||||||
if(self.canceled) {
|
if(self.canceled) {
|
||||||
return;
|
return;
|
||||||
@@ -100,7 +100,7 @@ BOOL inSyncing = NO;
|
|||||||
[self syncNotebookToLocal:notebookObjs];
|
[self syncNotebookToLocal:notebookObjs];
|
||||||
|
|
||||||
// 如果一样, 表示很可能还有笔记本, 得到最大的usn, 递归调用之
|
// 如果一样, 表示很可能还有笔记本, 得到最大的usn, 递归调用之
|
||||||
int count = [notebookObjs count];
|
NSUInteger count = [notebookObjs count];
|
||||||
if (count == maxEntryInt) {
|
if (count == maxEntryInt) {
|
||||||
NSNumber *maxUsn = notebookObjs[count-1][@"Usn"];
|
NSNumber *maxUsn = notebookObjs[count-1][@"Usn"];
|
||||||
[self syncNotebook:maxUsn callback:callback];
|
[self syncNotebook:maxUsn callback:callback];
|
||||||
@@ -186,7 +186,7 @@ BOOL inSyncing = NO;
|
|||||||
// 同步笔记
|
// 同步笔记
|
||||||
- (void) syncNote:(NSNumber *)afterUsn callback:(void (^)(BOOL))callback
|
- (void) syncNote:(NSNumber *)afterUsn callback:(void (^)(BOOL))callback
|
||||||
{
|
{
|
||||||
NSNumber *maxEntry = [NSNumber numberWithInt:maxEntryInt];
|
NSNumber *maxEntry = [NSNumber numberWithUnsignedInteger:maxEntryInt];
|
||||||
[ApiService getSyncNotes:afterUsn maxEntry:maxEntry success:^(NSArray * noteObjs) {
|
[ApiService getSyncNotes:afterUsn maxEntry:maxEntry success:^(NSArray * noteObjs) {
|
||||||
if(self.canceled) {
|
if(self.canceled) {
|
||||||
return;
|
return;
|
||||||
@@ -194,7 +194,7 @@ BOOL inSyncing = NO;
|
|||||||
[self syncNoteToLocal:noteObjs];
|
[self syncNoteToLocal:noteObjs];
|
||||||
|
|
||||||
// 如果一样, 表示很可能还有笔记本, 得到最大的usn, 递归调用之
|
// 如果一样, 表示很可能还有笔记本, 得到最大的usn, 递归调用之
|
||||||
int count = [noteObjs count];
|
NSUInteger count = [noteObjs count];
|
||||||
if (count == maxEntryInt) {
|
if (count == maxEntryInt) {
|
||||||
NSNumber *maxUsn = noteObjs[count-1][@"Usn"];
|
NSNumber *maxUsn = noteObjs[count-1][@"Usn"];
|
||||||
[self syncNote:maxUsn callback:callback];
|
[self syncNote:maxUsn callback:callback];
|
||||||
@@ -244,7 +244,7 @@ BOOL inSyncing = NO;
|
|||||||
// 同步标签
|
// 同步标签
|
||||||
- (void) syncTag:(NSNumber *)afterUsn callback:(void (^)(BOOL))callback
|
- (void) syncTag:(NSNumber *)afterUsn callback:(void (^)(BOOL))callback
|
||||||
{
|
{
|
||||||
NSNumber *maxEntry = [NSNumber numberWithInt:maxEntryInt];
|
NSNumber *maxEntry = [NSNumber numberWithUnsignedInteger:maxEntryInt];
|
||||||
[ApiService getSyncTags:afterUsn maxEntry:maxEntry success:^(NSArray * tagObjs) {
|
[ApiService getSyncTags:afterUsn maxEntry:maxEntry success:^(NSArray * tagObjs) {
|
||||||
if(self.canceled) {
|
if(self.canceled) {
|
||||||
return;
|
return;
|
||||||
@@ -252,7 +252,7 @@ BOOL inSyncing = NO;
|
|||||||
[self syncTagToLocal:tagObjs];
|
[self syncTagToLocal:tagObjs];
|
||||||
|
|
||||||
// 如果一样, 表示很可能还有Tag, 得到最大的usn, 递归调用之
|
// 如果一样, 表示很可能还有Tag, 得到最大的usn, 递归调用之
|
||||||
int count = [tagObjs count];
|
NSUInteger count = [tagObjs count];
|
||||||
if (count == maxEntryInt) {
|
if (count == maxEntryInt) {
|
||||||
NSNumber *maxUsn = tagObjs[count-1][@"Usn"];
|
NSNumber *maxUsn = tagObjs[count-1][@"Usn"];
|
||||||
[self syncTag:maxUsn callback:callback];
|
[self syncTag:maxUsn callback:callback];
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
request.HTTPBody = [requestBody dataUsingEncoding:NSUTF8StringEncoding];
|
request.HTTPBody = [requestBody dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
|
|
||||||
// Auth Headers
|
// Auth Headers
|
||||||
[request setValue:[NSString stringWithFormat:@"%d", requestBody.length] forHTTPHeaderField:@"Content-Length"];
|
[request setValue:[NSString stringWithFormat:@"%lu", requestBody.length] forHTTPHeaderField:@"Content-Length"];
|
||||||
[request addValue:@"*/*" forHTTPHeaderField:@"Accept"];
|
[request addValue:@"*/*" forHTTPHeaderField:@"Accept"];
|
||||||
|
|
||||||
// Bearer Token
|
// Bearer Token
|
||||||
|
@@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
@property (strong, nonatomic) NSArray *urlArr;
|
@property (strong, nonatomic) NSArray *urlArr;
|
||||||
@property (strong, nonatomic) NSString *curUrl;
|
@property (strong, nonatomic) NSString *curUrl;
|
||||||
@property int curIndex;
|
@property NSUInteger curIndex;
|
||||||
|
|
||||||
@end
|
@end
|
@@ -13,14 +13,14 @@
|
|||||||
|
|
||||||
#import "Common.h"
|
#import "Common.h"
|
||||||
|
|
||||||
@interface LeaImageSliderViewController ()
|
@interface LeaImageSliderViewController ()<UIPageViewControllerDelegate>
|
||||||
{
|
{
|
||||||
UILabel *_label;
|
UILabel *_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, strong) UIButton *saveBtn;
|
@property (nonatomic, strong) UIButton *saveBtn;
|
||||||
|
|
||||||
@property int count;
|
@property NSUInteger count;
|
||||||
@property (strong, nonatomic) NSMutableArray *views;
|
@property (strong, nonatomic) NSMutableArray *views;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
}
|
}
|
||||||
-(void)setIndexLabel
|
-(void)setIndexLabel
|
||||||
{
|
{
|
||||||
_label.text = [NSString stringWithFormat:@"%i/%i", self.curIndex + 1, self.count];
|
_label.text = [NSString stringWithFormat:@"%lu/%lu", self.curIndex + 1, self.count];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user