mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 18:42:24 +00:00
Stubbed entry proxy to enable better model editing behaviour
This commit is contained in:
25
MacPass/MPEntryProxy.h
Normal file
25
MacPass/MPEntryProxy.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// MPEntryProxy.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 07/03/16.
|
||||
// Copyright © 2016 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/*
|
||||
Proxies the display of an entry to enable discardable changes to the entry
|
||||
*/
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class KPKEntry;
|
||||
|
||||
@interface MPEntryProxy : NSProxy
|
||||
|
||||
- (instancetype)initWithEntry:(KPKEntry *)entry;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
36
MacPass/MPEntryProxy.m
Normal file
36
MacPass/MPEntryProxy.m
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// MPEntryProxy.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 07/03/16.
|
||||
// Copyright © 2016 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPEntryProxy.h"
|
||||
#import <KeePassKit/KeePassKit.h>
|
||||
|
||||
@interface MPEntryProxy ()
|
||||
|
||||
@property (strong) KPKEntry *entry;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPEntryProxy
|
||||
|
||||
- (instancetype)initWithEntry:(KPKEntry *)entry {
|
||||
if(!entry) {
|
||||
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:nil userInfo:nil];
|
||||
}
|
||||
_entry = entry;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)forwardInvocation:(NSInvocation *)invocation {
|
||||
[invocation invokeWithTarget:self.entry];
|
||||
}
|
||||
|
||||
- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel {
|
||||
return [self.entry methodSignatureForSelector:sel];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user