Skip to content

Commit 23db712

Browse files
committed
Lessen AppCore dependency, remove double-define
Fixes #15 and fixes #16
1 parent e8c6d2c commit 23db712

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

APCAppCore/APCAppCore/DataSubstrate/Model/APCDateRange.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
//
3333

3434
#import "APCDateRange.h"
35-
#import "APCAppCore.h"
35+
#import "NSDate+Helper.h"
3636

3737
@implementation APCDateRange
3838

APCAppCore/APCAppCore/Library/Objects/APCTasksReminderManager.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,17 @@
3232
//
3333

3434
#import "APCTasksReminderManager.h"
35-
#import "APCAppCore.h"
35+
#import "APCAppDelegate.h"
36+
#import "APCScheduledTask+AddOn.h"
37+
#import "APCResult+AddOn.h"
38+
3639
#import "APCConstants.h"
40+
#import "APCLog.h"
41+
#import "NSDate+Helper.h"
42+
#import "NSDictionary+APCAdditions.h"
43+
#import "NSManagedObject+APCHelper.h"
44+
45+
#import <UIKit/UIKit.h>
3746

3847
NSString * const kTaskReminderUserInfo = @"CurrentTaskReminder";
3948
NSString * const kSubtaskReminderUserInfo = @"CurrentSubtaskReminder";
@@ -160,7 +169,8 @@ - (void) createTaskReminder {
160169
{
161170
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert
162171
|UIUserNotificationTypeBadge
163-
|UIUserNotificationTypeSound) categories:[APCTasksReminderManager taskReminderCategories]];
172+
|UIUserNotificationTypeSound)
173+
categories:[APCTasksReminderManager taskReminderCategories]];
164174

165175
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
166176
[[NSUserDefaults standardUserDefaults]synchronize];

APCAppCore/APCAppCore/Library/Permissions/APCPermissionsManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
//
3333

3434
#import <Foundation/Foundation.h>
35-
#import "APCAppCore.h"
3635
#import "APCConstants.h"
3736

3837
typedef void(^APCPermissionsBlock)(BOOL granted, NSError *error);

APCAppCore/APCAppCore/Library/Permissions/APCPermissionsManager.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
//
3333

3434
#import "APCPermissionsManager.h"
35+
#import "APCUserInfoConstants.h"
36+
#import "APCTasksReminderManager.h"
3537

38+
#import <UIKit/UIKit.h>
3639
#import <CoreMotion/CoreMotion.h>
3740
#import <CoreLocation/CoreLocation.h>
3841
#import <HealthKit/HealthKit.h>

APCAppCore/APCAppCore/Startup/APCAppDelegate.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,9 @@ - (NSInteger) numberOfServicesInPermissionsListForOnboardingTask: (APCOnboarding
11771177

11781178
- (void)passcodeViewControllerDidSucceed:(APCPasscodeViewController *) __unused viewController
11791179
{
1180+
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:kLastUsedTimeKey];
1181+
[[NSUserDefaults standardUserDefaults] synchronize];
1182+
11801183
self.isPasscodeShowing = NO;
11811184
}
11821185

APCAppCore/APCAppCore/Startup/APCTabBarViewController.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333

3434

3535
#import "APCTabBarViewController.h"
36-
#import "APCAppCore.h"
36+
#import "APCPasscodeViewController.h"
3737

38-
static NSString *const kLastUsedTimeKey = @"APHLastUsedTime";
3938

4039
@interface APCTabBarViewController () <APCPasscodeViewControllerDelegate>
4140
@property (nonatomic) BOOL isPasscodeShowing;
@@ -54,7 +53,7 @@ - (void)setShowPasscodeScreen:(BOOL)showPasscodeScreen
5453
- (void)showPasscode
5554
{
5655
if (!self.isPasscodeShowing) {
57-
APCPasscodeViewController *passcodeViewController = [[UIStoryboard storyboardWithName:@"APCPasscode" bundle:[NSBundle appleCoreBundle]] instantiateInitialViewController];
56+
APCPasscodeViewController *passcodeViewController = [[UIStoryboard storyboardWithName:@"APCPasscode" bundle:[NSBundle bundleForClass:[self class]]] instantiateInitialViewController];
5857
passcodeViewController.delegate = self;
5958
UIViewController * presentVC = self.presentedViewController ? self.presentedViewController : self;
6059
[presentVC presentViewController:passcodeViewController animated:YES completion:nil];
@@ -67,8 +66,6 @@ - (void)passcodeViewControllerDidSucceed:(APCPasscodeViewController *)viewContro
6766
self.isPasscodeShowing = NO;
6867
self.showPasscodeScreen = NO;
6968
[viewController dismissViewControllerAnimated:YES completion:nil];
70-
[[NSUserDefaults standardUserDefaults] setObject: [NSDate date] forKey:kLastUsedTimeKey];
71-
[[NSUserDefaults standardUserDefaults] synchronize];
7269
if ([self.passcodeDelegate respondsToSelector:@selector(passcodeViewControllerDidSucceed:)]) {
7370
[self.passcodeDelegate passcodeViewControllerDidSucceed: viewController];
7471
}

APCAppCore/APCAppCore/UI/ViewControllers/APCPasscodeViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#import "APCKeychainStore.h"
4141
#import "APCUserInfoConstants.h"
4242
#import "UIImage+APCHelper.h"
43-
#import "APCAppCore.h"
43+
#import "APCLog.h"
4444

4545
@interface APCPasscodeViewController ()<APCPasscodeViewDelegate>
4646

@@ -84,7 +84,6 @@ - (void)viewDidLoad {
8484
- (void)viewWillAppear:(BOOL)animated
8585
{
8686
[super viewWillAppear:animated];
87-
8887
APCLogViewControllerAppeared();
8988
}
9089

0 commit comments

Comments
 (0)