Swiftpack.co -  xattacker/RxRequiredPropertyChecker as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
xattacker/RxRequiredPropertyChecker
a RxSwift Related component, help checking property has been filled
.package(url: "https://github.com/xattacker/RxRequiredPropertyChecker.git", from: "1.0.9")

RxRequiredPropertyChecker

a RxSwift Related component, help checking property has been filled

https://user-images.githubusercontent.com/33754378/131239984-9138ccfd-5525-4584-8b8c-712079140315.mp4

Installation

Cocoapods

RxRequiredPropertyChecker can be added to your project using CocoaPods 0.36 or later by adding the following line to your Podfile:

pod 'RxSwift'
pod 'RxCocoa'
pod 'RxRequiredPropertyChecker'

Swift Package Manager

To add RxRequiredPropertyChecker to a Swift Package Manager based project, add:

.package(url: "https://github.com/xattacker/RxRequiredPropertyChecker.git", .upToNextMajor(from: "1.0.9")),
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.2.0")),

to your Package.swift files dependencies array.

How to use:

// make the component implement protocol RequiredProperty
extension UITextField: RequiredProperty
{
    public var isFilled: Bool
    {
	return (self.text?.count ?? 0) > 0
    }

    public var isFilledBinding: Driver<Bool>
    {
	return self.rx.text.map { $0?.count ?? 0 > 0 }.asDriver(onErrorJustReturn: false)
    }
}


// then add the component instance into RxRequiredPropertyChecker
let textField: UITextField

let checker = RxRequiredPropertyChecker()
checker.add(textField)

// bind checker with other
checker.rx.isFilled.drive(self.button.rx.isEnable)
		     .disposed(by: self.disposeBag)

GitHub

link
Stars: 0
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Dependencies

Release Notes

1.0.9
1 week ago

fixed bug with RxRequiredPropertyChecker's func: driveProperty

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics