Skip to content
Permalink
Browse files

tvOS targets

  • Loading branch information...
Coeur committed Jun 20, 2019
1 parent 2f1696e commit 5e8635424d53b978feda821d225b5f7b1901ee5f
@@ -74,6 +74,24 @@ matrix:
xcode_scheme: libMagicalRecord for OS X
xcode_destination: platform=OS X
env: DEVICE="OS X 10.11"
- osx_image: xcode10.2
xcode_scheme: MagicalRecord for tvOS
xcode_destination: platform=tvOS Simulator,OS=12.2,name=Apple TV 4K (at 1080p)
env: DEVICE="Apple TV 4K (at 1080p) (12.2)"
- osx_image: xcode10.2
xcode_scheme: libMagicalRecord for tvOS
xcode_destination: platform=tvOS Simulator,OS=12.2,name=Apple TV 4K (at 1080p)
env: DEVICE="Apple TV 4K (at 1080p) (12.2)"
# Xcode 7.3 gives "Platform 'appletvos' is not yet supported.", so we use Xcode 8.0 as minimal requirement
- osx_image: xcode8.0
xcode_scheme: MagicalRecord for tvOS
xcode_destination: platform=tvOS Simulator,OS=9.0,name=Apple TV 1080p
env: DEVICE="Apple TV 1080p (9.0)"
# Xcode 7.3 gives "Platform 'appletvos' is not yet supported.", so we use Xcode 8.0 as minimal requirement
- osx_image: xcode8.0
xcode_scheme: libMagicalRecord for tvOS
xcode_destination: platform=tvOS Simulator,OS=9.0,name=Apple TV 1080p
env: DEVICE="Apple TV 1080p (9.0)"

env:
global:
@@ -10,6 +10,7 @@ Pod::Spec.new do |s|
s.description = 'Handy fetching, threading and data import helpers to make Core Data a little easier to use.'
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.8'
s.tvos.deployment_target = '9.0'

s.subspec 'Core' do |sp|
sp.framework = 'CoreData'

Large diffs are not rendered by default.

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "37CA2606229FEB7000EAB9F6"
BuildableName = "MagicalRecord.framework"
BlueprintName = "MagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "37CA260E229FEB7000EAB9F6"
BuildableName = "MagicalRecord for tvOS Tests.xctest"
BlueprintName = "MagicalRecord for tvOS Tests"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "37CA2606229FEB7000EAB9F6"
BuildableName = "MagicalRecord.framework"
BlueprintName = "MagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "37CA2606229FEB7000EAB9F6"
BuildableName = "MagicalRecord.framework"
BlueprintName = "MagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "-com.apple.CoreData.ConcurrencyDebug 1"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "37CA2606229FEB7000EAB9F6"
BuildableName = "MagicalRecord.framework"
BlueprintName = "MagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3790044822BB51880087D3FC"
BuildableName = "libMagicalRecord.a"
BlueprintName = "libMagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3790045522BB51DD0087D3FC"
BuildableName = "libMagicalRecord for tvOS Tests.xctest"
BlueprintName = "libMagicalRecord for tvOS Tests"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3790044822BB51880087D3FC"
BuildableName = "libMagicalRecord.a"
BlueprintName = "libMagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3790044822BB51880087D3FC"
BuildableName = "libMagicalRecord.a"
BlueprintName = "libMagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "-com.apple.CoreData.ConcurrencyDebug 1"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3790044822BB51880087D3FC"
BuildableName = "libMagicalRecord.a"
BlueprintName = "libMagicalRecord for tvOS"
ReferencedContainer = "container:MagicalRecord.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -45,6 +45,8 @@ OBJC_EXPORT NSString * __MR_nonnull const kMagicalRecordDidMergeChangesFromiClou
*/
- (void) MR_observeContextOnMainThread:(MR_nonnull NSManagedObjectContext *)otherContext;

#if TARGET_OS_OSX || TARGET_OS_IOS

/**
Merges changes from the supplied persistent store coordinator into self in response to changes from iCloud.
@@ -67,4 +69,6 @@ OBJC_EXPORT NSString * __MR_nonnull const kMagicalRecordDidMergeChangesFromiClou
*/
- (void) MR_stopObservingiCloudChangesInCoordinator:(MR_nonnull NSPersistentStoreCoordinator *)coordinator;

#endif

@end
@@ -85,6 +85,8 @@ - (void) MR_mergeChangesOnMainThread:(NSNotification *)notification
}
}

#if TARGET_OS_OSX || TARGET_OS_IOS

- (void) MR_observeiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator
{
if (![MagicalRecord isICloudEnabled]) return;
@@ -105,4 +107,6 @@ - (void) MR_stopObservingiCloudChangesInCoordinator:(NSPersistentStoreCoordinato
object:coordinator];
}

