diff --git a/.travis.yml b/.travis.yml index 0a8f4886..a1bc7917 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: objective-c +osx_image: xcode6.4 before_script: - - brew update && brew upgrade xctool + - bundle install script: - - xctool test -project Aardvark.xcodeproj -scheme Aardvark -sdk iphonesimulator + - xcodebuild -project Aardvark.xcodeproj -scheme Aardvark -sdk iphonesimulator -configuration Debug -PBXBuildsContinueAfterErrors=0 ACTIVE_ARCH_ONLY=0 build test + - pod lib lint --verbose --fail-fast diff --git a/Aardvark.podspec b/Aardvark.podspec index 2dd872db..9a29ac12 100644 --- a/Aardvark.podspec +++ b/Aardvark.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Aardvark' - s.version = '1.0.2' + s.version = '1.1' s.license = 'Apache License, Version 2.0' s.summary = 'Aardvark is a library that makes it dead simple to create actionable bug reports.' s.homepage = 'https://github.com/square/Aardvark' diff --git a/Aardvark/Aardvark.h b/Aardvark/Aardvark.h index 75669bc5..500f720d 100644 --- a/Aardvark/Aardvark.h +++ b/Aardvark/Aardvark.h @@ -22,6 +22,9 @@ #import +NS_ASSUME_NONNULL_BEGIN + + typedef NS_ENUM(NSUInteger, ARKLogType) { /// Default log type. ARKLogTypeDefault, @@ -38,7 +41,7 @@ typedef NS_ENUM(NSUInteger, ARKLogType) { OBJC_EXTERN void ARKLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); /// Logs a log with customized type and userInfo to the default log distributor. -OBJC_EXTERN void ARKLogWithType(ARKLogType type, NSDictionary *userInfo, NSString *format, ...) NS_FORMAT_FUNCTION(3,4); +OBJC_EXTERN void ARKLogWithType(ARKLogType type, NSDictionary * __nullable userInfo, NSString *format, ...) NS_FORMAT_FUNCTION(3,4); /// Logs a screenshot to the default log distributor. OBJC_EXTERN void ARKLogScreenshot(); @@ -47,9 +50,12 @@ OBJC_EXTERN void ARKLogScreenshot(); @interface Aardvark : NSObject /// Sets up a two finger press-and-hold gesture recognizer to trigger email bug reports that will be sent to emailAddress. Returns the created bug reporter for convenience. -+ (ARKEmailBugReporter *)addDefaultBugReportingGestureWithEmailBugReporterWithRecipient:(NSString *)emailAddress; ++ (nullable ARKEmailBugReporter *)addDefaultBugReportingGestureWithEmailBugReporterWithRecipient:(NSString *)emailAddress; /// Creates and returns a gesture recognizer that when triggered will call [bugReporter composeBugReport]. -+ (id)addBugReporter:(id )bugReporter triggeringGestureRecognizerClass:(Class)gestureRecognizerClass; ++ (nullable id)addBugReporter:(id )bugReporter triggeringGestureRecognizerClass:(Class)gestureRecognizerClass; @end + + +NS_ASSUME_NONNULL_END diff --git a/AardvarkSample/AardvarkSample/SampleAppDelegate.h b/AardvarkSample/AardvarkSample/SampleAppDelegate.h index b3d0eb5f..d60cfa78 100644 --- a/AardvarkSample/AardvarkSample/SampleAppDelegate.h +++ b/AardvarkSample/AardvarkSample/SampleAppDelegate.h @@ -20,9 +20,9 @@ @interface SampleAppDelegate : UIResponder -@property (strong, nonatomic, readwrite) UIWindow *window; +@property (nonatomic) UIWindow *window; -@property (strong, nonatomic, readwrite) ARKEmailBugReporter *bugReporter; +@property (nonatomic) ARKEmailBugReporter *bugReporter; @end diff --git a/AardvarkSample/AardvarkSample/SampleViewController.m b/AardvarkSample/AardvarkSample/SampleViewController.m index b77b2576..acf87ab9 100644 --- a/AardvarkSample/AardvarkSample/SampleViewController.m +++ b/AardvarkSample/AardvarkSample/SampleViewController.m @@ -33,8 +33,8 @@ @interface SampleViewController () -@property (nonatomic, readwrite, strong) ARKLogStore *tapGestureLogStore; -@property (nonatomic, strong, readwrite) UITapGestureRecognizer *tapRecognizer; +@property (nonatomic) ARKLogStore *tapGestureLogStore; +@property (nonatomic) UITapGestureRecognizer *tapRecognizer; @end diff --git a/AardvarkTests/ARKDataArchiveTests.m b/AardvarkTests/ARKDataArchiveTests.m index dab1e59c..c9b872ee 100644 --- a/AardvarkTests/ARKDataArchiveTests.m +++ b/AardvarkTests/ARKDataArchiveTests.m @@ -95,7 +95,7 @@ - (void)test_setUp_providesEmptyArchive; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_dealloc_closesFile; @@ -169,7 +169,7 @@ - (void)test_initWithURL_preservesExistingData; [expectation3 fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_appendArchiveOfObject_trimsArchive; @@ -245,7 +245,7 @@ - (void)test_appendArchiveOfObject_trimsArchive; [expectation5 fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_appendArchiveOfObject_trimsCorruptedArchive; @@ -283,7 +283,7 @@ - (void)test_appendArchiveOfObject_trimsCorruptedArchive; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_initWithURL_detectsCorruptedArchive; @@ -310,7 +310,7 @@ - (void)test_initWithURL_detectsCorruptedArchive; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_initWithURL_detectsPartiallyCorruptedArchive; @@ -339,7 +339,7 @@ - (void)test_initWithURL_detectsPartiallyCorruptedArchive; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_readObjectsFromArchive_excludesFaultyUnarchives; @@ -381,7 +381,7 @@ - (void)test_readObjectsFromArchive_excludesFaultyUnarchives; [expectation2 fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_clearArchiveWithCompletionHandler_removesAllDataFromDisk; @@ -406,7 +406,7 @@ - (void)test_clearArchiveWithCompletionHandler_removesAllDataFromDisk; }]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_clearArchiveWithCompletionHandler_completionHandlerCalledOnMainQueue; @@ -417,7 +417,7 @@ - (void)test_clearArchiveWithCompletionHandler_completionHandlerCalledOnMainQueu [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } #pragma mark - Performance Tests diff --git a/AardvarkTests/ARKDefaultLogFormatterTests.m b/AardvarkTests/ARKDefaultLogFormatterTests.m index 48358f83..254ef742 100644 --- a/AardvarkTests/ARKDefaultLogFormatterTests.m +++ b/AardvarkTests/ARKDefaultLogFormatterTests.m @@ -32,9 +32,9 @@ @interface ARKDefaultLogFormatterTests : XCTestCase -@property (nonatomic, strong, readwrite) ARKLogDistributor *defaultLogDistributor; -@property (nonatomic, strong, readwrite) ARKDefaultLogFormatter *logFormatter; -@property (nonatomic, weak, readwrite) ARKLogStore *logStore; +@property (nonatomic) ARKLogDistributor *defaultLogDistributor; +@property (nonatomic) ARKDefaultLogFormatter *logFormatter; +@property (nonatomic, weak) ARKLogStore *logStore; @end @@ -84,7 +84,7 @@ - (void)test_formattedLogMessage_errorLogLineCount; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_separatorLogLineCount; @@ -103,7 +103,7 @@ - (void)test_formattedLogMessage_separatorLogLineCount; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_defaultLogLineCount; @@ -121,7 +121,7 @@ - (void)test_formattedLogMessage_defaultLogLineCount; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_errorLogContent; @@ -142,7 +142,7 @@ - (void)test_formattedLogMessage_errorLogContent; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_separatorLogContent; @@ -163,7 +163,7 @@ - (void)test_formattedLogMessage_separatorLogContent; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_defaultLogContent; @@ -183,7 +183,7 @@ - (void)test_formattedLogMessage_defaultLogContent; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_errorPrefixChangeRespected; @@ -203,7 +203,7 @@ - (void)test_formattedLogMessage_errorPrefixChangeRespected; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_separatorPrefixChangeRespected; @@ -223,7 +223,7 @@ - (void)test_formattedLogMessage_separatorPrefixChangeRespected; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_errorPrefixOnSameLineIfLogTextIsEmpty; @@ -241,7 +241,7 @@ - (void)test_formattedLogMessage_errorPrefixOnSameLineIfLogTextIsEmpty; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_formattedLogMessage_separatorPrefixOnSameLineIfLogTextIsEmpty; @@ -259,7 +259,7 @@ - (void)test_formattedLogMessage_separatorPrefixOnSameLineIfLogTextIsEmpty; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } #pragma mark - Performance Tests @@ -286,7 +286,7 @@ - (void)test_formattedLogMessage_performance; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; }]; } diff --git a/AardvarkTests/ARKEmailBugReporterTests.m b/AardvarkTests/ARKEmailBugReporterTests.m index fe897245..72343513 100644 --- a/AardvarkTests/ARKEmailBugReporterTests.m +++ b/AardvarkTests/ARKEmailBugReporterTests.m @@ -33,9 +33,9 @@ @interface ARKEmailBugReporterTests : XCTestCase -@property (nonatomic, strong, readwrite) ARKLogDistributor *defaultLogDistributor; -@property (nonatomic, strong, readwrite) ARKEmailBugReporter *bugReporter; -@property (nonatomic, weak, readwrite) ARKLogStore *logStore; +@property (nonatomic) ARKLogDistributor *defaultLogDistributor; +@property (nonatomic) ARKEmailBugReporter *bugReporter; +@property (nonatomic, weak) ARKLogStore *logStore; @end @@ -91,7 +91,7 @@ - (void)test_recentErrorLogMessagesAsPlainText_countRespected; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_recentErrorLogMessagesAsPlainText_returnsNilIfNoErrorLogsPresent; @@ -114,7 +114,7 @@ - (void)test_recentErrorLogMessagesAsPlainText_returnsNilIfNoErrorLogsPresent; }]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_recentErrorLogMessagesAsPlainText_returnsNilIfRecentErrorLogsIsZero; @@ -137,7 +137,7 @@ - (void)test_recentErrorLogMessagesAsPlainText_returnsNilIfRecentErrorLogsIsZero }]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_addLogStores_enforcesARKLogStoreClass; diff --git a/AardvarkTests/ARKFileHandleAdditionsTests.m b/AardvarkTests/ARKFileHandleAdditionsTests.m index 9bc5ad55..cea4ede9 100644 --- a/AardvarkTests/ARKFileHandleAdditionsTests.m +++ b/AardvarkTests/ARKFileHandleAdditionsTests.m @@ -125,10 +125,7 @@ - (void)test_writeDataBlock; [self.fileHandle ARK_writeDataBlock:self.data_4]; [self _assertFileContentsMatchDataList:@[ self.block_9, self.block_4, self.block_7 ] failureMessage:@"Failed to over-write data in file."]; - // Write empty-length data. - [self.fileHandle ARK_writeDataBlock:nil]; - [self _assertFileContentsMatchDataList:@[ self.block_9, self.block_4, self.block_7 ] failureMessage:@"Writing nil data shouldn't change the file."]; - + // Write empty-length data. [self.fileHandle ARK_writeDataBlock:[NSData data]]; [self _assertFileContentsMatchDataList:@[ self.block_9, self.block_4, self.block_7 ] failureMessage:@"Writing empty data shouldn't change the file."]; } @@ -158,9 +155,6 @@ - (void)test_appendDataBlock; [self _assertFileContentsMatchDataList:@[ self.block_6, self.block_7, self.block_9, self.block_4 ] failureMessage:@"Failed to append to block after seeking to end of file."]; // Append empty data. - [self.fileHandle ARK_appendDataBlock:nil]; - [self _assertFileContentsMatchDataList:@[ self.block_6, self.block_7, self.block_9, self.block_4 ] failureMessage:@"Appending nil data shouldn't change the file."]; - [self.fileHandle ARK_appendDataBlock:[NSData data]]; [self _assertFileContentsMatchDataList:@[ self.block_6, self.block_7, self.block_9, self.block_4 ] failureMessage:@"Appending empty data shouldn't change the file."]; } diff --git a/AardvarkTests/ARKLogDistributorTests.m b/AardvarkTests/ARKLogDistributorTests.m index 6354e41c..aef108b7 100644 --- a/AardvarkTests/ARKLogDistributorTests.m +++ b/AardvarkTests/ARKLogDistributorTests.m @@ -121,7 +121,7 @@ - (void)test_logMessageClass_defaultsToARKLogMessage; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_setLogMessageClass_appendedLogsAreCorrectClass; @@ -137,7 +137,7 @@ - (void)test_setLogMessageClass_appendedLogsAreCorrectClass; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_defaultLogStore_lazilyInitializesOnFirstAccess; @@ -176,7 +176,7 @@ - (void)test_addLogObserver_notifiesLogObserverOnARKLog; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; [[ARKLogDistributor defaultDistributor] removeLogObserver:testLogObserver]; } @@ -197,7 +197,7 @@ - (void)test_addLogObserver_notifiesLogObserverOnLogWithFormat; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_removeLogObserver_removesLogObserver; @@ -224,7 +224,7 @@ - (void)test_removeLogObserver_removesLogObserver; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_distributeAllPendingLogsWithCompletionHandler_informsLogObserversOfAllPendingLogs; @@ -257,7 +257,7 @@ - (void)test_distributeAllPendingLogsWithCompletionHandler_informsLogObserversOf }]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } #pragma mark - Performance Tests diff --git a/AardvarkTests/ARKLogStoreTests.m b/AardvarkTests/ARKLogStoreTests.m index 1ce61aad..26b83f97 100644 --- a/AardvarkTests/ARKLogStoreTests.m +++ b/AardvarkTests/ARKLogStoreTests.m @@ -76,7 +76,7 @@ - (void)test_observeLogMessage_logsLogToLogStore; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_observeLogMessage_trimsOldestLogs; @@ -95,7 +95,7 @@ - (void)test_observeLogMessage_trimsOldestLogs; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_logFilterBlock_preventsLogsFromBeingObserved; @@ -130,7 +130,7 @@ - (void)test_logFilterBlock_preventsLogsFromBeingObserved; }]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_retrieveAllLogMessagesWithCompletionHandler_capturesAllLogsLogged; @@ -152,7 +152,7 @@ - (void)test_retrieveAllLogMessagesWithCompletionHandler_capturesAllLogsLogged; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_retrieveAllLogMessagesWithCompletionHandler_callsCompletionHandlerIfNoLogDistributor; @@ -164,7 +164,7 @@ - (void)test_retrieveAllLogMessagesWithCompletionHandler_callsCompletionHandlerI [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_retrieveAllLogMessagesWithCompletionHandler_completionHandlerCalledOnMainQueue; @@ -175,7 +175,7 @@ - (void)test_retrieveAllLogMessagesWithCompletionHandler_completionHandlerCalled [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_clearLogsWithCompletionHandler_removesAllLogMessages; @@ -194,7 +194,7 @@ - (void)test_clearLogsWithCompletionHandler_removesAllLogMessages; }]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } - (void)test_waitUntilAllOperationsAreFinished_completionHandlerCalledOnMainQueue; @@ -205,7 +205,7 @@ - (void)test_waitUntilAllOperationsAreFinished_completionHandlerCalledOnMainQueu [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } #pragma mark - Performance Tests @@ -265,7 +265,7 @@ - (void)test_retrieveAllLogMessagesWithCompletionHandler_performance; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; }]; } diff --git a/AardvarkTests/ARKLogTableViewControllerTests.m b/AardvarkTests/ARKLogTableViewControllerTests.m index ab0217ed..7f689423 100644 --- a/AardvarkTests/ARKLogTableViewControllerTests.m +++ b/AardvarkTests/ARKLogTableViewControllerTests.m @@ -161,7 +161,7 @@ - (void)test_logMessagesWithMinuteSeparators_insertsTimestampsBetweenLogs; [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1.0 handler:nil]; + [self waitForExpectationsWithTimeout:5.0 handler:nil]; } @end diff --git a/Bug Reporting/ARKBugReporter.h b/Bug Reporting/ARKBugReporter.h index 65c1f36d..3ad68bbb 100644 --- a/Bug Reporting/ARKBugReporter.h +++ b/Bug Reporting/ARKBugReporter.h @@ -21,6 +21,9 @@ #import +NS_ASSUME_NONNULL_BEGIN + + @protocol ARKBugReporter /// Called when the user has triggered the creation of a bug report. @@ -36,3 +39,5 @@ - (NSArray *)logStores; @end + +NS_ASSUME_NONNULL_END diff --git a/Bug Reporting/ARKDefaultLogFormatter.h b/Bug Reporting/ARKDefaultLogFormatter.h index 52c0d092..4a583731 100644 --- a/Bug Reporting/ARKDefaultLogFormatter.h +++ b/Bug Reporting/ARKDefaultLogFormatter.h @@ -21,12 +21,18 @@ #import +NS_ASSUME_NONNULL_BEGIN + + @interface ARKDefaultLogFormatter : NSObject /// The string that is prepended to error logs. -@property (nonatomic, copy, readwrite) NSString *errorLogPrefix; +@property (nonatomic, copy) NSString *errorLogPrefix; /// The string that is prepended to separator logs. -@property (nonatomic, copy, readwrite) NSString *separatorLogPrefix; +@property (nonatomic, copy) NSString *separatorLogPrefix; @end + + +NS_ASSUME_NONNULL_END diff --git a/Bug Reporting/ARKEmailBugReporter.h b/Bug Reporting/ARKEmailBugReporter.h index f99ac6da..3f182961 100644 --- a/Bug Reporting/ARKEmailBugReporter.h +++ b/Bug Reporting/ARKEmailBugReporter.h @@ -26,28 +26,31 @@ @protocol ARKLogFormatter; +NS_ASSUME_NONNULL_BEGIN + + /// Composes a bug report that is sent via email. @interface ARKEmailBugReporter : NSObject - (instancetype)initWithEmailAddress:(NSString *)emailAddress logStore:(ARKLogStore *)logStore; /// The email address to which bug reports will be sent. Must be set before composeBugReport is called. -@property (nonatomic, copy, readwrite) NSString *bugReportRecipientEmailAddress; +@property (nonatomic, copy) NSString *bugReportRecipientEmailAddress; /// The email body that will be presented to the user when they compose a report. -@property (nonatomic, copy, readwrite) NSString *prefilledEmailBody; +@property (nonatomic, copy) NSString *prefilledEmailBody; /// The formatter used to prepare the log for entry into an email. Defaults to a vanilla instance of ARKDefaultLogFormatter. -@property (nonatomic, strong, readwrite) id logFormatter; +@property (nonatomic) id logFormatter; /// Controls the number of recent error logs per log distributor to include in the email body of a bug report composed in a mail client that allows attachments. Defaults to 3. -@property (nonatomic, assign, readwrite) NSUInteger numberOfRecentErrorLogsToIncludeInEmailBodyWhenAttachmentsAreAvailable; +@property (nonatomic) NSUInteger numberOfRecentErrorLogsToIncludeInEmailBodyWhenAttachmentsAreAvailable; /// Controls the number of recent error logs per log distributor to include in the email body of a bug report composed in a mail client that does not allow attachments. Defaults to 15. -@property (nonatomic, assign, readwrite) NSUInteger numberOfRecentErrorLogsToIncludeInEmailBodyWhenAttachmentsAreUnavailable; +@property (nonatomic) NSUInteger numberOfRecentErrorLogsToIncludeInEmailBodyWhenAttachmentsAreUnavailable; /// The window level for the email composer on iOS 7 or later. Defaults to UIWindowLevelStatusBar + 3.0. -@property (nonatomic, assign, readwrite) UIWindowLevel emailComposeWindowLevel; +@property (nonatomic) UIWindowLevel emailComposeWindowLevel; /// Returns formatted log messages as NSData. - (NSData *)formattedLogMessagesAsData:(NSArray *)logMessages; @@ -59,3 +62,6 @@ - (NSString *)formattedLogMessagesAttachmentExtension; @end + + +NS_ASSUME_NONNULL_END diff --git a/Bug Reporting/ARKEmailBugReporter.m b/Bug Reporting/ARKEmailBugReporter.m index 1026afeb..2e2a4a7d 100644 --- a/Bug Reporting/ARKEmailBugReporter.m +++ b/Bug Reporting/ARKEmailBugReporter.m @@ -36,10 +36,10 @@ @interface ARKInvisibleView : UIView @interface ARKEmailBugReporter () -@property (nonatomic, strong, readwrite) UIView *screenFlashView; +@property (nonatomic) UIView *screenFlashView; -@property (nonatomic, strong) MFMailComposeViewController *mailComposeViewController; -@property (nonatomic, strong) UIWindow *emailComposeWindow; +@property (nonatomic) MFMailComposeViewController *mailComposeViewController; +@property (nonatomic) UIWindow *emailComposeWindow; @property (nonatomic, copy) NSMutableArray *mutableLogStores; diff --git a/Bug Reporting/ARKEmailBugReporter_Testing.h b/Bug Reporting/ARKEmailBugReporter_Testing.h index 6f2c0123..1efa58fe 100644 --- a/Bug Reporting/ARKEmailBugReporter_Testing.h +++ b/Bug Reporting/ARKEmailBugReporter_Testing.h @@ -18,8 +18,14 @@ // limitations under the License. // +NS_ASSUME_NONNULL_BEGIN + + @interface ARKEmailBugReporter () - (NSString *)_recentErrorLogMessagesAsPlainText:(NSArray *)logMessages count:(NSUInteger)errorLogsToInclude; @end + + +NS_ASSUME_NONNULL_END diff --git a/Bug Reporting/ARKLogFormatter.h b/Bug Reporting/ARKLogFormatter.h index 50facffc..c21cf43a 100644 --- a/Bug Reporting/ARKLogFormatter.h +++ b/Bug Reporting/ARKLogFormatter.h @@ -24,6 +24,9 @@ @class ARKLogMessage; +NS_ASSUME_NONNULL_BEGIN + + @protocol ARKLogFormatter @required @@ -32,3 +35,6 @@ - (NSString *)formattedLogMessage:(ARKLogMessage *)logMessage; @end + + +NS_ASSUME_NONNULL_END diff --git a/Categories/NSFileHandle+ARKAdditions.h b/Categories/NSFileHandle+ARKAdditions.h index fd3bcb7d..21dfa2a6 100644 --- a/Categories/NSFileHandle+ARKAdditions.h +++ b/Categories/NSFileHandle+ARKAdditions.h @@ -21,6 +21,9 @@ #import +NS_ASSUME_NONNULL_BEGIN + + extern NSUInteger const ARKInvalidDataBlockLength; @@ -36,9 +39,12 @@ extern NSUInteger const ARKInvalidDataBlockLength; - (NSUInteger)ARK_seekToDataBlockAtIndex:(NSUInteger)blockIndex; /// Reads the length of the data block, followed by the data itself. Returns nil at the end of the file, and passes back NO if corruption was detected (without changing the current offsetInFile). -- (NSData *)ARK_readDataBlock:(out BOOL *)success; +- (nullable NSData *)ARK_readDataBlock:(out BOOL *)success; /// Truncates the file from the beginning to the specified offset, moving data in chunks no larger than maximumChunkSize (to constrain the memory usage of the operation, at the expense of more processor and I/O time). Pass 0 or NSUIntegerMax to impose no limit. - (void)ARK_truncateFileToOffset:(unsigned long long)offset maximumChunkSize:(NSUInteger)maximumChunkSize; @end + + +NS_ASSUME_NONNULL_END diff --git a/Categories/NSURL+ARKAdditions.h b/Categories/NSURL+ARKAdditions.h index 19c48097..d5067920 100644 --- a/Categories/NSURL+ARKAdditions.h +++ b/Categories/NSURL+ARKAdditions.h @@ -21,8 +21,14 @@ #import +NS_ASSUME_NONNULL_BEGIN + + @interface NSURL (ARKAdditions) -+ (NSURL *)ARK_fileURLWithApplicationSupportFilename:(NSString *)filename; ++ (nullable NSURL *)ARK_fileURLWithApplicationSupportFilename:(NSString *)filename; @end + + +NS_ASSUME_NONNULL_END diff --git a/Categories/UIActivityViewController+ARKAdditions.h b/Categories/UIActivityViewController+ARKAdditions.h index 601cc0fa..b5eb612f 100644 --- a/Categories/UIActivityViewController+ARKAdditions.h +++ b/Categories/UIActivityViewController+ARKAdditions.h @@ -21,9 +21,15 @@ #import +NS_ASSUME_NONNULL_BEGIN + + @interface UIActivityViewController (ARKAdditions) /// Creates an activity sheet that allows for sharing via AirDrop, email, copying to the pasteboard and printing. + (instancetype)ARK_newAardvarkActivityViewControllerWithItems:(NSArray *)items; @end + + +NS_ASSUME_NONNULL_END diff --git a/Categories/UIApplication+ARKAdditions.h b/Categories/UIApplication+ARKAdditions.h index c8f2affc..99e11813 100644 --- a/Categories/UIApplication+ARKAdditions.h +++ b/Categories/UIApplication+ARKAdditions.h @@ -25,15 +25,21 @@ @class ARKLogDistributor; +NS_ASSUME_NONNULL_BEGIN + + @interface UIApplication (ARKAdditions) /// Adds a two finger press and hold gesture recognizer to the application. Triggering that gesture causes bugReporter to compose a bug report. - (void)ARK_addTwoFingerPressAndHoldGestureRecognizerTriggerWithBugReporter:(id )bugReporter; /// Adds a gesture recognizer of class gestureRecognizerClass to the application and returns it. Triggering that gesture causes bugReporter to compose a bug report from bugReporter's logStores. -- (id)ARK_addBugReporter:(id )bugReporter triggeringGestureRecognizerClass:(Class)gestureRecognizerClass; +- (nullable id)ARK_addBugReporter:(id )bugReporter triggeringGestureRecognizerClass:(Class)gestureRecognizerClass; /// Removes bugReporter and the associated gestureRecognizer. - (void)ARK_removeBugReporter:(id )bugReporter; @end + + +NS_ASSUME_NONNULL_END diff --git a/Categories/UIApplication+ARKAdditions.m b/Categories/UIApplication+ARKAdditions.m index 7d2218ef..db665df4 100644 --- a/Categories/UIApplication+ARKAdditions.m +++ b/Categories/UIApplication+ARKAdditions.m @@ -29,8 +29,8 @@ @interface UIApplication (ARKAdditions_Private) -@property (nonatomic, strong, readwrite) NSMapTable *ARK_bugReporterToGestureRecognizerMap; -@property (nonatomic, assign, readwrite, getter=ARK_isObservingKeyWindowNotifications, setter=setARK_ObservingKeyWindowNotifications:) BOOL ARK_observingKeyWindowNotifications; +@property (nonatomic) NSMapTable *ARK_bugReporterToGestureRecognizerMap; +@property (nonatomic, getter=ARK_isObservingKeyWindowNotifications, setter=setARK_ObservingKeyWindowNotifications:) BOOL ARK_observingKeyWindowNotifications; @end diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..1cc94a0c --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'cocoapods', '0.37.2' diff --git a/Log Viewing/ARKIndividualLogViewController.h b/Log Viewing/ARKIndividualLogViewController.h index b227f6ae..5c372793 100644 --- a/Log Viewing/ARKIndividualLogViewController.h +++ b/Log Viewing/ARKIndividualLogViewController.h @@ -24,8 +24,14 @@ @class ARKLogMessage; +NS_ASSUME_NONNULL_BEGIN + + @interface ARKIndividualLogViewController : UIViewController -- (instancetype)initWithLogMessage:(ARKLogMessage *)logMessage; +- (nullable instancetype)initWithLogMessage:(ARKLogMessage *)logMessage; @end + + +NS_ASSUME_NONNULL_END diff --git a/Log Viewing/ARKIndividualLogViewController.m b/Log Viewing/ARKIndividualLogViewController.m index 25247143..6813d2ea 100644 --- a/Log Viewing/ARKIndividualLogViewController.m +++ b/Log Viewing/ARKIndividualLogViewController.m @@ -26,8 +26,8 @@ @interface ARKIndividualLogViewController () -@property (nonatomic, strong, readonly) UITextView *textView; -@property (nonatomic, copy, readwrite) NSString *text; +@property (nonatomic, readonly) UITextView *textView; +@property (nonatomic, copy) NSString *text; @end diff --git a/Log Viewing/ARKLogTableViewController.h b/Log Viewing/ARKLogTableViewController.h index 78781fd9..1d8d912b 100644 --- a/Log Viewing/ARKLogTableViewController.h +++ b/Log Viewing/ARKLogTableViewController.h @@ -25,21 +25,27 @@ @class ARKLogStore; +NS_ASSUME_NONNULL_BEGIN + + /// Displays a list of ARKArdvarkLogs in a table. @interface ARKLogTableViewController : UITableViewController -- (instancetype)initWithLogStore:(ARKLogStore *)logStore logFormatter:(id )logFormatter; +- (nullable instancetype)initWithLogStore:(ARKLogStore *)logStore logFormatter:(id )logFormatter; /// The log store that provides the data for the table. -@property (nonatomic, strong, readonly) ARKLogStore *logStore; +@property (nonatomic, readonly) ARKLogStore *logStore; /// The formatter used to prepare the logs for the share/activity sheet. -@property (nonatomic, strong, readonly) id logFormatter; +@property (nonatomic, readonly) id logFormatter; /// The number of minutes between timestamps. Defaults to 3. -@property (nonatomic, assign, readwrite) NSUInteger minutesBetweenTimestamps; +@property (nonatomic) NSUInteger minutesBetweenTimestamps; /// Returns an array suitable for sharing via the activity sheet. - (NSArray *)contentForActivitySheet; @end + + +NS_ASSUME_NONNULL_END diff --git a/Log Viewing/ARKLogTableViewController.m b/Log Viewing/ARKLogTableViewController.m index 7cbaad26..ba64b54b 100644 --- a/Log Viewing/ARKLogTableViewController.m +++ b/Log Viewing/ARKLogTableViewController.m @@ -33,9 +33,9 @@ @interface ARKLogTableViewController () -@property (nonatomic, copy, readwrite) NSArray *logMessages; -@property (nonatomic, assign, readwrite) BOOL viewWillAppearForFirstTimeCalled; -@property (nonatomic, assign, readwrite) BOOL hasScrolledToBottom; +@property (nonatomic, copy) NSArray *logMessages; +@property (nonatomic) BOOL viewWillAppearForFirstTimeCalled; +@property (nonatomic) BOOL hasScrolledToBottom; @property (nonatomic) UIActionSheet *clearLogsConfirmationActionSheet; diff --git a/Log Viewing/ARKScreenshotViewController.h b/Log Viewing/ARKScreenshotViewController.h index a43e7051..56bbf962 100644 --- a/Log Viewing/ARKScreenshotViewController.h +++ b/Log Viewing/ARKScreenshotViewController.h @@ -24,8 +24,14 @@ @class ARKLogMessage; +NS_ASSUME_NONNULL_BEGIN + + @interface ARKScreenshotViewController : UIViewController -- (instancetype)initWithLogMessage:(ARKLogMessage *)logMessage; +- (nullable instancetype)initWithLogMessage:(ARKLogMessage *)logMessage; @end + + +NS_ASSUME_NONNULL_END diff --git a/Log Viewing/ARKScreenshotViewController.m b/Log Viewing/ARKScreenshotViewController.m index ed042518..8bc9bfbd 100644 --- a/Log Viewing/ARKScreenshotViewController.m +++ b/Log Viewing/ARKScreenshotViewController.m @@ -26,10 +26,10 @@ @interface ARKScreenshotViewController () -@property (nonatomic, strong, readonly) UIImageView *imageView; -@property (nonatomic, strong, readonly) UITapGestureRecognizer *tapGestureRecognizer; -@property (nonatomic, strong, readonly) NSDate *date; -@property (nonatomic, weak, readwrite) UIActivityViewController *activityViewController; +@property (nonatomic, readonly) UIImageView *imageView; +@property (nonatomic, readonly) UITapGestureRecognizer *tapGestureRecognizer; +@property (nonatomic, readonly) NSDate *date; +@property (nonatomic, weak) UIActivityViewController *activityViewController; @end diff --git a/Logging/ARKDataArchive.h b/Logging/ARKDataArchive.h index 96f4c936..923edf12 100644 --- a/Logging/ARKDataArchive.h +++ b/Logging/ARKDataArchive.h @@ -21,11 +21,14 @@ #import +NS_ASSUME_NONNULL_BEGIN + + /// Incrementally persists data to disk. All methods and properties on this class are threadsafe. @interface ARKDataArchive : NSObject /// Creates a file at the supplied URL if necessary, or reads in (and validates) the file if it already exists from a previous run. -- (instancetype)initWithURL:(NSURL *)fileURL maximumObjectCount:(NSUInteger)maximumObjectCount trimmedObjectCount:(NSUInteger)trimmedObjectCount __attribute__((nonnull(1))) NS_DESIGNATED_INITIALIZER; +- (nullable instancetype)initWithURL:(NSURL *)fileURL maximumObjectCount:(NSUInteger)maximumObjectCount trimmedObjectCount:(NSUInteger)trimmedObjectCount NS_DESIGNATED_INITIALIZER; /// The maximum number of archived objects to store in the file. @property (nonatomic, readonly) NSUInteger maximumObjectCount; @@ -40,12 +43,15 @@ - (void)appendArchiveOfObject:(id )object; /// Reads in all contents of the archive, unarchives each object, and returns them on the main thread. -- (void)readObjectsFromArchiveWithCompletionHandler:(void (^)(NSArray *unarchivedObjects))completionHandler __attribute__((nonnull(1))); +- (void)readObjectsFromArchiveWithCompletionHandler:(nonnull void (^)(NSArray *unarchivedObjects))completionHandler; /// Empties the archive (but does not remove the file). Completion handler is called on the main queue. -- (void)clearArchiveWithCompletionHandler:(dispatch_block_t)completionHandler; +- (void)clearArchiveWithCompletionHandler:(nullable dispatch_block_t)completionHandler; /// Ensures the archive is persisted on the file system, synchronously if requested. - (void)saveArchiveAndWait:(BOOL)wait; @end + + +NS_ASSUME_NONNULL_END diff --git a/Logging/ARKDataArchive.m b/Logging/ARKDataArchive.m index 5963a346..c3fa862c 100644 --- a/Logging/ARKDataArchive.m +++ b/Logging/ARKDataArchive.m @@ -25,13 +25,16 @@ #import "NSFileHandle+ARKAdditions.h" +NS_ASSUME_NONNULL_BEGIN + + NSUInteger const ARKMaximumChunkSizeForTrimOperation = (1024 * 1024); @interface ARKDataArchive () -@property (nonatomic, strong, readonly) NSFileHandle *fileHandle; -@property (nonatomic, strong, readonly) NSOperationQueue *fileOperationQueue; +@property (nonatomic, readonly) NSFileHandle *fileHandle; +@property (nonatomic, readonly) NSOperationQueue *fileOperationQueue; @property (nonatomic) NSUInteger objectCount; @@ -42,7 +45,12 @@ @implementation ARKDataArchive #pragma mark - Initialization -- (instancetype)initWithURL:(NSURL *)fileURL maximumObjectCount:(NSUInteger)maximumObjectCount trimmedObjectCount:(NSUInteger)trimmedObjectCount; +- (nullable instancetype)init NS_UNAVAILABLE; +{ + ARKCheckCondition(NO, nil, @"Use initWithURL:maximumObjectCount:trimmedObjectCount:"); +} + +- (nullable instancetype)initWithURL:(NSURL *)fileURL maximumObjectCount:(NSUInteger)maximumObjectCount trimmedObjectCount:(NSUInteger)trimmedObjectCount; { ARKCheckCondition([fileURL isFileURL], nil, @"Must provide a file URL!"); @@ -173,7 +181,7 @@ - (void)readObjectsFromArchiveWithCompletionHandler:(void (^)(NSArray *unarchive [self.fileOperationQueue addOperation:readOperation]; } -- (void)clearArchiveWithCompletionHandler:(dispatch_block_t)completionHandler; +- (void)clearArchiveWithCompletionHandler:(nullable dispatch_block_t)completionHandler; { [self.fileOperationQueue addOperationWithBlock:^{ self.objectCount = 0; @@ -252,3 +260,6 @@ - (void)_saveArchive_inFileOperationQueue; } @end + + +NS_ASSUME_NONNULL_END diff --git a/Logging/ARKDataArchive_Testing.h b/Logging/ARKDataArchive_Testing.h index 76c50b5b..c033221f 100644 --- a/Logging/ARKDataArchive_Testing.h +++ b/Logging/ARKDataArchive_Testing.h @@ -23,7 +23,7 @@ @interface ARKDataArchive (Private) -@property (nonatomic, strong, readonly) NSFileHandle *fileHandle; +@property (nonatomic, readonly) NSFileHandle *fileHandle; - (void)waitUntilAllOperationsAreFinished; diff --git a/Logging/ARKLogDistributor.h b/Logging/ARKLogDistributor.h index 151925c1..d0b82642 100644 --- a/Logging/ARKLogDistributor.h +++ b/Logging/ARKLogDistributor.h @@ -26,17 +26,20 @@ @class ARKLogStore; +NS_ASSUME_NONNULL_BEGIN + + /// Distrubutes log messages to log observers. All methods and properties on this class are threadsafe. @interface ARKLogDistributor : NSObject /// Returns the instance of the log distributor used by ARKLog(). -+ (instancetype)defaultDistributor; ++ (nullable instancetype)defaultDistributor; /// Defaults to ARKLogMessage. Can be set to a subclass of ARKLogMessage. -@property (atomic, assign, readwrite) Class logMessageClass; +@property Class logMessageClass; /// Convenience method to store a reference to the default log store. Lazily creates a log store when accessed for the first time if one is not already set. -@property (atomic, strong, readwrite) ARKLogStore *defaultLogStore; +@property (nullable) ARKLogStore *defaultLogStore; /// Returns all instances of `ARKLogStore` that are currently registered as observers on this log distributor. @property (atomic, copy, readonly) NSSet *logStores; @@ -48,19 +51,19 @@ - (void)removeLogObserver:(id )logObserver; /// Distributes all enqueued log messages to log observers prior to calling the completionHandler. Completion handler is called on the main queue. -- (void)distributeAllPendingLogsWithCompletionHandler:(dispatch_block_t)completionHandler __attribute__((nonnull(1))); +- (void)distributeAllPendingLogsWithCompletionHandler:(dispatch_block_t)completionHandler; /// Distributes the log to the log observers. - (void)logMessage:(ARKLogMessage *)logMessage; /// Creates a log message and distributes the log to the log observers. -- (void)logWithText:(NSString *)text image:(UIImage *)image type:(ARKLogType)type userInfo:(NSDictionary *)userInfo; +- (void)logWithText:(NSString *)text image:(nullable UIImage *)image type:(ARKLogType)type userInfo:(nullable NSDictionary *)userInfo; /// Creates a log message and distributes the log to the log observers. -- (void)logWithType:(ARKLogType)type userInfo:(NSDictionary *)userInfo format:(NSString *)format arguments:(va_list)argList; +- (void)logWithType:(ARKLogType)type userInfo:(nullable NSDictionary *)userInfo format:(NSString *)format arguments:(va_list)argList; /// Creates a log message and distributes the log to the log observers. -- (void)logWithType:(ARKLogType)type userInfo:(NSDictionary *)userInfo format:(NSString *)format, ... NS_FORMAT_FUNCTION(3,4); +- (void)logWithType:(ARKLogType)type userInfo:(nullable NSDictionary *)userInfo format:(NSString *)format, ... NS_FORMAT_FUNCTION(3,4); /// Creates a log message with ARKLogTypeDefault and distributes the log to the log observers. - (void)logWithFormat:(NSString *)format arguments:(va_list)argList; @@ -72,3 +75,6 @@ - (void)logScreenshot; @end + + +NS_ASSUME_NONNULL_END diff --git a/Logging/ARKLogDistributor.m b/Logging/ARKLogDistributor.m index e9c23a70..f3114cc2 100644 --- a/Logging/ARKLogDistributor.m +++ b/Logging/ARKLogDistributor.m @@ -29,13 +29,12 @@ @interface ARKLogDistributor () -@property (nonatomic, strong, readonly) NSOperationQueue *logDistributingQueue; -@property (atomic, strong, readonly) NSMutableArray *logObservers; - -@property (atomic, assign) Class internalLogMessageClass; -@property (atomic, weak) ARKLogStore *weakDefaultLogStore; -@property (atomic, strong, readonly) NSRecursiveLock *defaultLogStorePropertyLock; +@property (nonatomic, readonly) NSOperationQueue *logDistributingQueue; +@property (copy, readonly) NSMutableArray *logObservers; +@property Class internalLogMessageClass; +@property (weak) ARKLogStore *weakDefaultLogStore; +@property (readonly) NSRecursiveLock *defaultLogStorePropertyLock; /// Set to YES after calling `defaultLogStore`. /// Ensures that we only lazily create the default log store if `defaultLogStore` is nil the very first time it is called, diff --git a/Logging/ARKLogDistributor_Testing.h b/Logging/ARKLogDistributor_Testing.h index 47daebca..607f6a65 100644 --- a/Logging/ARKLogDistributor_Testing.h +++ b/Logging/ARKLogDistributor_Testing.h @@ -18,9 +18,15 @@ // limitations under the License. // +NS_ASSUME_NONNULL_BEGIN + + @interface ARKLogDistributor (Private) - (NSMutableSet *)logObservers; - (NSUInteger)internalQueueOperationCount; @end + + +NS_ASSUME_NONNULL_END diff --git a/Logging/ARKLogMessage.h b/Logging/ARKLogMessage.h index 4c6054ae..445373c7 100644 --- a/Logging/ARKLogMessage.h +++ b/Logging/ARKLogMessage.h @@ -21,16 +21,22 @@ #import +NS_ASSUME_NONNULL_BEGIN + + @interface ARKLogMessage : NSObject -- (instancetype)initWithText:(NSString *)text image:(UIImage *)image type:(ARKLogType)type userInfo:(NSDictionary *)userInfo; +- (instancetype)initWithText:(NSString *)text image:(nullable UIImage *)image type:(ARKLogType)type userInfo:(nullable NSDictionary *)userInfo; @property (nonatomic, copy, readonly) NSDate *creationDate; @property (nonatomic, copy, readonly) NSString *text; -@property (nonatomic, strong, readonly) UIImage *image; -@property (nonatomic, assign, readonly) ARKLogType type; +@property (nonatomic, readonly) UIImage *image; +@property (nonatomic, readonly) ARKLogType type; /// Arbitrary information used by ARKLogBlocks. This data is not persisted @property (nonatomic, copy, readonly) NSDictionary *userInfo; @end + + +NS_ASSUME_NONNULL_END diff --git a/Logging/ARKLogObserver.h b/Logging/ARKLogObserver.h index 6812ee10..613c99d2 100644 --- a/Logging/ARKLogObserver.h +++ b/Logging/ARKLogObserver.h @@ -25,12 +25,18 @@ @class ARKLogMessage; +NS_ASSUME_NONNULL_BEGIN + + @protocol ARKLogObserver /// The log distributor that distributes logs to this observer. -@property (atomic, weak, readwrite) ARKLogDistributor *logDistributor; +@property (weak, nullable) ARKLogDistributor *logDistributor; /// Called on a background operation queue when logs are appended to the log distributor. - (void)observeLogMessage:(ARKLogMessage *)logMessage; @end + + +NS_ASSUME_NONNULL_END diff --git a/Logging/ARKLogStore.h b/Logging/ARKLogStore.h index 30bf16f8..59533407 100644 --- a/Logging/ARKLogStore.h +++ b/Logging/ARKLogStore.h @@ -21,14 +21,17 @@ #import +NS_ASSUME_NONNULL_BEGIN + + /// Stores log messages locally for use in bug reports. All methods and properties on this class are threadsafe. @interface ARKLogStore : NSObject /// Creates an ARKLogStore with persistedLogFileURL set to the supplied fileName within the application support directory and a maximumLogMessageCount of logs to persist. -- (instancetype)initWithPersistedLogFileName:(NSString *)fileName maximumLogMessageCount:(NSUInteger)maximumLogMessageCount __attribute__((nonnull(1))); +- (nullable instancetype)initWithPersistedLogFileName:(NSString *)fileName maximumLogMessageCount:(NSUInteger)maximumLogMessageCount; /// Creates an ARKLogStore with persistedLogsFileURL set to the supplied fileName within the application support directory that keeps a maximum of 2000 logs persisted. -- (instancetype)initWithPersistedLogFileName:(NSString *)fileName __attribute__((nonnull(1))); +- (nullable instancetype)initWithPersistedLogFileName:(NSString *)fileName; /// Path to the file on disk that contains peristed logs. @property (nonatomic, copy, readonly) NSURL *persistedLogFileURL; @@ -49,9 +52,12 @@ @property (copy) BOOL (^logFilterBlock)(ARKLogMessage *logMessage); /// Retrieves an array of ARKLogMessage objects. Completion handler is called on the main queue. -- (void)retrieveAllLogMessagesWithCompletionHandler:(void (^)(NSArray *logMessages))completionHandler __attribute__((nonnull(1))); +- (void)retrieveAllLogMessagesWithCompletionHandler:(void (^)(NSArray *logMessages))completionHandler; /// Removes all logs. Completion handler is called on the main queue. -- (void)clearLogsWithCompletionHandler:(dispatch_block_t)completionHandler; +- (void)clearLogsWithCompletionHandler:(nullable dispatch_block_t)completionHandler; @end + + +NS_ASSUME_NONNULL_END diff --git a/Logging/ARKLogStore.m b/Logging/ARKLogStore.m index 7b131896..667eb6d0 100644 --- a/Logging/ARKLogStore.m +++ b/Logging/ARKLogStore.m @@ -32,7 +32,7 @@ @interface ARKLogStore () /// Stores all log messages. -@property (strong) ARKDataArchive *dataArchive; +@property ARKDataArchive *dataArchive; @end diff --git a/Logging/ARKLogStore_Testing.h b/Logging/ARKLogStore_Testing.h index 4f266ee7..6b9b28cf 100644 --- a/Logging/ARKLogStore_Testing.h +++ b/Logging/ARKLogStore_Testing.h @@ -23,6 +23,6 @@ @interface ARKLogStore (Private) -@property (strong) ARKDataArchive *dataArchive; +@property ARKDataArchive *dataArchive; @end diff --git a/README.md b/README.md index 2f19e9bf..9f094931 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Want to log with Aardvark but don’t want to use Aardvark’s bug reporting too ## Requirements -* Xcode 5 or later +* Xcode 6.3 or later * iOS 6 or later ## Contributing