This plugin provide customizable app group.
Because app group is strong bound to AppleID, it is hard to distribute iOS project using app group. This plugin enable each user to customize app group name at setup phase. This make easy to distribute your iOS project.
- CocoaPods 0.36
gem install cocoapods-app_group
1. Setup Podfile
Put followings to
target 'WriteToAppGroup' target 'ReadFromAppGroup' plugin 'cocoapods-app_group'
pod install will prompt for the keys not yet set and you can ensure everyone has the same setup.
2. Save app group name
Save group name by running following command:
pod app-group GROUP_NAME
3. Generate wrapper class
Generate wrapper class by running following command:
4. Enable app group of each target
*.xcworkspace and enable app group of each target. Use
group.$(APP_IDENTIFIER) as app group name.
5. Write code
Write code using wrapper class:
#import <Foundation/Foundation.h> @interface AppGroup : NSObject + (NSString *)appGroupID; + (NSString *)pathForResource:(NSString *)subpath; + (NSUserDefaults*)userDefaults; @end
Using at swift project
Using the bridge header
If you want to make your keys available to your whole project:
- Make sure you have a bridging header already setup.
- In the bridging header, import the generated key file:
Importing the framework
If you've added the
use_frameworks! and only want your Keys to be available in
specific files, simply use Swift's
import statement. The name of the generated
This was built with a lot of help from @banjun.
How to work
I explain how to work at Japanese document.
The gem is available as open source under the terms of the MIT License.