0822222222
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Lightweight Form Validation in SwiftUI: A Property Wrapper Approach That Actually Works | |
| Form validation in SwiftUI has always been a pain point. Most solutions either require you to wrap every input in custom controls, pollute your views with validation logic, or force you to use heavyweight third-party libraries. What if there was a simpler way? | |
| In this article, I'll walk you through a lightweight form validation approach that leverages Swift's property wrappers and SwiftUI's view modifiers to create a clean, type-safe, and extensible validation system. No custom controls required. | |
| ## The Problem with Existing Approaches | |
| Before diving into the solution, let's acknowledge why form validation in SwiftUI is challenging: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/widgets.dart'; | |
| // MARK: - Iterable Extensions | |
| extension FlutterishIterable<T> on Iterable<T> { | |
| List<Widget> toWidgets({ | |
| required Widget Function(T element) itemBuilder, | |
| Widget Function()? separatorBuilder | |
| }) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Prevent commits containing Tailor errors or warnings to be pushed to remote | |
| remote="$1" | |
| url="$2" | |
| RED='\033[0;31m' # Red Color | |
| NC='\033[0m' # No Color |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import PlaygroundSupport | |
| // MARK: Transport layer | |
| /// Represents error sent from transport layer | |
| struct TransportError: Error { | |
| let code: Int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //: Playground - noun: a place where people can play | |
| import Foundation | |
| // MARK: Infrastructure | |
| /// Contract for remote user service | |
| protocol UserService { | |
| func signIn(completion handler: (User?) -> ()) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| echo killing adl... | |
| pkill -HUP adl > /dev/null | |
| echo killed | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require "rexml/document" | |
| require "fileutils" | |
| include REXML | |
| platforms = ["ios", "android", "air-desktop"] | |
| script_name = File.basename(__FILE__) | |
| if ARGV.count < 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by max on 6/12/16. | |
| */ | |
| package | |
| { | |
| import flash.display.Stage; | |
| import flash.events.TimerEvent; | |
| import flash.events.TouchEvent; | |
| import flash.utils.Timer; | |
| import flash.utils.getTimer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package feathersx.controls.text | |
| { | |
| import feathers.controls.text.TextBlockTextRenderer; | |
| import flash.geom.Point; | |
| import flash.geom.Rectangle; | |
| import flash.text.engine.ContentElement; | |
| import flash.text.engine.ElementFormat; | |
| import flash.text.engine.GroupElement; | |
| import flash.text.engine.TextElement; |
NewerOlder