├── .gitignore ├── .gitmodules ├── Code ├── OCHamcrestIOS.framework │ ├── Headers │ ├── OCHamcrestIOS │ ├── Resources │ └── Versions │ │ ├── A │ │ ├── Headers │ │ │ ├── HCAllOf.h │ │ │ ├── HCAnyOf.h │ │ │ ├── HCAssertThat.h │ │ │ ├── HCBaseDescription.h │ │ │ ├── HCBaseMatcher.h │ │ │ ├── HCBoxNumber.h │ │ │ ├── HCCollectMatchers.h │ │ │ ├── HCConformsToProtocol.h │ │ │ ├── HCDescribedAs.h │ │ │ ├── HCDescription.h │ │ │ ├── HCHasCount.h │ │ │ ├── HCHasDescription.h │ │ │ ├── HCHasProperty.h │ │ │ ├── HCInvocationMatcher.h │ │ │ ├── HCIs.h │ │ │ ├── HCIsAnything.h │ │ │ ├── HCIsCloseTo.h │ │ │ ├── HCIsCollectionContaining.h │ │ │ ├── HCIsCollectionContainingInAnyOrder.h │ │ │ ├── HCIsCollectionContainingInOrder.h │ │ │ ├── HCIsCollectionOnlyContaining.h │ │ │ ├── HCIsDictionaryContaining.h │ │ │ ├── HCIsDictionaryContainingEntries.h │ │ │ ├── HCIsDictionaryContainingKey.h │ │ │ ├── HCIsDictionaryContainingValue.h │ │ │ ├── HCIsEmptyCollection.h │ │ │ ├── HCIsEqual.h │ │ │ ├── HCIsEqualIgnoringCase.h │ │ │ ├── HCIsEqualIgnoringWhiteSpace.h │ │ │ ├── HCIsEqualToNumber.h │ │ │ ├── HCIsIn.h │ │ │ ├── HCIsInstanceOf.h │ │ │ ├── HCIsNil.h │ │ │ ├── HCIsNot.h │ │ │ ├── HCIsSame.h │ │ │ ├── HCMatcher.h │ │ │ ├── HCNumberAssert.h │ │ │ ├── HCOrderingComparison.h │ │ │ ├── HCRequireNonNilObject.h │ │ │ ├── HCRequireNonNilString.h │ │ │ ├── HCSelfDescribing.h │ │ │ ├── HCStringContains.h │ │ │ ├── HCStringContainsInOrder.h │ │ │ ├── HCStringDescription.h │ │ │ ├── HCStringEndsWith.h │ │ │ ├── HCStringStartsWith.h │ │ │ ├── HCSubstringMatcher.h │ │ │ ├── HCWrapInMatcher.h │ │ │ └── OCHamcrestIOS.h │ │ ├── OCHamcrestIOS │ │ └── Resources │ │ │ └── Info.plist │ │ └── Current ├── OCMockitoIOS.framework │ ├── Headers │ ├── OCMockitoIOS │ ├── Resources │ └── Versions │ │ ├── A │ │ ├── Headers │ │ │ ├── MKTBaseMockObject.h │ │ │ ├── MKTClassObjectMock.h │ │ │ ├── MKTObjectAndProtocolMock.h │ │ │ ├── MKTObjectMock.h │ │ │ ├── MKTOngoingStubbing.h │ │ │ ├── MKTPrimitiveArgumentMatching.h │ │ │ ├── MKTProtocolMock.h │ │ │ └── OCMockitoIOS.h │ │ ├── OCMockitoIOS │ │ └── Resources │ │ │ └── Info.plist │ │ └── Current ├── Tests │ ├── CompareTests.m │ ├── Tests-Prefix.pch │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── ios-practiceTests-Info.plist │ ├── ios_practiceTests.h │ ├── ios_practiceTests.m │ └── notification │ │ └── LocalNotificationTest.m ├── ios-practice.xcodeproj │ └── project.pbxproj └── ios-practice │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── LocalNotification │ ├── LocalNotificationManager.h │ └── LocalNotificationManager.m │ ├── Property.h │ ├── Property.m │ ├── ReadOnly.h │ ├── ReadOnly.m │ ├── Resources │ ├── arrow.png │ ├── arrow@2x.png │ ├── no_image.png │ └── no_image@2x.png │ ├── Storyboard.storyboard │ ├── en.lproj │ └── InfoPlist.strings │ ├── ios-practice-Info.plist │ ├── ios-practice-Prefix.pch │ ├── ios_practice.xcdatamodeld │ ├── .xccurrentversion │ └── ios_practice.xcdatamodel │ │ └── contents │ ├── main.m │ └── tableView │ ├── MyTableViewController.h │ └── MyTableViewController.m ├── Makefile ├── _static ├── MyTableViewSample.png ├── TableView_Cell.png └── TableView_cell_content.png ├── _templates └── layout.html ├── _themes └── sphinx-theme-okfn │ ├── .gitignore │ ├── README.markdown │ ├── footer.html │ ├── globaltoc.html │ ├── layout.html │ ├── localtoc.html │ ├── searchbox.html │ ├── static │ ├── bootstrap-css-tweaks.js │ ├── bootstrap-sphinx.css │ ├── css │ │ ├── bootstrap-responsive.css │ │ └── bootstrap.css │ └── img │ │ ├── document_text.png │ │ ├── footer-bevel.png │ │ └── okfn-watermark.png │ └── theme.conf ├── conf.py ├── docs ├── code_structures.rst ├── coredata.rst ├── ivar_property.rst ├── notification.rst ├── save-data.rst ├── storyboard.rst └── tableview.rst ├── index.rst ├── make.bat └── readme.rst /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _build 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/.gitmodules -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/OCHamcrestIOS: -------------------------------------------------------------------------------- 1 | Versions/Current/OCHamcrestIOS -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCAllOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAllOf.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCAllOf : HCBaseMatcher 14 | { 15 | NSArray *matchers; 16 | } 17 | 18 | + (id)allOf:(NSArray *)theMatchers; 19 | - (id)initWithMatchers:(NSArray *)theMatchers; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_allOf(id match, ...) NS_REQUIRES_NIL_TERMINATION; 25 | 26 | /** 27 | allOf(firstMatcher, ...) - 28 | Matches if all of the given matchers evaluate to @c YES. 29 | 30 | @param firstMatcher,... A comma-separated list of matchers ending with @c nil. 31 | 32 | The matchers are evaluated from left to right using short-circuit evaluation, so evaluation 33 | stops as soon as a matcher returns @c NO. 34 | 35 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 36 | equality. 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_allOf instead.) 40 | 41 | @ingroup logical_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define allOf HC_allOf 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCAnyOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAnyOf.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCAnyOf : HCBaseMatcher 14 | { 15 | NSArray *matchers; 16 | } 17 | 18 | + (id)anyOf:(NSArray *)theMatchers; 19 | - (id)initWithMatchers:(NSArray *)theMatchers; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_anyOf(id match, ...) NS_REQUIRES_NIL_TERMINATION; 25 | 26 | /** 27 | anyOf(firstMatcher, ...) - 28 | Matches if any of the given matchers evaluate to @c YES. 29 | 30 | @param firstMatcher,... A comma-separated list of matchers ending with @c nil. 31 | 32 | The matchers are evaluated from left to right using short-circuit evaluation, so evaluation 33 | stops as soon as a matcher returns @c YES. 34 | 35 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 36 | equality. 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_anyOf instead.) 40 | 41 | @ingroup logical_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define anyOf HC_anyOf 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCAssertThat.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAssertThat.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | @protocol HCMatcher; 13 | 14 | 15 | OBJC_EXPORT void HC_assertThatWithLocation(id testCase, id actual, id matcher, 16 | const char *fileName, int lineNumber); 17 | 18 | #define HC_assertThat(actual, matcher) \ 19 | HC_assertThatWithLocation(self, actual, matcher, __FILE__, __LINE__) 20 | 21 | /** 22 | assertThat(actual, matcher) - 23 | Asserts that actual value satisfies matcher. 24 | 25 | @param actual The object to evaluate as the actual value. 26 | @param matcher The matcher to satisfy as the expected condition. 27 | 28 | @c assertThat passes the actual value to the matcher for evaluation. If the matcher is not 29 | satisfied, an exception is thrown describing the mismatch. 30 | 31 | @c assertThat is designed to integrate well with OCUnit and other unit testing frameworks. 32 | Unmet assertions are reported as test failures. In Xcode, these failures can be clicked to 33 | reveal the line of the assertion. 34 | 35 | In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 36 | @c HC_assertThat instead. 37 | 38 | @ingroup integration 39 | */ 40 | #ifdef HC_SHORTHAND 41 | #define assertThat HC_assertThat 42 | #endif 43 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCBaseDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBaseDescription.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | #import 12 | 13 | 14 | /** 15 | Base class for all HCDescription implementations. 16 | 17 | @ingroup core 18 | */ 19 | @interface HCBaseDescription : NSObject 20 | @end 21 | 22 | 23 | /** 24 | Methods that must be provided by subclasses of HCBaseDescription. 25 | */ 26 | @interface HCBaseDescription (SubclassMustImplement) 27 | 28 | /** 29 | Append the string @a str to the description. 30 | */ 31 | - (void)append:(NSString *)str; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCBaseMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBaseMatcher.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | #import 12 | 13 | #import // Convenience header, to provide OBJC_EXPORT 14 | 15 | 16 | /** 17 | Base class for all HCMatcher implementations. 18 | 19 | Most implementations can just implement @c -matches: and let 20 | -matches:describingMismatchTo: call it. But if it makes more sense to generate the 21 | mismatch description during the matching, override -matches:describingMismatchTo: 22 | and have @c -matches: call it with a @c nil description. 23 | 24 | @ingroup core 25 | */ 26 | @interface HCBaseMatcher : NSObject 27 | @end 28 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCBoxNumber.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBoxNumber.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #ifdef __cplusplus 11 | 12 | namespace hamcrest { 13 | 14 | /** 15 | Boxes a scalar value in an NSNumber, specialized per type. 16 | 17 | @b Deprecated 18 | 19 | @ingroup number_matchers 20 | */ 21 | template 22 | inline 23 | NSNumber *boxNumber(T value) __attribute__((deprecated)); 24 | { return nil; } 25 | 26 | template <> 27 | inline 28 | NSNumber *boxNumber(BOOL value) 29 | { return [NSNumber numberWithBool:value]; } 30 | 31 | template <> 32 | inline 33 | NSNumber *boxNumber(char value) 34 | { return [NSNumber numberWithChar:value]; } 35 | 36 | template <> 37 | inline 38 | NSNumber *boxNumber(double value) 39 | { return [NSNumber numberWithDouble:value]; } 40 | 41 | template <> 42 | inline 43 | NSNumber *boxNumber(float value) 44 | { return [NSNumber numberWithFloat:value]; } 45 | 46 | template <> 47 | inline 48 | NSNumber *boxNumber(int value) 49 | { return [NSNumber numberWithInt:value]; } 50 | 51 | template <> 52 | inline 53 | NSNumber *boxNumber(long value) 54 | { return [NSNumber numberWithLong:value]; } 55 | 56 | template <> 57 | inline 58 | NSNumber *boxNumber(long long value) 59 | { return [NSNumber numberWithLongLong:value]; } 60 | 61 | template <> 62 | inline 63 | NSNumber *boxNumber(short value) 64 | { return [NSNumber numberWithShort:value]; } 65 | 66 | template <> 67 | inline 68 | NSNumber *boxNumber(unsigned char value) 69 | { return [NSNumber numberWithUnsignedChar:value]; } 70 | 71 | template <> 72 | inline 73 | NSNumber *boxNumber(unsigned int value) 74 | { return [NSNumber numberWithUnsignedInt:value]; } 75 | 76 | template <> 77 | inline 78 | NSNumber *boxNumber(unsigned long value) 79 | { return [NSNumber numberWithUnsignedLong:value]; } 80 | 81 | template <> 82 | inline 83 | NSNumber *boxNumber(unsigned long long value) 84 | { return [NSNumber numberWithUnsignedLongLong:value]; } 85 | 86 | template <> 87 | inline 88 | NSNumber *boxNumber(unsigned short value) 89 | { return [NSNumber numberWithUnsignedShort:value]; } 90 | 91 | } // namespace hamcrest 92 | 93 | #endif // __cplusplus 94 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCCollectMatchers.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCCollectMatchers.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | 15 | @protocol HCMatcher; 16 | 17 | 18 | /** 19 | Returns an array of matchers from a variable-length comma-separated list terminated by @c nil. 20 | 21 | @ingroup helpers 22 | */ 23 | OBJC_EXPORT NSMutableArray *HCCollectMatchers(id item1, va_list args); 24 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCConformsToProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCConformsToProtocol.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Todd Farrell 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface HCConformsToProtocol : HCBaseMatcher 12 | { 13 | Protocol *theProtocol; 14 | } 15 | 16 | + (id)conformsToProtocol:(Protocol *)protocol; 17 | - (id)initWithProtocol:(Protocol *)protocol; 18 | 19 | @end 20 | 21 | 22 | OBJC_EXPORT id HC_conformsTo(Protocol *aProtocol); 23 | OBJC_EXPORT id HC_conformsToProtocol(Protocol *aProtocol) __attribute__((deprecated)); 24 | 25 | /** 26 | conformsTo(aProtocol) - 27 | Matches if object conforms to a given protocol. 28 | 29 | @param aProtocol The protocol to compare against as the expected protocol. 30 | 31 | This matcher checks whether the evaluated object conforms to @a aProtocol. 32 | 33 | Example: 34 | @li @ref conformsTo(\@protocol(NSObject)) 35 | 36 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 37 | @c HC_conformsTo instead.) 38 | 39 | @ingroup object_matchers 40 | */ 41 | #ifdef HC_SHORTHAND 42 | #define conformsTo HC_conformsTo 43 | #endif 44 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCDescribedAs.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCDescribedAs.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCDescribedAs : HCBaseMatcher 14 | { 15 | NSString *descriptionTemplate; 16 | id matcher; 17 | NSArray *values; 18 | } 19 | 20 | + (id)describedAs:(NSString *)description 21 | forMatcher:(id)aMatcher 22 | overValues:(NSArray *)templateValues; 23 | 24 | - (id)initWithDescription:(NSString *)description 25 | forMatcher:(id)aMatcher 26 | overValues:(NSArray *)templateValues; 27 | 28 | @end 29 | 30 | 31 | OBJC_EXPORT id HC_describedAs(NSString *description, id matcher, ...) NS_REQUIRES_NIL_TERMINATION; 32 | 33 | /** 34 | describedAs(description, matcher, ...) - 35 | Adds custom failure description to a given matcher. 36 | 37 | @param description Overrides the matcher's description. 38 | @param matcher,... The matcher to satisfy, followed by a comma-separated list of substitution values ending with @c nil. 39 | 40 | The description may contain substitution placeholders \%0, \%1, etc. These will be replaced by 41 | any values that follow the matcher. 42 | 43 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 44 | @c HC_describedAs instead.) 45 | 46 | @ingroup decorator_matchers 47 | */ 48 | #ifdef HC_SHORTHAND 49 | #define describedAs HC_describedAs 50 | #endif 51 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCDescription.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | /** 14 | A description of an HCMatcher. 15 | 16 | An HCMatcher will describe itself to a description which can later be used for reporting. 17 | 18 | @ingroup core 19 | */ 20 | @protocol HCDescription 21 | 22 | /** 23 | Appends some plain text to the description. 24 | 25 | @return @c self, for chaining. 26 | */ 27 | - (id)appendText:(NSString *)text; 28 | 29 | /** 30 | Appends description of given value to @c self. 31 | 32 | If the value implements the @ref HCSelfDescribing protocol, then it will be used. 33 | 34 | @return @c self, for chaining. 35 | */ 36 | - (id)appendDescriptionOf:(id)value; 37 | 38 | /** 39 | Appends a list of objects to the description. 40 | 41 | @return @c self, for chaining. 42 | */ 43 | - (id)appendList:(NSArray *)values 44 | start:(NSString *)start 45 | separator:(NSString *)separator 46 | end:(NSString *)end; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCHasCount.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCHasCount.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCHasCount : HCBaseMatcher 14 | { 15 | id countMatcher; 16 | } 17 | 18 | + (id)hasCount:(id)matcher; 19 | - (id)initWithCount:(id)matcher; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_hasCount(id matcher); 25 | 26 | /** 27 | hasCount(aMatcher) - 28 | Matches if object's @c -count satisfies a given matcher. 29 | 30 | @param aMatcher The matcher to satisfy. 31 | 32 | This matcher invokes @c -count on the evaluated object to get the number of elements it 33 | contains, passing the result to @a aMatcher for evaluation. 34 | 35 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 36 | @c HC_hasCount instead.) 37 | 38 | @ingroup collection_matchers 39 | */ 40 | #ifdef HC_SHORTHAND 41 | #define hasCount HC_hasCount 42 | #endif 43 | 44 | 45 | OBJC_EXPORT id HC_hasCountOf(NSUInteger count); 46 | 47 | /** 48 | hasCountOf(value) - 49 | Matches if object's @c -count equals a given value. 50 | 51 | @param value @c NSUInteger value to compare against as the expected value. 52 | 53 | This matcher invokes @c -count on the evaluated object to get the number of elements it 54 | contains, comparing the result to @a value for equality. 55 | 56 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 57 | @c HC_hasCountOf instead.) 58 | 59 | @ingroup collection_matchers 60 | */ 61 | #ifdef HC_SHORTHAND 62 | #define hasCountOf HC_hasCountOf 63 | #endif 64 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCHasDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCHasDescription.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCHasDescription : HCInvocationMatcher 14 | 15 | + (id)hasDescription:(id)descriptionMatcher; 16 | - (id)initWithDescription:(id)descriptionMatcher; 17 | 18 | @end 19 | 20 | 21 | OBJC_EXPORT id HC_hasDescription(id match); 22 | 23 | /** 24 | hasDescription(aMatcher) - 25 | Matches if object's @c -description satisfies a given matcher. 26 | 27 | @param aMatcher The matcher to satisfy, or an expected value for @ref equalTo matching. 28 | 29 | This matcher invokes @c -description on the evaluated object to get its description, passing the 30 | result to a given matcher for evaluation. If the @a aMatcher argument is not a matcher, it is 31 | implicitly wrapped in an @ref equalTo matcher to check for equality. 32 | 33 | Examples: 34 | @li @ref hasDescription(@ref startsWith(\@"foo")) 35 | @li @ref hasDescription(\@"bar") 36 | 37 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 38 | @c HC_hasDescription instead.) 39 | 40 | @ingroup object_matchers 41 | */ 42 | #ifdef HC_SHORTHAND 43 | #define hasDescription HC_hasDescription 44 | #endif 45 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCHasProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCHasProperty.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Justin Shacklette 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface HCHasProperty : HCBaseMatcher 12 | { 13 | NSString *propertyName; 14 | id valueMatcher; 15 | } 16 | 17 | + (id)hasProperty:(NSString *)property value:(id)aValueMatcher; 18 | - (id)initWithProperty:(NSString *)property value:(id)aValueMatcher; 19 | 20 | @end 21 | 22 | 23 | OBJC_EXPORT id HC_hasProperty(NSString *name, id valueMatch); 24 | 25 | /** 26 | hasProperty(name, valueMatcher) - 27 | Matches if object has a method of a given name whose return value satisfies a given matcher. 28 | 29 | @param name The name of a method without arguments that returns an object. 30 | @param valueMatcher The matcher to satisfy for the return value, or an expected value for @ref equalTo matching. 31 | 32 | This matcher first checks if the evaluated object has a method with a name matching the given 33 | @c name. If so, it invokes the method and sees if the returned value satisfies @c valueMatcher. 34 | 35 | While this matcher is called "hasProperty", it's useful for checking the results of any simple 36 | methods, not just properties. 37 | 38 | Examples: 39 | @li @ref hasProperty(\@"firstName", \@"Joe") 40 | @li @ref hasProperty(\@"firstName", startsWith(\@"J")) 41 | 42 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 43 | @c HC_hasProperty instead.) 44 | 45 | @ingroup object_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define hasProperty HC_hasProperty 49 | #endif 50 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCInvocationMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCInvocationMatcher.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | /** 14 | Supporting class for matching a feature of an object. 15 | 16 | Tests whether the result of passing a given invocation to the value satisfies a given matcher. 17 | 18 | @ingroup helpers 19 | */ 20 | @interface HCInvocationMatcher : HCBaseMatcher 21 | { 22 | NSInvocation *invocation; 23 | id subMatcher; 24 | BOOL shortMismatchDescription; 25 | } 26 | 27 | /** 28 | Determines whether a mismatch will be described in short form. 29 | 30 | Default is long form, which describes the object, the name of the invocation, and the 31 | sub-matcher's mismatch diagnosis. Short form only has the sub-matcher's mismatch diagnosis. 32 | */ 33 | @property (nonatomic, assign) BOOL shortMismatchDescription; 34 | 35 | /** 36 | Helper method for creating an invocation. 37 | 38 | A class is specified only so we can determine the method signature. 39 | */ 40 | + (NSInvocation *)invocationForSelector:(SEL)selector onClass:(Class)aClass; 41 | 42 | /** 43 | Returns an HCInvocationMatcher object initialized with an invocation and a matcher. 44 | */ 45 | - (id)initWithInvocation:(NSInvocation *)anInvocation matching:(id)aMatcher; 46 | 47 | /** 48 | Invokes stored invocation on given item and returns the result. 49 | */ 50 | - (id)invokeOn:(id)item; 51 | 52 | /** 53 | Returns string representation of the invocation's selector. 54 | */ 55 | - (NSString *)stringFromSelector; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIs.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIs.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIs : HCBaseMatcher 14 | { 15 | id matcher; 16 | } 17 | 18 | + (id)is:(id)aMatcher; 19 | - (id)initWithMatcher:(id)aMatcher; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_is(id match); 25 | 26 | /** 27 | is(aMatcher) - 28 | Decorates another matcher, or provides a shortcut to the frequently used @ref is(equalTo(x)). 29 | 30 | @param aMatcher The matcher to satisfy, or an expected value for @ref equalTo matching. 31 | 32 | This matcher compares the evaluated object to the given matcher. 33 | 34 | If the @a aMatcher argument is a matcher, its behavior is retained, but the test may be more 35 | expressive. For example: 36 | @li @ref assertThatInt(value, equalToInt(5)) 37 | @li @ref assertThatInt(value, is(equalToInt(5))) 38 | 39 | If the @a aMatcher argument is not a matcher, it is wrapped in an @ref equalTo matcher. This 40 | makes the following statements equivalent: 41 | @li @ref assertThat(cheese, equalTo(smelly)) 42 | @li @ref assertThat(cheese, is(equalTo(smelly))) 43 | @li @ref assertThat(cheese, is(smelly)) 44 | 45 | Choose the style that makes your expression most readable. This will vary depending on context. 46 | 47 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 48 | @c HC_is instead.) 49 | 50 | @ingroup decorator_matchers 51 | */ 52 | #ifdef HC_SHORTHAND 53 | #define is HC_is 54 | #endif 55 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsAnything.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsAnything.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsAnything : HCBaseMatcher 14 | { 15 | NSString *description; 16 | } 17 | 18 | + (id)isAnything; 19 | + (id)isAnythingWithDescription:(NSString *)aDescription; 20 | 21 | - (id)init; 22 | - (id)initWithDescription:(NSString *)aDescription; 23 | 24 | @end 25 | 26 | 27 | OBJC_EXPORT id HC_anything(void); 28 | 29 | /** 30 | Matches anything. 31 | 32 | This matcher always evaluates to @c YES. Specify this in composite matchers when the value of a 33 | particular element is unimportant. 34 | 35 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 36 | @c HC_anything instead.) 37 | 38 | @ingroup logical_matchers 39 | */ 40 | #ifdef HC_SHORTHAND 41 | #define anything() HC_anything() 42 | #endif 43 | 44 | 45 | OBJC_EXPORT id HC_anythingWithDescription(NSString *aDescription); 46 | 47 | /** 48 | anythingWithDescription(description) - 49 | Matches anything. 50 | 51 | @param description A string used to describe this matcher. 52 | 53 | This matcher always evaluates to @c YES. Specify this in collection matchers when the value of a 54 | particular element in a collection is unimportant. 55 | 56 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 57 | @c HC_anything instead.) 58 | 59 | @ingroup logical_matchers 60 | */ 61 | #ifdef HC_SHORTHAND 62 | #define anythingWithDescription HC_anythingWithDescription 63 | #endif 64 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCloseTo.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCloseTo.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsCloseTo : HCBaseMatcher 14 | { 15 | double value; 16 | double delta; 17 | } 18 | 19 | + (id)isCloseTo:(double)aValue within:(double)aDelta; 20 | - (id)initWithValue:(double)aValue delta:(double)aDelta; 21 | 22 | @end 23 | 24 | 25 | OBJC_EXPORT id HC_closeTo(double aValue, double aDelta); 26 | 27 | /** 28 | closeTo(aValue, aDelta) - 29 | Matches if object is a number close to a given value, within a given delta. 30 | 31 | @param aValue The @c double value to compare against as the expected value. 32 | @param aDelta The @c double maximum delta between the values for which the numbers are considered close. 33 | 34 | This matcher invokes @c -doubleValue on the evaluated object to get its value as a @c double. 35 | The result is compared against @a aValue to see if the difference is within a positive @a aDelta. 36 | 37 | Example: 38 | @li @ref closeTo(3.0, 0.25) 39 | 40 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 41 | @c HC_closeTo instead.) 42 | 43 | @ingroup number_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define closeTo HC_closeTo 47 | #endif 48 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionContaining.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsCollectionContaining : HCBaseMatcher 14 | { 15 | id elementMatcher; 16 | } 17 | 18 | + (id)isCollectionContaining:(id)anElementMatcher; 19 | - (id)initWithMatcher:(id)anElementMatcher; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_hasItem(id itemMatch); 25 | 26 | /** 27 | hasItem(aMatcher) - 28 | Matches if any element of collection satisfies a given matcher. 29 | 30 | @param aMatcher The matcher to satisfy, or an expected value for @ref equalTo matching. 31 | 32 | This matcher iterates the evaluated collection, searching for any element that satisfies a 33 | given matcher. If a matching element is found, @c hasItem is satisfied. 34 | 35 | If the @a aMatcher argument is not a matcher, it is implicitly wrapped in an @ref equalTo 36 | matcher to check for equality. 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_hasItem instead.) 40 | 41 | @ingroup collection_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define hasItem HC_hasItem 45 | #endif 46 | 47 | 48 | OBJC_EXPORT id HC_hasItems(id itemMatch, ...) NS_REQUIRES_NIL_TERMINATION; 49 | 50 | /** 51 | hasItems(firstMatcher, ...) - 52 | Matches if all of the given matchers are satisfied by any elements of the collection. 53 | 54 | @param firstMatcher,... A comma-separated list of matchers ending with @c nil. 55 | 56 | This matcher iterates the given matchers, searching for any elements in the evaluated collection 57 | that satisfy them. If each matcher is satisfied, then @c hasItems is satisfied. 58 | 59 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 60 | equality. 61 | 62 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 63 | @c hasItems instead.) 64 | 65 | @ingroup collection_matchers 66 | */ 67 | #ifdef HC_SHORTHAND 68 | #define hasItems HC_hasItems 69 | #endif 70 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContainingInAnyOrder.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionContainingInAnyOrder.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsCollectionContainingInAnyOrder : HCBaseMatcher 14 | { 15 | NSMutableArray *matchers; 16 | } 17 | 18 | + (id)isCollectionContainingInAnyOrder:(NSMutableArray *)itemMatchers; 19 | - (id)initWithMatchers:(NSMutableArray *)itemMatchers; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_containsInAnyOrder(id itemMatch, ...) NS_REQUIRES_NIL_TERMINATION; 25 | 26 | /** 27 | containsInAnyOrder(firstMatcher, ...) - 28 | Matches if collection's elements, in any order, satisfy a given list of matchers. 29 | 30 | @param firstMatcher,... A comma-separated list of matchers ending with @c nil. 31 | 32 | This matcher iterates the evaluated collection, seeing if each element satisfies any of the 33 | given matchers. The matchers are tried from left to right, and when a satisfied matcher is 34 | found, it is no longer a candidate for the remaining elements. If a one-to-one correspondence is 35 | established between elements and matchers, @c containsInAnyOrder is satisfied. 36 | 37 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 38 | equality. 39 | 40 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 41 | @c HC_containsInAnyOrder instead.) 42 | 43 | @ingroup collection_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define containsInAnyOrder HC_containsInAnyOrder 47 | #endif 48 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContainingInOrder.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionContainingInOrder.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsCollectionContainingInOrder : HCBaseMatcher 14 | { 15 | NSArray *matchers; 16 | } 17 | 18 | + (id)isCollectionContainingInOrder:(NSArray *)itemMatchers; 19 | - (id)initWithMatchers:(NSArray *)itemMatchers; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_contains(id itemMatch, ...) NS_REQUIRES_NIL_TERMINATION; 25 | 26 | /** 27 | contains(firstMatcher, ...) - 28 | Matches if collection's elements satisfy a given list of matchers, in order. 29 | 30 | @param firstMatcher,... A comma-separated list of matchers ending with @c nil. 31 | 32 | This matcher iterates the evaluated collection and a given list of matchers, seeing if each 33 | element satisfies its corresponding matcher. 34 | 35 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 36 | equality. 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_contains instead.) 40 | 41 | @ingroup collection_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define contains HC_contains 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionOnlyContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionOnlyContaining.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsCollectionOnlyContaining : HCBaseMatcher 14 | { 15 | id matcher; 16 | } 17 | 18 | + (id)isCollectionOnlyContaining:(id)aMatcher; 19 | - (id)initWithMatcher:(id)aMatcher; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_onlyContains(id itemMatch, ...) NS_REQUIRES_NIL_TERMINATION; 25 | 26 | /** 27 | onlyContains(firstMatcher, ...) - 28 | Matches if each element of collection satisfies any of the given matchers. 29 | 30 | @param firstMatcher,... A comma-separated list of matchers ending with @c nil. 31 | 32 | This matcher iterates the evaluated collection, confirming whether each element satisfies any of 33 | the given matchers. 34 | 35 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 36 | equality. 37 | 38 | Example: 39 | 40 | @par 41 | @ref onlyContains(startsWith(@"Jo"), nil) 42 | 43 | will match a collection [@"Jon", @"John", @"Johann"]. 44 | 45 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 46 | @c HC_onlyContains instead.) 47 | 48 | @ingroup collection_matchers 49 | */ 50 | #ifdef HC_SHORTHAND 51 | #define onlyContains HC_onlyContains 52 | #endif 53 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContaining.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsDictionaryContaining : HCBaseMatcher 14 | { 15 | id keyMatcher; 16 | id valueMatcher; 17 | } 18 | 19 | + (id)isDictionaryContainingKey:(id)aKeyMatcher 20 | value:(id)aValueMatcher; 21 | 22 | - (id)initWithKeyMatcher:(id)aKeyMatcher 23 | valueMatcher:(id)aValueMatcher; 24 | 25 | @end 26 | 27 | 28 | OBJC_EXPORT id HC_hasEntry(id keyMatch, id valueMatch); 29 | 30 | /** 31 | hasEntry(keyMatcher, valueMatcher) - 32 | Matches if dictionary contains key-value entry satisfying a given pair of matchers. 33 | 34 | @param keyMatcher The matcher to satisfy for the key, or an expected value for @ref equalTo matching. 35 | @param valueMatcher The matcher to satisfy for the value, or an expected value for @ref equalTo matching. 36 | 37 | This matcher iterates the evaluated dictionary, searching for any key-value entry that satisfies 38 | @a keyMatcher and @a valueMatcher. If a matching entry is found, @c hasEntry is satisfied. 39 | 40 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 41 | equality. 42 | 43 | Examples: 44 | @li @ref hasEntry(@ref equalTo(@"foo"), equalTo(@"bar")) 45 | @li @ref hasEntry(@"foo", @"bar") 46 | 47 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 48 | @c HC_hasEntry instead.) 49 | 50 | @ingroup collection_matchers 51 | */ 52 | #ifdef HC_SHORTHAND 53 | #define hasEntry HC_hasEntry 54 | #endif 55 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingEntries.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingEntries.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsDictionaryContainingEntries : HCBaseMatcher 14 | { 15 | NSArray *keys; 16 | NSArray *valueMatchers; 17 | } 18 | 19 | + (id)isDictionaryContainingKeys:(NSArray *)theKeys 20 | valueMatchers:(NSArray *)theValueMatchers; 21 | 22 | - (id)initWithKeys:(NSArray *)theKeys 23 | valueMatchers:(NSArray *)theValueMatchers; 24 | 25 | @end 26 | 27 | 28 | OBJC_EXPORT id HC_hasEntries(id keysAndValueMatch, ...) NS_REQUIRES_NIL_TERMINATION; 29 | 30 | /** 31 | hasEntries(firstKey, valueMatcher, ...) - 32 | Matches if dictionary contains entries satisfying a list of alternating keys and their value 33 | matchers. 34 | 35 | @param firstKey A key (not a matcher) to look up. 36 | @param valueMatcher,... The matcher to satisfy for the value, or an expected value for @ref equalTo matching. 37 | 38 | Note that the keys must be actual keys, not matchers. Any value argument that is not a matcher 39 | is implicitly wrapped in an @ref equalTo matcher to check for equality. The list must end with 40 | @c nil. 41 | 42 | Examples: 43 | @li @ref hasEntries(@"first", equalTo(@"Jon"), @"last", equalTo(@"Reid"), nil) 44 | @li @ref hasEntries(@"first", @"Jon", @"last", @"Reid", nil) 45 | 46 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 47 | @c HC_hasEntry instead.) 48 | 49 | @ingroup collection_matchers 50 | */ 51 | #ifdef HC_SHORTHAND 52 | #define hasEntries HC_hasEntries 53 | #endif 54 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingKey.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsDictionaryContainingKey : HCBaseMatcher 14 | { 15 | id keyMatcher; 16 | } 17 | 18 | + (id)isDictionaryContainingKey:(id)theKeyMatcher; 19 | - (id)initWithKeyMatcher:(id)theKeyMatcher; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_hasKey(id keyMatch); 25 | 26 | /** 27 | hasKey(keyMatcher) - 28 | Matches if dictionary contains an entry whose key satisfies a given matcher. 29 | 30 | @param keyMatcher The matcher to satisfy for the key, or an expected value for @ref equalTo matching. 31 | 32 | This matcher iterates the evaluated dictionary, searching for any key-value entry whose key 33 | satisfies the given matcher. If a matching entry is found, @c hasKey is satisfied. 34 | 35 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 36 | equality. 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_hasKey instead.) 40 | 41 | Examples: 42 | @li @ref hasEntry(equalTo(@"foo")) 43 | @li @ref hasEntry(@"foo") 44 | 45 | @ingroup collection_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define hasKey HC_hasKey 49 | #endif 50 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingValue.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsDictionaryContainingValue : HCBaseMatcher 14 | { 15 | id valueMatcher; 16 | } 17 | 18 | + (id)isDictionaryContainingValue:(id)theValueMatcher; 19 | - (id)initWithValueMatcher:(id)theValueMatcher; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_hasValue(id valueMatch); 25 | 26 | /** 27 | hasValue(valueMatcher) - 28 | Matches if dictionary contains an entry whose value satisfies a given matcher. 29 | 30 | @param valueMatcher The matcher to satisfy for the value, or an expected value for @ref equalTo matching. 31 | 32 | This matcher iterates the evaluated dictionary, searching for any key-value entry whose value 33 | satisfies the given matcher. If a matching entry is found, @c hasValue is satisfied. 34 | 35 | Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for 36 | equality. 37 | 38 | Examples: 39 | @li @ref hasValue(equalTo(@"bar")) 40 | @li @ref hasValue(@"bar") 41 | 42 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 43 | @c HC_hasValue instead.) 44 | 45 | @ingroup collection_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define hasValue HC_hasValue 49 | #endif 50 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEmptyCollection.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEmptyCollection.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsEmptyCollection : HCHasCount 14 | 15 | + (id)isEmptyCollection; 16 | - (id)init; 17 | 18 | @end 19 | 20 | 21 | OBJC_EXPORT id HC_empty(void); 22 | 23 | /** 24 | Matches empty collection. 25 | 26 | This matcher invokes @c -count on the evaluated object to determine if the number of elements it 27 | contains is zero. 28 | 29 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 30 | @c HC_empty instead.) 31 | 32 | @ingroup collection_matchers 33 | */ 34 | #ifdef HC_SHORTHAND 35 | #define empty() HC_empty() 36 | #endif 37 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqual.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqual.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsEqual : HCBaseMatcher 14 | { 15 | id object; 16 | } 17 | 18 | + (id)isEqualTo:(id)anObject; 19 | - (id)initEqualTo:(id)anObject; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_equalTo(id object); 25 | 26 | /** 27 | equalTo(anObject) - 28 | Matches if object is equal to a given object. 29 | 30 | @param anObject The object to compare against as the expected value. 31 | 32 | This matcher compares the evaluated object to @a anObject for equality, as determined by the 33 | @c -isEqual: method. 34 | 35 | If @a anObject is @c nil, the matcher will successfully match @c nil. 36 | 37 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 38 | @c HC_equalTo instead.) 39 | 40 | @ingroup object_matchers 41 | */ 42 | #ifdef HC_SHORTHAND 43 | #define equalTo HC_equalTo 44 | #endif 45 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualIgnoringCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualIgnoringCase.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsEqualIgnoringCase : HCBaseMatcher 14 | { 15 | NSString *string; 16 | } 17 | 18 | + (id)isEqualIgnoringCase:(NSString *)aString; 19 | - (id)initWithString:(NSString *)aString; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_equalToIgnoringCase(NSString *aString); 25 | 26 | /** 27 | equalToIgnoringCase(aString) - 28 | Matches if object is a string equal to a given string, ignoring case differences. 29 | 30 | @param aString The string to compare against as the expected value. This value must not be @c nil. 31 | 32 | This matcher first checks whether the evaluated object is a string. If so, it compares it with 33 | @a aString, ignoring differences of case. 34 | 35 | Example: 36 | 37 | @par 38 | @ref equalToIgnoringCase(@"hello world") 39 | 40 | will match "heLLo WorlD". 41 | 42 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 43 | @c HC_equalToIgnoringCase instead.) 44 | 45 | @ingroup text_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define equalToIgnoringCase HC_equalToIgnoringCase 49 | #endif 50 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualIgnoringWhiteSpace.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualIgnoringWhiteSpace.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsEqualIgnoringWhiteSpace : HCBaseMatcher 14 | { 15 | NSString *originalString; 16 | NSString *strippedString; 17 | } 18 | 19 | + (id)isEqualIgnoringWhiteSpace:(NSString *)aString; 20 | - (id)initWithString:(NSString *)aString; 21 | 22 | @end 23 | 24 | 25 | OBJC_EXPORT id HC_equalToIgnoringWhiteSpace(NSString *aString); 26 | 27 | /** 28 | equalToIgnoringWhiteSpace(aString) - 29 | Matches if object is a string equal to a given string, ignoring differences in whitespace. 30 | 31 | @param aString The string to compare against as the expected value. This value must not be @c nil. 32 | 33 | This matcher first checks whether the evaluated object is a string. If so, it compares it with 34 | @a aString, ignoring differences in runs of whitespace. 35 | 36 | Example: 37 | 38 | @par 39 | @ref equalToIgnoringWhiteSpace(@"hello world") 40 | 41 | will match @verbatim "hello world" @endverbatim 42 | 43 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 44 | @c HC_equalToIgnoringWhiteSpace instead.) 45 | 46 | @ingroup text_matchers 47 | */ 48 | #ifdef HC_SHORTHAND 49 | #define equalToIgnoringWhiteSpace HC_equalToIgnoringWhiteSpace 50 | #endif 51 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualToNumber.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualToNumber.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | OBJC_EXPORT id HC_equalToBool(BOOL value); 14 | 15 | /** 16 | equalToBool(value) - 17 | Matches if object is equal to @c NSNumber created from a @c BOOL. 18 | 19 | @param value The @c BOOL value from which to create an @c NSNumber. 20 | 21 | This matcher creates an @c NSNumber object from a @c BOOL @a value and compares the evaluated 22 | object to it for equality. 23 | 24 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 25 | @c HC_equalToBool instead.) 26 | 27 | @ingroup primitive_number_matchers 28 | */ 29 | #ifdef HC_SHORTHAND 30 | #define equalToBool HC_equalToBool 31 | #endif 32 | 33 | 34 | OBJC_EXPORT id HC_equalToChar(char value); 35 | 36 | /** 37 | equalToChar(value) - 38 | Matches if object is equal to @c NSNumber created from a @c char. 39 | 40 | @param value The @c char value from which to create an @c NSNumber. 41 | 42 | This matcher creates an @c NSNumber object from a @c char @a value and compares the evaluated 43 | object to it for equality. 44 | 45 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 46 | @c HC_equalToChar instead.) 47 | 48 | @ingroup primitive_number_matchers 49 | */ 50 | #ifdef HC_SHORTHAND 51 | #define equalToChar HC_equalToChar 52 | #endif 53 | 54 | 55 | OBJC_EXPORT id HC_equalToDouble(double value); 56 | 57 | /** 58 | equalToDouble(value) - 59 | Matches if object is equal to @c NSNumber created from a @c double. 60 | 61 | @param value The @c double value from which to create an @c NSNumber. 62 | 63 | This matcher creates an @c NSNumber object from a @c double @a value and compares the evaluated 64 | object to it for equality. 65 | 66 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 67 | @c HC_equalToDouble instead.) 68 | 69 | @ingroup primitive_number_matchers 70 | */ 71 | #ifdef HC_SHORTHAND 72 | #define equalToDouble HC_equalToDouble 73 | #endif 74 | 75 | 76 | OBJC_EXPORT id HC_equalToFloat(float value); 77 | 78 | /** 79 | equalToFloat(value) - 80 | Matches if object is equal to @c NSNumber created from a @c float. 81 | 82 | @param value The @c float value from which to create an @c NSNumber. 83 | 84 | This matcher creates an @c NSNumber object from a @c float @a value and compares the evaluated 85 | object to it for equality. 86 | 87 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 88 | @c HC_equalToFloat instead.) 89 | 90 | @ingroup primitive_number_matchers 91 | */ 92 | #ifdef HC_SHORTHAND 93 | #define equalToFloat HC_equalToFloat 94 | #endif 95 | 96 | 97 | OBJC_EXPORT id HC_equalToInt(int value); 98 | 99 | /** 100 | equalToInt(value) - 101 | Matches if object is equal to @c NSNumber created from an @c int. 102 | 103 | @param value The @c int value from which to create an @c NSNumber. 104 | 105 | This matcher creates an @c NSNumber object from a @c int @a value and compares the evaluated 106 | object to it for equality. 107 | 108 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 109 | @c HC_equalToInt instead.) 110 | 111 | @ingroup primitive_number_matchers 112 | */ 113 | #ifdef HC_SHORTHAND 114 | #define equalToInt HC_equalToInt 115 | #endif 116 | 117 | 118 | OBJC_EXPORT id HC_equalToLong(long value); 119 | 120 | /** 121 | equalToLong(value) - 122 | Matches if object is equal to @c NSNumber created from a @c long. 123 | 124 | @param value The @c long value from which to create an @c NSNumber. 125 | 126 | This matcher creates an @c NSNumber object from a @c long @a value and compares the evaluated 127 | object to it for equality. 128 | 129 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 130 | @c HC_equalToLong instead.) 131 | 132 | @ingroup primitive_number_matchers 133 | */ 134 | #ifdef HC_SHORTHAND 135 | #define equalToLong HC_equalToLong 136 | #endif 137 | 138 | 139 | OBJC_EXPORT id HC_equalToLongLong(long long value); 140 | 141 | /** 142 | equalToLongLong(value) - 143 | Matches if object is equal to @c NSNumber created from a long long. 144 | 145 | @param value The long long value from which to create an @c NSNumber. 146 | 147 | This matcher creates an @c NSNumber object from a long long @a value and compares 148 | the evaluated object to it for equality. 149 | 150 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 151 | @c HC_equalToLongLong instead.) 152 | 153 | @ingroup primitive_number_matchers 154 | */ 155 | #ifdef HC_SHORTHAND 156 | #define equalToLongLong HC_equalToLongLong 157 | #endif 158 | 159 | 160 | OBJC_EXPORT id HC_equalToShort(short value); 161 | 162 | /** 163 | equalToShort(value) - 164 | Matches if object is equal to @c NSNumber created from a @c short. 165 | 166 | @param value The @c short value from which to create an @c NSNumber. 167 | 168 | This matcher creates an @c NSNumber object from a @c short @a value and compares the evaluated 169 | object to it for equality. 170 | 171 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 172 | @c HC_equalToShort instead.) 173 | 174 | @ingroup primitive_number_matchers 175 | */ 176 | #ifdef HC_SHORTHAND 177 | #define equalToShort HC_equalToShort 178 | #endif 179 | 180 | 181 | OBJC_EXPORT id HC_equalToUnsignedChar(unsigned char value); 182 | 183 | /** 184 | equalToUnsignedChar(value) - 185 | Matches if object is equal to @c NSNumber created from an unsigned char. 186 | 187 | @param value The unsigned char value from which to create an @c NSNumber. 188 | 189 | This matcher creates an @c NSNumber object from an unsigned char @a value and 190 | compares the evaluated object to it for equality. 191 | 192 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 193 | @c HC_equalToUnsignedChar instead.) 194 | 195 | @ingroup primitive_number_matchers 196 | */ 197 | #ifdef HC_SHORTHAND 198 | #define equalToUnsignedChar HC_equalToUnsignedChar 199 | #endif 200 | 201 | 202 | OBJC_EXPORT id HC_equalToUnsignedInt(unsigned int value); 203 | 204 | /** 205 | equalToUnsignedInt(value) - 206 | Matches if object is equal to @c NSNumber created from an unsigned int. 207 | 208 | @param value The unsigned int value from which to create an @c NSNumber. 209 | 210 | This matcher creates an @c NSNumber object from an unsigned int @a value and 211 | compares the evaluated object to it for equality. 212 | 213 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 214 | @c HC_equalToUnsignedInt instead.) 215 | 216 | @ingroup primitive_number_matchers 217 | */ 218 | #ifdef HC_SHORTHAND 219 | #define equalToUnsignedInt HC_equalToUnsignedInt 220 | #endif 221 | 222 | 223 | OBJC_EXPORT id HC_equalToUnsignedLong(unsigned long value); 224 | 225 | /** 226 | equalToUnsignedLong(value) - 227 | Matches if object is equal to @c NSNumber created from an unsigned long. 228 | 229 | @param value The unsigned long value from which to create an @c NSNumber. 230 | 231 | This matcher creates an @c NSNumber object from an unsigned long @a value and 232 | compares the evaluated object to it for equality. 233 | 234 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 235 | @c HC_equalToUnsignedLong instead.) 236 | 237 | @ingroup primitive_number_matchers 238 | */ 239 | #ifdef HC_SHORTHAND 240 | #define equalToUnsignedLong HC_equalToUnsignedLong 241 | #endif 242 | 243 | 244 | OBJC_EXPORT id HC_equalToUnsignedLongLong(unsigned long long value); 245 | 246 | /** 247 | equalToUnsignedLongLong(value) - 248 | Matches if object is equal to @c NSNumber created from an unsigned long long. 249 | 250 | @param value The unsigned long long value from which to create an @c NSNumber. 251 | 252 | This matcher creates an @c NSNumber object from an unsigned long long @a value and 253 | compares the evaluated object to it for equality. 254 | 255 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 256 | @c HC_equalToUnsignedLongLong instead.) 257 | 258 | @ingroup primitive_number_matchers 259 | */ 260 | #ifdef HC_SHORTHAND 261 | #define equalToUnsignedLongLong HC_equalToUnsignedLongLong 262 | #endif 263 | 264 | 265 | OBJC_EXPORT id HC_equalToUnsignedShort(unsigned short value); 266 | 267 | /** 268 | equalToUnsignedShort(value) - 269 | Matches if object is equal to @c NSNumber created from an unsigned short. 270 | 271 | @param value The unsigned short value from which to create an @c NSNumber. 272 | 273 | This matcher creates an @c NSNumber object from an unsigned short @a value and 274 | compares the evaluated object to it for equality. 275 | 276 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 277 | @c HC_equalToUnsignedShort instead.) 278 | 279 | @ingroup primitive_number_matchers 280 | */ 281 | #ifdef HC_SHORTHAND 282 | #define equalToUnsignedShort HC_equalToUnsignedShort 283 | #endif 284 | 285 | 286 | OBJC_EXPORT id HC_equalToInteger(NSInteger value); 287 | 288 | /** 289 | equalToInteger(value) - 290 | Matches if object is equal to @c NSNumber created from an @c NSInteger. 291 | 292 | @param value The @c NSInteger value from which to create an @c NSNumber. 293 | 294 | This matcher creates an @c NSNumber object from an @c NSInteger @a value and compares the 295 | evaluated object to it for equality. 296 | 297 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 298 | @c HC_equalToInteger instead.) 299 | 300 | @ingroup primitive_number_matchers 301 | */ 302 | #ifdef HC_SHORTHAND 303 | #define equalToInteger HC_equalToInteger 304 | #endif 305 | 306 | 307 | OBJC_EXPORT id HC_equalToUnsignedInteger(NSUInteger value); 308 | 309 | /** 310 | equalToUnsignedInteger(value) - 311 | Matches if object is equal to @c NSNumber created from an @c NSUInteger. 312 | 313 | @param value The @c NSUInteger value from which to create an @c NSNumber. 314 | 315 | This matcher creates an @c NSNumber object from an @c NSUInteger @a value and compares the 316 | evaluated object to it for equality. 317 | 318 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 319 | @c HC_equalToUnsignedInteger instead.) 320 | 321 | @ingroup primitive_number_matchers 322 | */ 323 | #ifdef HC_SHORTHAND 324 | #define equalToUnsignedInteger HC_equalToUnsignedInteger 325 | #endif 326 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsIn.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsIn.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsIn : HCBaseMatcher 14 | { 15 | id collection; 16 | } 17 | 18 | + (id)isInCollection:(id)aCollection; 19 | - (id)initWithCollection:(id)aCollection; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_isIn(id aCollection); 25 | 26 | /** 27 | isIn(aCollection) - 28 | Matches if evaluated object is present in a given collection. 29 | 30 | @param aCollection The collection to search. 31 | 32 | This matcher invokes @c -containsObject: on @a aCollection to determine if the evaluated object 33 | is an element of the collection. 34 | 35 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 36 | @c HC_isIn instead.) 37 | 38 | @ingroup collection_matchers 39 | */ 40 | #ifdef HC_SHORTHAND 41 | #define isIn HC_isIn 42 | #endif 43 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsInstanceOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsInstanceOf.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsInstanceOf : HCBaseMatcher 14 | { 15 | Class theClass; 16 | } 17 | 18 | + (id)isInstanceOf:(Class)type; 19 | - (id)initWithType:(Class)type; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_instanceOf(Class aClass); 25 | 26 | /** 27 | instanceOf(aClass) - 28 | Matches if object is an instance of, or inherits from, a given class. 29 | 30 | @param aClass The class to compare against as the expected class. 31 | 32 | This matcher checks whether the evaluated object is an instance of @a aClass or an instance of 33 | any class that inherits from @a aClass. 34 | 35 | Example: 36 | @li @ref instanceOf([NSString class]) 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_instanceOf instead.) 40 | 41 | @ingroup object_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define instanceOf HC_instanceOf 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsNil.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsNil.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsNil : HCBaseMatcher 14 | 15 | + (id)isNil; 16 | 17 | @end 18 | 19 | 20 | OBJC_EXPORT id HC_nilValue(void); 21 | 22 | /** 23 | Matches if object is @c nil. 24 | 25 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 26 | @c HC_nilValue instead.) 27 | 28 | @ingroup object_matchers 29 | */ 30 | #ifdef HC_SHORTHAND 31 | #define nilValue() HC_nilValue() 32 | #endif 33 | 34 | 35 | OBJC_EXPORT id HC_notNilValue(void); 36 | 37 | /** 38 | Matches if object is not @c nil. 39 | 40 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 41 | @c HC_notNilValue instead.) 42 | 43 | @ingroup object_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define notNilValue() HC_notNilValue() 47 | #endif 48 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsNot.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsNot.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsNot : HCBaseMatcher 14 | { 15 | id matcher; 16 | } 17 | 18 | + (id)isNot:(id)aMatcher; 19 | - (id)initNot:(id)aMatcher; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_isNot(id aMatcher); 25 | 26 | /** 27 | isNot(aMatcher) - 28 | Inverts the given matcher to its logical negation. 29 | 30 | @param aMatcher The matcher to negate. 31 | 32 | This matcher compares the evaluated object to the negation of the given matcher. If the 33 | @a aMatcher argument is not a matcher, it is implicitly wrapped in an @ref equalTo matcher to 34 | check for equality, and thus matches for inequality. 35 | 36 | Examples: 37 | @li @ref assertThat(cheese, isNot(equalTo(smelly))) 38 | @li @ref assertThat(cheese, isNot(smelly)) 39 | 40 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 41 | @c HC_isNot instead.) 42 | 43 | @ingroup logical_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define isNot HC_isNot 47 | #endif 48 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCIsSame.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsSame.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCIsSame : HCBaseMatcher 14 | { 15 | id object; 16 | } 17 | 18 | + (id)isSameAs:(id)anObject; 19 | - (id)initSameAs:(id)anObject; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_sameInstance(id object); 25 | 26 | /** 27 | sameInstance(anObject) - 28 | Matches if evaluated object is the same instance as a given object. 29 | 30 | @param anObject The object to compare against as the expected value. 31 | 32 | This matcher compares the address of the evaluated object to determine if it is the same object 33 | as @a anObject. 34 | 35 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 36 | @c HC_sameInstance instead.) 37 | 38 | @ingroup object_matchers 39 | */ 40 | #ifdef HC_SHORTHAND 41 | #define sameInstance HC_sameInstance 42 | #endif 43 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCMatcher.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | /** 14 | A matcher over acceptable values. 15 | 16 | A matcher is able to describe itself to give feedback when it fails. 17 | 18 | HCMatcher implementations should @b not directly implement this protocol. 19 | Instead, @b extend the HCBaseMatcher class, which will ensure that the HCMatcher API can grow 20 | to support new features and remain compatible with all HCMatcher implementations. 21 | 22 | @ingroup core 23 | */ 24 | @protocol HCMatcher 25 | 26 | /** 27 | Evaluates the matcher for argument @a item. 28 | 29 | @param item The object against which the matcher is evaluated. 30 | @return @c YES if @a item matches, otherwise @c NO. 31 | */ 32 | - (BOOL)matches:(id)item; 33 | 34 | /** 35 | Evaluates the matcher for argument @a item. 36 | 37 | @param item The object against which the matcher is evaluated. 38 | @param mismatchDescription The description to be built or appended to if @a item does not match. 39 | @return @c YES if @a item matches, otherwise @c NO. 40 | */ 41 | - (BOOL)matches:(id)item describingMismatchTo:(id)mismatchDescription; 42 | 43 | /** 44 | Generates a description of why the matcher has not accepted the item. 45 | 46 | The description will be part of a larger description of why a matching failed, so it should be 47 | concise. 48 | 49 | This method assumes that @c matches:item is false, but will not check this. 50 | 51 | @param item The item that the HCMatcher has rejected. 52 | @param mismatchDescription The description to be built or appended to. 53 | */ 54 | - (void)describeMismatchOf:(id)item to:(id)mismatchDescription; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCNumberAssert.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCNumberAssert.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | @protocol HCMatcher; 13 | 14 | 15 | OBJC_EXPORT void HC_assertThatBoolWithLocation(id testCase, BOOL actual, 16 | id matcher, const char* fileName, int lineNumber); 17 | 18 | #define HC_assertThatBool(actual, matcher) \ 19 | HC_assertThatBoolWithLocation(self, actual, matcher, __FILE__, __LINE__) 20 | 21 | /** 22 | assertThatBool(actual, matcher) - 23 | Asserts that @c BOOL actual value, converted to an @c NSNumber, satisfies matcher. 24 | 25 | @param actual The @c BOOL value to convert to an @c NSNumber for evaluation. 26 | @param matcher The matcher to satisfy as the expected condition. 27 | 28 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 29 | @c HC_assertThatBool instead.) 30 | 31 | @ingroup integration_numeric 32 | */ 33 | #ifdef HC_SHORTHAND 34 | #define assertThatBool HC_assertThatBool 35 | #endif 36 | 37 | 38 | #pragma mark - 39 | 40 | OBJC_EXPORT void HC_assertThatCharWithLocation(id testCase, char actual, 41 | id matcher, const char* fileName, int lineNumber); 42 | 43 | #define HC_assertThatChar(actual, matcher) \ 44 | HC_assertThatCharWithLocation(self, actual, matcher, __FILE__, __LINE__) 45 | 46 | /** 47 | assertThatChar(actual, matcher) - 48 | Asserts that @c char actual value, converted to an @c NSNumber, satisfies matcher. 49 | 50 | @param actual The @c char value to convert to an @c NSNumber for evaluation. 51 | @param matcher The matcher to satisfy as the expected condition. 52 | 53 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 54 | @c HC_assertThatChar instead.) 55 | 56 | @ingroup integration_numeric 57 | */ 58 | #ifdef HC_SHORTHAND 59 | #define assertThatChar HC_assertThatChar 60 | #endif 61 | 62 | 63 | #pragma mark - 64 | 65 | OBJC_EXPORT void HC_assertThatDoubleWithLocation(id testCase, double actual, 66 | id matcher, const char* fileName, int lineNumber); 67 | 68 | #define HC_assertThatDouble(actual, matcher) \ 69 | HC_assertThatDoubleWithLocation(self, actual, matcher, __FILE__, __LINE__) 70 | 71 | /** 72 | HC_assertThatDouble(actual, matcher) - 73 | Asserts that @c double actual value, converted to an @c NSNumber, satisfies matcher. 74 | 75 | @param actual The @c double value to convert to an @c NSNumber for evaluation. 76 | @param matcher The matcher to satisfy as the expected condition. 77 | 78 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 79 | @c HC_assertThatDouble instead.) 80 | 81 | @ingroup integration_numeric 82 | */ 83 | #ifdef HC_SHORTHAND 84 | #define assertThatDouble HC_assertThatDouble 85 | #endif 86 | 87 | 88 | #pragma mark - 89 | 90 | OBJC_EXPORT void HC_assertThatFloatWithLocation(id testCase, float actual, 91 | id matcher, const char* fileName, int lineNumber); 92 | 93 | #define HC_assertThatFloat(actual, matcher) \ 94 | HC_assertThatFloatWithLocation(self, actual, matcher, __FILE__, __LINE__) 95 | 96 | /** 97 | assertThatFloat(actual, matcher) - 98 | Asserts that @c float actual value, converted to an @c NSNumber, satisfies matcher. 99 | 100 | @param actual The @c float value to convert to an @c NSNumber for evaluation. 101 | @param matcher The matcher to satisfy as the expected condition. 102 | 103 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 104 | @c HC_assertThatFloat instead.) 105 | 106 | @ingroup integration_numeric 107 | */ 108 | #ifdef HC_SHORTHAND 109 | #define assertThatFloat HC_assertThatFloat 110 | #endif 111 | 112 | 113 | #pragma mark - 114 | 115 | OBJC_EXPORT void HC_assertThatIntWithLocation(id testCase, int actual, 116 | id matcher, const char* fileName, int lineNumber); 117 | 118 | #define HC_assertThatInt(actual, matcher) \ 119 | HC_assertThatIntWithLocation(self, actual, matcher, __FILE__, __LINE__) 120 | 121 | /** 122 | assertThatInt(actual, matcher) - 123 | Asserts that @c int actual value, converted to an @c NSNumber, satisfies matcher. 124 | 125 | @param actual The @c int value to convert to an @c NSNumber for evaluation. 126 | @param matcher The matcher to satisfy as the expected condition. 127 | 128 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 129 | @c HC_assertThatInt instead.) 130 | 131 | @ingroup integration_numeric 132 | */ 133 | #ifdef HC_SHORTHAND 134 | #define assertThatInt HC_assertThatInt 135 | #endif 136 | 137 | 138 | #pragma mark - 139 | 140 | OBJC_EXPORT void HC_assertThatLongWithLocation(id testCase, long actual, 141 | id matcher, const char* fileName, int lineNumber); 142 | 143 | #define HC_assertThatLong(actual, matcher) \ 144 | HC_assertThatLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 145 | 146 | /** 147 | assertThatLong(actual, matcher) - 148 | Asserts that @c long actual value, converted to an @c NSNumber, satisfies matcher. 149 | 150 | @param actual The @c long value to convert to an @c NSNumber for evaluation. 151 | @param matcher The matcher to satisfy as the expected condition. 152 | 153 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 154 | @c HC_assertThatLong instead.) 155 | 156 | @ingroup integration_numeric 157 | */ 158 | #ifdef HC_SHORTHAND 159 | #define assertThatLong HC_assertThatLong 160 | #endif 161 | 162 | 163 | #pragma mark - 164 | 165 | OBJC_EXPORT void HC_assertThatLongLongWithLocation(id testCase, long long actual, 166 | id matcher, const char* fileName, int lineNumber); 167 | 168 | #define HC_assertThatLongLong(actual, matcher) \ 169 | HC_assertThatLongLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 170 | 171 | /** 172 | assertThatLongLong(actual, matcher) - 173 | Asserts that long long actual value, converted to an @c NSNumber, satisfies 174 | matcher. 175 | 176 | @param actual The long long value to convert to an @c NSNumber for evaluation. 177 | @param matcher The matcher to satisfy as the expected condition. 178 | 179 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 180 | @c HC_assertThatLongLong instead.) 181 | 182 | @ingroup integration_numeric 183 | */ 184 | #ifdef HC_SHORTHAND 185 | #define assertThatLongLong HC_assertThatLongLong 186 | #endif 187 | 188 | 189 | #pragma mark - 190 | 191 | OBJC_EXPORT void HC_assertThatShortWithLocation(id testCase, short actual, 192 | id matcher, const char* fileName, int lineNumber); 193 | 194 | #define HC_assertThatShort(actual, matcher) \ 195 | HC_assertThatShortWithLocation(self, actual, matcher, __FILE__, __LINE__) 196 | 197 | /** 198 | assertThatShort(actual, matcher) - 199 | Asserts that @c short actual value, converted to an @c NSNumber, satisfies matcher. 200 | 201 | @param actual The @c short value to convert to an @c NSNumber for evaluation. 202 | @param matcher The matcher to satisfy as the expected condition. 203 | 204 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 205 | @c HC_assertThatShort instead.) 206 | 207 | @ingroup integration_numeric 208 | */ 209 | #ifdef HC_SHORTHAND 210 | #define assertThatShort HC_assertThatShort 211 | #endif 212 | 213 | 214 | #pragma mark - 215 | 216 | OBJC_EXPORT void HC_assertThatUnsignedCharWithLocation(id testCase, unsigned char actual, 217 | id matcher, const char* fileName, int lineNumber); 218 | 219 | #define HC_assertThatUnsignedChar(actual, matcher) \ 220 | HC_assertThatUnsignedCharWithLocation(self, actual, matcher, __FILE__, __LINE__) 221 | 222 | /** 223 | assertThatUnsignedChar(actual, matcher) - 224 | Asserts that unsigned char actual value, converted to an @c NSNumber, satisfies 225 | matcher. 226 | 227 | @param actual The unsigned char value to convert to an @c NSNumber for evaluation. 228 | @param matcher The matcher to satisfy as the expected condition. 229 | 230 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 231 | @c HC_assertThatUnsignedChar instead.) 232 | 233 | @ingroup integration_numeric 234 | */ 235 | #ifdef HC_SHORTHAND 236 | #define assertThatUnsignedChar HC_assertThatUnsignedChar 237 | #endif 238 | 239 | 240 | #pragma mark - 241 | 242 | OBJC_EXPORT void HC_assertThatUnsignedIntWithLocation(id testCase, unsigned int actual, 243 | id matcher, const char* fileName, int lineNumber); 244 | 245 | #define HC_assertThatUnsignedInt(actual, matcher) \ 246 | HC_assertThatUnsignedIntWithLocation(self, actual, matcher, __FILE__, __LINE__) 247 | 248 | /** 249 | assertThatUnsignedInt(actual, matcher) - 250 | Asserts that unsigned int actual value, converted to an @c NSNumber, satisfies 251 | matcher. 252 | 253 | @param actual The unsigned int value to convert to an @c NSNumber for evaluation @param matcher The matcher to satisfy as the expected condition. 254 | 255 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 256 | @c HC_assertThatUnsignedInt instead.) 257 | 258 | @ingroup integration_numeric 259 | */ 260 | #ifdef HC_SHORTHAND 261 | #define assertThatUnsignedInt HC_assertThatUnsignedInt 262 | #endif 263 | 264 | 265 | #pragma mark - 266 | 267 | OBJC_EXPORT void HC_assertThatUnsignedLongWithLocation(id testCase, unsigned long actual, 268 | id matcher, const char* fileName, int lineNumber); 269 | 270 | #define HC_assertThatUnsignedLong(actual, matcher) \ 271 | HC_assertThatUnsignedLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 272 | 273 | /** 274 | assertThatUnsignedLong(actual, matcher) - 275 | Asserts that unsigned long actual value, converted to an @c NSNumber, satisfies 276 | matcher. 277 | 278 | @param actual The unsigned long value to convert to an @c NSNumber for evaluation @param matcher The matcher to satisfy as the expected condition. 279 | 280 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 281 | @c HC_assertThatUnsignedLong instead.) 282 | 283 | @ingroup integration_numeric 284 | */ 285 | #ifdef HC_SHORTHAND 286 | #define assertThatUnsignedLong HC_assertThatUnsignedLong 287 | #endif 288 | 289 | 290 | #pragma mark - 291 | 292 | OBJC_EXPORT void HC_assertThatUnsignedLongLongWithLocation(id testCase, unsigned long long actual, 293 | id matcher, const char* fileName, int lineNumber); 294 | 295 | #define HC_assertThatUnsignedLongLong(actual, matcher) \ 296 | HC_assertThatUnsignedLongLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 297 | 298 | /** 299 | assertThatUnsignedLongLong(actual, matcher) - 300 | Asserts that unsigned long long actual value, converted to an @c NSNumber, 301 | satisfies matcher. 302 | 303 | @param actual The unsigned long long value to convert to an @c NSNumber for evaluation @param matcher The matcher to satisfy as the expected condition. 304 | 305 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 306 | @c HC_assertThatUnsignedLongLong instead.) 307 | 308 | @ingroup integration_numeric 309 | */ 310 | #ifdef HC_SHORTHAND 311 | #define assertThatUnsignedLongLong HC_assertThatUnsignedLongLong 312 | #endif 313 | 314 | 315 | #pragma mark - 316 | 317 | OBJC_EXPORT void HC_assertThatUnsignedShortWithLocation(id testCase, unsigned short actual, 318 | id matcher, const char* fileName, int lineNumber); 319 | 320 | #define HC_assertThatUnsignedShort(actual, matcher) \ 321 | HC_assertThatUnsignedShortWithLocation(self, actual, matcher, __FILE__, __LINE__) 322 | 323 | /** 324 | assertThatUnsignedShort(actual, matcher) - 325 | Asserts that unsigned short actual value, converted to an @c NSNumber, satisfies 326 | matcher. 327 | 328 | @param actual The unsigned short value to convert to an @c NSNumber for evaluation @param matcher The matcher to satisfy as the expected condition. 329 | 330 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 331 | @c HC_assertThatUnsignedShort instead.) 332 | 333 | @ingroup integration_numeric 334 | */ 335 | #ifdef HC_SHORTHAND 336 | #define assertThatUnsignedShort HC_assertThatUnsignedShort 337 | #endif 338 | 339 | 340 | #pragma mark - 341 | 342 | OBJC_EXPORT void HC_assertThatIntegerWithLocation(id testCase, NSInteger actual, 343 | id matcher, const char* fileName, int lineNumber); 344 | 345 | #define HC_assertThatInteger(actual, matcher) \ 346 | HC_assertThatIntegerWithLocation(self, actual, matcher, __FILE__, __LINE__) 347 | 348 | /** 349 | assertThatInteger(actual, matcher) - 350 | Asserts that @c NSInteger actual value, converted to an @c NSNumber, satisfies matcher. 351 | 352 | @param actual The @c NSInteger value to convert to an @c NSNumber for evaluation. 353 | @param matcher The matcher to satisfy as the expected condition. 354 | 355 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 356 | @c HC_assertThatInteger instead.) 357 | 358 | @ingroup integration_numeric 359 | */ 360 | #ifdef HC_SHORTHAND 361 | #define assertThatInteger HC_assertThatInteger 362 | #endif 363 | 364 | 365 | #pragma mark - 366 | 367 | OBJC_EXPORT void HC_assertThatUnsignedIntegerWithLocation(id testCase, NSUInteger actual, 368 | id matcher, const char* fileName, int lineNumber); 369 | 370 | #define HC_assertThatUnsignedInteger(actual, matcher) \ 371 | HC_assertThatUnsignedIntegerWithLocation(self, actual, matcher, __FILE__, __LINE__) 372 | 373 | /** 374 | assertThatUnsignedInteger(actual, matcher) - 375 | Asserts that @c NSUInteger actual value, converted to an @c NSNumber, satisfies matcher. 376 | 377 | @param actual The @c NSUInteger value to convert to an @c NSNumber for evaluation. 378 | @param matcher The matcher to satisfy as the expected condition. 379 | 380 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 381 | @c HC_assertThatUnsignedInteger instead.) 382 | 383 | @ingroup integration_numeric 384 | */ 385 | #ifdef HC_SHORTHAND 386 | #define assertThatUnsignedInteger HC_assertThatUnsignedInteger 387 | #endif 388 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCOrderingComparison.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCOrderingComparison.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCOrderingComparison : HCBaseMatcher 14 | { 15 | id expected; 16 | NSComparisonResult minCompare; 17 | NSComparisonResult maxCompare; 18 | NSString *comparisonDescription; 19 | } 20 | 21 | + (id)compare:(id)expectedValue 22 | minCompare:(NSComparisonResult)min 23 | maxCompare:(NSComparisonResult)max 24 | comparisonDescription:(NSString *)comparisonDescription; 25 | 26 | - (id)initComparing:(id)expectedValue 27 | minCompare:(NSComparisonResult)min 28 | maxCompare:(NSComparisonResult)max 29 | comparisonDescription:(NSString *)comparisonDescription; 30 | 31 | @end 32 | 33 | 34 | OBJC_EXPORT id HC_greaterThan(id expected); 35 | 36 | /** 37 | greaterThan(aNumber) - 38 | Matches if object is greater than a given number. 39 | 40 | @param aNumber The @c NSNumber to compare against. 41 | 42 | Example: 43 | @li @ref greaterThan([NSNumber numberWithInt:5]) 44 | 45 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 46 | @c HC_greaterThan instead.) 47 | 48 | @ingroup number_matchers 49 | */ 50 | #ifdef HC_SHORTHAND 51 | #define greaterThan HC_greaterThan 52 | #endif 53 | 54 | 55 | OBJC_EXPORT id HC_greaterThanOrEqualTo(id expected); 56 | 57 | /** 58 | greaterThanOrEqualTo(aNumber) - 59 | Matches if object is greater than or equal to a given number. 60 | 61 | @param aNumber The @c NSNumber to compare against. 62 | 63 | Example: 64 | @li @ref greaterThanOrEqualTo([NSNumber numberWithInt:5]) 65 | 66 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 67 | @c HC_greaterThanOrEqualTo instead.) 68 | 69 | @ingroup number_matchers 70 | */ 71 | #ifdef HC_SHORTHAND 72 | #define greaterThanOrEqualTo HC_greaterThanOrEqualTo 73 | #endif 74 | 75 | 76 | OBJC_EXPORT id HC_lessThan(id expected); 77 | 78 | /** 79 | lessThan(aNumber) - 80 | Matches if object is less than a given number. 81 | 82 | @param aNumber The @c NSNumber to compare against. 83 | 84 | Example: 85 | @li @ref lessThan([NSNumber numberWithInt:5]) 86 | 87 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 88 | @c HC_lessThan instead.) 89 | 90 | @ingroup number_matchers 91 | */ 92 | #ifdef HC_SHORTHAND 93 | #define lessThan HC_lessThan 94 | #endif 95 | 96 | 97 | OBJC_EXPORT id HC_lessThanOrEqualTo(id expected); 98 | 99 | /** 100 | lessThanOrEqualTo(aNumber) - 101 | Matches if object is less than or equal to a given number. 102 | 103 | @param aNumber The @c NSNumber to compare against. 104 | 105 | Example: 106 | @li @ref lessThanOrEqualTo([NSNumber numberWithInt:5]) 107 | 108 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 109 | @c HC_lessThanOrEqualTo instead.) 110 | 111 | @ingroup number_matchers 112 | */ 113 | #ifdef HC_SHORTHAND 114 | #define lessThanOrEqualTo HC_lessThanOrEqualTo 115 | #endif 116 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCRequireNonNilObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCRequireNonNilObject.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | #import 12 | 13 | 14 | /** 15 | Throws an NSException if @a obj is @c nil. 16 | 17 | @ingroup helpers 18 | */ 19 | OBJC_EXPORT void HCRequireNonNilObject(id obj); 20 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCRequireNonNilString.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCRequireNonNilString.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | #import 12 | 13 | 14 | /** 15 | Throws an NSException if @a string is @c nil. 16 | 17 | @b Deprecated: Use @ref HCRequireNonNilObject instead. 18 | 19 | @ingroup helpers 20 | */ 21 | OBJC_EXPORT void HCRequireNonNilString(NSString *string) __attribute__((deprecated)); 22 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCSelfDescribing.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCSelfDescribing.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | @protocol HCDescription; 13 | 14 | 15 | /** 16 | The ability of an object to describe itself. 17 | 18 | @ingroup core 19 | */ 20 | @protocol HCSelfDescribing 21 | 22 | /** 23 | Generates a description of the object. 24 | 25 | The description may be part of a description of a larger object of which this is just a 26 | component, so it should be worded appropriately. 27 | 28 | @param description The description to be built or appended to. 29 | */ 30 | - (void)describeTo:(id)description; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCStringContains.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringContains.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCStringContains : HCSubstringMatcher 14 | 15 | + (id)stringContains:(NSString *)aSubstring; 16 | 17 | @end 18 | 19 | 20 | OBJC_EXPORT id HC_containsString(NSString *aSubstring); 21 | 22 | /** 23 | containsString(aString) - 24 | Matches if object is a string containing a given string. 25 | 26 | @param aString The string to search for. This value must not be @c nil. 27 | 28 | This matcher first checks whether the evaluated object is a string. If so, it checks whether it 29 | contains @a aString. 30 | 31 | Example: 32 | 33 | @par 34 | @ref containsString(@"def") 35 | 36 | will match "abcdefg". 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_containsString instead.) 40 | 41 | @ingroup text_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define containsString HC_containsString 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCStringContainsInOrder.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringContainsInOrder.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCStringContainsInOrder : HCBaseMatcher 14 | { 15 | NSArray *substrings; 16 | } 17 | 18 | + (id)containsInOrder:(NSArray *)substringList; 19 | - (id)initWithSubstrings:(NSArray *)substringList; 20 | 21 | @end 22 | 23 | 24 | OBJC_EXPORT id HC_stringContainsInOrder(NSString *substring, ...) NS_REQUIRES_NIL_TERMINATION; 25 | 26 | /** 27 | stringContainsInOrder(firstString, ...) - 28 | Matches if object is a string containing a given list of substrings in relative order. 29 | 30 | @param firstString,... A comma-separated list of strings ending with @c nil. 31 | 32 | This matcher first checks whether the evaluated object is a string. If so, it checks whether it 33 | contains a given list of strings, in relative order to each other. The searches are performed 34 | starting from the beginning of the evaluated string. 35 | 36 | Example: 37 | 38 | @par 39 | @ref stringContainsInOrder(@"bc", @"fg", @"jkl", nil) 40 | 41 | will match "abcdefghijklm". 42 | 43 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 44 | @c HC_stringContainsInOrder instead.) 45 | 46 | @ingroup text_matchers 47 | */ 48 | #ifdef HC_SHORTHAND 49 | #define stringContainsInOrder HC_stringContainsInOrder 50 | #endif 51 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCStringDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringDescription.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | @protocol HCSelfDescribing; 13 | 14 | 15 | /** 16 | An HCDescription that is stored as a string. 17 | 18 | @ingroup core 19 | */ 20 | @interface HCStringDescription : HCBaseDescription 21 | { 22 | NSMutableString *accumulator; 23 | } 24 | 25 | /** 26 | Returns the description of an HCSelfDescribing object as a string. 27 | 28 | @param selfDescribing The object to be described. 29 | @return The description of the object. 30 | */ 31 | + (NSString *)stringFrom:(id)selfDescribing; 32 | 33 | /** 34 | Returns an empty description. 35 | */ 36 | + (HCStringDescription *)stringDescription; 37 | 38 | /** 39 | Returns an initialized HCStringDescription object that is empty. 40 | */ 41 | - (id)init; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCStringEndsWith.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringEndsWith.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCStringEndsWith : HCSubstringMatcher 14 | 15 | + (id)stringEndsWith:(NSString *)aSubstring; 16 | 17 | @end 18 | 19 | 20 | OBJC_EXPORT id HC_endsWith(NSString *aSubstring); 21 | 22 | /** 23 | endsWith(aString) - 24 | Matches if object is a string ending with a given string. 25 | 26 | @param aString The string to search for. This value must not be @c nil. 27 | 28 | This matcher first checks whether the evaluated object is a string. If so, it checks if 29 | @a aString matches the ending characters of the evaluated object. 30 | 31 | Example: 32 | 33 | @par 34 | @ref endsWith(@"bar") 35 | 36 | will match "foobar". 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_endsWith instead.) 40 | 41 | @ingroup text_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define endsWith HC_endsWith 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCStringStartsWith.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringStartsWith.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCStringStartsWith : HCSubstringMatcher 14 | 15 | + (id)stringStartsWith:(NSString *)aSubstring; 16 | 17 | @end 18 | 19 | 20 | OBJC_EXPORT id HC_startsWith(NSString *aSubstring); 21 | 22 | /** 23 | startsWith(aString) - 24 | Matches if object is a string starting with a given string. 25 | 26 | @param aString The string to search for. This value must not be @c nil. 27 | 28 | This matcher first checks whether the evaluated object is a string. If so, it checks if 29 | @a aString matches the beginning characters of the evaluated object. 30 | 31 | Example: 32 | 33 | @par 34 | @ref endsWith(@"foo") 35 | 36 | will match "foobar". 37 | 38 | (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym 39 | @c HC_startsWith instead.) 40 | 41 | @ingroup text_matchers 42 | */ 43 | #ifdef HC_SHORTHAND 44 | #define startsWith HC_startsWith 45 | #endif 46 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCSubstringMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCSubstringMatcher.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | 13 | @interface HCSubstringMatcher : HCBaseMatcher 14 | { 15 | NSString *substring; 16 | } 17 | 18 | - (id)initWithSubstring:(NSString *)aString; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/HCWrapInMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCWrapInMatcher.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | #import 11 | 12 | @protocol HCMatcher; 13 | 14 | 15 | /** 16 | Wraps argument in a matcher, if necessary. 17 | 18 | @return The argument as-if if it is already a matcher, otherwise wrapped in an @ref equalTo matcher. 19 | 20 | @ingroup helpers 21 | */ 22 | OBJC_EXPORT id HCWrapInMatcher(id matcherOrValue); 23 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Headers/OCHamcrestIOS.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - OCHamcrest.h 3 | // Copyright 2012 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid, http://qualitycoding.org/ 6 | // Docs: http://hamcrest.github.com/OCHamcrest/ 7 | // Source: https://github.com/hamcrest/OCHamcrest 8 | // 9 | 10 | /** 11 | @defgroup library Matcher Library 12 | 13 | Library of Matcher implementations. 14 | */ 15 | 16 | /** 17 | @defgroup object_matchers Object Matchers 18 | 19 | Matchers that inspect objects. 20 | 21 | @ingroup library 22 | */ 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | 31 | /** 32 | @defgroup collection_matchers Collection Matchers 33 | 34 | Matchers of collections. 35 | 36 | @ingroup library 37 | */ 38 | #import 39 | #import 40 | #import 41 | #import 42 | #import 43 | #import 44 | #import 45 | #import 46 | #import 47 | #import 48 | #import 49 | 50 | /** 51 | @defgroup number_matchers Number Matchers 52 | 53 | Matchers that perform numeric comparisons. 54 | 55 | @ingroup library 56 | */ 57 | #import 58 | #import 59 | 60 | /** 61 | @defgroup primitive_number_matchers Primitive Number Matchers 62 | 63 | Matchers for testing equality against primitive numeric types. 64 | 65 | @ingroup number_matchers 66 | */ 67 | #import 68 | 69 | /** 70 | @defgroup text_matchers Text Matchers 71 | 72 | Matchers that perform text comparisons. 73 | 74 | @ingroup library 75 | */ 76 | #import 77 | #import 78 | #import 79 | #import 80 | #import 81 | #import 82 | 83 | /** 84 | @defgroup logical_matchers Logical Matchers 85 | 86 | Boolean logic using other matchers. 87 | 88 | @ingroup library 89 | */ 90 | #import 91 | #import 92 | #import 93 | #import 94 | 95 | /** 96 | @defgroup decorator_matchers Decorator Matchers 97 | 98 | Matchers that decorate other matchers for better expression. 99 | 100 | @ingroup library 101 | */ 102 | #import 103 | #import 104 | 105 | /** 106 | @defgroup integration Unit Test Integration 107 | */ 108 | #import 109 | 110 | /** 111 | @defgroup integration_numeric Unit Tests of Primitive Numbers 112 | 113 | Unit test integration for primitive numbers. 114 | 115 | The @c assertThat<Type> macros convert the primitive actual value to an @c NSNumber, 116 | passing that to the matcher for evaluation. If the matcher is not satisfied, an exception is 117 | thrown describing the mismatch. 118 | 119 | This family of macros is designed to integrate well with OCUnit and other unit testing 120 | frameworks. Unmet assertions are reported as test failures. In Xcode, they can be clicked to 121 | reveal the line of the assertion. 122 | 123 | @ingroup integration 124 | */ 125 | #import 126 | 127 | /** 128 | @defgroup core Core API 129 | */ 130 | 131 | /** 132 | @defgroup helpers Helpers 133 | 134 | Utilities for writing Matchers. 135 | 136 | @ingroup core 137 | */ 138 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/OCHamcrestIOS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/OCHamcrestIOS.framework/Versions/A/OCHamcrestIOS -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11E53 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | OCHamcrestIOS 11 | CFBundleIdentifier 12 | org.hamcrest.OCHamcrestIOS 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | OCHamcrestIOS 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.8 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.8 25 | DTCompiler 26 | 27 | DTPlatformBuild 28 | 4E2002 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 11D50a 33 | DTSDKName 34 | macosx10.7 35 | DTXcode 36 | 0432 37 | DTXcodeBuild 38 | 4E2002 39 | NSHumanReadableCopyright 40 | Copyright © 2012 hamcrest.org 41 | 42 | 43 | -------------------------------------------------------------------------------- /Code/OCHamcrestIOS.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/OCMockitoIOS: -------------------------------------------------------------------------------- 1 | Versions/Current/OCMockitoIOS -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/MKTBaseMockObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - MKTBaseMockObject.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | 6 | #import 7 | #import "MKTPrimitiveArgumentMatching.h" 8 | 9 | 10 | @interface MKTBaseMockObject : NSProxy 11 | 12 | - (id)init; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/MKTClassObjectMock.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - MKTClassObjectMock.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | // Created by: David Hart 6 | // 7 | 8 | #import "MKTBaseMockObject.h" 9 | 10 | 11 | /** 12 | Mock object of a given class object. 13 | */ 14 | @interface MKTClassObjectMock : MKTBaseMockObject 15 | 16 | + (id)mockForClass:(Class)aClass; 17 | - (id)initWithClass:(Class)aClass; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/MKTObjectAndProtocolMock.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - MKTObjectAndProtocolMock.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | // Created by: Kevin Lundberg 6 | // 7 | 8 | #import "MKTProtocolMock.h" 9 | 10 | 11 | /** 12 | Mock object of a given class that also implements a given protocol. 13 | */ 14 | @interface MKTObjectAndProtocolMock : MKTProtocolMock 15 | 16 | + (id)mockForClass:(Class)aClass protocol:(Protocol *)protocol; 17 | - (id)initWithClass:(Class)aClass protocol:(Protocol *)protocol; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/MKTObjectMock.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - MKTObjectMock.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | 6 | #import "MKTBaseMockObject.h" 7 | 8 | 9 | /** 10 | Mock object of a given class. 11 | */ 12 | @interface MKTObjectMock : MKTBaseMockObject 13 | 14 | + (id)mockForClass:(Class)aClass; 15 | - (id)initWithClass:(Class)aClass; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/MKTOngoingStubbing.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - MKTOngoingStubbing.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | 6 | #import 7 | #import "MKTPrimitiveArgumentMatching.h" 8 | 9 | @class MKTInvocationContainer; 10 | 11 | 12 | /** 13 | Methods to invoke on @c given(methodCall) to return stubbed values. 14 | */ 15 | @interface MKTOngoingStubbing : NSObject 16 | 17 | - (id)initWithInvocationContainer:(MKTInvocationContainer *)anInvocationContainer; 18 | 19 | /// Stubs given object as return value. 20 | - (MKTOngoingStubbing *)willReturn:(id)object; 21 | 22 | /// Stubs given @c BOOL as return value. 23 | - (MKTOngoingStubbing *)willReturnBool:(BOOL)value; 24 | 25 | /// Stubs given @c char as return value. 26 | - (MKTOngoingStubbing *)willReturnChar:(char)value; 27 | 28 | /// Stubs given @c int as return value. 29 | - (MKTOngoingStubbing *)willReturnInt:(int)value; 30 | 31 | /// Stubs given @c short as return value. 32 | - (MKTOngoingStubbing *)willReturnShort:(short)value; 33 | 34 | /// Stubs given @c long as return value. 35 | - (MKTOngoingStubbing *)willReturnLong:(long)value; 36 | 37 | /// Stubs given long long as return value. 38 | - (MKTOngoingStubbing *)willReturnLongLong:(long long)value; 39 | 40 | /// Stubs given @c NSInteger as return value. 41 | - (MKTOngoingStubbing *)willReturnInteger:(NSInteger)value; 42 | 43 | /// Stubs given unsigned char as return value. 44 | - (MKTOngoingStubbing *)willReturnUnsignedChar:(unsigned char)value; 45 | 46 | /// Stubs given unsigned int as return value. 47 | - (MKTOngoingStubbing *)willReturnUnsignedInt:(unsigned int)value; 48 | 49 | /// Stubs given unsigned short as return value. 50 | - (MKTOngoingStubbing *)willReturnUnsignedShort:(unsigned short)value; 51 | 52 | /// Stubs given unsigned long as return value. 53 | - (MKTOngoingStubbing *)willReturnUnsignedLong:(unsigned long)value; 54 | 55 | /// Stubs given unsigned long long as return value. 56 | - (MKTOngoingStubbing *)willReturnUnsignedLongLong:(unsigned long long)value; 57 | 58 | /// Stubs given @c NSUInteger as return value. 59 | - (MKTOngoingStubbing *)willReturnUnsignedInteger:(NSUInteger)value; 60 | 61 | /// Stubs given @c float as return value. 62 | - (MKTOngoingStubbing *)willReturnFloat:(float)value; 63 | 64 | /// Stubs given @c double as return value. 65 | - (MKTOngoingStubbing *)willReturnDouble:(double)value; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/MKTPrimitiveArgumentMatching.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - MKTPrimitiveArgumentMatching.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | 6 | @protocol HCMatcher; 7 | 8 | 9 | /** 10 | Ability to specify OCHamcrest matchers for primitive numeric arguments. 11 | */ 12 | @protocol MKTPrimitiveArgumentMatching 13 | 14 | /** 15 | Specifies OCHamcrest matcher for a specific argument of a method. 16 | 17 | For methods arguments that take objects, just pass the matcher directly as a method call. But 18 | for arguments that take primitive numeric types, call this to specify the matcher before passing 19 | in a dummy value. Upon verification, the actual numeric argument received will be converted to 20 | an NSNumber before being checked by the matcher. 21 | 22 | The argument index is 0-based, so the first argument of a method has index 0. 23 | 24 | Example: 25 | @code 26 | [[verify(mockArray) withMatcher:greaterThan([NSNumber numberWithInt:1]) forArgument:0] 27 | removeObjectAtIndex:0]; 28 | @endcode 29 | This verifies that @c removeObjectAtIndex: was called with a number greater than 1. 30 | */ 31 | - (id)withMatcher:(id )matcher forArgument:(NSUInteger)index; 32 | 33 | /** 34 | Specifies OCHamcrest matcher for the first argument of a method. 35 | 36 | Equivalent to withMatcher:matcher forArgument:0. 37 | 38 | Example: 39 | @code 40 | [[verify(mockArray) withMatcher:greaterThan([NSNumber numberWithInt:1]) forArgument:0] 41 | removeObjectAtIndex:0]; 42 | @endcode 43 | This verifies that @c removeObjectAtIndex: was called with a number greater than 1. 44 | */ 45 | - (id)withMatcher:(id )matcher; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/MKTProtocolMock.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - MKTProtocolMock.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | 6 | #import "MKTBaseMockObject.h" 7 | 8 | 9 | /** 10 | Mock object implementing a given protocol. 11 | */ 12 | @interface MKTProtocolMock : MKTBaseMockObject 13 | 14 | + (id)mockForProtocol:(Protocol *)aClass; 15 | - (id)initWithProtocol:(Protocol *)aClass; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Headers/OCMockitoIOS.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMockito - OCMockito.h 3 | // Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | // 5 | 6 | #import 7 | 8 | #import "MKTClassObjectMock.h" 9 | #import "MKTObjectMock.h" 10 | #import "MKTObjectAndProtocolMock.h" 11 | #import "MKTOngoingStubbing.h" 12 | #import "MKTProtocolMock.h" 13 | #import 14 | 15 | 16 | /** 17 | Returns a mock object of a given class. 18 | 19 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 20 | @c mock. 21 | */ 22 | #define MKTMock(aClass) [MKTObjectMock mockForClass:aClass] 23 | 24 | #ifdef MOCKITO_SHORTHAND 25 | #define mock(aClass) MKTMock(aClass) 26 | #endif 27 | 28 | 29 | /** 30 | Returns a mock class object of a given class. 31 | 32 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 33 | @c mock. 34 | */ 35 | #define MKTMockClass(aClass) [MKTClassObjectMock mockForClass:aClass] 36 | 37 | #ifdef MOCKITO_SHORTHAND 38 | #define mockClass(aClass) MKTMockClass(aClass) 39 | #endif 40 | 41 | 42 | /** 43 | Returns a mock object implementing a given protocol. 44 | 45 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 46 | @c mockProtocol. 47 | */ 48 | #define MKTMockProtocol(aProtocol) [MKTProtocolMock mockForProtocol:aProtocol] 49 | 50 | #ifdef MOCKITO_SHORTHAND 51 | #define mockProtocol(aProtocol) MKTMockProtocol(aProtocol) 52 | #endif 53 | 54 | 55 | /** 56 | Returns a mock object of a given class that also implements a given protocol. 57 | */ 58 | 59 | #define MKTMockObjectAndProtocol(aClass, aProtocol) [MKTObjectAndProtocolMock mockForClass:aClass protocol:aProtocol] 60 | 61 | #ifdef MOCKITO_SHORTHAND 62 | #define mockObjectAndProtocol(aClass, aProtocol) MKTMockObjectAndProtocol(aClass, aProtocol) 63 | #endif 64 | 65 | OBJC_EXPORT MKTOngoingStubbing *MKTGivenWithLocation(id testCase, const char *fileName, int lineNumber, ...); 66 | 67 | /** 68 | Enables method stubbing. 69 | 70 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 71 | @c given. 72 | 73 | Use @c given when you want the mock to return particular value when particular method is called. 74 | 75 | Example: 76 | @li @ref [given([mockObject methodReturningString]) willReturn:@"foo"]; 77 | 78 | See @ref MKTOngoingStubbing for other methods to stub different types of return values. 79 | */ 80 | #define MKTGiven(methodCall) MKTGivenWithLocation(self, __FILE__, __LINE__, methodCall) 81 | 82 | #ifdef MOCKITO_SHORTHAND 83 | #define given(methodCall) MKTGiven(methodCall) 84 | #endif 85 | 86 | 87 | OBJC_EXPORT id MKTVerifyWithLocation(id mock, id testCase, const char *fileName, int lineNumber); 88 | 89 | /** 90 | Verifies certain behavior happened once. 91 | 92 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 93 | @c verify. 94 | 95 | @c verify checks that a method was invoked once, with arguments that match given OCHamcrest 96 | matchers. If an argument is not a matcher, it is implicitly wrapped in an @c equalTo matcher to 97 | check for equality. 98 | 99 | Examples: 100 | @code 101 | [verify(mockObject) someMethod:startsWith(@"foo")]; 102 | [verify(mockObject) someMethod:@"bar"]; 103 | @endcode 104 | 105 | @c verify(mockObject) is equivalent to 106 | @code 107 | verifyCount(mockObject, times(1)) 108 | @endcode 109 | */ 110 | #define MKTVerify(mock) MKTVerifyWithLocation(mock, self, __FILE__, __LINE__) 111 | 112 | #ifdef MOCKITO_SHORTHAND 113 | #undef verify 114 | #define verify(mock) MKTVerify(mock) 115 | #endif 116 | 117 | 118 | OBJC_EXPORT id MKTVerifyCountWithLocation(id mock, id mode, id testCase, const char *fileName, int lineNumber); 119 | 120 | /** 121 | Verifies certain behavior happened a given number of times. 122 | 123 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 124 | @c verifyCount. 125 | 126 | Examples: 127 | @code 128 | [verifyCount(mockObject, times(5)) someMethod:@"was called five times"]; 129 | [verifyCount(mockObject, never()) someMethod:@"was never called"]; 130 | @endcode 131 | 132 | @c verifyCount checks that a method was invoked a given number of times, with arguments that 133 | match given OCHamcrest matchers. If an argument is not a matcher, it is implicitly wrapped in an 134 | @c equalTo matcher to check for equality. 135 | */ 136 | #define MKTVerifyCount(mock, mode) MKTVerifyCountWithLocation(mock, mode, self, __FILE__, __LINE__) 137 | 138 | #ifdef MOCKITO_SHORTHAND 139 | #define verifyCount(mock, mode) MKTVerifyCount(mock, mode) 140 | #endif 141 | 142 | 143 | /** 144 | Verifies exact number of invocations. 145 | 146 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 147 | @c times. 148 | 149 | Example: 150 | @code 151 | [verifyCount(mockObject, times(2)) someMethod:@"some arg"]; 152 | @endcode 153 | */ 154 | OBJC_EXPORT id MKTTimes(NSUInteger wantedNumberOfInvocations); 155 | 156 | #ifdef MOCKITO_SHORTHAND 157 | #define times(wantedNumberOfInvocations) MKTTimes(wantedNumberOfInvocations) 158 | #endif 159 | 160 | 161 | /** 162 | Verifies that interaction did not happen. 163 | 164 | Unless there is a name clash, you can \#define @c MOCKITO_SHORTHAND and use the synonym 165 | @c never. 166 | 167 | Example: 168 | @code 169 | [verifyCount(mockObject, never()) someMethod:@"some arg"]; 170 | @endcode 171 | */ 172 | OBJC_EXPORT id MKTNever(void); 173 | 174 | #ifdef MOCKITO_SHORTHAND 175 | #define never() MKTNever() 176 | #endif 177 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/OCMockitoIOS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/OCMockitoIOS.framework/Versions/A/OCMockitoIOS -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 10K549 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | OCMockitoIOS 11 | CFBundleIdentifier 12 | org.mockito.OCMockitoIOS 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | OCMockitoIOS 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.22 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 4C199 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 10K549 33 | DTSDKName 34 | macosx10.6 35 | DTXcode 36 | 0420 37 | DTXcodeBuild 38 | 4C199 39 | NSHumanReadableCopyright 40 | Copyright © 2012 Jonathan M. Reid 41 | 42 | 43 | -------------------------------------------------------------------------------- /Code/OCMockitoIOS.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Code/Tests/CompareTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface CompareTests : SenTestCase 5 | 6 | @end 7 | 8 | @implementation CompareTests 9 | 10 | - (void)testEqual { 11 | NSString *one = @"1"; 12 | NSString *eins = [NSString stringWithFormat:@"%c", '1']; 13 | BOOL isEqualOperator = (one == eins);// ポインタ値は一致しない 14 | assertThatBool(isEqualOperator, equalToBool(NO)); 15 | BOOL isEqualMethod = [one isEqualToString:eins];// 文字列的には一致する 16 | assertThatBool(isEqualMethod, equalToBool(YES)); 17 | } 18 | @end 19 | -------------------------------------------------------------------------------- /Code/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ios-practice' target in the 'ios-practice' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | 13 | #import 14 | 15 | #import 16 | 17 | #import 18 | 19 | #define HC_SHORTHAND 20 | 21 | #endif -------------------------------------------------------------------------------- /Code/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | -------------------------------------------------------------------------------- /Code/Tests/ios-practiceTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleIdentifier 7 | info.efcl.${PRODUCT_NAME:rfc1034identifier} 8 | 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleShortVersionString 14 | 1.0 15 | CFBundleVersion 16 | 1 17 | CFBundleDevelopmentRegion 18 | en 19 | CFBundlePackageType 20 | BNDL 21 | CFBundleSignature 22 | ???? 23 | 24 | 25 | -------------------------------------------------------------------------------- /Code/Tests/ios_practiceTests.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | #define HC_SHORTHAND 5 | 6 | #import 7 | 8 | @interface ios_practiceTests : SenTestCase 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Code/Tests/ios_practiceTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ios_practiceTests.m 3 | // ios-practiceTests 4 | // 5 | // Created by azu on 10/05/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ios_practiceTests.h" 10 | #import "ReadOnly.h" 11 | 12 | 13 | #import 14 | 15 | @implementation ios_practiceTests { 16 | } 17 | 18 | 19 | - (void)testReadOnlyInit { 20 | ReadOnly *readOnly = [[ReadOnly alloc] init]; 21 | assertThat(readOnly.array, notNilValue()); 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Code/Tests/notification/LocalNotificationTest.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "LocalNotificationManager.h" 4 | 5 | @interface LocalNotificationTest : SenTestCase 6 | 7 | @end 8 | 9 | @implementation LocalNotificationTest 10 | 11 | - (void)setUp { 12 | 13 | } 14 | 15 | - (void)tearDown { 16 | [[UIApplication sharedApplication] cancelAllLocalNotifications]; 17 | } 18 | 19 | - (void)testSetOnce { 20 | NSDate *tommorowDate = [NSDate dateWithTimeIntervalSinceNow:60 * 60 * 24]; 21 | [LocalNotificationManager setNotificationAtDate:tommorowDate]; 22 | // セットしたNotificationを取り出す 23 | NSArray *notifications = [[UIApplication sharedApplication] scheduledLocalNotifications]; 24 | UILocalNotification *notification = [notifications objectAtIndex:0]; 25 | NSDate *notificationDate = [notification fireDate]; 26 | assertThat(notificationDate, equalTo(tommorowDate)); 27 | } 28 | 29 | // 毎回リセットされてから設定されているか 30 | - (void)testSetTwice { 31 | NSDate *tommorowDate = [NSDate dateWithTimeIntervalSinceNow:60 * 60 * 24]; 32 | [LocalNotificationManager setNotificationAtDate:tommorowDate]; 33 | [LocalNotificationManager setNotificationAtDate:tommorowDate]; 34 | // セットしたNotificationを取り出す 35 | NSArray *notifications = [[UIApplication sharedApplication] scheduledLocalNotifications]; 36 | UILocalNotification *notification = [notifications objectAtIndex:0]; 37 | NSDate *notificationDate = [notification fireDate]; 38 | assertThat(notificationDate, equalTo(tommorowDate)); 39 | } 40 | 41 | // 過去の日付には設定できない 42 | - (void)testSetPastDate { 43 | NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-60 * 60 * 24]; 44 | [LocalNotificationManager setNotificationAtDate:yesterday]; 45 | // セットしたNotificationを取り出す 46 | NSArray *notifications = [[UIApplication sharedApplication] scheduledLocalNotifications]; 47 | assertThat(notifications, hasCountOf(0)); 48 | } 49 | @end -------------------------------------------------------------------------------- /Code/ios-practice/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ios-practice 4 | // 5 | // Created by azu on 10/05/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @property(nonatomic, strong) UIStoryboard *storyboard; 16 | @property(nonatomic, strong) UINavigationController * navigationController; 17 | @end -------------------------------------------------------------------------------- /Code/ios-practice/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ios-practice 4 | // 5 | // Created by azu on 10/05/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate { 12 | @private 13 | UIStoryboard *_storyboard; 14 | id _navigationController; 15 | } 16 | 17 | 18 | @synthesize storyboard = _storyboard; 19 | @synthesize navigationController = _navigationController; 20 | 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 23 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 24 | // Override point for customization after application launch. 25 | 26 | self.window.backgroundColor = [UIColor whiteColor]; 27 | 28 | self.storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil]; 29 | self.navigationController = [self.storyboard instantiateInitialViewController]; 30 | self.window.rootViewController = self.navigationController; 31 | [self.window makeKeyAndVisible]; 32 | return YES; 33 | } 34 | 35 | - (void)applicationWillResignActive:(UIApplication *)application { 36 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 37 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 38 | 39 | } 40 | 41 | - (void)applicationDidEnterBackground:(UIApplication *)application { 42 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 43 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 44 | 45 | } 46 | 47 | - (void)applicationWillEnterForeground:(UIApplication *)application { 48 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 49 | 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application { 53 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 54 | 55 | } 56 | 57 | - (void)applicationWillTerminate:(UIApplication *)application { 58 | 59 | } 60 | 61 | @end -------------------------------------------------------------------------------- /Code/ios-practice/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/ios-practice/Default-568h@2x.png -------------------------------------------------------------------------------- /Code/ios-practice/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/ios-practice/Default.png -------------------------------------------------------------------------------- /Code/ios-practice/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/ios-practice/Default@2x.png -------------------------------------------------------------------------------- /Code/ios-practice/LocalNotification/LocalNotificationManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface LocalNotificationManager : NSObject 4 | 5 | + (void)setNotificationAtDate:(NSDate *)fireDate; 6 | 7 | 8 | @end -------------------------------------------------------------------------------- /Code/ios-practice/LocalNotification/LocalNotificationManager.m: -------------------------------------------------------------------------------- 1 | #import "LocalNotificationManager.h" 2 | 3 | @implementation LocalNotificationManager 4 | 5 | + (void)setNotificationAtDate:(NSDate *) fireDate { 6 | // 通知時間 < 現在時 なら設定しない 7 | if (fireDate == nil || [fireDate timeIntervalSinceNow] <= 0) { 8 | return; 9 | } 10 | // 設定する前に、設定済みの通知をキャンセルする 11 | [[UIApplication sharedApplication] cancelAllLocalNotifications]; 12 | // 設定し直す 13 | UILocalNotification *localNotification = [[UILocalNotification alloc] init]; 14 | localNotification.fireDate = fireDate; 15 | localNotification.alertBody = @"Fire!"; 16 | localNotification.timeZone = [NSTimeZone localTimeZone]; 17 | localNotification.soundName = UILocalNotificationDefaultSoundName; 18 | localNotification.alertAction = @"OPEN"; 19 | [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; 20 | } 21 | @end -------------------------------------------------------------------------------- /Code/ios-practice/Property.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface Property : NSObject 4 | 5 | @property(nonatomic, strong, readonly) NSArray *array;// 必須なのはここのみ 6 | 7 | @end -------------------------------------------------------------------------------- /Code/ios-practice/Property.m: -------------------------------------------------------------------------------- 1 | #import "Property.h" 2 | 3 | @interface Property () 4 | 5 | @property(nonatomic, strong, readwrite) NSArray *array;// readwriteを付ける 6 | // 外から見えないようにするなら@interfaceのプロパティを消す 7 | @end 8 | 9 | @implementation Property { 10 | // @implementにインスタンス変数が書けるようになったのはXcode 4.2から 11 | @private 12 | NSArray *_array;// Xcode 4.4からここは省略してもいい 13 | } 14 | 15 | @synthesize array = _array;// XCode4.5からはここも省略できる 16 | 17 | - (id)init { 18 | self = [super init]; 19 | if (!self){ 20 | return nil; 21 | } 22 | // 初期化 23 | _array = [NSArray arrayWithObjects:@"a",@"b", nil]; 24 | 25 | return self; 26 | } 27 | 28 | 29 | @end -------------------------------------------------------------------------------- /Code/ios-practice/ReadOnly.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ReadOnly : NSObject { 4 | } 5 | 6 | @property(nonatomic, strong, readonly) NSArray *array; 7 | 8 | @end -------------------------------------------------------------------------------- /Code/ios-practice/ReadOnly.m: -------------------------------------------------------------------------------- 1 | #import "ReadOnly.h" 2 | 3 | @implementation ReadOnly { 4 | 5 | @private 6 | NSArray *_array; 7 | } 8 | 9 | @synthesize array = _array; 10 | 11 | - (id)init { 12 | self = [super init]; 13 | if (!self){ 14 | return nil; 15 | } 16 | // initで一回のみ初期化 17 | _array = [NSArray arrayWithObjects:@"readonly", @"first", @"init", nil]; 18 | 19 | return self; 20 | } 21 | 22 | @end -------------------------------------------------------------------------------- /Code/ios-practice/Resources/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/ios-practice/Resources/arrow.png -------------------------------------------------------------------------------- /Code/ios-practice/Resources/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/ios-practice/Resources/arrow@2x.png -------------------------------------------------------------------------------- /Code/ios-practice/Resources/no_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/ios-practice/Resources/no_image.png -------------------------------------------------------------------------------- /Code/ios-practice/Resources/no_image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/Code/ios-practice/Resources/no_image@2x.png -------------------------------------------------------------------------------- /Code/ios-practice/Storyboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Code/ios-practice/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | -------------------------------------------------------------------------------- /Code/ios-practice/ios-practice-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleIdentifier 7 | info.efcl.${PRODUCT_NAME:rfc1034identifier} 8 | 9 | CFBundleDevelopmentRegion 10 | en 11 | CFBundleExecutable 12 | ${EXECUTABLE_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | 22 | CFBundleDisplayName 23 | ${PRODUCT_NAME} 24 | CFBundleVersion 25 | 1.0 26 | CFBundleShortVersionString 27 | 1.0 28 | LSRequiresIPhoneOS 29 | 30 | UIRequiredDeviceCapabilities 31 | 32 | armv7 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationPortrait 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | -------------------------------------------------------------------------------- /Code/ios-practice/ios-practice-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ios-practice' target in the 'ios-practice' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | 14 | #import 15 | 16 | #import 17 | #endif -------------------------------------------------------------------------------- /Code/ios-practice/ios_practice.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | ios_practice.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /Code/ios-practice/ios_practice.xcdatamodeld/ios_practice.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Code/ios-practice/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ios-practice 4 | // 5 | // Created by azu on 10/05/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /Code/ios-practice/tableView/MyTableViewController.h: -------------------------------------------------------------------------------- 1 | @interface MyTableViewController : UITableViewController { 2 | 3 | } 4 | 5 | @property(nonatomic, retain, readonly) NSArray *dataSource; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Code/ios-practice/tableView/MyTableViewController.m: -------------------------------------------------------------------------------- 1 | #import "MyTableViewController.h" 2 | 3 | #define kCellIdentifier @"CellIdentifier" 4 | 5 | @interface MyTableViewController () 6 | 7 | @property(nonatomic, retain, readwrite) NSArray *dataSource; 8 | 9 | @end 10 | 11 | @implementation MyTableViewController { 12 | @private 13 | NSArray *_dataSource; 14 | } 15 | 16 | @synthesize dataSource = _dataSource; 17 | 18 | - (id)initWithStyle:(UITableViewStyle)style { 19 | self = [super initWithStyle:style]; 20 | if (!self){ 21 | return nil; 22 | } 23 | return self; 24 | } 25 | 26 | #pragma mark - View lifecycle 27 | - (void)viewWillAppear:(BOOL)animated { 28 | [super viewWillAppear:animated]; 29 | // deselect cell 30 | [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]; 31 | // update dataSource 32 | [self updateDataSource]; 33 | // update visible cells 34 | [self updateVisibleCells]; 35 | } 36 | 37 | - (void)updateDataSource { 38 | self.dataSource = [NSArray arrayWithObjects:@"tableview", @"cell", @"custom cell", nil]; 39 | } 40 | 41 | #pragma mark - Cell Operation 42 | - (void)updateVisibleCells { 43 | // 見えているセルの表示更新 44 | for (UITableViewCell *cell in [self.tableView visibleCells]){ 45 | [self updateCell:cell atIndexPath:[self.tableView indexPathForCell:cell]]; 46 | } 47 | } 48 | 49 | // Update Cells 50 | - (void)updateCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { 51 | // imageView 52 | cell.imageView.image = [UIImage imageNamed:@"no_image.png"]; 53 | // textLabel 54 | NSString *text = [self.dataSource objectAtIndex:(NSUInteger) indexPath.row]; 55 | cell.textLabel.text = text; 56 | NSString *detailText = @"詳細のtextLabel"; 57 | cell.detailTextLabel.text = detailText; 58 | // arrow accessoryView 59 | UIImage *arrowImage = [UIImage imageNamed:@"arrow.png"]; 60 | cell.accessoryView = [[UIImageView alloc] initWithImage:arrowImage]; 61 | } 62 | //--------------------------------------------------------------// 63 | #pragma mark -- UITableViewDataSource -- 64 | //--------------------------------------------------------------// 65 | - (NSInteger)tableView:(UITableView *)tableView 66 | numberOfRowsInSection:(NSInteger)section { 67 | return [self.dataSource count]; 68 | } 69 | 70 | - (UITableViewCell *)tableView:(UITableView *)tableView 71 | cellForRowAtIndexPath:(NSIndexPath *)indexPath { 72 | NSString *cellIdentifier = kCellIdentifier; 73 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 74 | if (!cell){ 75 | cell = [[UITableViewCell alloc] 76 | initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; 77 | } 78 | // Configure the cell... 79 | cell.accessoryType = UITableViewCellAccessoryNone; 80 | [self updateCell:cell atIndexPath:indexPath]; 81 | 82 | return cell; 83 | } 84 | 85 | //--------------------------------------------------------------// 86 | #pragma mark -- UITableViewDelegate -- 87 | //--------------------------------------------------------------// 88 | 89 | - (void)tableView:(UITableView *)tableView 90 | didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 91 | 92 | // ハイライトを外す 93 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 94 | } 95 | @end 96 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext livehtml 18 | 19 | help: 20 | @echo "Please use \`make ' where is one of" 21 | @echo " html to make standalone HTML files" 22 | @echo " dirhtml to make HTML files named index.html in directories" 23 | @echo " singlehtml to make a single large HTML file" 24 | @echo " pickle to make pickle files" 25 | @echo " json to make JSON files" 26 | @echo " htmlhelp to make HTML files and a HTML help project" 27 | @echo " qthelp to make HTML files and a qthelp project" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 | @echo " text to make text files" 33 | @echo " man to make manual pages" 34 | @echo " texinfo to make Texinfo files" 35 | @echo " info to make Texinfo files and run them through makeinfo" 36 | @echo " gettext to make PO message catalogs" 37 | @echo " changes to make an overview of all changed/added/deprecated items" 38 | @echo " linkcheck to check all external links for integrity" 39 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 | 41 | 42 | clean: 43 | -rm -rf $(BUILDDIR)/* 44 | 45 | html: 46 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 47 | @echo 48 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 49 | 50 | dirhtml: 51 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 52 | @echo 53 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 54 | 55 | singlehtml: 56 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 57 | @echo 58 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 59 | 60 | pickle: 61 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 62 | @echo 63 | @echo "Build finished; now you can process the pickle files." 64 | 65 | json: 66 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 67 | @echo 68 | @echo "Build finished; now you can process the JSON files." 69 | 70 | htmlhelp: 71 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 72 | @echo 73 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 74 | ".hhp project file in $(BUILDDIR)/htmlhelp." 75 | 76 | qthelp: 77 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 78 | @echo 79 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 80 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 81 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ios-conventions.qhcp" 82 | @echo "To view the help file:" 83 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ios-conventions.qhc" 84 | 85 | devhelp: 86 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 87 | @echo 88 | @echo "Build finished." 89 | @echo "To view the help file:" 90 | @echo "# mkdir -p $$HOME/.local/share/devhelp/ios-conventions" 91 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ios-conventions" 92 | @echo "# devhelp" 93 | 94 | epub: 95 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 96 | @echo 97 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 98 | 99 | latex: 100 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 101 | @echo 102 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 103 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 104 | "(use \`make latexpdf' here to do that automatically)." 105 | 106 | latexpdf: 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 | @echo "Running LaTeX files through pdflatex..." 109 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 110 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 111 | 112 | text: 113 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 114 | @echo 115 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 116 | 117 | man: 118 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 119 | @echo 120 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 121 | 122 | texinfo: 123 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 124 | @echo 125 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 126 | @echo "Run \`make' in that directory to run these through makeinfo" \ 127 | "(use \`make info' here to do that automatically)." 128 | 129 | info: 130 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 131 | @echo "Running Texinfo files through makeinfo..." 132 | make -C $(BUILDDIR)/texinfo info 133 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 134 | 135 | gettext: 136 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 137 | @echo 138 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 139 | 140 | changes: 141 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 142 | @echo 143 | @echo "The overview file is in $(BUILDDIR)/changes." 144 | 145 | linkcheck: 146 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 147 | @echo 148 | @echo "Link check complete; look for any errors in the above output " \ 149 | "or in $(BUILDDIR)/linkcheck/output.txt." 150 | 151 | doctest: 152 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 153 | @echo "Testing of doctests in the sources finished, look at the " \ 154 | "results in $(BUILDDIR)/doctest/output.txt." 155 | 156 | livehtml: html 157 | livereload -p 8000 -b $(BUILDDIR)/html -------------------------------------------------------------------------------- /_static/MyTableViewSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/_static/MyTableViewSample.png -------------------------------------------------------------------------------- /_static/TableView_Cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/_static/TableView_Cell.png -------------------------------------------------------------------------------- /_static/TableView_cell_content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/_static/TableView_cell_content.png -------------------------------------------------------------------------------- /_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | {% block linktags %} 3 | 4 | {% endblock %} -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | sandbox 3 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/README.markdown: -------------------------------------------------------------------------------- 1 | Repo for a Bootstrap based sphinx theme with lots of customizability (e.g. 2 | google analytics, logo etc). 3 | 4 | Theme Options 5 | ============= 6 | 7 | * logo\_icon: logo icon url (can be local in \_static) to use in top bar (in 8 | addition to title). Will be rendered with a height of 25px. 9 | * git\_repo: git(hub) repository link for the fork me badge. Example: 10 | `https://github.com/okfn/sphinx-theme-okfn` 11 | 12 | Configuring the sidebar: 13 | 14 | * Use the standard sphinx sidebars setup: http://sphinx.pocoo.org/config.html#confval-html\_sidebars 15 | 16 | * E.g. to have the global ToC there just add globaltoc.html to the list. To 17 | have local table of contents (for current page) at localtoc.html to the 18 | list. 19 | 20 | Configuring the Footer 21 | ---------------------- 22 | 23 | Override the footer.html template. 24 | 25 | 26 | Configuring the Top Bar 27 | ----------------------- 28 | 29 | You can add navigation links (and other material) to the top bar by overriding the navbar-nav.html template. This material will fit into the bootstrap topbar after the main brand link on the left. An example navbar-nav would be: 30 | 31 | 34 | 35 | 36 | How to Use 37 | ========== 38 | 39 | Imagine you have a sphinx project with layout like: 40 | 41 | source 42 | conf.py 43 | {other-dirs ...} 44 | 45 | You would do: 46 | 47 | git submodule add git://github.com/okfn/sphinx-theme-okfn.git source/_themes/sphinx-theme-okfn 48 | # then commit ... 49 | git commit -m "Adding submodule for sphinx-theme-okfn" 50 | 51 | Then in `conf.py` you would config like: 52 | 53 |
54 | sys.path.append(os.path.abspath('_themes'))
55 | html_theme_path = ['_themes']
56 | html_theme = 'sphinx-theme-okfn'
57 | html_theme_options = {
58 |         'logo_icon': ...
59 |         'google_analytics_id': ...
60 |     }
61 | 
62 | 63 | License 64 | ======= 65 | 66 | Copyright (c) 2012 Open Knowledge Foundation 67 | 68 | Permission is hereby granted, free of charge, to any person obtaining a copy 69 | of this software and associated documentation files (the "Software"), to deal 70 | in the Software without restriction, including without limitation the rights 71 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 72 | copies of the Software, and to permit persons to whom the Software is 73 | furnished to do so, subject to the following conditions: 74 | 75 | The above copyright notice and this permission notice shall be included in 76 | all copies or substantial portions of the Software. 77 | 78 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 79 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 80 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 81 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 82 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 83 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 84 | THE SOFTWARE. 85 | 86 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/footer.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |

