DevelopmentKit is a lightweight, easy-to-use framework for iOS development, making it simple to add powerful features to your app with just a few lines of code. The framework is written in Swift and designed to work seamlessly with UIKit.
p.s. I will be adding more features as well as tests and documentation in future releases.
- iOS 14.0+
- Xcode 12+
- Swift 5.3+
Select File → Add Packages, then enter the repository URL:
https://github.com/MarkoAntoljak/DevelopmentKit.git
Then select the version and add it to your project.
CocoaPods is a dependency manager for Cocoa projects. To integrate DevelopmentKit into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'DevelopmentKit', :git => 'https://github.com/MarkoAntoljak/DevelopmentKit.git'
Then, run the following command:
$ pod install
Add this to your Package.swift:
dependencies: [
.package(url: "https://github.com/MarkoAntoljak/DevelopmentKit.git", from: "1.0.1")
]
import DevelopmentKit
let phoneTextField = DKPhoneNumberTextField(
prefix: "1",
flag: "🇺🇸",
placeholder: "Enter phone number"
)
phoneTextField.countryDelegate = self
// Access the full phone number with country code
if let fullNumber = phoneTextField.fullPhoneNumber {
print(fullNumber) // Output: +1234567890
}let codeField = DKCodeSMSTextField(
placeholderCharacter: "-",
codeCount: 6
)
codeField.didEnterLastDigit = { code in
print("Code entered: \(code)")
}DKLogger.log(.info, "Application started")
DKLogger.log(.error, "An error occurred")
DKLogger.logAnalytics("user_signup")// Convert date to string
let dateString = Date().asString(.shortAmericanWithTime)
// Convert string to date
let date = "2024-12-13".getDate()
// Get time ago
let timeString = Date().timeAgo() // "Just now", "2 hours ago"// Get current user's country
if let userCountry = CountryRepository.shared.getUserCountry() {
print("User country: \(userCountry.name) \(userCountry.flag)")
}
// Get all countries
let allCountries = CountryRepository.shared.getCountries()// Add touch animation to button
button.addButtonReactivity()
// Add touch animation to view
view.addViewReactivity()
// Animate border width
view.animateBorderWidth(toValue: 2.0, duration: 0.3)// String manipulation
let substring = "Hello World"[0..<5] // "Hello"
let trimmed = " text ".trimmed() // "text"
let isValid = "user@email.com".isValidEmail() // true
// Number conversion
let numberString = 42.toString
let intValue = "100".toInt // 100DevelopmentKit is released under the MIT license. See LICENSE for details.