Skip to content

KarimEbrahemAbdelaziz/SparrowKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SparrowKit

It is library for projects SPPermission & SPStorkController. Also library have many useful extenshions and classes. Some fitures I am describe here

Integration

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

Extenshions

I am describe some fitures, not all. See classes in Source/sparrow for find more information

UIView

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()

UIViewController

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

UIButton

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")

UIImageView

Func setNativeStyle set background and border from apple way style:

let imageView = UIImageView()
imageView.setNativeStyle()

UILabel

Func setShadowOffsetForLetters set shadow for letters:

let label = UILabel()
label.text = "Text"
label.setShadowOffsetForLetters()

UITableView

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

UIColor

Support HEX for create UIColor:

UIColor.init(hex: "#000000")

String

let _ = "ivanvorobei@icloud.com".isEmail
let _ = "ivanvorobei@icloud.com".isLink

About

Simplify iOS programming

Resources

License

Stars

Watchers

Forks

Packages

No packages published