Menu โ–พ โ–ด

Tree [a7612a] master 1.0.5 /
 History

HTTPS access


File Date Author Commit
 KJCategories 2022-01-25 77ใ€‚ 77ใ€‚ [fbb0d3] Directory structure adjustment
 KJCategories.xcodeproj 2022-01-25 77ใ€‚ 77ใ€‚ [5af217] Remove DZN
 KJCategories.xcworkspace 2022-01-25 77ใ€‚ 77ใ€‚ [5af217] Remove DZN
 Pods 2022-01-25 77ใ€‚ 77ใ€‚ [a7612a] Pod 1.0.5
 Screenshots 2022-01-25 77ใ€‚ 77ใ€‚ [bec458] Update screenshots
 Sources 2022-01-25 77ใ€‚ 77ใ€‚ [5af217] Remove DZN
 Tests 2022-01-25 77ใ€‚ 77ใ€‚ [fbb0d3] Directory structure adjustment
 .gitattributes 2021-12-05 aba aba [070b73] Add opencv2.framework
 .gitignore 2022-01-25 77ใ€‚ 77ใ€‚ [be757a] Update gitihnore
 Git.txt 2022-01-25 77ใ€‚ 77ใ€‚ [a67873] Fix the word error
 KJCategories.podspec 2022-01-25 77ใ€‚ 77ใ€‚ [a7612a] Pod 1.0.5
 LICENSE 2021-12-05 aba aba [93d934] Initial commit
 Podfile 2022-01-25 77ใ€‚ 77ใ€‚ [fbb0d3] Directory structure adjustment
 Podfile.lock 2022-01-25 77ใ€‚ 77ใ€‚ [a7612a] Pod 1.0.5
 README.md 2021-12-21 aba aba [1a42e3] Update README
 README_CN.md 2021-12-21 aba aba [1a42e3] Update README

Read Me

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 KJExceptionDemo
Quick creation of chained UI controls ChainThen

Catalogue list

Methods and Functions

OpenCV

  • Opencv picture processing.
Name 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:b:
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:

โ˜ Return to the catalogue list โ˜

NSArray

  • Related processing of the elements in the array.
Name 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

โ˜ Return to the catalogue list โ˜

NSDate

  • Time transformation.
Name 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:

โ˜ Return to the catalogue list โ˜

NSDictionary

  • Dictionary common methods.
Name 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 name descending order kj_keySortDescending
Quickly traverse the dictionary kj_applyDictionaryValue:
Mapping kj_mapDictionary:
Merge kj_mergeDictionary:
Selector kj_pickForKeys:
Remover kj_omitForKeys:

โ˜ Return to the catalogue list โ˜

UIView

  • Advanced Edition Rounded Corners and Border Extension.
Name 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:

โ˜ Return to the catalogue list โ˜

UITextView

  • UITextView undo processing, equivalent to command + z, limit processing.
Name 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

โ˜ Return to the catalogue list โ˜

UITextField

  • UITextField input box extension, placeholder, quick setting account password box.
Name 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

โ˜ Return to the catalogue list โ˜

UILabel

  • UILabel add long press copy function, Get text position and size.
Name 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:

โ˜ Return to the catalogue list โ˜

UIImage

  • QR code and barcode generator, image size, screenshot and crop processing, Picture cropper.
Name 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

โ˜ Return to the catalogue list โ˜

UIDevice

  • UIDevice system related operations.
Name Signatures
App version number appCurrentVersion
App Name 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:

โ˜ Return to the catalogue list โ˜

UIColor

  • UIColor related extension.
Name 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:

โ˜ Return to the catalogue list โ˜

UIButton

  • UIButton click event block, mixed graphics and text, enlarge click.
Name 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:

โ˜ Return to the catalogue list โ˜

UISlider

  • Rainbow gradient color slider.
Name 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

โ˜ Return to the catalogue list โ˜

UIViewController

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

โ˜ Return to the catalogue list โ˜

CocoaPods Install

Example import core module:
- pod 'KJCategories'

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

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

Example import opencv2 picture processing:
- pod 'KJCategories/Opencv'

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

Ex

  • Download demo please execute first pod install

License

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