awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
JohnSundell avatar

JohnSundell/SwiftTips

0
View on GitHub↗
4,014 stars·244 forks·MIT·8 viewstwitter.com/johnsundell↗

SwiftTips

SwiftTips is a curated collection of guides, libraries, and design patterns focused on Swift language mastery, application architecture, and API design. It provides a technical resource for implementing advanced coding techniques and architectural best practices.

The project emphasizes creating type-safe and conversational interfaces through strategic protocol composition and generics. It offers specialized patterns for building modular UI systems and managing complex view hierarchies, alongside comprehensive strategies for unit testing and dependency injection.

The resource covers a broad surface of capabilities, including functional programming primitives, advanced type system utilities, and data modeling strategies. It also details techniques for error handling, memory management, and the development of responsive user interfaces.

Features

  • Swift API Design Guidelines - Guides the creation of intuitive, type-safe, and conversational Swift interfaces using protocol composition and generics.
  • Design Systems - Creates a set of robust, consistent UI building blocks to construct complex features.
  • External Dependency Injections - Passes external dependencies into classes via initializers to allow substitution of real implementations with mocks.
  • Programming Language Mastery Guides - Offers advanced technical guides on Swift's type system and functional programming patterns for language mastery.
  • Modular UI Architectures - Provides patterns for modularizing user interfaces through plugin-based view controller composition to avoid deep inheritance.
  • Access Level Organizations - Provides patterns for grouping public and private members into separate extensions to create a structured API surface.
  • Autoclosure Executions - Demonstrates how to use autoclosures to create cleaner call sites for delayed execution.
  • Class-Only Protocol Constraints - Constrains protocols to class types to ensure conforming instances are mutable and reference-based.
  • Custom Codable Mapping - Simplifies JSON decoding by mapping mismatched external structures to internal model properties.
  • Conditional Protocol Conformances - Allows types to conform to protocols only when specific constraints on generic parameters are met.
  • Dot Syntax Convenience APIs - Utilizes static properties and initializers with dot syntax to create concise, default-parameter-driven APIs.
  • Extension-Based API Organization - Partitions a type's interface using separate extensions and access modifiers to organize visibility.
  • Tuple Argument Passings - Shows how to apply a group of values to a function as a single unit to simplify data transfer.
  • Variadic Argument Collections - Supports collecting an arbitrary number of unnamed arguments into a single list for flexible function handling.
  • Associated Type Constraints - Uses generic constraints on associated types to enforce specific requirements in protocols.
  • Associated Type Refinement - Refines associated types with additional requirements to create precise protocol-oriented interfaces.
  • Protocol - Combines multiple single-purpose protocols into a composite type alias for reusable conformance.
  • Type-Safe Identifier Serialization - Ensures that type-safe identifier wrappers are represented as single primitive values in JSON.
  • Label-Free Grouped Value Instantiations - Omits argument labels during the instantiation of grouped values to reduce boilerplate in API calls.
  • Labeled Tuple Parameters - Uses labeled tuples in function signatures to allow callers to selectively include or omit labels.
  • Mutually Exclusive States - Encapsulates incompatible state information within single types to eliminate the need for multiple optional properties.
  • Swift Resources - Offers a technical library of advanced type system utilities and functional programming primitives for Swift.
  • Encapsulation Patterns - Applies design patterns that hide internal object state and implementation details behind defined interfaces.
  • Enum Result Modeling - Implements enumerated types with associated values to represent successful or failed asynchronous operation outcomes.
  • Closure-Based Type Configuration - Defines type behaviors and logic using injected closures to increase extensibility and reuse.
  • Enum-Based State Modeling - Uses enumerations with associated values to model mutually exclusive application states and asynchronous operation results.
  • Verb-Based Function Names - Applies the convention of using present-tense verbs without suffixes in method signatures to support multiple arguments.
  • Protocol-Oriented Design - Employs a protocol-oriented design to combine small protocols into composite types, hiding concrete implementation details.
  • Internal Mutation Restrictions - Uses internal protocols and extensions to restrict mutation of types to the defining module.
  • Internal Protocol Access Control - Implements a design pattern that ensures APIs are public for reading but internal for mutation via nested protocols.
  • Key Path Convenience APIs - Leverages language-level key paths to simplify property access, grouping, and data transformation.
  • Collection Mutation Restrictions - Implements patterns to limit exposed mutating operations while keeping underlying collection storage private.
  • Property vs Method Selection Guidelines - Provides decision frameworks for choosing between computed properties and methods based on time complexity and semantics.
  • Type-Safe Identifier Wrappers - Provides generic wrapper types for identifiers to prevent passing the wrong model ID into a function.
  • Type Alias Signature Simplifications - Uses type aliases to shorten complex generic method signatures for improved readability.
  • Conversational API Design - Guides the design of APIs where call sites read like natural language through strategic parameter labeling.
  • Swift Architectural Guidelines - Provides architectural guidelines for organizing Swift codebases via dependency injection and state modeling.
  • Swift Design Pattern References - Curates a collection of architectural best practices and reference implementations of design patterns for Swift.
  • Type-Safe Identifiers - Provides a generic wrapper for identifiers to ensure type safety across different data models.
  • Type-Safe Target-Action Patterns - Implements callback systems that trigger instance methods without using Objective-C selectors or causing leaks.
  • Protocol-Based Mocking - Replaces entire implementations with mock objects by abstracting APIs into shared protocols for better isolation.
  • Dynamic Mock Objects - Simulates dependencies using subclassing or protocol abstraction to isolate code during unit testing.
  • Swift Unit Testing Patterns - Implements robust unit testing strategies in Swift focusing on async stability and mock injection.
  • Controller Modularization - Embeds modular child view controllers to share common functionality without using class inheritance.
  • JSON Conversion Simplification - Streamlines JSON encoding and decoding through generic methods and type inference.
  • Collection Aggregations - Implements collection aggregation by applying a closure to combine elements into a single result.
  • Collection Element Transformations - Provides higher-order functions to transform collection elements while automatically skipping null values.
  • Recursive Closures - Implements recursive logic within localized scopes by defining inline closures.
  • Associated Values - Defines structured enum cases that store associated data to represent complex application states.
  • Optional Chaining - Executes a sequence of operations on optional values without nested conditional unwrapping.
  • Recursive Data Models - Builds self-referential data hierarchies using indirect enumerations and static functions.
  • Dynamic Feature Flag Systems - Provides mechanisms for updating application behavior dynamically via backend or local cache flags loaded after launch.
  • Private Setters - Combines access modifiers with private setters to keep properties read-only for external callers.
  • Static Method Referencing - Retrieves a reference to an instance method as a closure by combining it with a specific object instance.
  • Reference Cycle Management - Prevents strong reference cycles and memory leaks using weak references within closures.
  • Lazy Sequences - Computes elements on demand using custom sequences and iterators to reduce memory usage.
  • Builder-Based Sequence Construction - Uses a builder pattern with lazy sequences to create chainable data query APIs.
  • Functional Dictionary Transformations - Applies functional chaining to dictionary key-value tuples to reshape data during iteration.
  • Lazy Property Initialization - Uses self-executing closures to encapsulate complex setup logic for lazy properties.
  • Exhaustive Case Matching - Uses comprehensive switch statements to ensure all enum cases are handled via compiler checks.
  • First-Class Functions - Utilizes Swift's ability to treat methods and initializers as first-class values for declarative logic.
  • Initializer Injection - Implements the pattern of treating type initializers as closures to facilitate mocking and dependency injection.
  • Operator Functions - Treats operators as first-class functions that can be passed as arguments or called as closures.
  • Overload Disambiguation - Utilizes parameter labels to disambiguate between different function overloads when passing functions as arguments.
  • Static Method Mockings - Swaps static API implementations with mock versions to control output during testing.
  • Closure-Based Constraints - Uses closure signatures as generic constraints to build flexible APIs for handling sequences of functions.
  • Generic Extension Constraints - Restricts generic extensions to specific types or protocols to provide specialized functionality.
  • Protocol-Based Algorithms - Implements generic algorithms as extensions on protocols to support multiple concrete data structures.
  • Guard Statements - Employs guard statements for early exit and requirement validation in control flow.
  • Functional Property Accessors - Uses key paths as functional references to property accessors to eliminate repetitive closure boilerplate.
  • Boilerplate Reduction Techniques - Implements techniques to reduce syntactic noise and explicit self-references when capturing data in closures.
  • Value-Capturing Closures - Combines values with functions to create argumentless closures that capture state.
  • Operator Overloading - Overloads arithmetic operators for vector types to simplify geometric calculations for points and sizes.
  • Pipeline Operators - Overloads the addition operator to compose a sequence of throwing functions into a single pipeline.
  • Option Sets - Implements bit-mask based options using the native Swift OptionSet type.
  • Optional Extensions - Adds custom methods to optional types to simplify data validation on potentially nil values.
  • Overridable Properties - Provides patterns for creating computed properties in base classes that can be specialized via overrides in subclasses.
  • Pattern Matching - Implements pattern matching to evaluate values against structural shapes for logic execution.
  • Custom Pattern Matching Operators - Implements custom operators that allow key paths to be used as conditions within switch syntax.
  • Functional Pipeline Composition - Implements a custom operator to chain throwing functions into a sequential execution pipeline.
  • Semantic Type Aliases - Uses type aliases to provide semantic meaning to primitive types without wrapper overhead.
  • Sequence Zipping - Implements the zipping of two sequences into a sequence of tuples for data aggregation.
  • Sequence Subsequence Extractions - Implements utilities for extracting specific ranges of elements from a sequence using leading or trailing constraints.
  • Type Aliasing - Creates reusable and simplified type definitions using generic type aliases and tuples.
  • Variable Shadowing - Uses variable shadowing to declare local copies of parameters, ensuring stable state within closure scopes.
  • Property Change Observers - Uses property observers to automatically trigger logic and keep user interfaces synchronized with state changes.
  • Class Inheritance Restrictions - Demonstrates how to prevent subclassing and method overriding to protect the integrity of class implementations.
  • Compile-Time Feature Toggling - Implements compile-time feature gating to control functionality visibility and facilitate gradual rollouts.
  • Static Factory Methods - Uses static factory methods within extensions to encapsulate styling and setup logic without relying on class inheritance.
  • Closure-Based - Implements dependency injection by passing specific closures instead of full objects to decouple components and simplify mocking.
  • Logic Decompositions - Provides techniques for decomposing massive code blocks into smaller, maintainable methods and child controllers.
  • Marker-Based Mutability Control - Implements mutability control by combining public protocols with internal extensions to ensure types are read-only externally.
  • UI Style Propagators - Utilizes environment values to propagate global or contextual style configurations across a UI component hierarchy.
  • Function Composition - Combines multiple operations into a single closure to pipeline the output of one function to the next.
  • Option to Either Conversions - Transforms optional values into result types by mapping them to specific enum cases.
  • Logic Decoupling - Demonstrates how to decouple controller logic by extracting related property groups into dedicated types to prevent massive classes.
  • Plugin-Based Screen Management - Implements plugin-like screens for loading and error states that automatically resize to the parent view.
  • Synthesized Equality - Uses compiler-generated equality and hashability for value types with nested properties.
  • Mock Call Count Verification - Uses arrays within mock objects to capture passed values and verify the correct number of method calls.
  • Async Task Synchronization - Injects a dispatch queue into components to ensure background operations complete before running test assertions.
  • Async Test Stability - Uses expectations and timeouts instead of sleep commands to ensure test stability across different environments.
  • Asynchronous Code Testing - Utilizes expectations and inverted expectations to verify whether background tasks complete or do not occur.
  • Async-to-Sync Mocking - Replaces asynchronous dependencies with synchronous mocks that execute handlers immediately to remove waiting periods.
  • Expectation-Based Async Testing - Waits for asynchronous operations to complete or fail by fulfilling an expectation within a specified timeout.
  • Partial Mocks - Modifies existing types by overriding specific methods in a subclass to control returned values.
  • Date Provider Mocking - Injects date initialization as a closure into classes to allow deterministic testing of time-based logic.
  • Simplification Techniques - Provides patterns for using inline functions to decompose deeply nested UI code into manageable pieces.
  • Declarative Interface Definitions - Configures navigation and tables using state-driven, declarative logic to reduce boilerplate code.
  • Tuple-Based View State Management - Groups reactive properties into tuples to drive layouts efficiently without the overhead of dedicated view models.
  • Hybrid View Bridges - Implements mechanisms for embedding modern declarative view hierarchies within legacy imperative controllers for incremental migration.
  • Stack-Based Layouts - Offers techniques for building responsive interfaces using axis-aligned and nested stack view layouts.
  • Learning Resources - Curated insights and shortcuts for daily development.

Star history

Star history chart for johnsundell/swifttipsStar history chart for johnsundell/swifttips

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to SwiftTips

Similar open-source projects, ranked by how many features they share with SwiftTips.
  • github/swift-style-guidegithub avatar

    github/swift-style-guide

    4,762View on GitHub↗

    This project is a set of coding standards, architectural patterns, and type safety guidelines for writing Swift source code. It provides a framework for maintaining clean and maintainable code through established conventions and formatting rules. The guide prioritizes composition over class inheritance by favoring value types and final classes. It establishes a policy for access control to manage boundaries between internal logic and external components through explicit visibility modifiers. The standards cover type safety optimization through immutable bindings and safe optional handling. A

    View on GitHub↗4,762
  • soapyigu/swift-30-projectssoapyigu avatar

    soapyigu/Swift-30-Projects

    8,300View on GitHub↗

    This repository is a collection of Swift programming examples and an iOS app architecture reference. It provides a set of small applications and refactored projects that demonstrate the practical application of the Swift language, system frameworks, and user interface components. The project serves as a design pattern reference for implementing professional software architecture. It covers the application of Model-View-ViewModel, protocol-oriented programming, and dependency injection to decouple components and increase code reuse. Additional resources focus on test-driven development, provi

    Swiftcocoa-touchiosiphone-x
    View on GitHub↗8,300
  • adambard/learnxinyminutes-docsadambard avatar

    adambard/learnxinyminutes-docs

    12,287View on GitHub↗

    This project is a collection of programming language references and syntax cheat sheets designed for rapid developer onboarding. It serves as a library of code-based documentation that uses valid source code files to provide whirlwind tours of various language specifications. The project focuses on programming language learning by providing concise, commented code examples that explain core features and syntax in place. This approach enables developers to quickly grasp language-specific patterns, data types, and execution flow through a consistent reference format. The content covers a broad

    Markdown
    View on GitHub↗12,287
  • devlooped/moqdevlooped avatar

    devlooped/moq

    6,389View on GitHub↗

    Moq is a .NET mocking framework and C# library used to create simulated objects and interfaces. Its primary purpose is to isolate code from external dependencies during unit testing by providing a system for interface simulation and behavioral testing. The framework distinguishes itself through the use of functional specification queries and LINQ-based querying to create declarative mocks. It supports the simulation of complex scenarios, including the automatic generation of recursive mock hierarchies, the implementation of multiple interfaces within a single mock instance, and the ability to

    C#
    View on GitHub↗6,389