8 | {%- if last_updated %} 9 | {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
10 | {%- endif %} 11 | {%- if show_sphinx %} 12 | {% trans sphinx_version=sphinx_version|e %}Created using Sphinx {{ sphinx_version }}.{% endtrans %}
13 | {%- endif %} 14 |

15 | 16 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/globaltoc.html: -------------------------------------------------------------------------------- 1 |
2 |

Table of Contents

3 | {{ toctree(maxdepth=3) }} 4 |
5 | 6 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "basic/layout.html" %} 2 | {% set script_files = script_files + ['_static/bootstrap-css-tweaks.js'] %} 3 | {% set css_files = ['_static/css/bootstrap.css', '_static/css/bootstrap-responsive.css', '_static/bootstrap-sphinx.css'] + css_files %} 4 | 5 | {%- block extrahead %} 6 | {% endblock %} 7 | 8 | {% block header %} 9 | {% if theme_git_repo %} 10 | Fork me on GitHub 12 | {% endif %} 13 | 32 | {% endblock %} 33 | 34 | {# Silence the sidebar's, relbar's #} 35 | {% block sidebar1 %}{% endblock %} 36 | {% block relbar1 %}{% endblock %} 37 | {% block relbar2 %}{% endblock %} 38 | 39 | {%- block content %} 40 |
41 |
42 |
43 |
44 | {% block body %} {% endblock %} 45 |
46 |
47 |
48 | 53 |
54 |
55 |
56 | {%- endblock %} 57 | 58 | {%- block footer %} 59 | 60 |
61 |
62 |
63 | {% include "footer.html" %} 64 |
65 |
66 |
67 | 68 | 69 | {% if theme_google_analytics_id %} 70 | 81 | {% endif %} 82 | {% if theme_auto_reload %} 83 | 88 | {% endif %} 89 | {%- endblock %} 90 | 91 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/localtoc.html: -------------------------------------------------------------------------------- 1 |
2 |

On this Page

3 | {{ toc }} 4 |
5 | 6 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/searchbox.html: -------------------------------------------------------------------------------- 1 | {%- if pagename != "search" %} 2 |
3 | 4 | 5 | 6 | 7 |
8 | {%- endif %} 9 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/static/bootstrap-css-tweaks.js: -------------------------------------------------------------------------------- 1 | jQuery(function($){ 2 | $('table.docutils').addClass('table table-striped table-bordered'); 3 | $('table.docutils').removeClass('docutils'); 4 | 5 | $('.admonition').addClass('alert alert-block'); 6 | $('.admonition.note').addClass('alert-info'); 7 | $('.admonition.warning').addClass('alert-error'); 8 | }); 9 | jQuery(function($){ 10 | // options によっては存在しない 11 | if(!$('#live-reload')){ 12 | return; 13 | } 14 | 15 | function disableButton(){ 16 | $('#live-reload').addClass("disabled"); 17 | } 18 | var autoReload = function(){ 19 | if (autoReload.timer){ 20 | clearInterval(autoReload.timer); 21 | $("#live-reload").removeClass("disabled") 22 | return; 23 | } 24 | disableButton(); 25 | var content = {}; 26 | autoReload.timer = setInterval(function(){ 27 | var req = new XMLHttpRequest(); 28 | req.open("GET", location.href, true); 29 | req.onload = function(){ 30 | if (content.old && req.responseText != content.old){ 31 | location.reload(); 32 | } 33 | content.old = req.responseText; 34 | }; 35 | req.send(null); 36 | }, 1000); 37 | }; 38 | $('#live-reload').click(function(){ 39 | autoReload(); 40 | }); 41 | // exports 42 | if(typeof window.okfn === 'undefined'){ 43 | window.okfn = {}; 44 | } 45 | window.okfn.autoReload = autoReload; 46 | 47 | }); -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/static/bootstrap-sphinx.css: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-sphinx.css 3 | * ~~~~~~~~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- Twitter Bootstrap theme. 6 | */ 7 | html, body { 8 | background-color: #eee; 9 | } 10 | 11 | /**************** Typo *************************/ 12 | 13 | body, p, blockquote p { 14 | font-family: Palatino, georgia, 'times new roman', serif; 15 | font-size: 16px; 16 | line-height: 25px; 17 | } 18 | 19 | li { 20 | line-height: 25px; 21 | } 22 | 23 | h1 { 24 | font-size: 36px; 25 | margin-bottom: 15px; 26 | } 27 | 28 | h2 { 29 | line-height: 50px; 30 | } 31 | 32 | blockquote p { 33 | font-style: italic; 34 | margin-bottom: 1em; 35 | } 36 | 37 | a { 38 | color: #005580; 39 | } 40 | 41 | /* code styling */ 42 | 43 | .docutils.literal { 44 | font-family: Menlo, Monaco, "Courier New", monospace; 45 | font-size: 12px; 46 | color: #333333; 47 | -webkit-border-radius: 3px; 48 | -moz-border-radius: 3px; 49 | border-radius: 3px; 50 | 51 | padding: 0 3px 2px; 52 | 53 | background-color: #f7f7f9; 54 | border: 1px solid #e1e1e8; 55 | } 56 | 57 | .docutils.literal.file { 58 | color: #4070A0; 59 | background: url("./img/document_text.png") no-repeat 0 50%; 60 | padding-left: 16px; 61 | } 62 | 63 | /****************** Simpler Navbar *********************/ 64 | 65 | .navbar-inner { 66 | border-radius: 4px; 67 | -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); 68 | -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); 69 | box-shadow: 0 1px 10px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); 70 | padding-top: 0.5em; 71 | padding-bottom: 0.5em; 72 | } 73 | 74 | .navbar .brand, 75 | .navbar-search .search-query, 76 | .navbar-search .search-query:hover { 77 | } 78 | 79 | .navbar a.brand { 80 | font-weight: bold; 81 | } 82 | 83 | .navbar .brand .version { 84 | font-size: 90%; 85 | } 86 | 87 | /**************** Sidebar **********************/ 88 | 89 | div.sphinxsidebar { 90 | float: none; 91 | width: auto; 92 | margin-left: auto; 93 | font-size: inherit; 94 | } 95 | 96 | div.sphinxsidebarwrapper { 97 | padding: 0; 98 | } 99 | 100 | div.sphinxsidebar, div.sphinxsidebar p { 101 | font-size: 14px; 102 | } 103 | 104 | .toc > ul { 105 | margin-left: 0; 106 | border-bottom: solid 2px #ddd; 107 | } 108 | 109 | .toc li a.current { 110 | display: block; 111 | color: #ffffff; 112 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); 113 | background-color: #0088cc; 114 | margin-left: -19px; 115 | margin-right: -19px; 116 | padding-left: 19px; 117 | } 118 | 119 | /**************** Main Page **********************/ 120 | 121 | .content { 122 | background-color: #fff; 123 | padding: 20px; 124 | margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */ 125 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .15); 126 | -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .15); 127 | box-shadow: 0 1px 2px rgba(0, 0, 0, .15); 128 | } 129 | 130 | div.section { 131 | padding-top: 50px; 132 | } 133 | 134 | footer { 135 | margin: 15px 0; 136 | } 137 | 138 | div.documentwrapper { 139 | float: left; 140 | width: 100%; 141 | } 142 | 143 | .navbar .logo-icon img { 144 | float: left; 145 | max-height: 28px; 146 | padding: 5px 10px 0 0; 147 | } 148 | 149 | .navbar .okfn-logo img { 150 | margin-top: 5px; 151 | margin-left: 4px; 152 | } 153 | 154 | /* OKFN Footer */ 155 | 156 | body { 157 | padding-bottom: 0; 158 | } 159 | 160 | footer { 161 | margin-bottom: 0; 162 | } 163 | 164 | .navbar { 165 | font-family: "OpenSansLight", "Helvetica Neue", Helvetica, Arial, sans-serif; 166 | font-size: 13px; 167 | line-height: 18px; 168 | } 169 | 170 | footer, 171 | footer p { 172 | font-family: "OpenSansLight", "Helvetica Neue", Helvetica, Arial, sans-serif; 173 | font-size: 13px; 174 | line-height: 22px; 175 | } 176 | 177 | footer { 178 | background: #222222 url('img/okfn-watermark.png') top right no-repeat; 179 | margin-top: 50px; 180 | padding: 0; 181 | } 182 | 183 | footer > .inner { 184 | background: url('img/footer-bevel.png') top repeat-x; 185 | padding: 10px 0 30px 0; 186 | color: #fff; 187 | text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.2); 188 | min-height: 190px; 189 | } 190 | 191 | footer ul.footer-links { 192 | } 193 | 194 | footer a, footer a:hover { 195 | color: #AEEBDF; 196 | } 197 | 198 | 199 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/static/css/bootstrap-responsive.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.0.0 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | .hidden { 11 | display: none; 12 | visibility: hidden; 13 | } 14 | @media (max-width: 480px) { 15 | .nav-collapse { 16 | -webkit-transform: translate3d(0, 0, 0); 17 | } 18 | .page-header h1 small { 19 | display: block; 20 | line-height: 18px; 21 | } 22 | input[class*="span"], 23 | select[class*="span"], 24 | textarea[class*="span"], 25 | .uneditable-input { 26 | display: block; 27 | width: 100%; 28 | height: 28px; 29 | /* Make inputs at least the height of their button counterpart */ 30 | 31 | /* Makes inputs behave like true block-level elements */ 32 | 33 | -webkit-box-sizing: border-box; 34 | /* Older Webkit */ 35 | 36 | -moz-box-sizing: border-box; 37 | /* Older FF */ 38 | 39 | -ms-box-sizing: border-box; 40 | /* IE8 */ 41 | 42 | box-sizing: border-box; 43 | /* CSS3 spec*/ 44 | 45 | } 46 | .input-prepend input[class*="span"], .input-append input[class*="span"] { 47 | width: auto; 48 | } 49 | input[type="checkbox"], input[type="radio"] { 50 | border: 1px solid #ccc; 51 | } 52 | .form-horizontal .control-group > label { 53 | float: none; 54 | width: auto; 55 | padding-top: 0; 56 | text-align: left; 57 | } 58 | .form-horizontal .controls { 59 | margin-left: 0; 60 | } 61 | .form-horizontal .control-list { 62 | padding-top: 0; 63 | } 64 | .form-horizontal .form-actions { 65 | padding-left: 10px; 66 | padding-right: 10px; 67 | } 68 | .modal { 69 | position: absolute; 70 | top: 10px; 71 | left: 10px; 72 | right: 10px; 73 | width: auto; 74 | margin: 0; 75 | } 76 | .modal.fade.in { 77 | top: auto; 78 | } 79 | .modal-header .close { 80 | padding: 10px; 81 | margin: -10px; 82 | } 83 | .carousel-caption { 84 | position: static; 85 | } 86 | } 87 | @media (max-width: 768px) { 88 | .container { 89 | width: auto; 90 | padding: 0 20px; 91 | } 92 | .row-fluid { 93 | width: 100%; 94 | } 95 | .row { 96 | margin-left: 0; 97 | } 98 | .row > [class*="span"], .row-fluid > [class*="span"] { 99 | float: none; 100 | display: block; 101 | width: auto; 102 | margin: 0; 103 | } 104 | } 105 | @media (min-width: 768px) and (max-width: 980px) { 106 | .row { 107 | margin-left: -20px; 108 | *zoom: 1; 109 | } 110 | .row:before, .row:after { 111 | display: table; 112 | content: ""; 113 | } 114 | .row:after { 115 | clear: both; 116 | } 117 | [class*="span"] { 118 | float: left; 119 | margin-left: 20px; 120 | } 121 | .span1 { 122 | width: 42px; 123 | } 124 | .span2 { 125 | width: 104px; 126 | } 127 | .span3 { 128 | width: 166px; 129 | } 130 | .span4 { 131 | width: 228px; 132 | } 133 | .span5 { 134 | width: 290px; 135 | } 136 | .span6 { 137 | width: 352px; 138 | } 139 | .span7 { 140 | width: 414px; 141 | } 142 | .span8 { 143 | width: 476px; 144 | } 145 | .span9 { 146 | width: 538px; 147 | } 148 | .span10 { 149 | width: 600px; 150 | } 151 | .span11 { 152 | width: 662px; 153 | } 154 | .span12, .container { 155 | width: 724px; 156 | } 157 | .offset1 { 158 | margin-left: 82px; 159 | } 160 | .offset2 { 161 | margin-left: 144px; 162 | } 163 | .offset3 { 164 | margin-left: 206px; 165 | } 166 | .offset4 { 167 | margin-left: 268px; 168 | } 169 | .offset5 { 170 | margin-left: 330px; 171 | } 172 | .offset6 { 173 | margin-left: 392px; 174 | } 175 | .offset7 { 176 | margin-left: 454px; 177 | } 178 | .offset8 { 179 | margin-left: 516px; 180 | } 181 | .offset9 { 182 | margin-left: 578px; 183 | } 184 | .offset10 { 185 | margin-left: 640px; 186 | } 187 | .offset11 { 188 | margin-left: 702px; 189 | } 190 | .row-fluid { 191 | width: 100%; 192 | *zoom: 1; 193 | } 194 | .row-fluid:before, .row-fluid:after { 195 | display: table; 196 | content: ""; 197 | } 198 | .row-fluid:after { 199 | clear: both; 200 | } 201 | .row-fluid > [class*="span"] { 202 | float: left; 203 | margin-left: 2.762430939%; 204 | } 205 | .row-fluid > [class*="span"]:first-child { 206 | margin-left: 0; 207 | } 208 | .row-fluid .span1 { 209 | width: 5.801104972%; 210 | } 211 | .row-fluid .span2 { 212 | width: 14.364640883%; 213 | } 214 | .row-fluid .span3 { 215 | width: 22.928176794%; 216 | } 217 | .row-fluid .span4 { 218 | width: 31.491712705%; 219 | } 220 | .row-fluid .span5 { 221 | width: 40.055248616%; 222 | } 223 | .row-fluid .span6 { 224 | width: 48.618784527%; 225 | } 226 | .row-fluid .span7 { 227 | width: 57.182320438000005%; 228 | } 229 | .row-fluid .span8 { 230 | width: 65.74585634900001%; 231 | } 232 | .row-fluid .span9 { 233 | width: 74.30939226%; 234 | } 235 | .row-fluid .span10 { 236 | width: 82.87292817100001%; 237 | } 238 | .row-fluid .span11 { 239 | width: 91.436464082%; 240 | } 241 | .row-fluid .span12 { 242 | width: 99.999999993%; 243 | } 244 | input.span1, textarea.span1, .uneditable-input.span1 { 245 | width: 32px; 246 | } 247 | input.span2, textarea.span2, .uneditable-input.span2 { 248 | width: 94px; 249 | } 250 | input.span3, textarea.span3, .uneditable-input.span3 { 251 | width: 156px; 252 | } 253 | input.span4, textarea.span4, .uneditable-input.span4 { 254 | width: 218px; 255 | } 256 | input.span5, textarea.span5, .uneditable-input.span5 { 257 | width: 280px; 258 | } 259 | input.span6, textarea.span6, .uneditable-input.span6 { 260 | width: 342px; 261 | } 262 | input.span7, textarea.span7, .uneditable-input.span7 { 263 | width: 404px; 264 | } 265 | input.span8, textarea.span8, .uneditable-input.span8 { 266 | width: 466px; 267 | } 268 | input.span9, textarea.span9, .uneditable-input.span9 { 269 | width: 528px; 270 | } 271 | input.span10, textarea.span10, .uneditable-input.span10 { 272 | width: 590px; 273 | } 274 | input.span11, textarea.span11, .uneditable-input.span11 { 275 | width: 652px; 276 | } 277 | input.span12, textarea.span12, .uneditable-input.span12 { 278 | width: 714px; 279 | } 280 | } 281 | @media (max-width: 980px) { 282 | body { 283 | padding-top: 0; 284 | } 285 | .navbar-fixed-top { 286 | position: static; 287 | margin-bottom: 18px; 288 | } 289 | .navbar-fixed-top .navbar-inner { 290 | padding: 5px; 291 | } 292 | .navbar .container { 293 | width: auto; 294 | padding: 0; 295 | } 296 | .navbar .brand { 297 | padding-left: 10px; 298 | padding-right: 10px; 299 | margin: 0 0 0 -5px; 300 | } 301 | .navbar .nav-collapse { 302 | clear: left; 303 | } 304 | .navbar .nav { 305 | float: none; 306 | margin: 0 0 9px; 307 | } 308 | .navbar .nav > li { 309 | float: none; 310 | } 311 | .navbar .nav > li > a { 312 | margin-bottom: 2px; 313 | } 314 | .navbar .nav > .divider-vertical { 315 | display: none; 316 | } 317 | .navbar .nav > li > a, .navbar .dropdown-menu a { 318 | padding: 6px 15px; 319 | font-weight: bold; 320 | color: #999999; 321 | -webkit-border-radius: 3px; 322 | -moz-border-radius: 3px; 323 | border-radius: 3px; 324 | } 325 | .navbar .dropdown-menu li + li a { 326 | margin-bottom: 2px; 327 | } 328 | .navbar .nav > li > a:hover, .navbar .dropdown-menu a:hover { 329 | background-color: #222222; 330 | } 331 | .navbar .dropdown-menu { 332 | position: static; 333 | top: auto; 334 | left: auto; 335 | float: none; 336 | display: block; 337 | max-width: none; 338 | margin: 0 15px; 339 | padding: 0; 340 | background-color: transparent; 341 | border: none; 342 | -webkit-border-radius: 0; 343 | -moz-border-radius: 0; 344 | border-radius: 0; 345 | -webkit-box-shadow: none; 346 | -moz-box-shadow: none; 347 | box-shadow: none; 348 | } 349 | .navbar .dropdown-menu:before, .navbar .dropdown-menu:after { 350 | display: none; 351 | } 352 | .navbar .dropdown-menu .divider { 353 | display: none; 354 | } 355 | .navbar-form, .navbar-search { 356 | float: none; 357 | padding: 9px 15px; 358 | margin: 9px 0; 359 | border-top: 1px solid #222222; 360 | border-bottom: 1px solid #222222; 361 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 362 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 363 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 364 | } 365 | .navbar .nav.pull-right { 366 | float: none; 367 | margin-left: 0; 368 | } 369 | .navbar-static .navbar-inner { 370 | padding-left: 10px; 371 | padding-right: 10px; 372 | } 373 | .btn-navbar { 374 | display: block; 375 | } 376 | .nav-collapse { 377 | overflow: hidden; 378 | height: 0; 379 | } 380 | } 381 | @media (min-width: 980px) { 382 | .nav-collapse.collapse { 383 | height: auto !important; 384 | } 385 | } 386 | @media (min-width: 1200px) { 387 | .row { 388 | margin-left: -30px; 389 | *zoom: 1; 390 | } 391 | .row:before, .row:after { 392 | display: table; 393 | content: ""; 394 | } 395 | .row:after { 396 | clear: both; 397 | } 398 | [class*="span"] { 399 | float: left; 400 | margin-left: 30px; 401 | } 402 | .span1 { 403 | width: 70px; 404 | } 405 | .span2 { 406 | width: 170px; 407 | } 408 | .span3 { 409 | width: 270px; 410 | } 411 | .span4 { 412 | width: 370px; 413 | } 414 | .span5 { 415 | width: 470px; 416 | } 417 | .span6 { 418 | width: 570px; 419 | } 420 | .span7 { 421 | width: 670px; 422 | } 423 | .span8 { 424 | width: 770px; 425 | } 426 | .span9 { 427 | width: 870px; 428 | } 429 | .span10 { 430 | width: 970px; 431 | } 432 | .span11 { 433 | width: 1070px; 434 | } 435 | .span12, .container { 436 | width: 1170px; 437 | } 438 | .offset1 { 439 | margin-left: 130px; 440 | } 441 | .offset2 { 442 | margin-left: 230px; 443 | } 444 | .offset3 { 445 | margin-left: 330px; 446 | } 447 | .offset4 { 448 | margin-left: 430px; 449 | } 450 | .offset5 { 451 | margin-left: 530px; 452 | } 453 | .offset6 { 454 | margin-left: 630px; 455 | } 456 | .offset7 { 457 | margin-left: 730px; 458 | } 459 | .offset8 { 460 | margin-left: 830px; 461 | } 462 | .offset9 { 463 | margin-left: 930px; 464 | } 465 | .offset10 { 466 | margin-left: 1030px; 467 | } 468 | .offset11 { 469 | margin-left: 1130px; 470 | } 471 | .row-fluid { 472 | width: 100%; 473 | *zoom: 1; 474 | } 475 | .row-fluid:before, .row-fluid:after { 476 | display: table; 477 | content: ""; 478 | } 479 | .row-fluid:after { 480 | clear: both; 481 | } 482 | .row-fluid > [class*="span"] { 483 | float: left; 484 | margin-left: 2.564102564%; 485 | } 486 | .row-fluid > [class*="span"]:first-child { 487 | margin-left: 0; 488 | } 489 | .row-fluid .span1 { 490 | width: 5.982905983%; 491 | } 492 | .row-fluid .span2 { 493 | width: 14.529914530000001%; 494 | } 495 | .row-fluid .span3 { 496 | width: 23.076923077%; 497 | } 498 | .row-fluid .span4 { 499 | width: 31.623931624%; 500 | } 501 | .row-fluid .span5 { 502 | width: 40.170940171000005%; 503 | } 504 | .row-fluid .span6 { 505 | width: 48.717948718%; 506 | } 507 | .row-fluid .span7 { 508 | width: 57.264957265%; 509 | } 510 | .row-fluid .span8 { 511 | width: 65.81196581200001%; 512 | } 513 | .row-fluid .span9 { 514 | width: 74.358974359%; 515 | } 516 | .row-fluid .span10 { 517 | width: 82.905982906%; 518 | } 519 | .row-fluid .span11 { 520 | width: 91.45299145300001%; 521 | } 522 | .row-fluid .span12 { 523 | width: 100%; 524 | } 525 | input.span1, textarea.span1, .uneditable-input.span1 { 526 | width: 60px; 527 | } 528 | input.span2, textarea.span2, .uneditable-input.span2 { 529 | width: 160px; 530 | } 531 | input.span3, textarea.span3, .uneditable-input.span3 { 532 | width: 260px; 533 | } 534 | input.span4, textarea.span4, .uneditable-input.span4 { 535 | width: 360px; 536 | } 537 | input.span5, textarea.span5, .uneditable-input.span5 { 538 | width: 460px; 539 | } 540 | input.span6, textarea.span6, .uneditable-input.span6 { 541 | width: 560px; 542 | } 543 | input.span7, textarea.span7, .uneditable-input.span7 { 544 | width: 660px; 545 | } 546 | input.span8, textarea.span8, .uneditable-input.span8 { 547 | width: 760px; 548 | } 549 | input.span9, textarea.span9, .uneditable-input.span9 { 550 | width: 860px; 551 | } 552 | input.span10, textarea.span10, .uneditable-input.span10 { 553 | width: 960px; 554 | } 555 | input.span11, textarea.span11, .uneditable-input.span11 { 556 | width: 1060px; 557 | } 558 | input.span12, textarea.span12, .uneditable-input.span12 { 559 | width: 1160px; 560 | } 561 | .thumbnails { 562 | margin-left: -30px; 563 | } 564 | .thumbnails > li { 565 | margin-left: 30px; 566 | } 567 | } 568 | -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/static/img/document_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/_themes/sphinx-theme-okfn/static/img/document_text.png -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/static/img/footer-bevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/_themes/sphinx-theme-okfn/static/img/footer-bevel.png -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/static/img/okfn-watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azu/ios-practice/03d1501209093dd4101f27db83c0c7e681e4294f/_themes/sphinx-theme-okfn/static/img/okfn-watermark.png -------------------------------------------------------------------------------- /_themes/sphinx-theme-okfn/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = basic.css 4 | pygments_style = tango 5 | 6 | [options] 7 | logo_icon = 8 | git_repo = 9 | show_okfn_logo = False 10 | google_analytics_id = 11 | show_version = False 12 | auto_reload = False 13 | -------------------------------------------------------------------------------- /conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # ios-practice documentation build configuration file, created by 4 | # sphinx-quickstart on Fri Oct 5 10:51:48 2012. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys, os 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | #sys.path.insert(0, os.path.abspath('.')) 20 | 21 | # -- General configuration ----------------------------------------------------- 22 | 23 | # If your documentation needs a minimal Sphinx version, state it here. 24 | #needs_sphinx = '1.0' 25 | 26 | # Add any Sphinx extension module names here, as strings. They can be extensions 27 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 28 | extensions = ['sphinx.ext.todo'] 29 | 30 | todo_include_todos=True 31 | # Add any paths that contain templates here, relative to this directory. 32 | templates_path = ['_templates'] 33 | 34 | # The suffix of source filenames. 35 | source_suffix = '.rst' 36 | 37 | # The encoding of source files. 38 | #source_encoding = 'utf-8-sig' 39 | 40 | # The master toctree document. 41 | master_doc = 'index' 42 | 43 | # General information about the project. 44 | project = u'ios-practice' 45 | copyright = u'2012, azu' 46 | 47 | # The version info for the project you're documenting, acts as replacement for 48 | # |version| and |release|, also used in various other places throughout the 49 | # built documents. 50 | # 51 | # The short X.Y version. 52 | version = '0.1' 53 | # The full version, including alpha/beta/rc tags. 54 | release = '0.1' 55 | 56 | # The language for content autogenerated by Sphinx. Refer to documentation 57 | # for a list of supported languages. 58 | language = 'ja' 59 | 60 | # There are two options for replacing |today|: either, you set today to some 61 | # non-false value, then it is used: 62 | #today = '' 63 | # Else, today_fmt is used as the format for a strftime call. 64 | #today_fmt = '%B %d, %Y' 65 | 66 | # List of patterns, relative to source directory, that match files and 67 | # directories to ignore when looking for source files. 68 | exclude_patterns = ['_build', 'readme.rst','Code'] 69 | 70 | # The reST default role (used for this markup: `text`) to use for all documents. 71 | #default_role = None 72 | 73 | # If true, '()' will be appended to :func: etc. cross-reference text. 74 | #add_function_parentheses = True 75 | 76 | # If true, the current module name will be prepended to all description 77 | # unit titles (such as .. function::). 78 | #add_module_names = True 79 | 80 | # If true, sectionauthor and moduleauthor directives will be shown in the 81 | # output. They are ignored by default. 82 | #show_authors = False 83 | 84 | # The name of the Pygments (syntax highlighting) style to use. 85 | pygments_style = 'sphinx' 86 | 87 | # A list of ignored prefixes for module index sorting. 88 | #modindex_common_prefix = [] 89 | 90 | 91 | # -- Options for HTML output --------------------------------------------------- 92 | 93 | # The theme to use for HTML and HTML Help pages. See the documentation for 94 | # a list of builtin themes. 95 | sys.path.append(os.path.abspath('_themes')) 96 | html_theme_path = ['_themes'] 97 | html_theme = 'sphinx-theme-okfn' 98 | html_theme_options = { 99 | 'show_okfn_logo': False, 100 | 'git_repo': 'https://github.com/azu/ios-practice' 101 | } 102 | 103 | # reload option 104 | import os 105 | on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # Trueならreadthedocs 106 | if on_rtd: 107 | html_theme_options["auto_reload"] = False 108 | else: 109 | html_theme_options["auto_reload"] = True 110 | 111 | # The name for this set of Sphinx documents. If None, it defaults to 112 | # " v documentation". 113 | #html_title = None 114 | 115 | # A shorter title for the navigation bar. Default is the same as html_title. 116 | #html_short_title = None 117 | 118 | # The name of an image file (relative to this directory) to place at the top 119 | # of the sidebar. 120 | #html_logo = None 121 | 122 | # The name of an image file (within the static path) to use as favicon of the 123 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 124 | # pixels large. 125 | #html_favicon = None 126 | 127 | # Add any paths that contain custom static files (such as style sheets) here, 128 | # relative to this directory. They are copied after the builtin static files, 129 | # so a file named "default.css" will overwrite the builtin "default.css". 130 | html_static_path = ['_static'] 131 | 132 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 133 | # using the given strftime format. 134 | #html_last_updated_fmt = '%b %d, %Y' 135 | 136 | # If true, SmartyPants will be used to convert quotes and dashes to 137 | # typographically correct entities. 138 | #html_use_smartypants = True 139 | 140 | # Custom sidebar templates, maps document names to template names. 141 | #html_sidebars = {} 142 | 143 | # Additional templates that should be rendered to pages, maps page names to 144 | # template names. 145 | #html_additional_pages = {} 146 | 147 | # If false, no module index is generated. 148 | #html_domain_indices = True 149 | 150 | # If false, no index is generated. 151 | #html_use_index = True 152 | 153 | # If true, the index is split into individual pages for each letter. 154 | #html_split_index = False 155 | 156 | # If true, links to the reST sources are added to the pages. 157 | #html_show_sourcelink = True 158 | 159 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 160 | #html_show_sphinx = True 161 | 162 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 163 | #html_show_copyright = True 164 | 165 | # If true, an OpenSearch description file will be output, and all pages will 166 | # contain a tag referring to it. The value of this option must be the 167 | # base URL from which the finished HTML is served. 168 | #html_use_opensearch = '' 169 | 170 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 171 | #html_file_suffix = None 172 | 173 | # Output file base name for HTML help builder. 174 | htmlhelp_basename = 'ios-practicedoc' 175 | 176 | 177 | # -- Options for LaTeX output -------------------------------------------------- 178 | 179 | latex_elements = { 180 | # The paper size ('letterpaper' or 'a4paper'). 181 | #'papersize': 'letterpaper', 182 | 183 | # The font size ('10pt', '11pt' or '12pt'). 184 | #'pointsize': '10pt', 185 | 186 | # Additional stuff for the LaTeX preamble. 187 | #'preamble': '', 188 | } 189 | 190 | # Grouping the document tree into LaTeX files. List of tuples 191 | # (source start file, target name, title, author, documentclass [howto/manual]). 192 | latex_documents = [ 193 | ('index', 'ios-practice.tex', u'ios-practice Documentation', 194 | u'azu', 'manual'), 195 | ] 196 | 197 | # The name of an image file (relative to this directory) to place at the top of 198 | # the title page. 199 | #latex_logo = None 200 | 201 | # For "manual" documents, if this is true, then toplevel headings are parts, 202 | # not chapters. 203 | #latex_use_parts = False 204 | 205 | # If true, show page references after internal links. 206 | #latex_show_pagerefs = False 207 | 208 | # If true, show URL addresses after external links. 209 | #latex_show_urls = False 210 | 211 | # Documents to append as an appendix to all manuals. 212 | #latex_appendices = [] 213 | 214 | # If false, no module index is generated. 215 | #latex_domain_indices = True 216 | 217 | 218 | # -- Options for manual page output -------------------------------------------- 219 | 220 | # One entry per manual page. List of tuples 221 | # (source start file, name, description, authors, manual section). 222 | man_pages = [ 223 | ('index', 'ios-practice', u'ios-practice Documentation', 224 | [u'azu'], 1) 225 | ] 226 | 227 | # If true, show URL addresses after external links. 228 | #man_show_urls = False 229 | 230 | 231 | # -- Options for Texinfo output ------------------------------------------------ 232 | 233 | # Grouping the document tree into Texinfo files. List of tuples 234 | # (source start file, target name, title, author, 235 | # dir menu entry, description, category) 236 | texinfo_documents = [ 237 | ('index', 'ios-practice', u'ios-practice Documentation', 238 | u'azu', 'ios-practice', 'One line description of project.', 239 | 'Miscellaneous'), 240 | ] 241 | 242 | # Documents to append as an appendix to all manuals. 243 | #texinfo_appendices = [] 244 | 245 | # If false, no module index is generated. 246 | #texinfo_domain_indices = True 247 | 248 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 249 | #texinfo_show_urls = 'footnote' 250 | -------------------------------------------------------------------------------- /docs/code_structures.rst: -------------------------------------------------------------------------------- 1 | コードの構造について 2 | ============================================= 3 | 4 | if/for文は常に波括弧 ``{}`` をつける 5 | --------------------------------------------- 6 | 7 | ifやfor等、波括弧 ``{}`` を省略できるものがありますが、基本的に省略せずにかきましょう 8 | 9 | .. code-block:: objc 10 | 11 | // Bad! 12 | if (something) 13 | // do something 14 | 15 | // Good! 16 | if (something) { 17 | // do something 18 | } 19 | 20 | .. note:: 21 | 22 | ``if (something) return;`` というようにスグにreturnするだけの場合は省略しても悪くは無いが、 23 | 出来れば付けていたほうがよい。 24 | 25 | 比較は常に厳密に行う 26 | ----------------------------------------------- 27 | 28 | NSStringを比較する場合 ``==`` で文字列を比較するのは避けるべきです。 29 | ``==`` による比較は文字列としての比較ではなく、同じポインタの値かどうかの比較になります。 30 | 31 | 文字列の比較を行う場合は ``isEqualToString:`` メソッドを使い比較します。 32 | 33 | :file:`/Code/Tests/CompareTests.m` 34 | 35 | .. literalinclude:: /Code/Tests/CompareTests.m 36 | :language: objc 37 | 38 | * `objective c - Why does NSString sometimes work with the equal sign? - Stack Overflow `_ 39 | * `文字列比較のお作法 - memory*Leak `_ 40 | 41 | .. note:: 42 | 43 | 定義済みの文字列定数同士を ``==`` で比較した場合は問題無いですが、 44 | それを考えて行うのは難しい所もあるので、基本的に文字列の比較はメソッドを使って行う方がよい。 45 | 46 | * `プログラミング雑記: NSString定数の定義 `_ 47 | 48 | 一般にオブジェクト同士の値を比較する場合は適当な ``isEqual*:`` や ``compare:`` といったメソッドが用意されているはずなので、 49 | それを利用し比較するべきです。(intやNSUInteger等のプリミティブな値はC言語と同様に ``==`` で比較して問題ありません) 50 | 51 | .. seealso:: 52 | 53 | `Objective-Cによるプログラミング P40 `_ 54 | "オブジェクトの等価性を判断する" に ``==`` , ``isEqual:`` , ``compare:`` について書かれている。 55 | 56 | 真偽値の比較は省略する 57 | ------------------------------------------------ 58 | 59 | BOOL型等の真偽値をif文等において比較するのは、あまり意味がなく冗長になるだけなので、 60 | 避けるべきです。 61 | 62 | .. code-block:: objc 63 | 64 | BOOL hasYES = YES; 65 | // Bad! 66 | if(hasYES == YES){ /* somthing */ } 67 | // Good! 68 | if(hasYES){ /* somthing */ } 69 | 70 | 71 | -------------------------------------------------------------------------------- /docs/coredata.rst: -------------------------------------------------------------------------------- 1 | CoreDataについて 2 | ============================================= 3 | 4 | .. todo:: 5 | 6 | 全体的にもう少し詳しく書くべき 7 | 8 | `mogenerator`_ でモデルクラスを作成 9 | ---------------------------------------------- 10 | 11 | `mogenerator`_ はCoreData定義を書くの ``.xcdatamodel`` ファイルから自動的にモデルクラスを作成するツールである。 12 | 13 | Xcodeも :menuselection:`Editor --> Create NSManagedObject SubClass` で類似の機能が存在するが、 14 | mogeneratorを使い生成した方が、拡張性等が優れているためこちらを利用する。 15 | 16 | .. todo:: 17 | 18 | mogeneratorの親クラスを利用したサブクラスの作り方について 19 | 20 | `MagicalRecord`_ のススメ 21 | ---------------------------------------------- 22 | 23 | CoreDataをもっと使いやすく、ハマりどころを減らすために `MagicalRecord`_ ライブラリの使用を推奨。 24 | 25 | * `MagicalRecordのREADMEを意訳 - Object for cutie `_ 26 | 27 | 28 | 少なくともCoreDataを扱う際にはManagerとなるクラスを経由するようにして利用しないと、 29 | 不必要にmanagedObjectContextが複数作成されてしまうことなどが発生してしまう可能性があるため、統一的な利用方法を定めておくべきである。 30 | 31 | * `CoreDataプロジェクト作成時にやっておきたいこと | iPhoneアプリ開発で稼げるのか `_ 32 | 33 | Entityにidentifier属性を作成する 34 | ---------------------------------------------- 35 | 36 | Entityには任意の属性を作成できるが、どのEntityにも必ず ``identifier`` 属性を作成する。 37 | また、そのidentifierにはUUIDを代入するようにしておく。 38 | 39 | UUIDの代入を自動的に行えるようにするにはmogeneratorを利用し作成した拡張用のサブクラスで 40 | ``-awakeFromInsert`` をoverwriteし代入するようにしておくといい。 41 | 42 | .. seealso:: 43 | 44 | `mogeneratorと識別子を使ったCoreDataのModelクラス作成パターン | Technology-Gym `_ 45 | mogeneratorを使ったモデル作成について 46 | 47 | CoreDataではObjectIDという識別子が振られているがこれは内部的に使われるもののため、 48 | 外部から一意に特定するためにidentifier属性を付けることで、検索時にUUIDを使い探索が簡単に行えるようになる。 49 | 50 | .. _`mogenerator`: https://github.com/rentzsch/mogenerator 51 | .. _`MagicalRecord`: https://github.com/magicalpanda/MagicalRecord -------------------------------------------------------------------------------- /docs/ivar_property.rst: -------------------------------------------------------------------------------- 1 | プロパティとインスタンス変数(ivar) 2 | ============================================= 3 | 4 | `github/objective-c-conventions `_ をベースとして書かれています。 5 | 6 | getter/setter, init, dealloc 以外でivarにアクセスしない 7 | --------------------------------------------------------------------- 8 | 9 | インスタンス変数にアクセスする時は、基本的にgetter/setter(アクセッサメソッド、プロパティ)を経由してアクセスすべきです。 10 | 11 | インスタンス変数を直接使わない理由としては、 12 | インスタンス変数を直接使う場合は不必要なretain等、参照カウントを操作するコードが必要になり見通しが悪くなる事や、 13 | KVO(Key-Value Observing)が使えない事や、アクセッサメソッドを経由しないため変更に弱い部分があることなどがあげられます。 14 | 15 | 以下の条件を満たしているならインスタンス変数を直接使っても問題は無いですが、統一性という観点から 16 | インスタンス変数を直接参照するのは ``-init`` と ``-dealloc`` 以外では避けるべきです:: 17 | 18 | 1.Is declared in a class using ARC. 19 | 2.Is used solely for class implementation (not exposed as part of the class interface). 20 | 3.Does not require any KVO. 21 | 4.Does not require any custom getter/setter. 22 | http://stackoverflow.com/questions/7836182/property-vs-ivar-in-times-of-arc 23 | 24 | 逆に ``-init`` と ``-dealloc`` ではインスタンス変数を参照するべき理由は、 25 | 下記の記事に詳細に書かれています。 26 | 27 | * `Don't Message self in Objective-C init (or dealloc) - Quality Coding `_ 28 | 29 | 単純にまとめると、プロパティでアクセスすためには ``self`` が存在していないといけないため、 30 | その ``self`` が初期化(init)、破棄(dealloc)されているかを ``-init`` と ``-dealloc`` 内では気をつけないといけません。 31 | 32 | そのため、``-init`` と ``-dealloc`` 内では **プロパティを使わない** とすることで単純化できるため、そういう習慣としています。 33 | 34 | 外から書き込む必要のないプロパティはreadonly属性にする 35 | ------------------------------------------------------------------------ 36 | 37 | Objective-C のプロパティにはreadonly属性が指定できます。 38 | そのプロパティのスコープを小さくするために、外から書き込みが必要のないプロパティにはreadonly属性を指定しましょう。 39 | 40 | :file:`/Code/ios-practice/ReadOnly.h` 41 | 42 | .. literalinclude:: /Code/ios-practice/ReadOnly.h 43 | :language: objc 44 | 45 | 46 | :file:`/Code/ios-practice/ReadOnly.m` 47 | 48 | .. literalinclude:: /Code/ios-practice/ReadOnly.m 49 | :language: objc 50 | 51 | また、readonly属性を指定すると、そのクラス内部からも ``self.array = @[];`` のような代入はできなくなりますが、 52 | クラスエクステンションを使いプライベートカテゴリ内で、プロパティに ``readwrite`` を付けることで、 53 | 外からはreadonlyだけど、中からはreadwriteのプロパティを作ることができます。 54 | 55 | * `Objective-C 2.0 のプロパティ隠蔽 | ishwt::tracking `_ 56 | * `privateなpropertyを作りたい時は無名カテゴリ(クラスエクステンション)を使う — Gist `_ 57 | 58 | インスタンス変数には接頭辞に_を付ける 59 | ------------------------------------------------------------------------------ 60 | 61 | インスタンス変数とプロパティの名前が被らないようにするため、頭か末尾に_(アンダーバー)を付けると思いますが、 62 | 基本的には統一されていることが大事なのでどちらでも構いませんが、 63 | 最近のAppleのドキュメントでは接頭辞に_を付けることを推奨しているため、新規に書くコード等はこの作法に則った方が良いでしょう。 64 | 65 | * `Cocoa向け コーディング ガイドライン - CodingGuidelines.pdf `_ 66 | * `プロパティに対応するインスタンス変数の命名規則について - Awaresoft `_ 67 | * `[iOS] Objective-C @propertyについて « きんくまデザイン `_ 68 | 69 | インスタンス変数とプロパティのまとめ 70 | ------------------------------------------------ 71 | ここまでをまとめるてみると 72 | 73 | :file:`/Code/ios-practice/Property.h` 74 | 75 | .. literalinclude:: /Code/ios-practice/Property.h 76 | :language: objc 77 | 78 | 79 | :file:`/Code/ios-practice/Property.m` 80 | 81 | .. literalinclude:: /Code/ios-practice/Property.m 82 | :language: objc 83 | 84 | Xcodeのバージョン(Clang)が上がるに連れて省略出来る箇所が増えてきているので、 85 | 一般に理解できるであろう最低限の記述を考えながら書いていくとよい。 86 | 87 | * `Xcode 4.5のテンプレートに@synthesizeがなくなった・・ | J7LG `_ 88 | * `Objective-C Feature Availability Index `_ 89 | 90 | .. note:: 91 | 92 | |today| 現在では、@interface の @property 宣言だけでもコンパイルは問題なく通る。 93 | どこまで省略するかは周りのチームの人に合わせて行うのがよいと思われる。 94 | 95 | 不必要なivarは宣言しない 96 | --------------------------------------------- 97 | 98 | そのインスタンス変数が本当に必要なのか、ローカル変数で間に合わないかを検討しましょう。 99 | 100 | 101 | .. _`github/objective-c-conventions` https://github.com/github/objective-c-conventions -------------------------------------------------------------------------------- /docs/notification.rst: -------------------------------------------------------------------------------- 1 | UILocalNotificationを使った通知の設定について 2 | ============================================================== 3 | 4 | ``UILocalNotification`` を使ったローカル通知の設定方法について 5 | 6 | 設定済みの通知をキャンセルしてから設定し直す 7 | -------------------------------------------------------------- 8 | 9 | ローカル通知が重複して登録されてしまうことがあるため、基本的に設定済みのローカル通知をキャンセルしてから 10 | 通知を設定し直した方が管理が楽になります。(複数の通知がある場合はそれを設定し直す) 11 | 12 | .. code-block:: objc 13 | 14 | [[UIApplication sharedApplication] cancelAllLocalNotifications]; 15 | 16 | 通知を設定する期間の問題 17 | -------------------------------------------------------------- 18 | 19 | アプリによって設定する通知は時間や繰り返しなど様々だと思いますが、 20 | 遠い未来や無限に繰り返す内容の通知をそのまま設定するのは無理がでてきます。 21 | 22 | そのため、現在の情報をもとに1週間から1ヶ月程度の範囲に通知だけを設定する等の制限を設けたほうがいいと思います。 23 | (これは上記の毎回キャンセルしてから設定するのと相性がいいです) 24 | 25 | そして、アプリを起動 or 終了 した時などに、通知を設定し直すことで、 26 | ずっと放置してる場合は通知がでなくなりますが、使っている人に対しては通知が継続されるような仕組みが自然とできると思います。 27 | 28 | 29 | 通知の発火時間をチェックしてから通知の設定を行う 30 | -------------------------------------------------------------- 31 | 32 | ローカル通知を設定する際は、必ず通知の ``fireDate`` プロパティが、現在時間より後なのかを 33 | 確認してから設定するべきです。 34 | 35 | 現在時間より前に通知を設定すると、設定した瞬間に通知が発火してしまいます。 36 | 37 | :file:`/Code/ios-practice/LocalNotification/LocalNotificationManager.m` 38 | 39 | .. literalinclude:: /Code/ios-practice/LocalNotification/LocalNotificationManager.m 40 | :language: objc 41 | 42 | 43 | 44 | 通知を設定するのはいつ? 45 | ----------------------------------------------------------------- 46 | 47 | ローカル通知は必ず、通知を管理するクラスを経由して設定すべきですが、 48 | いつ設定するのがいいのかという問題もあります。 49 | (毎回、UILocalNotificationを書くのはバッドプラクティスだと思います) 50 | 51 | データを保存した際に通知を設定すると、保存するコードごとに通知について書かないといけなくなる事や、 52 | "設定済みの通知をキャンセルしてから設定し直す" というパターンとも相性があまり良くありません。 53 | 54 | 比較的シンプルに書けるのが、アプリがバックグラウンドに行く時に設定するパターンです。 55 | 56 | .. code-block:: objc 57 | 58 | - (void)applicationDidEnterBackground:(UIApplication *)application { 59 | // 通知の設定クラスを呼び出す 60 | } 61 | 62 | メリットとしては、同期的に通知を設定してもUIスレッドに対しての影響が少ない事や、 63 | アプリのライフサイクル的に、大体の場合はここを通るので、保存するごとに通知を設定しないで、 64 | ``applicationDidEnterBackground`` のみで設定すればよくなるためコードもシンプルになります。 65 | 66 | デメリットとして、アプリ表示中にローカル通知を受け取って表示する( ``application:didReceiveRemoteNotification:`` )など、 67 | 保存した時にローカル通知を付けないといけないような条件があるときには利用できないパターンです。 68 | 69 | 別スレッドで通知を設定する場合 70 | ----------------------------------------------------------------- 71 | 72 | ローカル通知の設定は同期的に行われるので大量に設定する場合は、dispatch_async等を使い、 73 | UIが固まらないように設定すればいいです。 74 | 75 | .. code-block:: objc 76 | 77 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 78 | // 通知を設定する処理 79 | dispatch_async(dispatch_get_main_queue(), ^{ 80 | /* メインスレッドでのみ実行可能な処理 */ 81 | }); 82 | }); 83 | 84 | しかし、別スレッドで設定する際、通知を設定する基準を決めるデータを取るために、 85 | CoreData等スレッドセーフではないもの等を触る時に問題が起きやすいことがあります。 86 | 87 | そのような場合は、同期的に設定できてUIスレッドを意識しないでシンプルに行える、アプリがバックグラウンドに移行する時がお手軽です。 88 | 89 | 通知登録の管理クラス 90 | ----------------------------------------------------------------- 91 | 92 | 実際に動かせるサンプルプロジェクトは以下にあります。 93 | (通知登録のテストについても書いてあるので、ここにでてくるものとは少し違います) 94 | 95 | .. seealso:: 96 | 97 | `azu/LocalNotificationPattern`_ 98 | これまででてきたパターンを使った通知登録管理クラスのサンプルプロジェクト 99 | 100 | 101 | ローカル通知は一箇所にまとめておくと見通しがよく管理がしやすくなります。 102 | これまで、でてきたパターンをまとめたようなクラス ``LocalNotificationManager`` というものを見てみます。 103 | 104 | .. code-block:: objc 105 | 106 | @interface LocalNotificationManager : NSObject 107 | // ローカル通知を登録する 108 | - (void)scheduleLocalNotifications; 109 | @end 110 | 111 | @implementation LocalNotificationManager 112 | #pragma mark - Scheduler 113 | - (void)scheduleLocalNotifications { 114 | // 一度通知を全てキャンセルする 115 | [[UIApplication sharedApplication] cancelAllLocalNotifications]; 116 | // 通知を設定していく... 117 | [self scheduleWeeklyWork]; 118 | } 119 | 120 | // 例: weeklyWorkSchedule の時間を通知登録する 121 | - (void)scheduleWeeklyWork { 122 | // ... 123 | // makeNotification: を呼び出して通知を登録する 124 | } 125 | 126 | #pragma mark - helper 127 | - (void)makeNotification:(NSDate *) fireDate alertBody:(NSString *) alertBody userInfo:(NSDictionary *) userInfo { 128 | // 現在より前の通知は設定しない 129 | if (fireDate == nil || [fireDate timeIntervalSinceNow] <= 0) { 130 | return; 131 | } 132 | [self schedule:fireDate alertBody:alertBody userInfo:userInfo]; 133 | } 134 | 135 | - (void)schedule:(NSDate *) fireDate alertBody:(NSString *) alertBody userInfo:(NSDictionary *) userInfo { 136 | // ローカル通知を作成する 137 | UILocalNotification *notification = [[UILocalNotification alloc] init]; 138 | [notification setFireDate:fireDate]; 139 | [notification setTimeZone:[NSTimeZone systemTimeZone]]; 140 | [notification setAlertBody:alertBody]; 141 | [notification setUserInfo:userInfo]; 142 | [notification setSoundName:UILocalNotificationDefaultSoundName]; 143 | [notification setAlertAction:@"Open"]; 144 | [[UIApplication sharedApplication] scheduleLocalNotification:notification]; 145 | } 146 | @end 147 | 148 | ``AppDelegate`` から以下のようにバックグラウンドへ移行する際に呼び出して使います。 149 | 150 | .. code-block:: objc 151 | 152 | - (void)applicationDidEnterBackground:(UIApplication *) application { 153 | // バックグラウンドに移行際に通知を設定する 154 | LocalNotificationManager *notificationManager = [[LocalNotificationManager alloc] init]; 155 | [notificationManager scheduleLocalNotifications]; 156 | } 157 | 158 | 159 | ``- (void)scheduleLocalNotifications;`` を呼び出すと、まず全ての通知をキャンセルしてから通知を登録していくようになっています。 160 | 161 | それぞれの通知は、種類ごとなどでメソッドにまとめておくとテストがしやすくなると思います。 162 | また、実際に通知を登録するときは ``- (void)makeNotification:(NSDate *) fireDate`` を経由して、 163 | 通知の登録時間が過去になってないかをチェックしてから登録するようにしています。 164 | 165 | ローカル通知登録のテストについて 166 | ============================================================================ 167 | 168 | ``UILocalNotification`` は名前に ``UI`` とついてるように、ロジックテストだと通知が登録出来ないためテストがしにくくなっています。 169 | 170 | アプリケーションテストの場合は動作します。 171 | (現在のXcodeはアプリケーションテストがデフォルトなので、あまり問題ないのかもしれませんが) 172 | 173 | .. seealso:: 174 | 175 | `iOS Unit Test `_ 176 | ロジックテストとアプリケーションテストの違いについて 177 | 178 | それでも、ここはモックなりで潰してコントロールできたほうが嬉しいので、 179 | 以下のような通知を登録したふりをするspyとなるクラスを作ります。 180 | 181 | 実際のサンプルは `azu/LocalNotificationPattern`_ を見て下さい。 182 | 183 | .. code-block:: objc 184 | 185 | // テスト用にLocalNotificationManagerを継承したモッククラスを作る 186 | @interface LocationNotificationManagerSpy : LocalNotificationManager 187 | @property(nonatomic) NSMutableArray *schedules; 188 | // helper 189 | - (UILocalNotification *)notificationAtIndex:(NSUInteger) index; 190 | // overwrite 191 | - (void)schedule:(NSDate *) fireDate alertBody:(NSString *) alertBody userInfo:(NSDictionary *) userInfo; 192 | @end 193 | 194 | @implementation LocationNotificationManagerSpy 195 | - (NSMutableArray *)schedules { 196 | if (_schedules == nil) { 197 | _schedules = [NSMutableArray array]; 198 | } 199 | return _schedules; 200 | } 201 | 202 | - (UILocalNotification *)notificationAtIndex:(NSUInteger) index { 203 | if (index < [self.schedules count]) { 204 | return self.schedules[index]; 205 | } 206 | return nil; 207 | } 208 | 209 | // 通知を登録するメソッドを乗っ取り、呼ばれたことを記録する(いわゆるspy) 210 | - (void)schedule:(NSDate *) fireDate alertBody:(NSString *) alertBody userInfo:(NSDictionary *) userInfo { 211 | UILocalNotification *notification = [[UILocalNotification alloc] init]; 212 | notification.fireDate = fireDate; 213 | notification.alertBody = alertBody; 214 | notification.userInfo = userInfo; 215 | [self.schedules addObject:notification]; 216 | } 217 | @end 218 | 219 | 実際にテストを行う際には、 ``LocalNotificationManager`` ではなく、 220 | それを継承した ``LocationNotificationManagerSpy`` を使うことで、通知登録が呼ばれたことを記録できるようになります。 221 | 222 | 223 | ローカル通知のテストケース 224 | ----------------------------------------------------------------- 225 | 226 | 先ほどの、 `LocalNotificationManager.m `_ では、 227 | 実装されていなかった実際の登録内容を決める ``- (void)scheduleWeeklyWork`` を以下のように実装します。 228 | 229 | ``[self.scheduleDataSource weeklyWorkSchedule];`` を呼び出す事で、 NSDateの配列を返してくれるようにして、 230 | それをスケジュールを登録するという感じになっています。 231 | 232 | .. code-block:: objc 233 | 234 | // 例: weeklyWorkSchedule の時間を通知登録する 235 | - (void)scheduleWeeklyWork { 236 | // NSDateの配列が返ってくる 237 | NSArray *schedules = [self.scheduleDataSource weeklyWorkSchedule]; 238 | for (NSDate *date in schedules) { 239 | [self makeNotification:date alertBody:@"Work Schedule" userInfo:@{ 240 | @"key" : LocalNotification.weeklyWork 241 | }]; 242 | } 243 | } 244 | 245 | テストする際には、 ``[self.scheduleDataSource weeklyWorkSchedule]`` をテストコード内で、 246 | モックにすり替えればいいので、以下のようにOCMockObjectを使って、 ``self.scheduleDataSource`` をモックに変更しています。 247 | 248 | .. note:: 249 | 250 | userInfo に 通知の種類毎のkeyを指定する事で、どの通知から起動したのかを判別することができる 251 | 252 | こうすることで、テスト時に任意の NSDate を通知登録させられるのでテスト側から制御しやすくなります。 253 | 254 | 255 | .. code-block:: objc 256 | 257 | @implementation LocalNotificationManagerTest { 258 | } 259 | - (void)setUp { 260 | [super setUp]; 261 | self.managerSpy = [[LocationNotificationManagerSpy alloc] init]; 262 | } 263 | 264 | - (void)tearDown { 265 | self.managerSpy = nil; 266 | [super tearDown]; 267 | } 268 | 269 | - (void)testWeeklyWorkSchedule { 270 | // 通知に登録される日付オブジェクト 271 | NSDate *expectedDate = [[NSDate date] dateByAddingDays:5]; 272 | NSArray *expectedScheduleDates = @[ 273 | expectedDate 274 | ]; 275 | // データソースをモックに差し替える 276 | id dataSourceMock = [OCMockObject mockForClass:[ExampleScheduleDataSource class]]; 277 | [[[dataSourceMock stub] andReturn:expectedScheduleDates] weeklyWorkSchedule]; 278 | self.managerSpy.scheduleDataSource = dataSourceMock; 279 | // 通知を登録 280 | [self.managerSpy scheduleLocalNotifications]; 281 | // 期待するもの 282 | // self.managerSpy.schedules には登録されるUILocalNotificationが入る 283 | for (UILocalNotification *localNotification in self.managerSpy.schedules) { 284 | STAssertEquals(localNotification.fireDate, expectedDate, 285 | @"通知に登録されたものはexpectedDateである"); 286 | } 287 | } 288 | @end 289 | 290 | LocationNotificationManagerSpy には ``self.managerSpy.schedules`` というように、 291 | 通知登録した内容を記録するプロパティがあるので、これの中身を検証すれば、ロジックテストからも ``UILocalNotification`` のテストが行えます。 292 | 293 | .. seealso:: 294 | 295 | `Intro to Objective-C TDD [Screencast] - Quality Coding `_ 296 | 今回のようなプロパティで依存するDataSourceを注入してモックですり替える方法について詳しく解説した動画 297 | `azu/LocalNotificationPattern`_ 298 | 通知登録管理クラスのサンプルプロジェクト 299 | 300 | 301 | .. _`azu/LocalNotificationPattern`: https://github.com/azu/LocalNotificationPattern -------------------------------------------------------------------------------- /docs/save-data.rst: -------------------------------------------------------------------------------- 1 | データの保存方法について 2 | ============================================= 3 | 4 | iOSに複数のデータ保存方法が用意されているが、それは得意/不得意があるため、 5 | 目的にあった保存方法を正しく選択できる事が重要である。 6 | 7 | 一度決めた保存方法から別の方法へ変更するには面倒な事が多いため、適切なものを選べるようにしておくべきである。 8 | 9 | 10 | .. seealso:: 11 | 12 | `iOS でデータを永続化する方法 - A Day In The Life `_ 13 | iOSでのデータ保存方法について詳しく書かれている 14 | 15 | CoreDataについては別途下記を参照 16 | 17 | * :doc:`/docs/coredata` -------------------------------------------------------------------------------- /docs/storyboard.rst: -------------------------------------------------------------------------------- 1 | StoryBoardの使用 2 | ====================================== 3 | 4 | iOS5以降を対象とした場合に、StoryBoardを利用する事のデメリットはXibを直接使う場合に比べて少ないです。 5 | 6 | StoryBoardを使うことで以下のようなメリットも得られるので、すべての画面において特殊なUIが求められない場合は 7 | StoryBoardを使ったほうが効率がよくなると思います。 8 | 9 | * Static Cell 10 | * iOS6以降のContainer View 11 | * Segueでの遷移 12 | 13 | 画面間で値を渡す場合にXibの時のようにインスタンスを作って設定する方法はStoryBoardでも運用的カバーできます。 14 | 15 | * `StoryBoardで画面間で値を渡す方法論について(文字列を直接使わない方法) | Technology-Gym `_ 16 | -------------------------------------------------------------------------------- /docs/tableview.rst: -------------------------------------------------------------------------------- 1 | UITableViewについて 2 | =================================================== 3 | 4 | TableViewにおいていくつか気をつけておくと良いことがあります。 5 | 6 | 下記を参考に書いています。 7 | 8 | * `iOS開発におけるパターンによるオートマティズム `_ 9 | * `Pro iOS Table Views `_ 10 | * `timd/Pro-iOS-TableViews `_ 11 | 12 | Cellの表示更新を別のメソッドに分ける 13 | --------------------------------------------------- 14 | 15 | ``tableView:cellForRowAtIndexPath:`` のdelegateメソッドでそれぞれのUITableViewCellを生成しますが、 16 | このメソッド内で、Cell内容を更新する処理を直接書くのは避けましょう。 17 | 18 | .. code-block:: objc 19 | 20 | - (void)updateCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { 21 | // Update Cells 22 | } 23 | - (UITableViewCell *)tableView:(UITableView *)tableView 24 | cellForRowAtIndexPath:(NSIndexPath *)indexPath { 25 | NSString *cellIdentifier = @"Cell"; 26 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 27 | if (!cell){ 28 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 29 | } 30 | // Update Cell 31 | [self updateCell:cell atIndexPath:indexPath]; 32 | 33 | return cell; 34 | } 35 | 36 | ``updateCell:atIndexPath:`` といったCellの更新を行うメソッドを用意し、 37 | ``tableView:cellForRowAtIndexPath:`` からそのメソッドを呼び表示の更新を行う事で、表示更新処理を分離できます。 38 | 39 | なぜ、このように表示更新処理を分離するかというと、 40 | Cellの表示内容を変えようと思った場合に、 ``[self.tableView reloadData];`` として、 41 | ``tableView:cellForRowAtIndexPath:`` で全てのCellを生成し直すのはあまり効率的ではありません。 42 | 43 | 表示の更新だけを行うメソッドを用意しておけば、以下のように見えている部分だけの表示更新なども簡単に行う事ができます。 44 | 45 | .. code-block:: objc 46 | 47 | // 画面上に見えているセルの表示更新 48 | - (void)updateVisibleCells { 49 | for (UITableViewCell *cell in [self.tableView visibleCells]){ 50 | [self updateCell:cell atIndexPath:[self.tableView indexPathForCell:cell]]; 51 | } 52 | } 53 | 54 | Cellに直接Viewを追加しない 55 | ---------------------------------------------------------- 56 | 57 | Cellに対して ``addSubView:`` でUIButtonやLabelといったViewを追加する事ができるが、 58 | UITableViewCellのインスタンスに直接ではなく、cell.contentViewに追加する。 59 | 60 | .. image:: /_static/TableView_Cell.png 61 | :alt: TableViewCellの構成要素 62 | 63 | Cellに対して直接追加した場合、編集モードなどにおいて適切な動作にならない事があるため、 64 | Viewを追加するのはcell.contentViewの方にする。 65 | 66 | .. code-block:: objc 67 | 68 | UITableViewCell *cell = [[UITableViewCell alloc] init]; 69 | UILabel *label = [[UILabel alloc] init]; 70 | // Bad!! 71 | [cell addSubview:label]; 72 | // Good! 73 | [cell.contentView addSubview:label]; 74 | 75 | ControllerでCellにaddSubView:するのを避ける 76 | ----------------------------------------------------------- 77 | 78 | 可能ならば、Controller上で上記のようにaddSubview:等をしてCellをカスタマイズするのは避けたほうがよい。 79 | 80 | 最初の表示更新メソッドが利用しにくくなることや ``dequeueReusableCellWithIdentifier:`` によるセルのキャッシュも利用しくくなるため、 81 | UITableViewCellのサブクラス(いわゆるカスタムセル)を作り、Cellの拡張したViewを作る方がよい。 82 | 83 | Controller上で ``[cell.contentView addSubview:]`` した場合に起きる問題点としては、 84 | そのcellが ``dequeueReusableCellWithIdentifier:`` により再利用され、再びaddSubview:が行われ、 85 | cellに対して複数回Viewが追加されてしまう事が起こってしまう。 86 | 87 | そのため、以下のような目に見える問題やメモリ効率的にもあまり良くない場合が多い。 88 | 89 | .. _`tableviewcell-issue-label`: 90 | 91 | 1. `UITableViewのセルの値がスクロールするごとに重なったり壊れる現象 - hachinobuのメモ `_ 92 | 2. `UITableViewでセル再描画時に文字が重ならないようにする « sabitori works `_ 93 | 3. `UITableViewCell セルの再利用の問題 | DevCafeJp `_ 94 | 95 | この問題を解決するには、以下のような方法がある。 96 | 97 | 1. キャッシュをしない(or identifierをCell毎に変える) 98 | 2. addSubViewする前に、CellのsubViewを除去する 99 | 3. CellのtextLabelやaccessoryView等のデフォルトのセルコンテンツで表示する 100 | 4. カスタムセルを作って利用する 101 | 102 | 1と2は 上記のリンクのような方法であるが、 103 | 3と4のような手法を使い表示したほうが、コード的にも綺麗に書くことができ、バグも減ると思われる。 104 | 105 | 次は3と4の手法についてあたっていく 106 | 107 | UITableViewCellデフォルトのセルコンテンツの利用 108 | ----------------------------------------------------------- 109 | 110 | .. figure:: /_static/TableView_cell_content.png 111 | :alt: セルコンテントの構成要素 112 | 113 | UITableViewCellデフォルトのセルコンテンツ 114 | 115 | UITableViewCellオブジェクトにはデフォルトでセルコンテンツ用に次のプロパティが定義されています。 116 | 117 | * **textLabel** — セル内のテキストのメインラベル(UILabelオブジェクト) 118 | * **detailTextLabel** — セル内のテキストのサブラベル(UILabelオブジェクト) 119 | * **imageView** - 画像を保持する画像ビュー(UIImageViewオブジェクト) 120 | * **accessoryView** - アクセサリビュー(UIViewオブジェクト) 121 | 122 | textLabelとdetailTextLabelの配置はUITableViewCellStyle(4種類)によって異なるので、下記を参考にして下さい。 123 | 124 | * `[iOS]UITableViewCellのプリセットビュー - l4l `_ 125 | 126 | accessoryViewは見落としがちですが、Cellの右側に任意のUIViewオブジェクト(UILabelやUIButtonもUIViewを継承してる)を配置できるので、 127 | 色々と使い道があります。 128 | 129 | * `UITableViewCell の accessoryView を使うと少し楽 (フェンリル | デベロッパーズブログ) `_ 130 | 131 | 凝った表示を求めない場合は、これらのデフォルトセルコンテンツを使い解決出来る場合が多いため、 132 | まずは、デフォルトセルコンテンツで解決できないかを考えてみるとよいです。 133 | 134 | デフォルトのセルコンテンツを利用したサンプルはCodeのTableViewに入っています。 135 | 136 | :file:`/Code/ios-practice/tableView/MyTableViewController.m` 137 | 138 | .. literalinclude:: /Code/ios-practice/tableView/MyTableViewController.m 139 | :language: objc 140 | 141 | 上記のコードでは、デフォルトのセルコンテンツにそれぞれ指定をしています。 142 | 143 | .. image:: /_static/MyTableViewSample.png 144 | :alt: MyTableViewの実行結果 145 | 146 | 147 | カスタムセルを利用する 148 | ----------------------------------------------------------- 149 | 150 | 利点としては見た目について扱うものが分離できるためコードが綺麗になる事や、 151 | Interface Builderを使い見た目を決定できるため細かい調整が簡単になることがある。 152 | 153 | カスタムセルの作り方は下記の記事を見るといい。 154 | 155 | .. seealso:: 156 | 157 | `シンプルなカスタムセルの作り方とセル内のボタンへのイベント設定方法 `_ 158 | xibを使ったカスタムセルとセル内部のUIButtonのイベント設定方法について 159 | `TableViewでDynamic PrototypesだけどStatic Cellsのように見た目をGUIで作成する方法 | Technology-Gym `_ 160 | カスタムセルもUITableViewController上で作る方法を利用した例 -------------------------------------------------------------------------------- /index.rst: -------------------------------------------------------------------------------- 1 | .. ios-conventions documentation master file, created by 2 | sphinx-quickstart on Fri Oct 5 10:51:48 2012. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | iOS Practice 7 | =========================================== 8 | 9 | iOSアプリ開発におけるプラクティス集 10 | 11 | .. seealso:: 12 | 13 | `Objective-Cによるプログラミング`_ 14 | AppleによるObjective-Cでのベストプラクティスについてかかれた文章 15 | `github/objective-c-conventions`_ 16 | GithubによるObjective-Cのコーディングルール 17 | 18 | サンプルコード 19 | -------------------------------------------- 20 | 21 | サンプルコードは `azu/ios-practice · GitHub `_ のCodeディレクトリにあります。 22 | 23 | .. code-block:: bash 24 | 25 | git clone https://github.com/azu/ios-practice.git 26 | cd ios-practice/Code && open ios-practice.xcodeproj 27 | 28 | Contents: 29 | 30 | .. toctree:: 31 | :maxdepth: 3 32 | 33 | docs/ivar_property 34 | docs/code_structures 35 | docs/storyboard 36 | docs/tableview 37 | docs/notification 38 | docs/save-data 39 | docs/coredata 40 | 41 | 42 | Indices and tables 43 | ================== 44 | 45 | * :ref:`genindex` 46 | * :ref:`modindex` 47 | * :ref:`search` 48 | 49 | .. _`github/objective-c-conventions`: https://github.com/github/objective-c-conventions 50 | .. _`Objective-Cによるプログラミング`: https://developer.apple.com/jp/devcenter/ios/library/documentation/ProgrammingWithObjectiveC.pdf -------------------------------------------------------------------------------- /make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. linkcheck to check all external links for integrity 37 | echo. doctest to run all doctests embedded in the documentation if enabled 38 | goto end 39 | ) 40 | 41 | if "%1" == "clean" ( 42 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 43 | del /q /s %BUILDDIR%\* 44 | goto end 45 | ) 46 | 47 | if "%1" == "html" ( 48 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 49 | if errorlevel 1 exit /b 1 50 | echo. 51 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 52 | goto end 53 | ) 54 | 55 | if "%1" == "dirhtml" ( 56 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 57 | if errorlevel 1 exit /b 1 58 | echo. 59 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 60 | goto end 61 | ) 62 | 63 | if "%1" == "singlehtml" ( 64 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 68 | goto end 69 | ) 70 | 71 | if "%1" == "pickle" ( 72 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished; now you can process the pickle files. 76 | goto end 77 | ) 78 | 79 | if "%1" == "json" ( 80 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished; now you can process the JSON files. 84 | goto end 85 | ) 86 | 87 | if "%1" == "htmlhelp" ( 88 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can run HTML Help Workshop with the ^ 92 | .hhp project file in %BUILDDIR%/htmlhelp. 93 | goto end 94 | ) 95 | 96 | if "%1" == "qthelp" ( 97 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 98 | if errorlevel 1 exit /b 1 99 | echo. 100 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 101 | .qhcp project file in %BUILDDIR%/qthelp, like this: 102 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\ios-conventions.qhcp 103 | echo.To view the help file: 104 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\ios-conventions.ghc 105 | goto end 106 | ) 107 | 108 | if "%1" == "devhelp" ( 109 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 110 | if errorlevel 1 exit /b 1 111 | echo. 112 | echo.Build finished. 113 | goto end 114 | ) 115 | 116 | if "%1" == "epub" ( 117 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 118 | if errorlevel 1 exit /b 1 119 | echo. 120 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 121 | goto end 122 | ) 123 | 124 | if "%1" == "latex" ( 125 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 129 | goto end 130 | ) 131 | 132 | if "%1" == "text" ( 133 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The text files are in %BUILDDIR%/text. 137 | goto end 138 | ) 139 | 140 | if "%1" == "man" ( 141 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 145 | goto end 146 | ) 147 | 148 | if "%1" == "texinfo" ( 149 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 150 | if errorlevel 1 exit /b 1 151 | echo. 152 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 153 | goto end 154 | ) 155 | 156 | if "%1" == "gettext" ( 157 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 158 | if errorlevel 1 exit /b 1 159 | echo. 160 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 161 | goto end 162 | ) 163 | 164 | if "%1" == "changes" ( 165 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 166 | if errorlevel 1 exit /b 1 167 | echo. 168 | echo.The overview file is in %BUILDDIR%/changes. 169 | goto end 170 | ) 171 | 172 | if "%1" == "linkcheck" ( 173 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 174 | if errorlevel 1 exit /b 1 175 | echo. 176 | echo.Link check complete; look for any errors in the above output ^ 177 | or in %BUILDDIR%/linkcheck/output.txt. 178 | goto end 179 | ) 180 | 181 | if "%1" == "doctest" ( 182 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 183 | if errorlevel 1 exit /b 1 184 | echo. 185 | echo.Testing of doctests in the sources finished, look at the ^ 186 | results in %BUILDDIR%/doctest/output.txt. 187 | goto end 188 | ) 189 | 190 | :end 191 | -------------------------------------------------------------------------------- /readme.rst: -------------------------------------------------------------------------------- 1 | これはなに? 2 | ================================= 3 | 4 | Objective-C,iOSにおけるプラクティスをまとめたもの 5 | 6 | 中身はSphinxですが、readthedocsで見られるようになっています。 7 | 8 | * `iOS Practice documentation `_ 9 | 10 | Contributions 11 | ================================= 12 | 13 | Sphinxを使って書いているので、そのままPull Requestを送るか、 14 | Issueを立てる等して下さい。 --------------------------------------------------------------------------------