Sha256: b396b2e45f61305386bb9263745e9402f8e6df8956533d3593a430a67417bad9

Contents?: true

Size: 832 Bytes

Versions: 3

Compression:

Stored size: 832 Bytes

Contents

#import "AppGroup.h"

static NSString * const kAppIdentifier = @"<%= store.read :app_group %>";

@implementation AppGroup

+ (NSString *)appGroupID
{
    return [NSString stringWithFormat:@"group.%@", kAppIdentifier];
}

+ (NSString *)pathForResource:(NSString *)subpath
{
    NSString *containerPath = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[self appGroupID]].path;
    return [containerPath stringByAppendingPathComponent:subpath];
}

+ (NSURL *)urlForResource:(NSString *)subpath {
    NSURL *container = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[self appGroupID]];
    return [container URLByAppendingPathComponent:subpath];
}

+ (NSUserDefaults*)userDefaults
{
    return [[NSUserDefaults alloc] initWithSuiteName: [self appGroupID]];
}

@end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cocoapods-app_group-0.4.0 templates/AppGroup.m
cocoapods-app_group-0.3.0 templates/AppGroup.m
cocoapods-app_group-0.2.0 templates/AppGroup.m