A lightweight Swift framework providing commonly used extensions for Foundation types, simplifying everyday iOS development tasks.
- String Extensions
- Email validation
- String formatting
- URL encoding
- Case modifications
- Whitespace handling
// Email validation
let email = "[email protected]"
email.isValidEmail // true
// String formatting
let text = " Hello World "
text.trimmed // "Hello World"
- iOS 13.0+
- Swift 5.0+
- Xcode 14.0+
- In Xcode, select
File
→Add Packages...
- Enter package URL:
https://github.com/arcos33/CoreExtensions.git
- Select your desired version rules
- Click
Add Package
First, import the framework:
import CoreExtensions
// Email validation
let email = "[email protected]"
if email.isValidEmail {
print("Valid email")
}
// String formatting
let text = " Hello World "
let trimmed = text.trimmed
print(trimmed) // "Hello World"
// URL encoding
let urlString = "Hello World!"
let encoded = urlString.urlEncoded // "Hello%20World!"
// First letter capitalization
let name = "john"
let capitalized = name.capitalizedFirst // "John"
Contributions are welcome! Please feel free to submit a pull request.
CoreExtensions is available under the MIT license. See the LICENSE file for more info.