NativeUIKit
Mimicrated views and controls to native Apple appearance. If you have any ideas of what elements can be added, let me know. Below you will see previews of all the elements and how to use them.
If you like the project, don't forget to put star ★
Check out my other libraries:
Navigate
Installation
Ready for use on iOS 12+, tvOS 12+ & watchOS 6.0+. Works with Swift 5+. Required Xcode 12.0 and higher.
Swift Package Manager
The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
To integrate using Xcode 12, specify it in File > Swift Packages > Add Package Dependency...
:
https://github.com/ivanvorobei/NativeUIKit
CocoaPods:
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate using CocoaPods, specify it in your Podfile
:
pod 'NativeUIKit'
Manually
If you prefer not to use any of dependency managers, you can integrate manually. Put Sources/ProjectName
folder in your Xcode project. Make sure to enable Copy items if needed
and Create groups
.
Classes
NativeLargeActionButton
Usually used at the bottom of the screen. You can set an icon. You can set how to change the style when you click. Supports states disabled
and dimmed
.
Next code for usage:
// Set Appearance and Content
let button = NativeLargeActionButton()
button.setImage(UIImage.init(systemName: "plus.circle.fill")!)
button.higlightStyle = .background
button.applyDefaultAppearance(with: .init(content: .custom(.white), background: .tint))
// or use Wrapper
button.set(
title: "Large Action",
icon: UIImage.init(systemName: "plus.circle.fill")!,
colorise: .init(content: .custom(.white), background: .tint)
)
Button support system layouts by sizeToFit()
. Next code allow you to layout button with cutom width:
button.sizeToFit()
button.frame = .init(x: 0, y: 0, width: 300, height: button.frame.height)
NativeSmallActionButton
You definitely saw this button in the AppStore. You can use it without the icon.
Supports states disabled
and dimmed
.
Next code for usage:
// Set Appearance and Content
let button = NativeSmallActionButton()
button.higlightStyle = .background
button.applyDefaultAppearance(with: .init(content: .custom(.white), background: .tint))
// or use Wrapper
button.set(
title: "Edit",
icon: nil,
colorise: .init(content: .custom(.white), background: .tint)
)
Button support system layouts by sizeToFit()
. Next code allow you to layout button:
button.sizeToFit()
Other Projects
I love being helpful. Here I have provided a list of libraries that I keep up to date. For see video previews
of libraries without install open opensource.ivanvorobei.by website.
I have libraries with native interface and managing permissions. Also available pack of useful extensions for boost your development process.
Russian Community
Подписывайся в телеграмм-канал, если хочешь получать уведомления о новых туториалах.
Со сложными и непонятными задачами помогут в чате.
Видео-туториалы выклыдываю на YouTube: