diff --git a/CoreLib/CoreLib.h b/CoreLib/CoreLib.h index c865f30..08aff6b 100644 --- a/CoreLib/CoreLib.h +++ b/CoreLib/CoreLib.h @@ -110,6 +110,7 @@ CC_ENUM(uint8_t, openChoice) static inline NS ## classname * make ## classname (void) { return (NS ## classname *)[NS ## classname new];} MAKE_MAKER(MutableArray) MAKE_MAKER(MutableDictionary) +MAKE_MAKER(MutableIndexSet) MAKE_MAKER(MutableString) MAKE_MAKER(MutableSet) diff --git a/CoreLib/Foundation+CoreCode.m b/CoreLib/Foundation+CoreCode.m index abe02c1..31e7d1f 100644 --- a/CoreLib/Foundation+CoreCode.m +++ b/CoreLib/Foundation+CoreCode.m @@ -1528,7 +1528,7 @@ - (NSURL *)add:(NSString *)component NSString *path = self.path; NSError *err; NSArray *c = [fileManager contentsOfDirectoryAtPath:path error:&err]; - assert(c && !err); + return [c mapped:^id (NSString *input) { return [self URLByAppendingPathComponent:input]; }]; } diff --git a/CoreLibTests.xcodeproj/project.pbxproj b/CoreLibTests.xcodeproj/project.pbxproj index 65aa2c7..a075134 100644 --- a/CoreLibTests.xcodeproj/project.pbxproj +++ b/CoreLibTests.xcodeproj/project.pbxproj @@ -83,9 +83,7 @@ B9EF05541865D5A200CF7A38 /* JMActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF05351865D5A200CF7A38 /* JMActionSheet.m */; }; B9EF05551865D5A200CF7A38 /* JMAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF05371865D5A200CF7A38 /* JMAlertView.m */; }; B9EF05561865D5A200CF7A38 /* JMChoiceController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF05391865D5A200CF7A38 /* JMChoiceController.m */; }; - B9EF05571865D5A200CF7A38 /* JMPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF053B1865D5A200CF7A38 /* JMPopoverController.m */; }; B9EF05581865D5A200CF7A38 /* JMWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF053D1865D5A200CF7A38 /* JMWebViewController.m */; }; - B9EF05691865F18300CF7A38 /* JMPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF053B1865D5A200CF7A38 /* JMPopoverController.m */; }; B9EF056B1865F18300CF7A38 /* JMActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF05351865D5A200CF7A38 /* JMActionSheet.m */; }; B9EF05721865F18300CF7A38 /* JMWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF053D1865D5A200CF7A38 /* JMWebViewController.m */; }; B9EF05731865F18300CF7A38 /* CoreLibTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B9EF052C1865D57400CF7A38 /* CoreLibTests.m */; }; @@ -192,8 +190,6 @@ B9EF05371865D5A200CF7A38 /* JMAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JMAlertView.m; sourceTree = ""; }; B9EF05381865D5A200CF7A38 /* JMChoiceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JMChoiceController.h; sourceTree = ""; }; B9EF05391865D5A200CF7A38 /* JMChoiceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JMChoiceController.m; sourceTree = ""; }; - B9EF053A1865D5A200CF7A38 /* JMPopoverController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JMPopoverController.h; sourceTree = ""; }; - B9EF053B1865D5A200CF7A38 /* JMPopoverController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JMPopoverController.m; sourceTree = ""; }; B9EF053C1865D5A200CF7A38 /* JMWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JMWebViewController.h; sourceTree = ""; }; B9EF053D1865D5A200CF7A38 /* JMWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JMWebViewController.m; sourceTree = ""; }; B9EF05631865EEF600CF7A38 /* CoreLibTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CoreLibTests.h; path = Tests/CoreLibTests.h; sourceTree = ""; }; @@ -311,8 +307,6 @@ B9EF05371865D5A200CF7A38 /* JMAlertView.m */, B9EF05381865D5A200CF7A38 /* JMChoiceController.h */, B9EF05391865D5A200CF7A38 /* JMChoiceController.m */, - B9EF053A1865D5A200CF7A38 /* JMPopoverController.h */, - B9EF053B1865D5A200CF7A38 /* JMPopoverController.m */, B97FDAD81933AA1900A93E6C /* JMSlideshowController.h */, B97FDAD91933AA1900A93E6C /* JMSlideshowController.m */, B9EF053C1865D5A200CF7A38 /* JMWebViewController.h */, @@ -501,7 +495,6 @@ buildActionMask = 2147483647; files = ( B933AB3618BBDFA1006E42B9 /* Foundation+CoreCode.m in Sources */, - B9EF05571865D5A200CF7A38 /* JMPopoverController.m in Sources */, B9EF05541865D5A200CF7A38 /* JMActionSheet.m in Sources */, B933AB3A18BBDFA1006E42B9 /* Foundation+Properties.m in Sources */, B9EF05581865D5A200CF7A38 /* JMWebViewController.m in Sources */, @@ -520,7 +513,6 @@ buildActionMask = 2147483647; files = ( B933AB3718BBDFA1006E42B9 /* Foundation+CoreCode.m in Sources */, - B9EF05691865F18300CF7A38 /* JMPopoverController.m in Sources */, B9EF056B1865F18300CF7A38 /* JMActionSheet.m in Sources */, B933AB3B18BBDFA1006E42B9 /* Foundation+Properties.m in Sources */, B9EF05721865F18300CF7A38 /* JMWebViewController.m in Sources */, diff --git a/iOS/JMPopoverController.h b/iOS/JMPopoverController.h deleted file mode 100644 index 70caaf8..0000000 --- a/iOS/JMPopoverController.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// JMPopoverController.h -// CoreLib -// -// Created by CoreCode on 14.11.12. -/* Copyright (c) 2016 CoreCode - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#import "CoreLib.h" - -@interface JMPopoverController : UIPopoverController - -@property (copy, nonatomic) BasicBlock dismissBlock; - -@end diff --git a/iOS/JMPopoverController.m b/iOS/JMPopoverController.m deleted file mode 100644 index bf4aba1..0000000 --- a/iOS/JMPopoverController.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// JMPopoverController.m -// CoreLib -// -// Created by CoreCode on 14.11.12. -/* Copyright (c) 2016 CoreCode - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#import "JMPopoverController.h" - -@implementation JMPopoverController - -- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated -{ - self.delegate = self; - - [super presentPopoverFromRect:rect inView:view permittedArrowDirections:arrowDirections animated:animated]; -} - -- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated -{ - self.delegate = self; - - [super presentPopoverFromBarButtonItem:item permittedArrowDirections:arrowDirections animated:animated]; -} - -- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController -{ - if (self.dismissBlock) - self.dismissBlock(); -} - -@end