Provides a custom presentation modifier that provides more options including full screen presentations. (iOS)

Overview

ios

Presentation

Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+

Provides a custom presentation modifier that provides more options including full screen presentations.

Features

Presentation allows the configuration of the following properties:

  • UIModalTransitionStyle
  • UIModalPresentationStyle
  • isModalInPresentation
  • Easy API for presenting SwiftUI from UIKit

Example

Sheet replacement in SwiftUI with a custom environment value:

struct Presenting: View {
    @State private var presentSheet: Bool = false
    @State private var presentFullscreen: Bool = false

    var body: some View {
        VStack(spacing: 20) {
            Button {
                presentSheet = true
            } label: {
                Text("Present Modal")
            }
            .present(isPresented: $present) { Presented() }

            Button {
                presentFullscreen = true
            } label: {
                Text("Present Fullscreen")
            }
            .present(isPresented: $present, style: .fullscreen) { Presented() }
        }
    }
}

struct Presented: View {
    @Environment(\.presentation) private var presentation // note this is __not__ `presentationMode`
    var body: some View {
        Button {
            presentation.wrappedValue.dismiss() // but it has an identical API
        } label: {
            Text("Dismiss")
        }
    }
}

Present from UIKit with a convenient and familiar API:

controller.present(Presented(), animated: true)

Installation

The code is packaged as a framework. You can install manually (by copying the files in the Sources directory) or using Swift Package Manager (preferred)

To install using Swift Package Manager, add this to the dependencies section of your Package.swift file:

.package(url: "https://github.com/SwiftUI-Plus/Presentation.git", .upToNextMinor(from: "1.0.0"))

Note: The package requires iOS v13+

Other Packages

If you want easy access to this and more packages, add the following collection to your Xcode 13+ configuration:

https://benkau.com/packages.json

You might also like...
An easier way to handle third-party URL schemes in iOS apps.
An easier way to handle third-party URL schemes in iOS apps.

IntentKit ========= IntentKit is an easier way to handle third-party URL schemes in iOS apps. Linking to third-party apps is essentially broken on iOS

URL routing library for iOS with a simple block-based API

JLRoutes What is it? JLRoutes is a URL routing library with a simple block-based API. It is designed to make it very easy to handle complex URL scheme

Marshroute is an iOS Library for making your Routers simple but extremely powerful

Marshroute Contents Overview Detailes Tuning the transition animation 3d touch support PeekAndPopUtility Peek and pop state observing Demo Requirement

πŸ›£ Simple Navigation for iOS
πŸ›£ Simple Navigation for iOS

Router Reason - Get Started - Installation Why Because classic App Navigation introduces tight coupling between ViewControllers. Complex Apps navigati

Protocol oriented, Cocoa UI abstractions based library that helps to handle view controllers composition, navigation and deep linking tasks in the iOS application. Can be used as the universal replacement for the Coordinator pattern. An extremely lean implementation on the classic iOS router pattern.
An extremely lean implementation on the classic iOS router pattern.

Beeline is a very small library that aims to provide a lean, automatic implementation of the classic iOS router pattern.

Swift wrapper for custom ViewController presentations on iOS
Swift wrapper for custom ViewController presentations on iOS

Presentr is a simple customizable wrapper for the Custom View Controller Presentation API introduced in iOS 8. About iOS let's you modally present any

BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

A custom SwiftUI modifier to present an ActionSheet or a Popover menu
A custom SwiftUI modifier to present an ActionSheet or a Popover menu

ActionOver A custom SwiftUI modifier to present an Action Sheet on iPhone and a Popover on iPad and Mac. iPhone Preview iPad Preview Mac Preview Featu

A Swift library to design custom prompts with a great scope of options to choose from.
A Swift library to design custom prompts with a great scope of options to choose from.

Installation CocoaPods Install with CocoaPods by adding the following to your Podfile: source 'https://github.com/CocoaPods/Specs.git' platform :ios,

This
This "Calculator" application is a simple one screen design of calculator screen i have made this single screen design application just to practice AutoLayout concepts.

Calculator Layout This "Calculator" application is a simple one screen design of calculator screen i have made this single screen design application j

Syntax sugar of OpenTok iOS SDK with Audio/Video communication including screen sharing
Syntax sugar of OpenTok iOS SDK with Audio/Video communication including screen sharing

Accelerator Core iOS The Accelerator Core is a solution to integrate audio/video communication to any iOS applications via OpenTok platform. Accelerat

🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller  transitions and presentations with the focus on a simple and yet flexible API.
🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.

Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexibl

🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller  transitions and presentations with the focus on a simple and yet flexible API.
🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.

Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexibl

DeckRocket turns your iPhone into a remote for Deckset presentations
DeckRocket turns your iPhone into a remote for Deckset presentations

