Skip to content

Instantly share code, notes, and snippets.

Avatar

Rostyslav Dovhaliuk RenGate

View GitHub Profile
@darrarski
darrarski / FormattedTextField.swift
Last active Apr 6, 2022
SwiftUI FormattedTextField - TextField with custom display/edit formatters
View FormattedTextField.swift
import SwiftUI
public struct FormattedTextField<Formatter: TextFieldFormatter>: View {
public init(_ title: String,
value: Binding<Formatter.Value>,
formatter: Formatter) {
self.title = title
self.value = value
self.formatter = formatter
}
@DenTelezhkin
DenTelezhkin / main.m
Last active Dec 26, 2015
Running XCTests without creating any of application controllers.
View main.m
static bool isRunningTests()
{
NSDictionary* environment = [[NSProcessInfo processInfo] environment];
NSString* injectBundle = environment[@"XCInjectBundle"];
return [[injectBundle pathExtension] isEqualToString:@"xctest"];
}
int main(int argc, char *argv[])
{
@autoreleasepool