• Stars
    star
    474
  • Rank 92,007 (Top 2 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Collection of native ios extensions and classes to boost development process. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV, CoreGraphics, os and more. 超实用开发加速工具库

KJCategories

Carthage compatible Releases Compatible CocoaPods Compatible Platform

Set of Extensions and Custom control for standard types and classes.
Just like Doraemon’s pocket, has an endless variety of props for us to use.

English | 简体中文


  • OpenCV: Hough correction, feature extraction, image processing package, morphological processing, filter processing, photo restoration, etc.
  • NSArray: Related processing of the elements in the array, etc.
  • NSDate: Time transformation, etc.
  • UIButton: Emitter animation, image and text mixing, click event encapsulation, expanded click field, time interval limit, countdown, click particle effect, etc.
  • UIView: Gesture package, rounded corner gradient, Xib attribute, basic animation package, etc.
  • UITextView: Expand the input box, limit the number of words, cancel processing, get the internal hyperlink of the text, etc.
  • UITextField: Placeholder color, line, graphic processing, etc.
  • UILabel: Rich text, fast display text position, etc.
  • UIImage: Screenshot and cropping, image compression, mask processing, image stitching, image size processing, filter rendering, flooding algorithm, etc.
  • UIImage: QR code, barcode generation, dynamic image playback, watermark processing, etc.
  • NSObject: GCD, asynchronous timer, resident thread, thread keep alive, runtime methods, etc.
  • NSString: Hash crypto, mathematical operators, unit conversion, etc.
  • Other: Gradient slider, Open screen particle animation, projection and shadow, etc.
Encapsulation exception Handling FoggyDemo

Contents

Methods and Functions

OpenCV

  • Opencv picture processing.
Description Signatures
Picture Tile kj_opencvTiledRows:cols:
Four-point perspective image based on perspective kj_opencvWarpPerspectiveWithKnownPoints:size:
Eliminate image highlights kj_opencvIlluminationChangeBeta:alpha:
Picture Blending kj_opencvBlendImage:alpha:
Adjust picture brightness and contrast kj_opencvChangeContrast:luminance:
Modify the color of the picture channel value kj_opencvChangeR:g🅱️
Blur processing kj_opencvBlurX:y:
Gaussian Blur kj_opencvGaussianBlurX:y:
Median Blur kj_opencvMedianBlurksize:
Gaussian Bilateral Blur kj_opencvBilateralFilterBlurRadio:sigma:
Custom linear blur kj_opencvCustomBlurksize:
Morphology operations kj_opencvMorphology:element:
Remove watermark kj_opencvInpaintImage:
Picture repair, effect enhancement processing kj_opencvRepairImage
Cut out the largest inner rectangular area kj_opencvCutMaxRegionImage
Feature extraction kj_opencvFeatureExtractionFromSobel
Hough line judgment and correction kj_opencvHoughLinesCorrectTextImageFillColor:

back to top

NSArray

  • Related processing of the elements in the array.
Description Signatures
Is it empty isEmpty
Filter data kj_detectArray:
Multidimensional array data kj_detectManyDimensionArray:
Search data kj_searchObject:
Map kj_mapArray:
Insert data to the destination kj_insertObject:
Array calculation intersection kj_arrayIntersectionWithOtherArray:
Array calculation difference kj_arrayMinusWithOtherArray:
Randomly Disorganize Array kj_disorganizeArray
Delete the same element in the array kj_delArrayEquelObj
Binary Search kj_binarySearchTarget:
Bubble Sort kj_bubbleSort
Insert Sort kj_insertSort
Selection Sort kj_selectionSort

back to top

NSDate

  • Time transformation.
Description Signatures
Convert date to local time kj_localeDate
Time string conversion NSDate kj_dateFromString:
Time string to NSDate kj_dateFromString:format:
Get the current timestamp kj_currentTimetampWithMsec:
Timestamp to time kj_timeWithTimestamp:format:
Get the UTC timestamp of the specified time kj_timeStampUTCWithTimeString:

back to top

NSDictionary

  • Dictionary common methods.
Description Signatures
Is it empty isEmpty
Convert to Josn String jsonString
Whether to include a key kj_containsKey:
Dictionary keys in ascending order kj_keysSorted
Dictionary key Description descending order kj_keySortDescending
Quickly traverse the dictionary kj_applyDictionaryValue:
Mapping kj_mapDictionary:
Merge kj_mergeDictionary:
Selector kj_pickForKeys:
Remover kj_omitForKeys:

back to top

UIView

  • Advanced Edition Rounded Corners and Border Extension.
Description Signatures
Bezier Fillet bezierRadius
Shadow Offset shadowOffset
Shadow Opacity shadowOpacity
Shadow Width shadowWidth
Shadow rounded corners shadowRadius
Shadow Color shadowColor
Corner Radius cornerRadius
Border Width borderWidth
Border Color borderColor
Image properties viewImage
Top Controller topViewController
Current Controller viewController
Current Controller kj_currentViewController
View created by Xib kj_viewFromXib
View created by Xib kj_viewFromXibWithFrame:
Fillet radius kj_radius
Rounded corner orientation kj_rectCorner
Border Color kj_borderColor
Border width kj_borderWidth
Border Orientation kj_borderOrientation
Size size
Location origin
x coordinate x
y coordinate y
Width width
Height height
Center point x centerX
Center point y centerY
Left distance left
Right distance right
Top distance top
Bottom distance bottom
x + width maxX
y + height Property
After Masonry layout x masonry_x
After Masonry layout y masonry_y
Masonry width after layout masonry_width
Masonry height after layout masonry_height
Center the view in its parent view kj_centerToSuperview
Distance from the right of the parent view kj_rightToSuperview:
Distance from the bottom of the parent view kj_bottomToSuperview:
Get the highest Y of the subview kj_subviewMaxY
Get the highest X of the subview kj_subviewMaxX
Find Subview kj_FindSubviewRecursively:
Remove all subviews kj_removeAllSubviews
Hide/Show all subviews kj_hideSubviews:operation:
Child controls handle gesture events kj_childHitTest:withEvent:

back to top

UITextView

  • UITextView undo processing, equivalent to command + z, limit processing.
Description Signatures
Whether to enable the undo function kOpenBackout
Cancel input kj_textViewBackout
Placeholder text placeHolder
Placeholder Label placeHolderLabel
Limit word count limitCount
Right margin of restricted area limitMargin
Restricted area height limitHeight
Statistics limit the number of words Label limitLabel

back to top

UITextField

  • UITextField input box extension, placeholder, quick setting account password box.
Description Signatures
Set the bottom border line color bottomLineColor
Placeholder Color placeholderColor
PlaceholderFontSize placeholderFontSize
Maximum Length maxLength
Clear text to dark text switch securePasswords
Maximum character length reached kMaxLengthBolck
Text editing moment callback kTextEditingChangedBolck

back to top

UILabel

  • UILabel add long press copy function, Get text position and size.
Description Signatures
Can copy copyable
Remove copy long press gesture kj_removeCopyLongPressGestureRecognizer
Set the display position of the text content customTextAlignment
Get width kj_calculateWidth
Get height kj_calculateHeightWithWidth:
Get height, specify line height kj_calculateHeightWithWidth:OneLineHeight:
The text line spacing between Ranges kj_AttributedStringTextLineSpace:
Text size between ranges kj_AttributedStringTextFont:Range:
Text color between Ranges kj_AttributedStringTextColor:Range:
Text size and color between Ranges kj_AttributedStringTextFont:TextColor:Range:
Text related attributes between Ranges kj_AttributedStringTextAttributes:Range:
Rich text text size kj_AttributedStringTextFont:Loc:Len:
Rich text text color kj_AttributedStringTextColor:Loc:Len:
Rich text text size and color kj_AttributedStringTextFont:TextColor:Loc:Len:
Rich text related attributes kj_AttributedStringTextAttributes:Loc:Len:

back to top

UIImage

  • QR code and barcode generator, image size, screenshot and crop processing, Picture cropper.
Description Signatures
Convert a string to a barcode kj_barCodeImageWithContent:
Generate QR Code kj_QRCodeImageWithContent:codeImageSize:
Generate QR Code with Specified Color kj_QRCodeImageWithContent:codeImageSize:color:
Generate barcode kj_barcodeImageWithContent:codeImageSize:
Generate barcode with specified color kj_barcodeImageWithContent:codeImageSize:color:
Change the image size, bitmap mode kj_bitmapChangeImageSize:
Change the internal pixel color of the image kj_changeImagePixelColor:
Get network image size kj_imageSizeWithURL:
Scale the image by scale kj_scaleImage:
Scale the image with a fixed width kj_scaleWithFixedWidth:
Scale the image with a fixed height kj_scaleWithFixedHeight:
Change the image size proportionally kj_cropImageWithAnySize:
Reduce the image size proportionally kj_zoomImageWithMaxSize:
Do not pull up the filling image kj_fitImageWithSize:
Screenshot of the current view kj_captureScreen:
Specified location screen capture kj_captureScreen:Rect:
Customized quality screenshots, quality multiples kj_captureScreen:Rect:Quality:
Capture the current screen kj_captureScreenWindow
Capture the long image of the scroll view kj_captureScreenWithScrollView:ContentOffset:
Cut out the transparent part around the picture kj_cutImageRoundAlphaZero:
Irregular graphics cutting kj_anomalyCaptureImageWithView:BezierPath:
Polygon Cut Image kj_polygonCaptureImageWithImageView:PointArray:
Specified area crop kj_cutImageWithImage:Frame:
quartz 2d to achieve cropping kj_quartzCutImageWithImage:Frame:
Image path clipping, clipping path "outside" part kj_captureOuterImage:BezierPath:Rect:
Image path clipping, clipping path "within" part kj_captureInnerImage:BezierPath:Rect:
Picture Rotation kj_rotateInRadians:
Specified color linear blur kj_blurImageWithTintColor:
Linear blur, keep transparent area kj_linearBlurryImageBlur:
Blur processing kj_blurImageWithRadius:Color:MaskImage:
Equalization calculation kj_equalizationImage
Erosion kj_erodeImage
Form expansion kj_dilateImage
Multiple erosion kj_erodeImageWithIterations:
Multiple expansion of form kj_dilateImageWithIterations:
Gradient kj_gradientImageWithIterations:
Top Hat Computing kj_tophatImageWithIterations:
Black Hat Computing kj_blackhatImageWithIterations:
Convolution processing kj_convolutionImageWithKernel:
Sharpen kj_sharpenImage
Relief kj_embossImage
Gauss kj_gaussianImage
Edge Detection kj_marginImage

back to top

UIDevice

  • UIDevice system related operations.
Description Signatures
App version number appCurrentVersion
App Description appName
Mobile UUID deviceID
Get App Icon appIcon
Get launch page image launchImage
System startup map cache path launchImageCachePath
Launch Image Backup File Path launchImageBackupPath
Generate launch image kj_launchImageWithPortrait:Dark:
Generate launch diagram kj_launchImageWithStoryboard:Portrait:Dark:
Comparison version number kj_comparisonVersion:
Jump to the specified URL kj_openURL:
Call AppStore kj_skipToAppStoreWithAppid:
Call the built-in browser safari kj_skipToSafari
Call the built-in Mail kj_skipToMail
Whether to switch to speaker kj_changeLoudspeaker:
Save to Album kj_savedPhotosAlbumWithImage:Complete:
System comes with sharing kj_shareActivityWithItems:ViewController:Complete:
Switch Root View Controller kj_changeRootViewController:Complete:

back to top

UIColor

  • UIColor related extension.
Description Signatures
UIColor to hexadecimal string kj_hexString
Hexadecimal string to UIColor kj_colorWithHexString:
red red
green green
blue blue
alpha alpha
Hue hue
Saturation saturation
Brightness light
Get the RGBA corresponding to the color kj_colorGetRGBA
Get the average value of colors kj_averageColors:
Vertical gradient color kj_gradientVerticalToColor:height:
Horizontal gradient color kj_gradientAcrossToColor:width:
Get the color of a specified point on the image kj_colorAtImage:Point:

back to top

UIButton

  • UIButton click event block, mixed graphics and text, enlarge click.
Description Signatures
Add click event kj_addAction:
Click Event Interval timeInterval
Expand the unified click field enlargeClick
Graphic style layoutType
Picture and text spacing padding
The spacing of the graphic borders periphery
Picture and text spacing kj_contentLayout:padding:
Picture and text spacing kj_contentLayout:padding:periphery:

back to top

UISlider

  • Rainbow gradient color slider.
Description Signatures
Color array colors
Location information corresponding to each color locations
Color height colorHeight
Border Width borderWidth
Border Color borderColor
Callback processing time timeSpan
Current progress, for external kvo progress
Moving block movingWithTimeSpan:withBlock:
Moved block moveEndBlock:
Reset UI updateUI

back to top

UIViewController

  • Switch view controller.
Description Signatures
Jump back to the specified controller kj_popTargetViewController:complete:
Switch Root View Controller kj_changeRootViewController:

back to top

CustomizedControl

  • Primarily encapsulates custom controls.
Description Class
Particle animation effect KJEmitterAnimation
Rainbow gradient slider KJGradientSlider
Drop shadow layer control KJProjectionView
Inner and outer shadow control KJShadowView

back to top

CocoaPods Install

Example import core module:
- pod 'KJCategories'

Example import UIBezierPath:
- pod 'KJCategories/KitExtension/UIBezierPath'

Example import NSArray:
- pod 'KJCategories/Foundation/NSArray'

Example import GradientSlider:
- pod 'KJCategories/Customized/GradientSlider'

About Opencv module

As for Opencv module, I have taken it out separately. Friends who need it can directly introduce OpencvQueen library.

pod 'OpencvQueen'

License

KJCategories is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

Harbeth

🎨 GPU accelerated image / video and camera filter library based on Metal. Support macOS & iOS. 图像、视频、相机滤镜框架
Metal
416
star
2

RxNetworks

🧚 MVP Network Api library. 插件版网络基础架构,支持响应式。
Swift
221
star
3

KJPlayerDemo

Audio and video player, breakpoint resuming playback, record played time, free watching limit, etc. 🎷多内核多功能播放器
Objective-C
188
star
4

Rickenbacker

🎉 RxSwift extensions and MVVM component project architecture.
Swift
108
star
5

KJNetworkPlugin

🎡A lightweight but powerful Network library. Network Plugin, Support batch and chain operation. 插件机制、上传、下载、批量、链式网络架构
Objective-C
65
star
6

Foggy

Automatic crash protection.自动防护异常崩溃 🌇
Objective-C
45
star
7

Opencv-ios

OpenCV image at iOS system. 🎨
Objective-C++
37
star
8

KJBannerViewDemo

轮播图无限自动循环滚动、缩放布局、缓存预加载读取、支持自定义继承,网络GIF和网图混合轮播,支持Storyboard和Xib中创建并配置属性,多种分页控件选择,自动清理缓存等等
Objective-C
27
star
9

ImageX

👓 GIFs and images displayed. 动态图像滤镜播放图像框架。
Swift
26
star
10

Kakapos

🌀 High-performance and flexible video edit and export framework.
Shell
23
star
11

PT

Automatically generate componentized modules 自动生成组件化模块
Ruby
20
star
12

StudyDatas

整理平时的学习资料源码大礼包 🥁..
Objective-C++
20
star
13

Moonlit

播放器,支持边下边播边缓存的播放器方案,支持免费试看、跳过片头片尾、记忆观看记录、画中画播放等等
Swift
12
star
14

KJEmitterView

OC开发分类加速库,你想要的这都有!!!!
Objective-C
11
star
15

CacheX

📦 Mixed cached storage warehouse with disk and memory. Support OC and Swift.
Swift
8
star
16

Color

🎨. Pixel color extension with Swift and SwiftUI.
Swift
8
star
17

iDay

🫥 Metal Daily Share And Shell Script. 每日分享
Shell
8
star
18

gcd

Objective-C
7
star
19

WebDiscernDemo

长按识别网页图片工具
Objective-C
6
star
20

MajiaDemos

MajiaDemos.
Objective-C
5
star
21

PunchCardDemo

打卡管理器
Swift
5
star
22

MPlanet

♻️MVVM + RxSwift 搭建组件化宿主项目架构
4
star
23

blockchain

区块链钱包相关,支持生成助记词、私钥、公钥、地址等🧸
C
4
star
24

KJXIBAdaptiveDemo

xib适配工具
Objective-C
3
star
25

RxPagerView

FSPagerView appending RxSwift extension.
Swift
3
star
26

KJScanDemo

一款项目提炼出来的扫描二维码工具
Objective-C
2
star
27

RxSkeletonView

RxSkeletonView
Swift
2
star
28

KJNetWorkingDemo

一款基于AFNetWorking和YYCache二次封装网络请求工具 其中包含加密和解密 按App版本缓存数据等等
Objective-C
2
star
29

Boxes

Collect macos extensions.
Swift
2
star
30

KJWorkboxDemo

本地消息推送工具、APNs推送工具 自带缓存机制网络图片下载工具 快速识别网页当中的图片 跳转处理工具 加密解密工具 谓词工具等等
Objective-C
1
star
31

Heyuan

12-26 10:09 最新和源版本
Objective-C
1
star
32

KJPredicateDemo

利用谓词写的一套工具
Objective-C
1
star
33

KJJumpControllerDemo

一款万能控制器跳转工具
Objective-C
1
star
34

Cryptograph

This is blockchain cryptograph library. 区块链密钥相关库
Swift
1
star
35

FFmpeg-ios

FFmpeg static libraries compiled for iOS.
1
star
36

YangKJ

1
star
37

KJBaseHandler

Base
Objective-C
1
star
38

KJMoreTargetDemo

同工程里面创建两个Target,然后通过判断Target来修改代码,这样都是基于同一套代码做修改,只是部分不相同的地方通过Target来添加不同代码,后期修改维护成本低
Objective-C
1
star
39

KJExtensionHandler

持续更新中,Category各种工具集合,Button图文混排、点击事件封装、View圆角渐变、Xib属性、TextView输入框扩展、限制字数、撤销,富文本,多语言,加密解密,数组算法,字符串加减乘除幂运算等等等
Objective-C
1
star