See all 30 alternatives to SwiftTips→

Frequently asked questions

What does johnsundell/swifttips do?

SwiftTips is a curated collection of guides, libraries, and design patterns focused on Swift language mastery, application architecture, and API design. It provides a technical resource for implementing advanced coding techniques and architectural best practices.

What are the main features of johnsundell/swifttips?

The main features of johnsundell/swifttips are: Swift API Design Guidelines, Design Systems, External Dependency Injections, Programming Language Mastery Guides, Modular UI Architectures, Access Level Organizations, Autoclosure Executions, Class-Only Protocol Constraints.

What are some open-source alternatives to johnsundell/swifttips?

Open-source alternatives to johnsundell/swifttips include: github/swift-style-guide — This project is a set of coding standards, architectural patterns, and type safety guidelines for writing Swift source… soapyigu/swift-30-projects — This repository is a collection of Swift programming examples and an iOS app architecture reference. It provides a set… sebastianbergmann/phpunit-mock-objects — This project is a mocking framework and library designed for creating simulated objects to isolate code and verify… devlooped/moq — Moq is a .NET mocking framework and C# library used to create simulated objects and interfaces. Its primary purpose is… kodecocodes/swift-style-guide — This project is a comprehensive set of standards for the Swift ecosystem, providing a code style guide, API design… adambard/learnxinyminutes-docs — This project is a collection of programming language references and syntax cheat sheets designed for rapid developer…