diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..9b7e92e --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +PRIMARY AUTHORS +Kevin Renskers - https://github.com/kevinrenskers diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..66c610e --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,2 @@ +0.1.0 - December 18, 2012 +- First public release on CocoaPods. diff --git a/Example/AppDelegate.h b/Example/AppDelegate.h new file mode 100644 index 0000000..67c77c9 --- /dev/null +++ b/Example/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Example +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Example/AppDelegate.m b/Example/AppDelegate.m new file mode 100644 index 0000000..e5dc6c4 --- /dev/null +++ b/Example/AppDelegate.m @@ -0,0 +1,21 @@ +// +// AppDelegate.m +// Example +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + // Override point for customization after application launch. + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/Example/Default-568h@2x.png b/Example/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/Example/Default-568h@2x.png differ diff --git a/Example/Default.png b/Example/Default.png new file mode 100644 index 0000000..4c8ca6f Binary files /dev/null and b/Example/Default.png differ diff --git a/Example/Default@2x.png b/Example/Default@2x.png new file mode 100644 index 0000000..35b84cf Binary files /dev/null and b/Example/Default@2x.png differ diff --git a/Example/Example-Info.plist b/Example/Example-Info.plist new file mode 100644 index 0000000..6530e68 --- /dev/null +++ b/Example/Example-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + is.gangverk.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/Example-Prefix.pch b/Example/Example-Prefix.pch new file mode 100644 index 0000000..16fc7c2 --- /dev/null +++ b/Example/Example-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'Example' target in the 'Example' project +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3f48552 --- /dev/null +++ b/Example/Example.xcodeproj/project.pbxproj @@ -0,0 +1,479 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0AD6F3601680DCD400E13802 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD6F35F1680DCD400E13802 /* UIKit.framework */; }; + 0AD6F3621680DCD400E13802 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD6F3611680DCD400E13802 /* Foundation.framework */; }; + 0AD6F3641680DCD400E13802 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD6F3631680DCD400E13802 /* CoreGraphics.framework */; }; + 0AD6F37E1680DCD400E13802 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD6F37D1680DCD400E13802 /* SenTestingKit.framework */; }; + 0AD6F37F1680DCD400E13802 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD6F35F1680DCD400E13802 /* UIKit.framework */; }; + 0AD6F3801680DCD400E13802 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD6F3611680DCD400E13802 /* Foundation.framework */; }; + 0AD6F3881680DCD400E13802 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3861680DCD400E13802 /* InfoPlist.strings */; }; + 0AD6F38B1680DCD400E13802 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AD6F38A1680DCD400E13802 /* ExampleTests.m */; }; + 0AD6F3AF1680DDD000E13802 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3A21680DDD000E13802 /* InfoPlist.strings */; }; + 0AD6F3B01680DDD000E13802 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AD6F3A51680DDD000E13802 /* AppDelegate.m */; }; + 0AD6F3B11680DDD000E13802 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3A61680DDD000E13802 /* Default-568h@2x.png */; }; + 0AD6F3B21680DDD000E13802 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3A71680DDD000E13802 /* Default.png */; }; + 0AD6F3B31680DDD000E13802 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3A81680DDD000E13802 /* Default@2x.png */; }; + 0AD6F3B51680DDD000E13802 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AD6F3AE1680DDD000E13802 /* main.m */; }; + 0AD6F3B91680DE0600E13802 /* GVUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AD6F3B81680DE0600E13802 /* GVUserDefaults.m */; }; + 0AD6F3C41680DF3900E13802 /* GVUserDefaults+Mine.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AD6F3C31680DF3800E13802 /* GVUserDefaults+Mine.m */; }; + 0AD6F3DD168123C900E13802 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3DA168123C800E13802 /* CHANGELOG */; }; + 0AD6F3DE168123C900E13802 /* GVUserDefaults.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3DB168123C800E13802 /* GVUserDefaults.podspec */; }; + 0AD6F3DF168123C900E13802 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 0AD6F3DC168123C800E13802 /* README.md */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 0AD6F3811680DCD400E13802 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0AD6F3521680DCD400E13802 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0AD6F35A1680DCD400E13802; + remoteInfo = Example; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0AD6F35B1680DCD400E13802 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0AD6F35F1680DCD400E13802 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 0AD6F3611680DCD400E13802 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 0AD6F3631680DCD400E13802 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 0AD6F37C1680DCD400E13802 /* ExampleTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; + 0AD6F37D1680DCD400E13802 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 0AD6F3851680DCD400E13802 /* ExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ExampleTests-Info.plist"; sourceTree = ""; }; + 0AD6F3871680DCD400E13802 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 0AD6F3891680DCD400E13802 /* ExampleTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExampleTests.h; sourceTree = ""; }; + 0AD6F38A1680DCD400E13802 /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = ""; }; + 0AD6F3A31680DDD000E13802 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; + 0AD6F3A41680DDD000E13802 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; }; + 0AD6F3A51680DDD000E13802 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; }; + 0AD6F3A61680DDD000E13802 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; + 0AD6F3A71680DDD000E13802 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = SOURCE_ROOT; }; + 0AD6F3A81680DDD000E13802 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = SOURCE_ROOT; }; + 0AD6F3A91680DDD000E13802 /* Example-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Example-Info.plist"; sourceTree = SOURCE_ROOT; }; + 0AD6F3AA1680DDD000E13802 /* Example-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Example-Prefix.pch"; sourceTree = SOURCE_ROOT; }; + 0AD6F3AE1680DDD000E13802 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; }; + 0AD6F3B71680DE0600E13802 /* GVUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GVUserDefaults.h; sourceTree = ""; }; + 0AD6F3B81680DE0600E13802 /* GVUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GVUserDefaults.m; sourceTree = ""; }; + 0AD6F3C21680DF3800E13802 /* GVUserDefaults+Mine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GVUserDefaults+Mine.h"; sourceTree = ""; }; + 0AD6F3C31680DF3800E13802 /* GVUserDefaults+Mine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GVUserDefaults+Mine.m"; sourceTree = ""; }; + 0AD6F3DA168123C800E13802 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CHANGELOG; path = ../CHANGELOG; sourceTree = ""; }; + 0AD6F3DB168123C800E13802 /* GVUserDefaults.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GVUserDefaults.podspec; path = ../GVUserDefaults.podspec; sourceTree = ""; }; + 0AD6F3DC168123C800E13802 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0AD6F3581680DCD400E13802 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AD6F3601680DCD400E13802 /* UIKit.framework in Frameworks */, + 0AD6F3621680DCD400E13802 /* Foundation.framework in Frameworks */, + 0AD6F3641680DCD400E13802 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0AD6F3781680DCD400E13802 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AD6F37E1680DCD400E13802 /* SenTestingKit.framework in Frameworks */, + 0AD6F37F1680DCD400E13802 /* UIKit.framework in Frameworks */, + 0AD6F3801680DCD400E13802 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0AD6F3501680DCD400E13802 = { + isa = PBXGroup; + children = ( + 0AD6F3B61680DE0600E13802 /* GVUserDefaults */, + 0AD6F3651680DCD400E13802 /* Example */, + 0AD6F3831680DCD400E13802 /* ExampleTests */, + 0AD6F35E1680DCD400E13802 /* Frameworks */, + 0AD6F35C1680DCD400E13802 /* Products */, + 0AD6F3DA168123C800E13802 /* CHANGELOG */, + 0AD6F3DB168123C800E13802 /* GVUserDefaults.podspec */, + 0AD6F3DC168123C800E13802 /* README.md */, + ); + sourceTree = ""; + }; + 0AD6F35C1680DCD400E13802 /* Products */ = { + isa = PBXGroup; + children = ( + 0AD6F35B1680DCD400E13802 /* Example.app */, + 0AD6F37C1680DCD400E13802 /* ExampleTests.octest */, + ); + name = Products; + sourceTree = ""; + }; + 0AD6F35E1680DCD400E13802 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0AD6F35F1680DCD400E13802 /* UIKit.framework */, + 0AD6F3611680DCD400E13802 /* Foundation.framework */, + 0AD6F3631680DCD400E13802 /* CoreGraphics.framework */, + 0AD6F37D1680DCD400E13802 /* SenTestingKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 0AD6F3651680DCD400E13802 /* Example */ = { + isa = PBXGroup; + children = ( + 0AD6F3C21680DF3800E13802 /* GVUserDefaults+Mine.h */, + 0AD6F3C31680DF3800E13802 /* GVUserDefaults+Mine.m */, + 0AD6F3A41680DDD000E13802 /* AppDelegate.h */, + 0AD6F3A51680DDD000E13802 /* AppDelegate.m */, + 0AD6F3A61680DDD000E13802 /* Default-568h@2x.png */, + 0AD6F3A71680DDD000E13802 /* Default.png */, + 0AD6F3A81680DDD000E13802 /* Default@2x.png */, + 0AD6F3A91680DDD000E13802 /* Example-Info.plist */, + 0AD6F3AA1680DDD000E13802 /* Example-Prefix.pch */, + 0AD6F3AE1680DDD000E13802 /* main.m */, + 0AD6F3A11680DDD000E13802 /* en.lproj */, + ); + name = Example; + sourceTree = SOURCE_ROOT; + }; + 0AD6F3831680DCD400E13802 /* ExampleTests */ = { + isa = PBXGroup; + children = ( + 0AD6F3891680DCD400E13802 /* ExampleTests.h */, + 0AD6F38A1680DCD400E13802 /* ExampleTests.m */, + 0AD6F3841680DCD400E13802 /* Supporting Files */, + ); + path = ExampleTests; + sourceTree = ""; + }; + 0AD6F3841680DCD400E13802 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 0AD6F3851680DCD400E13802 /* ExampleTests-Info.plist */, + 0AD6F3861680DCD400E13802 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 0AD6F3A11680DDD000E13802 /* en.lproj */ = { + isa = PBXGroup; + children = ( + 0AD6F3A21680DDD000E13802 /* InfoPlist.strings */, + ); + path = en.lproj; + sourceTree = SOURCE_ROOT; + }; + 0AD6F3B61680DE0600E13802 /* GVUserDefaults */ = { + isa = PBXGroup; + children = ( + 0AD6F3B71680DE0600E13802 /* GVUserDefaults.h */, + 0AD6F3B81680DE0600E13802 /* GVUserDefaults.m */, + ); + name = GVUserDefaults; + path = ../GVUserDefaults; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 0AD6F35A1680DCD400E13802 /* Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0AD6F38E1680DCD400E13802 /* Build configuration list for PBXNativeTarget "Example" */; + buildPhases = ( + 0AD6F3571680DCD400E13802 /* Sources */, + 0AD6F3581680DCD400E13802 /* Frameworks */, + 0AD6F3591680DCD400E13802 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Example; + productName = Example; + productReference = 0AD6F35B1680DCD400E13802 /* Example.app */; + productType = "com.apple.product-type.application"; + }; + 0AD6F37B1680DCD400E13802 /* ExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0AD6F3911680DCD400E13802 /* Build configuration list for PBXNativeTarget "ExampleTests" */; + buildPhases = ( + 0AD6F3771680DCD400E13802 /* Sources */, + 0AD6F3781680DCD400E13802 /* Frameworks */, + 0AD6F3791680DCD400E13802 /* Resources */, + 0AD6F37A1680DCD400E13802 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 0AD6F3821680DCD400E13802 /* PBXTargetDependency */, + ); + name = ExampleTests; + productName = ExampleTests; + productReference = 0AD6F37C1680DCD400E13802 /* ExampleTests.octest */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0AD6F3521680DCD400E13802 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = Gangverk; + }; + buildConfigurationList = 0AD6F3551680DCD400E13802 /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 0AD6F3501680DCD400E13802; + productRefGroup = 0AD6F35C1680DCD400E13802 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 0AD6F35A1680DCD400E13802 /* Example */, + 0AD6F37B1680DCD400E13802 /* ExampleTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 0AD6F3591680DCD400E13802 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AD6F3AF1680DDD000E13802 /* InfoPlist.strings in Resources */, + 0AD6F3B11680DDD000E13802 /* Default-568h@2x.png in Resources */, + 0AD6F3B21680DDD000E13802 /* Default.png in Resources */, + 0AD6F3B31680DDD000E13802 /* Default@2x.png in Resources */, + 0AD6F3DD168123C900E13802 /* CHANGELOG in Resources */, + 0AD6F3DE168123C900E13802 /* GVUserDefaults.podspec in Resources */, + 0AD6F3DF168123C900E13802 /* README.md in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0AD6F3791680DCD400E13802 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AD6F3881680DCD400E13802 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 0AD6F37A1680DCD400E13802 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 0AD6F3571680DCD400E13802 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AD6F3B01680DDD000E13802 /* AppDelegate.m in Sources */, + 0AD6F3B51680DDD000E13802 /* main.m in Sources */, + 0AD6F3B91680DE0600E13802 /* GVUserDefaults.m in Sources */, + 0AD6F3C41680DF3900E13802 /* GVUserDefaults+Mine.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0AD6F3771680DCD400E13802 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AD6F38B1680DCD400E13802 /* ExampleTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 0AD6F3821680DCD400E13802 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 0AD6F35A1680DCD400E13802 /* Example */; + targetProxy = 0AD6F3811680DCD400E13802 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 0AD6F3861680DCD400E13802 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 0AD6F3871680DCD400E13802 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 0AD6F3A21680DDD000E13802 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 0AD6F3A31680DDD000E13802 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 0AD6F38C1680DCD400E13802 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 0AD6F38D1680DCD400E13802 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 0AD6F38F1680DCD400E13802 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Example-Prefix.pch"; + INFOPLIST_FILE = "Example-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 0AD6F3901680DCD400E13802 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Example-Prefix.pch"; + INFOPLIST_FILE = "Example-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 0AD6F3921680DCD400E13802 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SDKROOT)/Developer/Library/Frameworks\"", + "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Example-Prefix.pch"; + INFOPLIST_FILE = "ExampleTests/ExampleTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Debug; + }; + 0AD6F3931680DCD400E13802 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SDKROOT)/Developer/Library/Frameworks\"", + "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Example/Example-Prefix.pch"; + INFOPLIST_FILE = "ExampleTests/ExampleTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0AD6F3551680DCD400E13802 /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0AD6F38C1680DCD400E13802 /* Debug */, + 0AD6F38D1680DCD400E13802 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0AD6F38E1680DCD400E13802 /* Build configuration list for PBXNativeTarget "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0AD6F38F1680DCD400E13802 /* Debug */, + 0AD6F3901680DCD400E13802 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0AD6F3911680DCD400E13802 /* Build configuration list for PBXNativeTarget "ExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0AD6F3921680DCD400E13802 /* Debug */, + 0AD6F3931680DCD400E13802 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0AD6F3521680DCD400E13802 /* Project object */; +} diff --git a/Example/ExampleTests/ExampleTests-Info.plist b/Example/ExampleTests/ExampleTests-Info.plist new file mode 100644 index 0000000..42d70b3 --- /dev/null +++ b/Example/ExampleTests/ExampleTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + is.gangverk.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Example/ExampleTests/ExampleTests.h b/Example/ExampleTests/ExampleTests.h new file mode 100644 index 0000000..a1db732 --- /dev/null +++ b/Example/ExampleTests/ExampleTests.h @@ -0,0 +1,13 @@ +// +// ExampleTests.h +// ExampleTests +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import + +@interface ExampleTests : SenTestCase + +@end diff --git a/Example/ExampleTests/ExampleTests.m b/Example/ExampleTests/ExampleTests.m new file mode 100644 index 0000000..ddd0222 --- /dev/null +++ b/Example/ExampleTests/ExampleTests.m @@ -0,0 +1,48 @@ +// +// ExampleTests.m +// ExampleTests +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import "ExampleTests.h" +#import "GVUserDefaults+Mine.h" + +@implementation ExampleTests + +- (void)setUp { + [super setUp]; + + NSDictionary *defaults = @{ + @"NSUSerDefault:userName": @"default", + @"NSUSerDefault:userId": @1 + }; + + [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; +} + +- (void)tearDown { + // Tear-down code here. + [super tearDown]; +} + +- (void)testDefaults { + STAssertEquals([GVUserDefaults standardUserDefaults].userName, @"default", @"username equals default"); + STAssertEquals([GVUserDefaults standardUserDefaults].userId, @1, @"userId equals 1"); +} + +- (void)testSetters { + [GVUserDefaults standardUserDefaults].userName = @"changed"; + [GVUserDefaults standardUserDefaults].userId = @2; + + STAssertEquals([GVUserDefaults standardUserDefaults].userName, @"changed", @"username equals changed"); + STAssertEquals([GVUserDefaults standardUserDefaults].userId, @2, @"userId equals 2"); +} + +- (void)testGetters { + STAssertEquals([GVUserDefaults standardUserDefaults].userName, [[NSUserDefaults standardUserDefaults] objectForKey:@"NSUSerDefault:userName"], @"username equals username"); + STAssertEquals([GVUserDefaults standardUserDefaults].userId, [[NSUserDefaults standardUserDefaults] objectForKey:@"NSUSerDefault:userId"], @"userId equals userId"); +} + +@end diff --git a/Example/ExampleTests/en.lproj/InfoPlist.strings b/Example/ExampleTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Example/ExampleTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Example/GVUserDefaults+Mine.h b/Example/GVUserDefaults+Mine.h new file mode 100644 index 0000000..33e21f3 --- /dev/null +++ b/Example/GVUserDefaults+Mine.h @@ -0,0 +1,16 @@ +// +// GVUserDefaults+Mine.h +// GVUserDefaults +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import "GVUserDefaults.h" + +@interface GVUserDefaults (Mine) + +@property NSString *userName; +@property NSNumber *userId; + +@end diff --git a/Example/GVUserDefaults+Mine.m b/Example/GVUserDefaults+Mine.m new file mode 100644 index 0000000..6f28f9e --- /dev/null +++ b/Example/GVUserDefaults+Mine.m @@ -0,0 +1,20 @@ +// +// GVUserDefaults+Mine.m +// GVUserDefaults +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import "GVUserDefaults+Mine.h" + +@implementation GVUserDefaults (Mine) + +- (NSString *)prefix { + return @"NSUSerDefault:"; +} + +@dynamic userName; +@dynamic userId; + +@end diff --git a/Example/en.lproj/InfoPlist.strings b/Example/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Example/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Example/main.m b/Example/main.m new file mode 100644 index 0000000..1e233fb --- /dev/null +++ b/Example/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Example +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/GVUserDefaults.podspec b/GVUserDefaults.podspec new file mode 100644 index 0000000..cd5746b --- /dev/null +++ b/GVUserDefaults.podspec @@ -0,0 +1,13 @@ +Pod::Spec.new do |s| + s.name = "GVUserDefaults" + s.version = "0.1.0" + s.summary = "NSUserDefaults access via properties." + s.homepage = "https://github.com/gangverk/GVUserDefaults" + s.license = 'MIT' + s.author = { "Kevin Renskers" => "info@mixedcase.nl" } + s.source = { :git => "https://github.com/gangverk/GVUserDefaults.git", :tag => s.version.to_s } + s.ios.deployment_target = '4.0' + s.osx.deployment_target = '10.6' + s.source_files = 'GVUserDefaults/*.{h,m}' + s.requires_arc = true +end diff --git a/GVUserDefaults/GVUserDefaults.h b/GVUserDefaults/GVUserDefaults.h new file mode 100644 index 0000000..938ce8b --- /dev/null +++ b/GVUserDefaults/GVUserDefaults.h @@ -0,0 +1,15 @@ +// +// GVUserDefaults.h +// GVUserDefaults +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import + +@interface GVUserDefaults : NSObject + ++ (GVUserDefaults *)standardUserDefaults; + +@end diff --git a/GVUserDefaults/GVUserDefaults.m b/GVUserDefaults/GVUserDefaults.m new file mode 100644 index 0000000..a8011ed --- /dev/null +++ b/GVUserDefaults/GVUserDefaults.m @@ -0,0 +1,62 @@ +// +// GVUserDefaults.m +// GVUserDefaults +// +// Created by Kevin Renskers on 18-12-12. +// Copyright (c) 2012 Gangverk. All rights reserved. +// + +#import "GVUserDefaults.h" +#import + +@implementation GVUserDefaults + ++ (GVUserDefaults *)standardUserDefaults { + static dispatch_once_t pred; + static GVUserDefaults *sharedInstance = nil; + dispatch_once(&pred, ^{ sharedInstance = [[self alloc] init]; }); + return sharedInstance; +} + ++ (BOOL)resolveInstanceMethod:(SEL)aSEL { + NSString *method = NSStringFromSelector(aSEL); + + if ([method isEqualToString:@"prefix"]) { + // Prevent endless loop for possibly non-existing prefix method + return [super resolveInstanceMethod:aSEL]; + } + + if ([method hasPrefix:@"set"]) { + class_addMethod([self class], aSEL, (IMP) accessorSetter, "v@:@"); + return YES; + } else { + class_addMethod([self class], aSEL, (IMP) accessorGetter, "@@:"); + return YES; + } +} + +- (NSString *)getPrefix { + if ([self respondsToSelector:@selector(prefix)]) { + return [self performSelector:@selector(prefix)]; + } + + return @""; +} + +id accessorGetter(id self, SEL _cmd) { + NSString *key = [NSString stringWithFormat:@"%@%@", [self getPrefix], NSStringFromSelector(_cmd)]; + return [[NSUserDefaults standardUserDefaults] objectForKey:key]; +} + +void accessorSetter(id self, SEL _cmd, id newValue) { + NSString *method = NSStringFromSelector(_cmd); + NSString *key = [[method stringByReplacingCharactersInRange:NSMakeRange(0, 3) withString:@""] stringByReplacingOccurrencesOfString:@":" withString:@""]; + key = [key stringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[key substringToIndex:1] lowercaseString]]; + key = [NSString stringWithFormat:@"%@%@", [self getPrefix], key]; + + // Set value of the key anID to newValue + [[NSUserDefaults standardUserDefaults] setObject:newValue forKey:key]; + [[NSUserDefaults standardUserDefaults] synchronize]; +} + +@end diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c7ce888 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Gangverk ehf. http://gangverk.is + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 38ebef8..e0a3fe7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,17 @@ -GVUserDefaults -============== +# GVUserDefaults - NSUserDefaults access via properties -NSUserDefaults access via properties. \ No newline at end of file + +## Issues and questions +Have a bug? Please [create an issue on GitHub](https://github.com/gangverk/GVUserDefaults/issues)! + + +## Contributing +GVUserDefaults is an open source project and your contribution is very much appreciated. + +1. Check for [open issues](https://github.com/gangverk/GVUserDefaults/issues) or [open a fresh issue](https://github.com/gangverk/GVUserDefaults/issues/new) to start a discussion around a feature idea or a bug. +2. Fork the [repository on Github](https://github.com/gangverk/GVUserDefaults) and make your changes on the **develop** branch (or branch off of it). +3. Make sure to add yourself to AUTHORS and send a pull request. + + +## License +GVUserDefaults is available under the MIT license. See the LICENSE file for more info.