DeckRocket DeckRocket turns your iPhone into a remote for Deckset presentations Requirements DeckRocket is built in Swift and relies on Multipeer Conn

ExpoMod - a small application tool that lets you quickly setting up your computer for presentations / exhibitions
ExpoMod - a small application tool that lets you quickly setting up your computer for presentations / exhibitions

ExpoMod is a small application tool that lets you quickly setting up your computer for presentations / exhibitions. Or simply having useful shortcut to not being distract and keep awake your computer.

Provides a SwiftUI multi-line TextView implementation including support for auto-sizing. (iOS)

TextView Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ Provides a SwiftUI multi-line TextView implementation with supp

A minimal iOS AR app that displays a wave animation using RealityKit2 Geometry Modifier
A minimal iOS AR app that displays a wave animation using RealityKit2 Geometry Modifier

AR Simple Sea A minimal iOS AR app that displays a wave animation using RealityKit2 Geometry Modifier. Xcode 13.3 Target: iOS / iPadOS 15.0+ SwiftUI,

This is a small View modifier that adds detents for native .sheet representations that appeared in iOS 16

SheetDetentsModifier This is a small View modifier that adds detents for .sheet representations that appeared in iOS 16 It works starting with iOS 15

Comments
  • Call onDismiss when FullscreenView is dismissed

    Call onDismiss when FullscreenView is dismissed

    I noticed my onDismiss wasn't called when I used .present(isPresented: $showOverlay, style: .overFullscreen, onDismiss: reset) { ... } this PR addresses that by passing onDismiss to FullscreenView and from FullscreenView to FullscreenWrapper then calling onDismiss in the onDismiss closure passed to:

    func viewController<V: View>(rootView: V, isModal: Bool, transition: UIModalTransitionStyle, style: UIModalPresentationStyle, onDismiss: (() -> Void)?) -> UIViewController
    
    opened by vdka 2
Owner
SwiftUI+
A collection of SwiftUI backports and more. Fully certificate signed, so please do not use any of the packages if Xcode warns otherwise.
SwiftUI+
πŸ“±πŸ“² Navigate between view controllers with ease. πŸ’« πŸ”œ More stable version (written in Swift 5) coming soon.

CoreNavigation ?? ?? Navigate between view controllers with ease. ?? ?? More stable version (written in Swift 5) coming soon. Getting Started API Refe

Aron Balog 69 Sep 21, 2022
A bidirectional Vapor router with more type safety and less fuss.

vapor-routing A routing library for Vapor with a focus on type safety, composition, and URL generation. Motivation Getting started Documentation Licen

Point-Free 68 Jan 7, 2023
A bidirectional router with more type safety and less fuss.

swift-url-routing A bidirectional URL router with more type safety and less fuss. This library is built with Parsing. Motivation Getting started Docum

Point-Free 242 Jan 4, 2023
Crossroad is an URL router focused on handling Custom URL Scheme

Crossroad is an URL router focused on handling Custom URL Scheme. Using this, you can route multiple URL schemes and fetch arguments and parameters easily.

Kohki Miki 331 May 23, 2021
A custom modal transition that presents a controller with an expanding effect while sliding out the presenter remnants.

DAExpandAnimation A custom modal transition that presents a controller with an expanding effect while sliding out the presenter remnants. Screenshot I

Denis Avdeev 578 Nov 29, 2022
⛡️ URLNavigator provides an elegant way to navigate through view controllers by URLs.

URLNavigator ⛡️ URLNavigator provides an elegant way to navigate through view controllers by URLs. URL patterns can be mapped by using URLNavigator.re

Suyeol Jeon 2.6k May 27, 2021
🎯Linker Lightweight way to handle internal and external deeplinks in Swift for iOS

Linker Lightweight way to handle internal and external deeplinks in Swift for iOS. Installation Dependency Managers CocoaPods CocoaPods is a dependenc

Maksim Kurpa 128 May 20, 2021
RxFlow is a navigation framework for iOS applications based on a Reactive Flow Coordinator pattern

About Navigation concerns RxFlow aims to Installation The key principles How to use RxFlow Tools and dependencies GitHub Actions Frameworks Platform L

RxSwift Community 1.5k May 26, 2021
SwiftRouter - A URL Router for iOS, written in Swift

SwiftRouter A URL Router for iOS, written in Swift, inspired by HHRouter and JLRoutes. Installation SwiftRouter Version Swift Version Note Before 1.0.

Chester Liu 259 Apr 16, 2021
iOS routing done right. Handles both URL recognition and controller displaying with parsed parameters. All in one line, controller stack preserved automatically!

Developed and Maintained by Ipodishima Founder & CTO at Wasappli Inc. (If you need to develop an app, get in touch with our team!) So what is this lib

null 589 Dec 24, 2022