Build fixes, improvements and project cleanup.
This commit is contained in:
@@ -225,7 +225,7 @@
|
||||
- (void)copyAnswer:(NSString *)answer {
|
||||
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
if ([pasteboard respondsToSelector:@selector( setItems:options: )]) {
|
||||
if (@available(iOS 10.0, *)) {
|
||||
[pasteboard setItems:@[ @{ UIPasteboardTypeAutomatic: answer } ]
|
||||
options:@{
|
||||
UIPasteboardOptionLocalOnly : @NO,
|
||||
|
@@ -55,20 +55,21 @@
|
||||
[self.views[self.nextView++] setVisible:YES];
|
||||
}];
|
||||
|
||||
self.viewTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 block:^(NSTimer *timer) {
|
||||
self.viewProgress.progress += 1.0f / 50;
|
||||
|
||||
if (self.viewProgress.progress == 1)
|
||||
[UIView animateWithDuration:0.3f animations:^{
|
||||
self.viewProgress.progress = 0;
|
||||
[self.views[self.nextView++] setVisible:YES];
|
||||
|
||||
if (self.nextView >= [self.views count]) {
|
||||
[self.viewTimer invalidate];
|
||||
self.viewProgress.visible = NO;
|
||||
}
|
||||
}];
|
||||
} repeats:YES];
|
||||
if (@available(iOS 10.0, *))
|
||||
self.viewTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer *timer) {
|
||||
self.viewProgress.progress += 1.0f / 50;
|
||||
|
||||
if (self.viewProgress.progress == 1)
|
||||
[UIView animateWithDuration:0.3f animations:^{
|
||||
self.viewProgress.progress = 0;
|
||||
[self.views[self.nextView++] setVisible:YES];
|
||||
|
||||
if (self.nextView >= [self.views count]) {
|
||||
[self.viewTimer invalidate];
|
||||
self.viewProgress.visible = NO;
|
||||
}
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle {
|
||||
|
@@ -92,7 +92,7 @@
|
||||
return;
|
||||
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
if ([pasteboard respondsToSelector:@selector( setItems:options: )])
|
||||
if (@available(iOS 10.0, *))
|
||||
[pasteboard setItems:@[ @{ UIPasteboardTypeAutomatic: sitePassword } ]
|
||||
options:@{
|
||||
UIPasteboardOptionLocalOnly : @NO,
|
||||
|
@@ -677,7 +677,7 @@
|
||||
[self.window endEditing:YES];
|
||||
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
if ([pasteboard respondsToSelector:@selector( setItems:options: )]) {
|
||||
if (@available(iOS 10.0, *)) {
|
||||
[pasteboard setItems:@[ @{ UIPasteboardTypeAutomatic: password } ]
|
||||
options:@{
|
||||
UIPasteboardOptionLocalOnly : @NO,
|
||||
|
@@ -83,7 +83,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) {
|
||||
|
||||
NSURL *pasteboardURL = nil;
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
if ([pasteboard respondsToSelector:@selector( hasURLs )])
|
||||
if (@available(iOS 10.0, *))
|
||||
pasteboardURL = pasteboard.hasURLs? pasteboard.URL: nil;
|
||||
else
|
||||
pasteboardURL = [NSURL URLWithString:pasteboard.string];
|
||||
@@ -352,7 +352,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) {
|
||||
} );
|
||||
} );
|
||||
|
||||
[MPiOSAppDelegate managedObjectContextChanged:^(NSDictionary<NSManagedObjectID *, NSString *> *affectedObjects) {
|
||||
[[MPiOSAppDelegate get] managedObjectContextChanged:^(NSDictionary<NSManagedObjectID *, NSString *> *affectedObjects) {
|
||||
[MPiOSAppDelegate managedObjectContextForMainThreadPerformBlock:^(NSManagedObjectContext *mainContext) {
|
||||
// TODO: either move this into the app delegate or remove the duplicate signOutAnimated: call from the app delegate.
|
||||
if (![[MPiOSAppDelegate get] activeUserInContext:mainContext])
|
||||
|
@@ -697,7 +697,7 @@ referenceSizeForFooterInSection:(NSInteger)section {
|
||||
} );
|
||||
|
||||
if ((self.contextChangedObserver
|
||||
= [MPiOSAppDelegate managedObjectContextChanged:^(NSDictionary<NSManagedObjectID *, NSString *> *affectedObjects) {
|
||||
= [[MPiOSAppDelegate get] managedObjectContextChanged:^(NSDictionary<NSManagedObjectID *, NSString *> *affectedObjects) {
|
||||
if ([[[affectedObjects allKeys] filteredArrayUsingPredicate:
|
||||
[NSPredicate predicateWithBlock:^BOOL(NSManagedObjectID *objectID, NSDictionary *bindings) {
|
||||
return [objectID.entity.name isEqualToString:NSStringFromClass( [MPUserEntity class] )];
|
||||
|
Reference in New Issue
Block a user