Skip to content

Commit

Permalink
added Stanley submodule
Browse files Browse the repository at this point in the history
comments
change completion block on KAGAction to take an optional NSError
  • Loading branch information
willbur1984 committed May 5, 2017
1 parent 31f9442 commit e2c4444
Show file tree
Hide file tree
Showing 12 changed files with 218 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Vendor/Stanley"]
path = Vendor/Stanley
url = https://github.com/Kosoku/Stanley.git
95 changes: 93 additions & 2 deletions Agamotto.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@

/* Begin PBXBuildFile section */
072628281E70E49800511F80 /* Agamotto.h in Headers */ = {isa = PBXBuildFile; fileRef = 072628261E70E49800511F80 /* Agamotto.h */; settings = {ATTRIBUTES = (Public, ); }; };
075163B11EBD1AD700758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163B01EBD1AD700758A06 /* Stanley.framework */; };
075163B31EBD1ADF00758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163B21EBD1ADF00758A06 /* Stanley.framework */; };
075163B51EBD1AE600758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163B41EBD1AE600758A06 /* Stanley.framework */; };
075163B71EBD1AF000758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163B61EBD1AF000758A06 /* Stanley.framework */; };
075163B81EBD1B1500758A06 /* Agamotto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 072628231E70E49800511F80 /* Agamotto.framework */; };
075163B91EBD1B1500758A06 /* Agamotto.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 072628231E70E49800511F80 /* Agamotto.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
075163BC1EBD1B1F00758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163BB1EBD1B1F00758A06 /* Stanley.framework */; };
075163BD1EBD1B1F00758A06 /* Stanley.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 075163BB1EBD1B1F00758A06 /* Stanley.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
075163BE1EBD1B2A00758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163BB1EBD1B1F00758A06 /* Stanley.framework */; };
075163BF1EBD1B2A00758A06 /* Stanley.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 075163BB1EBD1B1F00758A06 /* Stanley.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
075163C11EBD1B3000758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163C01EBD1B3000758A06 /* Stanley.framework */; };
075163C21EBD1B3000758A06 /* Stanley.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 075163C01EBD1B3000758A06 /* Stanley.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
075163C41EBD1B3D00758A06 /* Stanley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 075163C31EBD1B3D00758A06 /* Stanley.framework */; };
075163C51EBD1B3D00758A06 /* Stanley.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 075163C31EBD1B3D00758A06 /* Stanley.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
077B15001EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B14FE1EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; };
077B15011EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B14FE1EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; };
077B15021EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 077B14FF1EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.m */; };
Expand Down Expand Up @@ -151,7 +165,6 @@
07DB3CC71E713B420089F7F5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 07DB3CC51E713B420089F7F5 /* Main.storyboard */; };
07DB3CC91E713B420089F7F5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 07DB3CC81E713B420089F7F5 /* Assets.xcassets */; };
07DB3CCC1E713B420089F7F5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 07DB3CCA1E713B420089F7F5 /* LaunchScreen.storyboard */; };
07DB3CD31E713B550089F7F5 /* Agamotto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 072628231E70E49800511F80 /* Agamotto.framework */; };
07ED26B01EB5144C007F5CBE /* KAGObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 07ED26AF1EB5144C007F5CBE /* KAGObserver.h */; settings = {ATTRIBUTES = (Public, ); }; };
07ED26B11EB5144C007F5CBE /* KAGObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 07ED26AF1EB5144C007F5CBE /* KAGObserver.h */; settings = {ATTRIBUTES = (Public, ); }; };
07ED26B21EB5144C007F5CBE /* KAGObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 07ED26AF1EB5144C007F5CBE /* KAGObserver.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -204,13 +217,26 @@
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
075163BA1EBD1B1500758A06 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
075163B91EBD1B1500758A06 /* Agamotto.framework in Embed Frameworks */,
075163BD1EBD1B1F00758A06 /* Stanley.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
07A547FF1E7C44BA00A6C4A1 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
07A547FC1E7C44BA00A6C4A1 /* Agamotto.framework in Embed Frameworks */,
075163BF1EBD1B2A00758A06 /* Stanley.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -222,6 +248,7 @@
dstSubfolderSpec = 10;
files = (
07A548591E7C4B3400A6C4A1 /* Agamotto.framework in Embed Frameworks */,
075163C21EBD1B3000758A06 /* Stanley.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -255,6 +282,7 @@
dstSubfolderSpec = 10;
files = (
07A548B11E7C4EF200A6C4A1 /* Agamotto.framework in Embed Frameworks */,
075163C51EBD1B3D00758A06 /* Stanley.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -266,6 +294,13 @@
072628261E70E49800511F80 /* Agamotto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Agamotto.h; sourceTree = "<group>"; };
072628271E70E49800511F80 /* Agamotto-iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Agamotto-iOS-Info.plist"; sourceTree = "<group>"; };
0726282D1E70E57300511F80 /* Agamotto-Info.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Agamotto-Info.h"; sourceTree = "<group>"; };
075163B01EBD1AD700758A06 /* Stanley.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Stanley.framework; path = "Vendor/Stanley/build/Debug-iphoneos/Stanley.framework"; sourceTree = "<group>"; };
075163B21EBD1ADF00758A06 /* Stanley.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Stanley.framework; path = Vendor/Stanley/build/Debug/Stanley.framework; sourceTree = "<group>"; };
075163B41EBD1AE600758A06 /* Stanley.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Stanley.framework; path = "Vendor/Stanley/build/Debug-appletvos/Stanley.framework"; sourceTree = "<group>"; };
075163B61EBD1AF000758A06 /* Stanley.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Stanley.framework; path = "Vendor/Stanley/build/Debug-watchos/Stanley.framework"; sourceTree = "<group>"; };
075163BB1EBD1B1F00758A06 /* Stanley.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Stanley.framework; sourceTree = BUILT_PRODUCTS_DIR; };
075163C01EBD1B3000758A06 /* Stanley.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Stanley.framework; sourceTree = BUILT_PRODUCTS_DIR; };
075163C31EBD1B3D00758A06 /* Stanley.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Stanley.framework; sourceTree = BUILT_PRODUCTS_DIR; };
077B14FE1EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIBarButtonItem+KAGExtensions.h"; path = "iOS/UIBarButtonItem+KAGExtensions.h"; sourceTree = "<group>"; };
077B14FF1EBCAF7E007454FD /* UIBarButtonItem+KAGExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIBarButtonItem+KAGExtensions.m"; path = "iOS/UIBarButtonItem+KAGExtensions.m"; sourceTree = "<group>"; };
077B15041EBCAFA6007454FD /* KAGAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KAGAction.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -352,13 +387,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
075163B11EBD1AD700758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
07A547D61E7C43FA00A6C4A1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
075163B31EBD1ADF00758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -367,13 +404,15 @@
buildActionMask = 2147483647;
files = (
07A547FB1E7C44BA00A6C4A1 /* Agamotto.framework in Frameworks */,
075163BE1EBD1B2A00758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
07A5481A1E7C4A6B00A6C4A1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
075163B51EBD1AE600758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -382,13 +421,15 @@
buildActionMask = 2147483647;
files = (
07A548581E7C4B3400A6C4A1 /* Agamotto.framework in Frameworks */,
075163C11EBD1B3000758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
07A5485E1E7C4CF300A6C4A1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
075163B71EBD1AF000758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -397,14 +438,16 @@
buildActionMask = 2147483647;
files = (
07A548B01E7C4EF200A6C4A1 /* Agamotto.framework in Frameworks */,
075163C41EBD1B3D00758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
07DB3CB71E713B420089F7F5 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
07DB3CD31E713B550089F7F5 /* Agamotto.framework in Frameworks */,
075163B81EBD1B1500758A06 /* Agamotto.framework in Frameworks */,
075163BC1EBD1B1F00758A06 /* Stanley.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -421,6 +464,7 @@
07A5486E1E7C4D6E00A6C4A1 /* AgamottoDemo-watchOS */,
07A5487D1E7C4D6E00A6C4A1 /* AgamottoDemo-watchOS Extension */,
072628241E70E49800511F80 /* Products */,
075163AF1EBD1AD600758A06 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -479,6 +523,20 @@
name = Source;
sourceTree = "<group>";
};
075163AF1EBD1AD600758A06 /* Frameworks */ = {
isa = PBXGroup;
children = (
075163C31EBD1B3D00758A06 /* Stanley.framework */,
075163C01EBD1B3000758A06 /* Stanley.framework */,
075163BB1EBD1B1F00758A06 /* Stanley.framework */,
075163B61EBD1AF000758A06 /* Stanley.framework */,
075163B41EBD1AE600758A06 /* Stanley.framework */,
075163B21EBD1ADF00758A06 /* Stanley.framework */,
075163B01EBD1AD700758A06 /* Stanley.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
07A547D41E7C431F00A6C4A1 /* Private */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -867,6 +925,7 @@
07DB3CB71E713B420089F7F5 /* Frameworks */,
07DB3CB81E713B420089F7F5 /* Resources */,
07A548961E7C4D6E00A6C4A1 /* Embed Watch Content */,
075163BA1EBD1B1500758A06 /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -1272,6 +1331,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug-iphoneos",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1337,6 +1400,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug-iphoneos",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "OSATOMIC_USE_INLINED=1";
Expand Down Expand Up @@ -1396,6 +1463,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug",
);
FRAMEWORK_VERSION = A;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
Expand Down Expand Up @@ -1460,6 +1531,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug",
);
FRAMEWORK_VERSION = A;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1615,6 +1690,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug-appletvos",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1678,6 +1757,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug-appletvos",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -1836,6 +1919,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug-watchos",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1900,6 +1987,10 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Vendor/Stanley/build/Debug-watchos",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
10 changes: 10 additions & 0 deletions Agamotto.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
<false/>
</dict>
</plist>
50 changes: 48 additions & 2 deletions Agamotto/KAGAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,65 @@

NS_ASSUME_NONNULL_BEGIN

typedef void(^KAGAsynchronousBlock)(dispatch_block_t completion);
/**
Typedef for a block that takes an NSError as its argument, signaling success or failure.
@param error The error or nil
*/
typedef void(^KAGErrorBlock)(NSError * _Nullable error);
/**
Typedef for a block that takes a KAGErrorBlock which the block should invoke upon completion of the async activity.
@param completion The block to invoke when the activity is complete
*/
typedef void(^KAGAsynchronousBlock)(KAGErrorBlock completion);

/**
KAGAction represents a repeatable action that can be assigned to various UI controls and executed when the user interacts with the control.
*/
@interface KAGAction : NSObject

/**
Set and get whether the receiver is enabled. The value of this property affects whether execute invokes the async block provided on initialization.
The default is NO.
*/
@property (assign,nonatomic,getter=isEnabled) BOOL enabled;
/**
Get whether the receiver is executing the provided async block.
The default is NO.
*/
@property (readonly,nonatomic,getter=isExecuting) BOOL executing;

/**
Creates and returns an instance of the receiver with the provided *asynchronousBlock* which will be invoked whenever the execute method is called.
@param asynchronousBlock The async block to invoke
@return The initialized instance
*/
- (instancetype)initWithAsynchronousBlock:(KAGAsynchronousBlock)asynchronousBlock NS_DESIGNATED_INITIALIZER;

+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;

- (void)addExecutionObserver:(id)observer completion:(dispatch_block_t)completion;
/**
Add an execution observer with the provided *completion* block that will be invoked whenever the *asynchronousBlock* provided above finishes executing. The observer can act on the provided error if necessary.
@param observer The execution observer
@param completion The block to invoke each time execution finishes
*/
- (void)addExecutionObserver:(id)observer completion:(KAGErrorBlock)completion;
/**
Remove an execution observer. This does not need to be called on dealloc, the receiver hold weak references to all execution observers.
@param observer The execution observer
*/
- (void)removeExecutionObserver:(id)observer;

/**
Invoke the provided *asynchronousBlock* and notify all execution observers when the blocks completion block is invoked.
*/
- (void)execute;

@end
Expand Down
Loading

0 comments on commit e2c4444

Please sign in to comment.