{"id":21374077,"url":"https://github.com/yangKJ/KJCategories","last_synced_at":"2025-07-13T08:32:26.002Z","repository":{"id":41391683,"uuid":"162827752","full_name":"yangKJ/KJCategories","owner":"yangKJ","description":"Collection of native ios extensions and classes to boost development process. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV, CoreGraphics, os and more. 超实用开发加速工具库","archived":false,"fork":false,"pushed_at":"2022-08-29T02:16:17.000Z","size":6135,"stargazers_count":492,"open_issues_count":1,"forks_count":77,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-15T01:47:08.901Z","etag":null,"topics":["animation","categories","coregraphics","extensions","opencv","projection","shine","tool"],"latest_commit_sha":null,"homepage":"https://juejin.cn/user/1987535102554472/posts","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/yangKJ.png","metadata":{"files":{"readme":"README.md","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":"2018-12-22T16:50:18.000Z","updated_at":"2024-11-08T15:40:38.000Z","dependencies_parsed_at":"2022-08-10T02:07:14.677Z","dependency_job_id":null,"html_url":"https://github.com/yangKJ/KJCategories","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangKJ%2FKJCategories","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangKJ%2FKJCategories/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangKJ%2FKJCategories/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangKJ%2FKJCategories/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yangKJ","download_url":"https://codeload.github.com/yangKJ/KJCategories/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225868622,"owners_count":17537088,"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":["animation","categories","coregraphics","extensions","opencv","projection","shine","tool"],"created_at":"2024-11-22T08:29:40.555Z","updated_at":"2024-11-22T08:30:12.566Z","avatar_url":"https://github.com/yangKJ.png","language":"Objective-C","funding_links":[],"categories":["OOM-Leaks-Crash"],"sub_categories":["Categories-Extensions"],"readme":"# KJCategories\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg?style=flat\u0026colorA=28a745\u0026\u0026colorB=4E4E4E)](https://github.com/yangKJ/KJCategories)\n[![Releases Compatible](https://img.shields.io/github/release/yangKJ/KJCategories.svg?style=flat\u0026label=Releases\u0026colorA=28a745\u0026\u0026colorB=4E4E4E)](https://github.com/yangKJ/KJCategories/releases)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/KJCategories.svg?style=flat\u0026label=CocoaPods\u0026colorA=28a745\u0026\u0026colorB=4E4E4E)](https://cocoapods.org/pods/KJCategories)\n[![Platform](https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS%20%7C%20watchOS-4E4E4E.svg?colorA=28a745)](#installation)\n\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"Screenshots/AT.jpeg\" width=\"800\" hspace=\"1px\"\u003e\n\u003c/p\u003e\n\n\u003cfont color=red size=3\u003eSet of **Extensions** and **Custom control** for standard types and classes.\u003c/font\u003e  \n\u003cfont color=red\u003eJust like Doraemon’s pocket, has an endless variety of props for us to use.\u003c/font\u003e\n\nEnglish | [简体中文](https://github.com/yangKJ/KJCategories/blob/master/README_CN.md)\n\n---\n\n- [x] OpenCV: Hough correction, feature extraction, image processing package, morphological processing, filter processing, photo restoration, etc.\n- [x] NSArray: Related processing of the elements in the array, etc.\n- [x] NSDate: Time transformation, etc.\n- [x] UIButton: Emitter animation, image and text mixing, click event encapsulation, expanded click field, time interval limit, countdown, click particle effect, etc.\n- [x] UIView: Gesture package, rounded corner gradient, Xib attribute, basic animation package, etc.\n- [x] UITextView: Expand the input box, limit the number of words, cancel processing, get the internal hyperlink of the text, etc.\n- [x] UITextField: Placeholder color, line, graphic processing, etc.\n- [x] UILabel: Rich text, fast display text position, etc.\n- [x] UIImage: Screenshot and cropping, image compression, mask processing, image stitching, image size processing, filter rendering, flooding algorithm, etc.\n- [x] UIImage: QR code, barcode generation, dynamic image playback, watermark processing, etc.\n- [x] NSObject: GCD, asynchronous timer, resident thread, thread keep alive, runtime methods, etc.\n- [x] NSString: Hash crypto, mathematical operators, unit conversion, etc.\n- [x] Other: Gradient slider, Open screen particle animation, projection and shadow, etc.\n\n##### Encapsulation exception Handling [FoggyDemo](https://github.com/yangKJ/Foggy)\n\n### \u003ca id=\"Contents\"\u003e\u003c/a\u003e Contents ###\n- **[OpenCV](#OpenCV)**\n- **[NSArray](#NSArray)**\n- **[NSDate](#NSDate)**\n- **[NSDictionary](#NSDictionary)**\n- **[NSObject](#NSObject)**\n- **[NSString](#NSString)**\n- **[UIButton](#UIButton)**\n- **[UIColor](#UIColor)**\n- **[UIDevice](#UIDevice)**\n- **[UIImage](#UIImage)**\n- **[UILabel](#UILabel)**\n- **[UISlider](#UISlider)**\n- **[UITextField](#UITextField)**\n- **[UITextView](#UITextView)**\n- **[UIView](#UIView)**\n- **[UIViewController](#UIViewController)**\n- **[CustomizedControl](#CustomizedControl)**\n\n### Methods and Functions\n#### \u003ca id=\"OpenCV\"\u003e\u003c/a\u003eOpenCV ####\n- Opencv picture processing.\n\n| Description | Signatures | \n| ---- | ---- |\n| Picture Tile | kj_opencvTiledRows:cols: |\n| Four-point perspective image based on perspective | kj_opencvWarpPerspectiveWithKnownPoints:size: |\n| Eliminate image highlights | kj_opencvIlluminationChangeBeta:alpha: |\n| Picture Blending | kj_opencvBlendImage:alpha: |\n| Adjust picture brightness and contrast | kj_opencvChangeContrast:luminance: |\n| Modify the color of the picture channel value | kj_opencvChangeR:g:b: |\n| Blur processing | kj_opencvBlurX:y: |\n| Gaussian Blur | kj_opencvGaussianBlurX:y: |\n| Median Blur | kj_opencvMedianBlurksize: |\n| Gaussian Bilateral Blur | kj_opencvBilateralFilterBlurRadio:sigma: |\n| Custom linear blur | kj_opencvCustomBlurksize: |\n| Morphology operations | kj_opencvMorphology:element: |\n| Remove watermark | kj_opencvInpaintImage: |\n| Picture repair, effect enhancement processing | kj_opencvRepairImage |\n| Cut out the largest inner rectangular area | kj_opencvCutMaxRegionImage |\n| Feature extraction | kj_opencvFeatureExtractionFromSobel |\n| Hough line judgment and correction | kj_opencvHoughLinesCorrectTextImageFillColor: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"NSArray\"\u003e\u003c/a\u003eNSArray ####\n- Related processing of the elements in the array.\n\n| Description | Signatures | \n| ---- | ---- | \n| Is it empty| isEmpty | \n| Filter data | kj_detectArray: | \n| Multidimensional array data | kj_detectManyDimensionArray: | \n| Search data | kj_searchObject: | \n| Map | kj_mapArray: | \n| Insert data to the destination | kj_insertObject: | \n| Array calculation intersection | kj_arrayIntersectionWithOtherArray: | \n| Array calculation difference| kj_arrayMinusWithOtherArray: | \n| Randomly Disorganize Array | kj_disorganizeArray | \n| Delete the same element in the array| kj_delArrayEquelObj | \n| Binary Search| kj_binarySearchTarget: | \n| Bubble Sort| kj_bubbleSort | \n| Insert Sort | kj_insertSort | \n| Selection Sort| kj_selectionSort | \n\n[back to top](#readme)  \n\n#### \u003ca id=\"NSDate\"\u003e\u003c/a\u003eNSDate ####\n- Time transformation.\n\n| Description | Signatures | \n| ---- | ---- | \n| Convert date to local time | kj_localeDate |\n| Time string conversion NSDate | kj_dateFromString: |\n| Time string to NSDate | kj_dateFromString:format: |\n| Get the current timestamp | kj_currentTimetampWithMsec: |\n| Timestamp to time | kj_timeWithTimestamp:format: |\n| Get the UTC timestamp of the specified time | kj_timeStampUTCWithTimeString: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"NSDictionary\"\u003e\u003c/a\u003eNSDictionary ####\n- Dictionary common methods.\n\n| Description | Signatures |\n| ---- | ---- |\n| Is it empty | isEmpty |\n| Convert to Josn String | jsonString |\n| Whether to include a key | kj_containsKey: |\n| Dictionary keys in ascending order | kj_keysSorted |\n| Dictionary key Description descending order | kj_keySortDescending |\n| Quickly traverse the dictionary | kj_applyDictionaryValue: |\n| Mapping | kj_mapDictionary: |\n| Merge | kj_mergeDictionary: |\n| Selector | kj_pickForKeys: |\n| Remover | kj_omitForKeys: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UIView\"\u003e\u003c/a\u003eUIView ####\n- Advanced Edition Rounded Corners and Border Extension.\n\n| Description | Signatures |\n| ---- | ---- |\n| Bezier Fillet | bezierRadius |\n| Shadow Offset | shadowOffset |\n| Shadow Opacity | shadowOpacity |\n| Shadow Width | shadowWidth |\n| Shadow rounded corners | shadowRadius |\n| Shadow Color | shadowColor |\n| Corner Radius | cornerRadius |\n| Border Width | borderWidth |\n| Border Color | borderColor |\n| Image properties | viewImage |\n| Top Controller | topViewController |\n| Current Controller | viewController |\n| Current Controller | kj_currentViewController |\n| View created by Xib | kj_viewFromXib |\n| View created by Xib | kj_viewFromXibWithFrame: |\n| Fillet radius | kj_radius |\n| Rounded corner orientation | kj_rectCorner |\n| Border Color | kj_borderColor |\n| Border width | kj_borderWidth |\n| Border Orientation | kj_borderOrientation |\n| Size | size |\n| Location | origin |\n| x coordinate | x |\n| y coordinate | y |\n| Width | width |\n| Height | height |\n| Center point x | centerX |\n| Center point y | centerY |\n| Left distance | left |\n| Right distance | right |\n| Top distance | top |\n| Bottom distance | bottom |\n| x + width | maxX |\n| y + height | Property |maxY |\n| After Masonry layout x | masonry_x |\n| After Masonry layout y | masonry_y |\n| Masonry width after layout | masonry_width |\n| Masonry height after layout | masonry_height |\n| Center the view in its parent view | kj_centerToSuperview |\n| Distance from the right of the parent view | kj_rightToSuperview: |\n| Distance from the bottom of the parent view | kj_bottomToSuperview: |\n| Get the highest Y of the subview | kj_subviewMaxY |\n| Get the highest X of the subview | kj_subviewMaxX |\n| Find Subview | kj_FindSubviewRecursively: |\n| Remove all subviews | kj_removeAllSubviews |\n| Hide/Show all subviews | kj_hideSubviews:operation: |\n| Child controls handle gesture events | kj_childHitTest:withEvent: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UITextView\"\u003e\u003c/a\u003eUITextView ####\n- UITextView undo processing, equivalent to command + z, limit processing.\n\n| Description | Signatures |\n| ---- | ---- |\n| Whether to enable the undo function | kOpenBackout |\n| Cancel input | kj_textViewBackout |\n| Placeholder text | placeHolder |\n| Placeholder Label | placeHolderLabel |\n| Limit word count | limitCount |\n| Right margin of restricted area | limitMargin |\n| Restricted area height | limitHeight |\n| Statistics limit the number of words Label | limitLabel |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UITextField\"\u003e\u003c/a\u003eUITextField ####\n- UITextField input box extension, placeholder, quick setting account password box.\n\n| Description | Signatures |\n| ---- | ---- |\n| Set the bottom border line color | bottomLineColor |\n| Placeholder Color | placeholderColor |\n| PlaceholderFontSize | placeholderFontSize |\n| Maximum Length | maxLength |\n| Clear text to dark text switch | securePasswords |\n| Maximum character length reached | kMaxLengthBolck |\n| Text editing moment callback | kTextEditingChangedBolck |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UILabel\"\u003e\u003c/a\u003eUILabel ####\n- UILabel add long press copy function, Get text position and size.\n\n| Description | Signatures |\n| ---- | ---- |\n| Can copy | copyable |\n| Remove copy long press gesture | kj_removeCopyLongPressGestureRecognizer |\n| Set the display position of the text content | customTextAlignment |\n| Get width | kj_calculateWidth |\n| Get height | kj_calculateHeightWithWidth: |\n| Get height, specify line height | kj_calculateHeightWithWidth:OneLineHeight: |\n| The text line spacing between Ranges | kj_AttributedStringTextLineSpace: |\n| Text size between ranges | kj_AttributedStringTextFont:Range: |\n| Text color between Ranges | kj_AttributedStringTextColor:Range: |\n| Text size and color between Ranges | kj_AttributedStringTextFont:TextColor:Range: |\n| Text related attributes between Ranges | kj_AttributedStringTextAttributes:Range: |\n| Rich text text size | kj_AttributedStringTextFont:Loc:Len: |\n| Rich text text color | kj_AttributedStringTextColor:Loc:Len: |\n| Rich text text size and color | kj_AttributedStringTextFont:TextColor:Loc:Len: |\n| Rich text related attributes | kj_AttributedStringTextAttributes:Loc:Len: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UIImage\"\u003e\u003c/a\u003eUIImage ####\n- QR code and barcode generator, image size, screenshot and crop processing, Picture cropper.\n\n| Description | Signatures |\n| ---- | ---- |\n| Convert a string to a barcode | kj_barCodeImageWithContent: |\n| Generate QR Code | kj_QRCodeImageWithContent:codeImageSize: |\n| Generate QR Code with Specified Color | kj_QRCodeImageWithContent:codeImageSize:color: |\n| Generate barcode | kj_barcodeImageWithContent:codeImageSize: |\n| Generate barcode with specified color | kj_barcodeImageWithContent:codeImageSize:color: |\n| Change the image size, bitmap mode | kj_bitmapChangeImageSize: |\n| Change the internal pixel color of the image | kj_changeImagePixelColor: |\n| Get network image size | kj_imageSizeWithURL: |\n| Scale the image by scale | kj_scaleImage: |\n| Scale the image with a fixed width | kj_scaleWithFixedWidth: |\n| Scale the image with a fixed height | kj_scaleWithFixedHeight: |\n| Change the image size proportionally | kj_cropImageWithAnySize: |\n| Reduce the image size proportionally | kj_zoomImageWithMaxSize: |\n| Do not pull up the filling image | kj_fitImageWithSize: |\n| Screenshot of the current view | kj_captureScreen: |\n| Specified location screen capture | kj_captureScreen:Rect: |\n| Customized quality screenshots, quality multiples | kj_captureScreen:Rect:Quality: |\n| Capture the current screen | kj_captureScreenWindow |\n| Capture the long image of the scroll view | kj_captureScreenWithScrollView:ContentOffset: |\n| Cut out the transparent part around the picture | kj_cutImageRoundAlphaZero: |\n| Irregular graphics cutting | kj_anomalyCaptureImageWithView:BezierPath: |\n| Polygon Cut Image | kj_polygonCaptureImageWithImageView:PointArray: |\n| Specified area crop | kj_cutImageWithImage:Frame: |\n| quartz 2d to achieve cropping | kj_quartzCutImageWithImage:Frame: |\n| Image path clipping, clipping path \"outside\" part | kj_captureOuterImage:BezierPath:Rect: |\n| Image path clipping, clipping path \"within\" part | kj_captureInnerImage:BezierPath:Rect: |\n| Picture Rotation | kj_rotateInRadians: |\n| Specified color linear blur | kj_blurImageWithTintColor: |\n| Linear blur, keep transparent area | kj_linearBlurryImageBlur: |\n| Blur processing | kj_blurImageWithRadius:Color:MaskImage: |\n| Equalization calculation | kj_equalizationImage |\n| Erosion | kj_erodeImage |\n| Form expansion| kj_dilateImage |\n| Multiple erosion | kj_erodeImageWithIterations: |\n| Multiple expansion of form | kj_dilateImageWithIterations: |\n| Gradient | kj_gradientImageWithIterations: |\n| Top Hat Computing | kj_tophatImageWithIterations: |\n| Black Hat Computing | kj_blackhatImageWithIterations: |\n| Convolution processing | kj_convolutionImageWithKernel: |\n| Sharpen | kj_sharpenImage |\n| Relief | kj_embossImage |\n| Gauss | kj_gaussianImage |\n| Edge Detection | kj_marginImage |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UIDevice\"\u003e\u003c/a\u003eUIDevice ####\n- UIDevice system related operations.\n\n| Description | Signatures |\n| ---- | ---- |\n| App version number | appCurrentVersion |\n| App Description | appName |\n| Mobile UUID | deviceID |\n| Get App Icon | appIcon |\n| Get launch page image | launchImage |\n| System startup map cache path | launchImageCachePath |\n| Launch Image Backup File Path | launchImageBackupPath |\n| Generate launch image | kj_launchImageWithPortrait:Dark: |\n| Generate launch diagram | kj_launchImageWithStoryboard:Portrait:Dark: |\n| Comparison version number | kj_comparisonVersion: |\n| Jump to the specified URL | kj_openURL: |\n| Call AppStore | kj_skipToAppStoreWithAppid: |\n| Call the built-in browser safari | kj_skipToSafari |\n| Call the built-in Mail | kj_skipToMail |\n| Whether to switch to speaker | kj_changeLoudspeaker: |\n| Save to Album | kj_savedPhotosAlbumWithImage:Complete: |\n| System comes with sharing | kj_shareActivityWithItems:ViewController:Complete: |\n| Switch Root View Controller | kj_changeRootViewController:Complete: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UIColor\"\u003e\u003c/a\u003eUIColor ####\n- UIColor related extension.\n\n| Description | Signatures |\n| ---- | ---- |\n| UIColor to hexadecimal string | kj_hexString |\n| Hexadecimal string to UIColor | kj_colorWithHexString: |\n| red | red |\n| green | green |\n| blue | blue |\n| alpha | alpha |\n| Hue | hue |\n| Saturation | saturation |\n| Brightness | light |\n| Get the RGBA corresponding to the color | kj_colorGetRGBA |\n| Get the average value of colors | kj_averageColors: |\n| Vertical gradient color | kj_gradientVerticalToColor:height: |\n| Horizontal gradient color | kj_gradientAcrossToColor:width: |\n| Get the color of a specified point on the image | kj_colorAtImage:Point: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UIButton\"\u003e\u003c/a\u003eUIButton ####\n- UIButton click event block, mixed graphics and text, enlarge click.\n\n| Description | Signatures |\n| ---- | ---- |\n| Add click event | kj_addAction: |\n| Click Event Interval | timeInterval |\n| Expand the unified click field | enlargeClick |\n| Graphic style | layoutType |\n| Picture and text spacing | padding |\n| The spacing of the graphic borders | periphery |\n| Picture and text spacing | kj_contentLayout:padding: |\n| Picture and text spacing | kj_contentLayout:padding:periphery: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UISlider\"\u003e\u003c/a\u003eUISlider ####\n- Rainbow gradient color slider.\n\n| Description | Signatures |\n| ---- | ---- |\n| Color array | colors |\n| Location information corresponding to each color | locations |\n| Color height | colorHeight |\n| Border Width | borderWidth |\n| Border Color | borderColor |\n| Callback processing time | timeSpan |\n| Current progress, for external kvo | progress |\n| Moving block | movingWithTimeSpan:withBlock: |\n| Moved block | moveEndBlock: |\n| Reset UI | updateUI |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"UIViewController\"\u003e\u003c/a\u003e UIViewController ####\n- Switch view controller.\n\n| Description | Signatures |\n| ---- | ---- |\n| Jump back to the specified controller | kj_popTargetViewController:complete: |\n| Switch Root View Controller | kj_changeRootViewController: |\n\n[back to top](#readme)  \n\n#### \u003ca id=\"CustomizedControl\"\u003e\u003c/a\u003e CustomizedControl ####\n- Primarily encapsulates custom controls.\n\n| Description | Class |\n| ---- | ---- |\n| Particle animation effect | [KJEmitterAnimation](https://github.com/yangKJ/KJCategories/blob/master/KJCategories/Moudles/Customized/EmitterAnimation/EmitterAnimationViewController.swift) |\n| Rainbow gradient slider | [KJGradientSlider](https://github.com/yangKJ/KJCategories/blob/master/KJCategories/Moudles/Customized/Slider/GradientSliderViewController.swift) |\n| Drop shadow layer control | [KJProjectionView](https://github.com/yangKJ/KJCategories/blob/master/KJCategories/Moudles/Customized/Projection/ProjectionViewController.swift) |\n| Inner and outer shadow control | [KJShadowView](https://github.com/yangKJ/KJCategories/blob/master/KJCategories/Moudles/Customized/Shadow/ShadowViewController.swift) |\n\n[back to top](#readme) \n\n### CocoaPods Install\n\n```\nExample import core module:\n- pod 'KJCategories'\n\nExample import UIBezierPath:\n- pod 'KJCategories/KitExtension/UIBezierPath'\n\nExample import NSArray:\n- pod 'KJCategories/Foundation/NSArray'\n\nExample import GradientSlider:\n- pod 'KJCategories/Customized/GradientSlider'\n```\n\n----\n\n### About Opencv module\nAs for Opencv module, I have taken it out separately. Friends who need it can directly introduce [OpencvQueen](https://github.com/yangKJ/MetalQueen) library.\n\n```\npod 'OpencvQueen'\n```\n\n## License\n\nKJCategories is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FyangKJ%2FKJCategories","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FyangKJ%2FKJCategories","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FyangKJ%2FKJCategories/lists"}