{"id":18270374,"url":"https://github.com/yaakaito/Overline","last_synced_at":"2025-04-05T01:30:33.592Z","repository":{"id":5602745,"uuid":"6809745","full_name":"yaakaito/Overline","owner":"yaakaito","description":"Objective-C utilities and shorthands.","archived":true,"fork":false,"pushed_at":"2016-06-19T13:17:10.000Z","size":859,"stargazers_count":234,"open_issues_count":19,"forks_count":23,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-01T17:06:11.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaakaito.png","metadata":{"files":{"readme":"README.mkd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-22T08:14:21.000Z","updated_at":"2025-02-14T16:21:47.000Z","dependencies_parsed_at":"2022-07-07T07:33:13.780Z","dependency_job_id":null,"html_url":"https://github.com/yaakaito/Overline","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaakaito%2FOverline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaakaito%2FOverline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaakaito%2FOverline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaakaito%2FOverline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaakaito","download_url":"https://codeload.github.com/yaakaito/Overline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276022,"owners_count":20912285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:38:33.082Z","updated_at":"2025-04-05T01:30:33.063Z","avatar_url":"https://github.com/yaakaito.png","language":"Objective-C","readme":"# Overline 0.2.0\n\nObjective-C utilities and shorthands.\n\nOverline is not clone of other language features.\nSimple and clean Objective-C.\n\n## Usage\n\nsetup with cocoapods.\n```\npod 'Overline'\n```\n\nimport `Overline.h`\n```objective-c\n#import \"Overline.h\"\n```\n\n### with BlocksKit\n\n```\npod 'BlocksKit'\npod 'Overline-BlocksKit'\n```\n\nIgnored duplicate methods: `each` `map` `reduce` `filter` `reject`\n\n## Features\n\n### NSArray\n\n#### NSArray+Initialize\n\n```objective-c\nNSArray *array = [NSArray arrayWithRangeFrom:0 to:10];\n// @[@0, @1, @2, @3, @4, @5, @6, @7, @8, @9]\n\nNSArray *array2 = [NSArray arrayWithRangeFrom:0 to:-10 step:2];\n// @[@0, @-2, @-4, @-6, @-8]\n```\n\n* `arrayWithRangeFrom:to:`\n* `arrayWithRangeFrom:to:step:`\n\n#### NSArray+Enumeration\n\n```objective-c\nNSArray *mapped = [@[@1,@2,@3,@4,@5,@6] mappedArrayUsingBlock:^id(id obj, NSUInteger idx) {\n    if ([obj integerValue] % 2 == 0) {\n        return obj;\n    }\n    return nil;\n}];\n// @[@2,@4,@6]\n```\n\n* `each`\n* `map` `mappedArrayUsingBlock`\n* `reduce` `reducedObjectByBlock`\n* `find` `objectUsingBlock`\n* `filter` `filteredArrayUsingBlock`\n* `reject` `rejectedArrayUsingBlock`\n\n#### NSArray+Random\n\n```objective-c\nNSArray *shuffled = [@[@1,@2,@3,@4,@5,@6] shuffledArray];\n```\n\n* `shuffle` `shuffledArray`\n* `anyObject`\n\n#### NSArray+Reverse\n\n```objective-c\nNSArray *reversed = [@[@1,@2,@3,@4,@5,@6] reversedArray]; \n// @[@6,@5,@4,@3,@2,@1]\n```\n\n* `reverse` `reversedArray`\n* `objectAtReversedIndex`\n\n#### NSArray+Selector\n\n* `firstObject`\n\n#### NSArray+SubArray\n\n* `subarrayFromIndex:`\n* `subarrayFromIndex:length:`\n* `subarrayToIndex:`\n* `uniqueObjects`\n* `uniqueObjectsUsingEqualsBlock`\n\n#### NSArray+Difference\n\n* `difference` `arrayDifferenceWithArray`\n* `unionise` `arrayByUnionisingArray`\n\n#### NSArray+Shorthand\n\n* `isEmpty`\n\n\n#### NSArray+Sorting\n\n* `arraySortedDescending:`\n* `arraySortedAsc`\n* `arraySortedDesc`\n\n### NSMutableArray\n#### NSMutableArray+Shorthands\n\n```objective-c\nNSMutableArray *marray = [NSMutableArray arrayWithArray:@[@1,@2,@3]];\n[marray insertObjects:@[@4,@5,@6] atIndex:1];\n```\n* `insertObjects:atIndex:`\n\n#### NSMutableArray+Sorting\n\n* `sortDescending:`\n* `sortAsc`\n* `sortDesc`\n\n### NSDate\n\n#### NSDate+Components\n\n##### Class Methods\n\n* `currentWeekday`\n* `currentHour`\n* `currentMinute`\n* `currentSecond`\n* `currentDay`\n* `currentMonth`\n* `currentYear`\n* `commonDateComponentsForNow`\n* `timeComponentsForNow`\n\n##### Instance Methods\n\n* `weekday`\n* `hour`\n* `minute`\n* `second`\n* `day`\n* `month`\n* `year`\n* `commonDateComponents`\n* `timeComponents`\n\n\n### NSDictionary\n\n#### NSDictionary+Selector\n\n```objective-c\nNSDate *date = [JSON objectForKey:@\"date8601\" transformBlock:^id(id obj) {\n    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];\n    [formatter setDateFormat:@\"yyyy/MM/dd HH:mm:ss Z\"];\n    return [formatter dateFromString:obj];\n}];\n```\n\n* `objectForKey:transformBlock:`\n* `numberForKey:`\n* `stringForKey:`\n* `arrayForKey:`\n* `dictionaryForKey:`\n* `dateForKey:`\n* `dateForKey:usingFormat:`\n* `since1970DateForKey:`\n* `timestampForKey:`\n* `boolObjectForKey:withTrueValue:`\n* `boolForKey:withTureValue:`\n* `boolForKey:`\n* `intForKey:`\n* `integerForKey:`\n* `unsignedIntForKey:`\n* `unsignedIntegerForKey:`\n* `longForKey:`\n* `unsignedLongForKey:`\n* `longLongForKey:`\n* `unsignedLongLongForKey:`\n* `doubleForKey:`\n* `floatForKey:`\n\n#### NSDictionary+Enumeration\n\n```objective-c\nNSDictionary *dic = @{\n        @\"a\" : @1,\n        @\"b\" : @2,\n        @\"c\" : @3,\n        @\"d\" : @4\n};\n\nNSDictionary *filtered = [dic dictionaryFilteredByKeyUsingBlock:^BOOL(NSString *key) {\n    return [key isEqualToString:@\"a\"];\n}]; // @{@\"a\":@1}\n ```\n\n* `each:`\n* `map` `mappedDictionaryUsingBlock`\n* `arrayMap` `mappedArrayUsingBlock`\n* `filterKey` `dictionaryFilteredByKeyUsingBlock`\n* `rejectKey` `dictionaryRejectedByKeyUsingBlock`\n* `filterObject` `dictionaryFilteredByObjectUsingBlock`\n* `rejectObject` `dictionaryRejectedByObjectUsingBlock`\n* `merge` `dictionaryByMergingDictionary`\n* `reduce:` `reducedObjectUsingBlock:memo:`\n* `queryString` `stringByFormattingQuery`\n\n\n#### NSDictionary+Path\n\n```objective-c\n/*\n@{\n    @\"error\" : @{\n        @\"message\" : @\"msg\"\n    }\n}\n*/\nNSString *s = [dic objectForPath:@\"error.message\"];\n```\n\n* `objectForPath:`\n\n### NSSet\n#### NSSet+Enumeration\n\n```objective-c\nNSSet *set = [NSSet setWithArray:@[@1,@2,@3,@4,@5,@6]];\nNSSet *mapped = [set mappedSetUsingBlock:^id(id obj, NSUInteger idx) {\n    if ([obj integerValue] % 2 == 0) {\n        return obj;\n    }\n    return nil;\n}];\n```\n\n* `each`\n* `map` `mappedSetUsingBlock`\n* `reduce` `reducedObjectByBlock`\n* `filter` `filteredSetUsingBlock`\n* `reject` `rejectedSetUsingBlock`\n\n### NSString \n\n#### NSString+Components\n\n```objective-c\n[@\"hoge=fuga\u0026piyo=foo\" componentsSeparatedByInnerString:@\"=\" andOuterString:@\"\u0026\"];\n/* \n@{\n    @\"hoge\" : @\"fuga\",\n    @\"piyo\" : @\"foo\"\n};\n*/\n```\n\n* `componentsSeparatedByInnerString:andOuterString:`\n\n#### NSString+RegularExpression\n\n```objective-c\n[@\"https?\" testInString:urlString];\n```\n* `rangeOfFirstMatchInString:`\n* `rangeOfFirstMatchInString:options:`\n* `matchesInString:`\n* `matchesInString:options:`\n* `testInString:`\n* `testInString:options:`\n* `replace:newString:` `stringByReplacingOccurrencesOfRegExpPattern:withString`\n* `replace:newString:options:` `stringByReplacingOccurrencesOfRegExpPattern:withString:options:`\n* `replace:template:` `stringByReplacingOccurrencesOfRegExpPattern:withTemplate:`\n* `replace:template:options:` `stringByReplacingOccurrencesOfRegExpPattern:withTemplate:options:`\n\n#### NSString+Hash\n\n```objective-c\n[@\"hoge\" md5]; // @\"ea703e7aa1efda0064eaa507d9e8ab7e\"\n```\n\n* `sha256`\n* `stringByHashingSha256`\n* `md5`\n* `stringByHashingMD5`\n\n#### NSString+URLEncode\n* `URLEncode`\n* `stringByEncodingURL`\n* `URLDecode`\n* `stringByDecodingURL`\n\n#### NSString+Shorthand\n* `trim`\n* `trim:` - Trim character set in a given string\n\n#### NSString+JSON\n```objective-c\nNSString *JSONString = @\"{\\\"hoge\\\" : \\\"fuga\\\" }\";\nid json = [JSONString jsonObject];\n```\n* `JSON` `jsonObject`\n\n#### NSString+Base64Encode\n```objective-c\n[@\"a\" stringByEncodingBase64]; // @\"YQ==\"\n[@\"YQ==\" stringByDecodingBase64]; // @\"a\"\n```\n\n* `encodeBase64` `stringByEncodingBase64`\n* `decodeBase64` `stringByDecodingBase64`\n* `dataUsingDecodingBase64`\n\n### NSData\n#### NSData+Base64Encode\n\n* `base64Encode` `stringUsingEncodingBase64`\n\n### NSURL\n\n#### NSURL+Components\n* `queryComponents`\n\n#### NSURL+Directories\n```objective-c\nNSURL *pdfURL = [NSURL URLForUserDirectoryWithAppendedPath:@\"myDoc.pdf\"];\nNSURL *userImageFolderURL = [NSURL URLForUserDirectoryWithAppendedPath:@\"images\"];\n```\n\n* `URLForDirectory:domainMask:`\n* `URLForApplicationSupportDataDirectory`\n* `URLForApplicationSupportWithAppendedPath:`\n* `URLForUserDirectory`\n* `URLForUserDirectoryWithAppendedPath:`\n* `URLForDocumentDirectory`;\n* `URLForDocumentDirectoryWithAppendedPath:`;\n\n### NSBundle\n\n#### NSBundle+Shorthand\n* `JSONForResourceName`\n\n### NSNumber \n\n#### NSNumber+Equals\n\n```objective-c\n[@1 isEqualToInteger:1];\n```\n\n* `isEqualToInt:`\n* `isEqualToInteger:`\n* `isEqualToUnsignedInt:`\n* `isEqualToUnsignedInteger:`\n* `isEqualToLong:`\n* `isEqualToLongLong:`\n* `isEqualToUnsignedLong:`\n* `isEqualToUnsignedLongLong:`\n* `isEqualToDouble:`\n* `isEqualToFloat:`\n\n### NSDateFormatter\n\n#### NSDateFormatter+Shothand\n\n* `userDefaultFormatter`\n* `dateFormatterWithCalendarIndetifiter:localeIdentifiter:timeZoneAbbreviation:`\n\n### NSObject\n\n#### NSObject+Equals\n```objective-c\n[[NSNull null] isNullObject]; // YES\n[[NSArray array] isNullObject]; // NO\n```\n* `isNullObject`\n* `isArray`\n* `isDictionary`\n* `isSet`\n* `isString`\n* `isNumber`\n\n### NSNull\n\n#### NSNull+Natural\nProvide `NSNull` like `nil`\n```objective-c\nNSDictionary *dic = @{\n        @\"null-key\" : [NSNull null]\n};\n[[dic objectForKey:@\"null-key\"] objectForKey:@\"empty\"]; // nil\n```\n\n※ This feature disable on default. Define `OV_USE_NATURAL_NULL`, if use this feature.\n```objective-c\n#define OV_USE_NATURAL_NULL\n#import \"Overline.h\"\n```\n\n## Credits\n\nBe sure to thank these contributors:\n\n* Kazuma Ukyo (Creator, http://yaakaito.org)\n* Hari Karam Singh (Contributor, http://soundwandapp.com)\n\n### Coding rules\n\n* Write tests.\n* Objective-C style naming.\n  * and shorthands.\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaakaito%2FOverline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaakaito%2FOverline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaakaito%2FOverline/lists"}