It is library for projects SPPermission & SPStorkController. Also library have many useful extenshions and classes. Some fitures I am describe here
Drop in Source/Sparrow
folder to your Xcode project. Make sure to enable Copy items if needed
and Create groups
Or via CocoaPods:
pod 'SparrowKit'
and import library in class:
import SparrowKit
I am describe some fitures, not all. See classes in Source/sparrow
for find more information
Set paralax for view:
let view = UIView()
view.setParalax(amount: 10)
Set paralax for view:
let image: UIImage = view.convertToImage()
Set deep shadow:
view.setDeepShadow()
view.removeShadow()
Animate corner radius:
view.addCornerRadiusAnimation(to: 10, duration: 0.3)
Max rounding view:
view.round()
Wrap controller to navigation controller:
let controller = UIViewController()
let nav = controller.wrapToNavigationController()
Dismiss keyborad now:
controller.dismissKeyboard()
Save image or video to gallery:
controller.save(image: UIImage())
controller.saveVideo(url: "https://youtu.be/1mDdX7fQRv4")
Set navigation title for small
or large
style:
controller.setNavigationTitle("Title", style: .large)
Safe area for controller:
let _ = controller.topSafeArea
let _ = controller.bottomSafeArea
Set navigation title color:
controller.navigationTitleColor = UIColor.black
var button = UIButton()
button.target {
print("Touch up inside")
}
Func showText
show title animatable in button frame:
var button = UIButton()
button.showText("Alert")
Func setAnimatableText
set new title for button animatable:
var button = UIButton()
button.setAnimatableText("New Title")
Func setNativeStyle
set background and border from apple way style:
let imageView = UIImageView()
imageView.setNativeStyle()
Func setShadowOffsetForLetters
set shadow for letters:
let label = UILabel()
label.text = "Text"
label.setShadowOffsetForLetters()
let tableView = UITableView()
let _ = tableView.isEmpty
let _ = tableView.isEmpty(section: 0)
let _ = tableView.lastSection
let _ = tableView.lastSectionWithRows // last not empty section
let _ = tableView.firstSectionWithRows // first not empty section
Support HEX for create UIColor
:
UIColor.init(hex: "#000000")
let _ = "ivanvorobei@icloud.com".isEmail
let _ = "ivanvorobei@icloud.com".isLink