SLUtility
Requirements
- iOS 8.0 or later
- Xcode 9.0 or later
Installation
SLUtility is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SLUtility'
Feature
- String Extension.
- Date Extension.
- UIButton Class with UIImagePickerController
CODE
SLString.swift - provided methods
- func removeWhiteSpaceAndNewLine()
- func validateStringToURL()
- func isValidEmail()
SLDateTimeAgo.swift
- This class will provide you date diffrence from any date to current date by x.. seconds, min, hours, days, months, years ago...
SLImagePickerButton.swift
- This class provide you image from UIImagePickerViewController .
Example - SLImagePickerButton
self.buttonImagePicker.pickImageFromPicker(isAllowEditingImage: true) { (imagePickerInfo) in
guard let info = imagePickerInfo else {
// Cancel image picker
return
}
// Image selected successfully from image picker.
if let image = info[self.buttonImagePicker.imagePicker.allowsEditing ? UIImagePickerController.InfoKey.editedImage : UIImagePickerController.InfoKey.originalImage] as? UIImage {
self.buttonImagePicker.setBackgroundImage(image, for: .normal)
}
}
Author
ankitsolulab, [email protected]
License
SLUtility is available under the MIT license. See the LICENSE file for more info.