Introduction
SainiUtils is used to extend the basic functionality of UIKit elements like UIView,UIButton,UITextfield etc.
Purpose
SainiUtils basic purpose to reduce your development time by extened the basic functionality of UIKit elements.
Installation
SainiUtils is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SainiUtils'How to Use
let demoView = UIView()
demoView.sainiFeatureName()//Just use the below given function names.
//example
let demoLabel = UILabel()
demoLabel.sainiAddTapGesture{
print("I can now click on UILabel")
demoLabel.sainiRotate()//Oh cool its rotating
}
Features
| UIView |
|---|
| 1.)sainiCircle |
| 2.)sainiBlur |
| 3.)sainiGradientColor |
| 4.)sainiCornerRadius |
| 5.)sainiRoundCorners |
| 6.)sainiShadow |
| 7.)sainiShadowWithCornerRadius |
| 8.)sainiShadowWithGradientAndCornerRadius |
| 9.)sainiGrowAndShrink |
| 10.)sainiRotate |
| 11.)sainiStopRotating |
| 12.)sainiTapToChangeColor |
| 13.)sainiScreenshot |
| 14.)sainiAddBorderWithColor |
| 15.)sainiDrawDashedBorderAroundView |
| 16.)sainiFadeIn |
| 17.)sainiFadeOut |
| 18.)sainiFadeOutInfinite |
| 19.)sainiFadeInInfinite |
| 20.)sainiShowLoader |
| 21.)sainiRemoveLoader |
| 22.)sainiRotateByAngle |
| 23.)sainiDashedLine |
| 24.)sainiAddTapGesture |
| 25.)sainiPulsate |
| 26.)sainiFlash |
| 27.)sainiShake |
| 28.)sainiShowToast |
| UITextField |
|---|
| 29.)sainiSetLeftPadding |
| 30.)sainiSetRightPadding |
| 31.)sainiSetLeftIcon |
| 32.)sainiSetRightIcon |
| UITableView |
|---|
| 33.)sainiSetEmptyMessage |
| 34.)restore |
| Date |
|---|
| 35.)sianiFirstDayOfWeek |
| 36.)sainiAddWeeks |
| 37.)sainiWeeksAgo |
| 38.)sainiAddDays |
| 39.)sainiDaysAgo |
| 40.)sainiAddHours |
| 41.)sainiHoursAgo |
| 42.)sainiAddMinutes |
| 43.)sainiMinutesAgo |
| 44.)sainiStartOfDay |
| 45.)sainiEndOfDay |
| 46.)sainiZeroBasedDayOfWeek |
| 47.)sainiHoursFrom |
| 48.)sainiDaysBetween |
| 49.)sainiPercentageOfDay |
| 50.)sainiNumberOfWeeksInMonth |
| 51.)sainiFormattedDateString |
Some handy Functions
sainiColorFromHex
let demoLbl = UILabel()
demoLbl.textColor = sainiColorFromHex(hex: "#687f9")sainiCompressImage
//Image Compression to 10th of original size
let image = sainiCompressImage(image: UIImage(named: "someImage"))sainiSignatureView
//Assign sainiSignatureView to any UIView class and it will behave as an signatureView
sainiCardView
//Assign sainiCardView to any UIView class and it will behave as an CardView
sainiTimesAgo
let timeAgoStr = sainiTimesAgo(78789877387)
print(timeAgoStr)
//2 Min ago
Author
rohitsaini91, [email protected]
License
SainiUtils is available under the MIT license. See the LICENSE file for more info.
Update from SainiUtils Date: Sun 7 Jun 2020
Lots of new cool features added, will update documentation in next few days.
