ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - james01/CardNavigation: A navigation controller that displays its view controllers as an interactive stack of cards.
A navigation controller that displays its view controllers as an interactive stack of cards. - james01/CardNavigation
Visit Site

GitHub - james01/CardNavigation: A navigation controller that displays its view controllers as an interactive stack of cards.

GitHub - james01/CardNavigation: A navigation controller that displays its view controllers as an interactive stack of cards.

CardNavigation

CocoaPods Platform

The easiest way to turn a navigation controller into an interactive stack of cards.

Highlights

  • ✅ Fully interactive and interruptible
  • ✅ Works seamlessly with scroll views
  • ✅ Supports changes in orientation
  • ✅ Can be used with or without storyboards
  • ✅ Written entirely in Swift using standard UIKit components

Example

Installation

CocoaPods

To install CardNavigation using CocoaPods, add the following line to your Podfile:

pod 'CardNavigation', '~> 1.1'

Swift Package Manager

To install CardNavigation using the Swift Package Manager, add the following value to your Package.swift:

dependencies: [
    .package(url: "https://github.com/james01/CardNavigation.git", .upToNextMajor(from: "1.1.0"))
]

Usage

Getting Started

CardNavigation consists of a single class: CardNavigationController. It behaves like a standard UINavigationController.

At the top of the file where you'd like to use a CardNavigationController, import CardNavigation.

import CardNavigation

Create an instance of CardNavigationController the way you would a regular UINavigationController.

let navController = CardNavigationController(rootViewController: SomeViewController())

When you push a view controller, it will automatically be displayed as an interactive card.

navController.pushViewController(AnotherViewController(), animated: true)

Background Color

The CardNavigationController's navigationBar is transparent by default. This allows the controller's background color to show through.

You may want to change the background color to reflect the theme of your app.

navController.view.backgroundColor = .systemTeal

Card Appearance

To change the card appearance, create a custom view class.

import UIKit

class MyCardBackgroundView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .white

        layer.cornerRadius = 32
        layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
        layer.cornerCurve = .continuous

        layer.borderColor = UIColor.black.cgColor
        layer.borderWidth = 4
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

Then, create a subclass of CardNavigationController and override the cardBackgroundViewClass property to return your custom class.

import UIKit
import CardNavigation

class MyCardNavigationController: CardNavigationController {

    override var cardBackgroundViewClass: UIView.Type {
        return MyCardBackgroundView.self
    }
}

Author

James Randolph (@jamesrandolph01)

License

CardNavigation is released under the MIT license. See LICENSE for details.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory