Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen in Apple's TV & TestFlight iOS apps.

Overview

SwiftUI Matched Inline Title

Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen in Apple's TV & TestFlight iOS apps.

Example

struct ContentView: View {
    
    @Namespace var namespace
    
    var body: some View {
        NavigationView {
            ScrollView {
                VStack(alignment: .leading) {
                    MatchedTitle("For All Mankind", namespace: namespace) {
                        $0
                            .font(.largeTitle)
                            .fontWeight(.bold)
                            .padding()
                    }

                    // Other content…
                }
            }
            .matchedInlineTitle(in: namespace)
            // Other view modifiers, including `Toolbar` can be used…
        }
    }
}

Screenshots

Naming and namespacing conventions follow Swift's existing .matchedGeometryEffect view modifier.

A MatchedTitle view is initialized with any String, SubString or LocalizedStringKey, using similar parameters to SwiftUI's Text, and it provides optional customisation of the created Text view.

The .matchedInlineTitle modifier must be used on a ScrollView, and enforces a navigation bar title display mode of inline.

Minimum Requirements

  • iOS 14.0
  • Swift 5.3

License

This library is released under the MIT license. See the LICENSE file for more information.

You might also like...
Autocomplete for a text field in SwiftUI using async/await
Autocomplete for a text field in SwiftUI using async/await

Autocomplete for a text field in SwiftUI using async/await

Currency text field formatter available for UIKit and SwiftUI 💶✏️
Currency text field formatter available for UIKit and SwiftUI 💶✏️

CurrencyText provides lightweight libraries for formating text field text as currency, available for both UIKit and SwiftUI. Its main core, the Curren

ExpandableText 😎 (SwiftUI) Expand the text with the
ExpandableText 😎 (SwiftUI) Expand the text with the "more" button

ExpandableText 😎 (SwiftUI) Expand the text with the "more" button Get Started import SwiftUI import ExpandableText struct ExpandableText_Test: View

Render Markdown text in SwiftUI
Render Markdown text in SwiftUI

Render Markdown text in SwiftUI. It is a preview based on the Marked implementation

RichTextKit is a Swift-based library for working with rich text in UIKit, AppKit and SwiftUI.
RichTextKit is a Swift-based library for working with rich text in UIKit, AppKit and SwiftUI.

About RichTextKit RichTextKit is a Swift-based library that lets you work with rich text in UIKit, AppKit and SwiftUI. RichTextKit is under developmen

The famous iOS search bar with auto completion feature implemented.
The famous iOS search bar with auto completion feature implemented.

PRESENTATION This search bar will allow you to offer suggestions words to your users when they are looking for something using default iOS search bar.

AEOTPTextField - A beautiful iOS OTP Text Field library, written in Swift with full access customization in UI.
AEOTPTextField - A beautiful iOS OTP Text Field library, written in Swift with full access customization in UI.

AEOTPTextField - A beautiful iOS OTP Text Field library, written in Swift with full access customization in UI.

Declarative text styles and streamlined Dynamic Type support for iOS
Declarative text styles and streamlined Dynamic Type support for iOS

StyledText StyledText is a library that simplifies styling dynamic text in iOS applications. Instead of having to use attributed strings every time yo

A beautiful and flexible text field control implementation of
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.

SkyFloatingLabelTextField SkyFloatingLabelTextField is a beautiful, flexible and customizable implementation of the space saving "Float Label Pattern"

Comments
Owner
Seb Jachec
📱 Mobile engineer @ Daybridge • 🎮 gamer •  Apple enthusiast • he/him
Seb Jachec
Subclass of UITextField that shows inline suggestions while typing.

AutocompleteField Subclass of UITextField that shows inline suggestions while typing. Plug and play replacement for UITextField. Delimiter support. Pe

Filip Stefansson 663 Dec 6, 2022
An auto growing text input bar for messaging apps.

ALTextInputBar An auto growing text input bar for messaging apps. Written in Swift. ALTextInputBar is designed to solve a few issues that folks usuall

Alex Littlejohn 265 Nov 15, 2022
TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes

TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes

Nguyen Duc Thinh 7 Aug 28, 2022
UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text.

Deprecated Please use JVFloatLabeledTextField instead or feel free to chime in on an issue if you'd like to take over the repo. RPFloatingPlaceholders

rob phillips 1.1k Jan 5, 2023
SwiftUI TextEdit View - A proof-of-concept text edit component in SwiftUI & CoreText.

A proof-of-concept text edit component in SwiftUI & CoreText. No UIKit, No AppKit, no UITextView/NSTextView/UITextField involved.

Marcin Krzyzanowski 80 Dec 1, 2022
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews

' __________________ _______ _________ _______ _________ _______ _ ______ ' |\ /|\__ __/\__ __/( ____ \|\ /

Thanh Pham 446 Nov 24, 2022
A SwiftUI TextField with a prompt (or placeholder) that floats above the text field when active or not empty. Requires iOS 15.

FloatingPromptTextField A prompt is the label in a text field that informs the user about the kind of content the text field expects. In a default Tex

Emilio Peláez 43 Nov 3, 2022
Focus text field in SwiftUI dynamically and progress through form using iOS keyboard.

Focuser Focuser allows to focus SwiftUI text fields dynamically and implements ability move go through the form using Keyboard for iOS 13 and iOS 14.

Art Technologies 118 Dec 25, 2022
A text view that supports selection and expansion

The Problem UILabel and UITextView offer unsatisfying support for text selection. Existing solutions like TTTAttributedLabel are great but offer a som

Jeff Hurray 636 Dec 20, 2022
Render Markdown text in SwiftUI

MarkdownUI MarkdownUI is a library for rendering Markdown in SwiftUI, fully compliant with the CommonMark Spec. Supported Platforms You can use the Ma

Guille Gonzalez 916 Jan 8, 2023