#endif

@end
@@ -263,17 +263,19 @@ + (void) MR_setDefaultContext:(NSManagedObjectContext *)moc
[[NSNotificationCenter defaultCenter] removeObserver:MagicalRecordDefaultContext];
}

NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_defaultStoreCoordinator];
if (MagicalRecordUbiquitySetupNotificationObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:MagicalRecordUbiquitySetupNotificationObserver];
MagicalRecordUbiquitySetupNotificationObserver = nil;
}

#if TARGET_OS_OSX || TARGET_OS_IOS
NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_defaultStoreCoordinator];
if ([MagicalRecord isICloudEnabled])
{
[MagicalRecordDefaultContext MR_stopObservingiCloudChangesInCoordinator:coordinator];
}
#endif

MagicalRecordDefaultContext = moc;
[MagicalRecordDefaultContext MR_setWorkingName:@"MagicalRecord Default Context"];
@@ -286,6 +288,7 @@ + (void) MR_setDefaultContext:(NSManagedObjectContext *)moc
}

[moc MR_obtainPermanentIDsBeforeSaving];
#if TARGET_OS_OSX || TARGET_OS_IOS
if ([MagicalRecord isICloudEnabled])
{
[MagicalRecordDefaultContext MR_observeiCloudChangesInCoordinator:coordinator];
@@ -300,6 +303,7 @@ + (void) MR_setDefaultContext:(NSManagedObjectContext *)moc
[[NSManagedObjectContext MR_defaultContext] MR_observeiCloudChangesInCoordinator:coordinator];
}];
}
#endif
MRLogInfo(@"Set default context: %@", MagicalRecordDefaultContext);
}

@@ -30,11 +30,13 @@ OBJC_EXPORT NSString * __MR_nonnull const kMagicalRecordPSCMismatchCouldNotRecre
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreAtURL:(MR_nonnull NSURL *)storeURL;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithAutoMigratingSqliteStoreAtURL:(MR_nonnull NSURL *)storeURL;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithPersistentStore:(MR_nonnull NSPersistentStore *)persistentStore;
#if TARGET_OS_OSX || TARGET_OS_IOS
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;

+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionHandler;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionHandler;
#endif

- (MR_nullable NSPersistentStore *) MR_addInMemoryStore;
- (MR_nullable NSPersistentStore *) MR_addAutoMigratingSqliteStoreNamed:(MR_nonnull NSString *) storeFileName;
@@ -43,9 +45,11 @@ OBJC_EXPORT NSString * __MR_nonnull const kMagicalRecordPSCMismatchCouldNotRecre
- (MR_nullable NSPersistentStore *) MR_addSqliteStoreNamed:(MR_nonnull id)storeFileName withOptions:(MR_nullable __autoreleasing NSDictionary *)options;
- (MR_nullable NSPersistentStore *) MR_addSqliteStoreNamed:(MR_nonnull id)storeFileName configuration:(MR_nullable NSString *)configuration withOptions:(MR_nullable __autoreleasing NSDictionary *)options;

#if TARGET_OS_OSX || TARGET_OS_IOS
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionBlock;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionBlock;
#endif

@end
@@ -140,6 +140,8 @@ - (NSPersistentStore *) MR_addSqliteStoreNamed:(id)storeFileName configuration:(
return store;
}

#if TARGET_OS_OSX || TARGET_OS_IOS

- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey storeIdentifier:(id)storeIdentifier cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock
{
if (contentNameKey.length > 0)
@@ -210,6 +212,7 @@ - (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSStrin
});
}

#endif


#pragma mark - Public Instance Methods
@@ -308,6 +311,8 @@ + (NSPersistentStoreCoordinator *) MR_newPersistentStoreCoordinator
return coordinator;
}

#if TARGET_OS_OSX || TARGET_OS_IOS

- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent
{
[self MR_addiCloudContainerID:containerID
@@ -404,6 +409,8 @@ + (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString
return psc;
}

#endif

+ (NSPersistentStoreCoordinator *) MR_coordinatorWithPersistentStore:(NSPersistentStore *)persistentStore
{
NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel];
@@ -13,6 +13,7 @@

+ (BOOL)isICloudEnabled;

#if TARGET_OS_OSX || TARGET_OS_IOS
+ (void)setupCoreDataStackWithiCloudContainer:(MR_nonnull NSString *)containerID
localStoreNamed:(MR_nonnull NSString *)localStore;

@@ -40,5 +41,6 @@
localStoreAtURL:(MR_nonnull NSURL *)storeURL
cloudStorePathComponent:(MR_nullable NSString *)pathSubcomponent
completion:(void (^ __MR_nullable)(void))completion;
#endif

@end

0 comments on commit 5e86354

Please sign in to comment.
You can’t perform that action at this time.