A carousel of stacked items as seen in iMessage for photos

Overview

StackedItemsCarousel

A carousel of stacked items (such as photos) as seen in iMessage

What?

iMessage on iOS 15 shows multiple photos in a carousel of stacked items that the user can swipe thru. This is a reimplementation of that view.

Simulator.Screen.Recording.-.iPhone.13.Pro.-.2021-10-21.at.23.05.37.mp4

How to use?

StackedItemsLayout

The carousel has been implemented as a custom UICollectionViewLayout: StackedItemsLayout. You can use this layout directly in a UICollectionView that uses paging:

let collectionView = UICollectionView(frame: .zero, collectionViewLayout: StackedItemsLayout())
collectionView.backgroundColor = nil
collectionView.alwaysBounceHorizontal = true
collectionView.clipsToBounds = false
collectionView.isPagingEnabled = true

//  configure the collection view as any other collection view 

StackedItemsView

You can also use the convenience wrapper view, StackedItemsView. This is a generic view that takes an ItemType and CellType as generic parameters and handles the collection view for you:

let stackedItemsView = StackedItemsView
   
    ()

stackedItemsView.items = [.red, .blue, .brown, .green, .orange, .purple, .yellow, .gray, .cyan, .magenta]
stackedItemsView.configureItemHandler = { item, cell in
	// configure your cell here - it already has some shadow and corner radius parameters set on
	// the cell itself.
}
stackedItemsView.selectionHandler = { [weak self] item, index in
	// handle item selection here
}
view.addSubview(stackedItemsView)

   
Comments
  • Problems with the relationships

    Problems with the relationships

    Good morning!!!

    I'm sorry, but my english is not good.

    When I create a relationship between two models and schematics it implements it in the code of the corresponding model, it does it between the namespace declaration zone and the class, it does not add it to the end of the class, as would be correct. That must be defined somewhere or is it a bug? user_model

    And then, I have a problem with the migrations...

    Please, anyone helps me?

    bug question 
    opened by paolaDC 13
  • Multiple namespaces

    Multiple namespaces

    Hello,

    eager to try the package. Actually I have multiple namespaces and can't make schematics to read them. I need to set the config for each individual package. Since some packages make use of others I can't make them appear on the interface.

    Can I trick schematics to scaffold a "base" namespace, so it finds the "models" in there?

    Edited: The config only affects new models forms etc... the scaffolding is not working right now.

    I'm using https://github.com/nWidart/laravel-modules, nothing fancy, just a way to divide the code into components, 100% laravel way. But still...

    enhancement good first issue 
    opened by Surt 7
  • php artisan schematics:install failed

    php artisan schematics:install failed

    LogicException

    at vendor/laravel/framework/src/Illuminate/Routing/Route.php:1039 1035| */ 1036| public function prepareForSerialization() 1037| { 1038| if ($this->action['uses'] instanceof Closure) {

    1039| throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure."); 1040| } 1041| 1042| $this->compileRoute(); 1043|

      +32 vendor frames
    

    33 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    duplicate 
    opened by saimyosett 7
  • issue with adding relationships

    issue with adding relationships

    I created "User hasMany Posts" relationship this is what the User.php file look like after that:

        /**
         * @return \Illuminate\Database\Eloquent\Relations\HasMany
         */
        public function posts()
        {
            return $this->hasMany(\App\Models\Post::class);
        }
    }
    
    namespace App;
    
    use Illuminate\Contracts\Auth\MustVerifyEmail;
    use Illuminate\Foundation\Auth\User as Authenticatable;
    use Illuminate\Notifications\Notifiable;
    
    class User extends Authenticatable
    {
        use Notifiable;
    
        /**
         * The attributes that are mass assignable.
         *
         * @var array
         */
        protected $fillable = [
            'name', 'email', 'password',
        ];
    
        /**
         * The attributes that should be hidden for arrays.
         *
         * @var array
         */
        protected $hidden = [
            'password', 'remember_token',
        ];
    
        /**
         * The attributes that should be cast to native types.
         *
         * @var array
         */
        protected $casts = [
            'email_verified_at' => 'datetime',
        ];
    }
    
    bug duplicate question 
    opened by mobayen 6
  •  Unable to prepare route [welcome] for serialization. Uses Closure.

    Unable to prepare route [welcome] for serialization. Uses Closure.

    web.php

    Route::get('/welcome', function () {
        return view('welcome');
    });
    
     php artisan schematics:install
    

    Error:

     Unable to prepare route [welcome] for serialization. Uses Closure.
    
      at /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php:917
    
    opened by robsontenorio 5
  •  Very beautiful project, but here I still couldn't run

    Very beautiful project, but here I still couldn't run

    Hello, how are you? First of all I want to thank you for the beauty you are doing, it is very good!

    But I followed the steps of installing the project, and here it gave this error:

    image

    If anyone knows how to proceed, please :) thanks in advance.

    opened by vitorhugosg 4
  • Don't run in production env

    Don't run in production env

    Great package 👏👏👏

    Is there a way to run schematics on during development, when config('app.env') != 'production'?

    opened by mtvbrianking 4
  • Stop working after somes tests

    Stop working after somes tests

    Hi, it's an interesting project but it's not working anymore after trying fews things, now i only get this message when i acces to it.

    Symfony\Component\ErrorHandler\Error\FatalError Cannot declare class App\Policies\User because the name is already in use``

    Thanks.

    opened by kontas 3
  • Support for non-standard model directory path for DDD Laravel Sites

    Support for non-standard model directory path for DDD Laravel Sites

    This might be too edge case, but I recently started using a Laravel boilerplate which places the Models inside a non-standard location (src/App/) due to using Domain Driven Design pattern..

    Any ideas on supporting a site structure like this? Thanks

    enhancement 
    opened by ejntaylor 3
  • Bump url-parse from 1.5.1 to 1.5.3

    Bump url-parse from 1.5.1 to 1.5.3

    Bumps url-parse from 1.5.1 to 1.5.3.

    Commits
    • ad44493 [dist] 1.5.3
    • c798461 [fix] Fix host parsing for file URLs (#210)
    • 201034b [dist] 1.5.2
    • 2d9ac2c [fix] Sanitize only special URLs (#209)
    • fb128af [fix] Use 'null' as origin for non special URLs
    • fed6d9e [fix] Add a leading slash only if the URL is special
    • 94872e7 [fix] Do not incorrectly set the slashes property to true
    • 81ab967 [fix] Ignore slashes after the protocol for special URLs
    • ee22050 [ci] Use GitHub Actions
    • d2979b5 [fix] Special case the file: protocol (#204)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies javascript 
    opened by dependabot[bot] 0
  • Dynamic paths to create models

    Dynamic paths to create models

    Hi, good job

    I use https://nwidart.com/laravel-modules/v6/introduction to make modules in Laravel

    Example: all modules are created into Modules folder, can set custom path to create a model into path Modules/Customer/Entities?? and are same case to create controller with namespace Modules\Customer
    image

    Another question is can use some iframe or something to put schematics into own view to seem it's into my system?? To see my layout with sidebar, navbar, footer and into content area see schematics

    My layout image

    My layout + schematics image

    Thanks

    opened by yashiroiori 0
  • Fix failed tests

    Fix failed tests

    opened by Dennis-Mwea 0
  • Suport laravel 8?

    Suport laravel 8?

    Have suport for laravel 8?

    opened by sarjo 1
  • Schematics finds migrations but not models

    Schematics finds migrations but not models

    As the subject says, schematics can find the migrations, but no models. We have written our code so that the routes are in devolved routes files - the code is separated into different modules, and each module has its own route file (eg Modules/Communication/Http/routes.php). Is there any way schematics can use this? The routes have been cached, and I can see them when I do php artisan route:list.

    Thanks.

    opened by rflatt-reassured 3
  • Creating Resource Controller when add Model

    Creating Resource Controller when add Model

    Hello,

    In my tests, when adding a Model and check "Resource Controller" it does add a Controller in the Controllers folder but it doesn't contain CRUD methods.

    opened by ClementN 2
  • WIP: pivot table

    WIP: pivot table

    Work in progress. Some things that need to be done from top of my head:

    • FE should check model exists.
    • When pivot model fields are left empty, should use default.
    • BelongsToMany relations are now 'pseudo-relations' in backend (A related to AB, AB related to A). Maybe would be better if these 'pseudo-relations' exist in frontend only, because they are only there for visuals, and aren't actual model relations. They are not stored though (outside of cache) so maybe it's fine this way.
    • Migrations for relations when generating pivot model with relations.
    • General clean, not all parts are 'equally elegant'. Also some TODOs can be found in the wild
    • I think belongsToManyMigrations dont delete correctly when the checkbox is used
    opened by dedobbin 0
  • [Feature] Support namespace models and controllers

    [Feature] Support namespace models and controllers

    When creating a model, choose a sub namespace, For example

    Namespace = Blog Model = Post

    App\Blog\Post.php App\Http\Controllers\Blog\PostController.php App\Http\Request\Blog\Post\CreatePostRequest.php

    Namespace = Blog Model = Comment

    App\Blog\Comment.php App\Http\Controllers\Blog\CommentController.php App\Http\Request\Blog\Comment\CreateCommentRequest.php

    opened by gpibarra 0
  • [Feature] Support table name on create models (and migrations)

    [Feature] Support table name on create models (and migrations)

    When creating a model you can rename the table ($ protected $ table = '' and Schema :: table () / Schema :: create ())

    opened by gpibarra 0
Owner
Andreas Verhoeven
Andreas Verhoeven
📸 iMessage-like, Image Picker Controller Provides custom features.

RAImagePicker Description RAImagePicker is a protocol-oriented framework that provides custom features from the built-in Image Picker Edit. Overview O

Rashed Al-Lahaseh 14 Aug 18, 2022
ImagePickerSheetController replicates the custom photo action sheet in iMessage.

ImagePickerSheetController About ImagePickerSheetController is a component that replicates the custom photo action sheet in iMessage. It's very simila

Laurin Brandner 1.5k Jan 3, 2023
A lightweight 3D Linear Carousel with parallax effect

TGLParallaxCarousel A lightweight 3D Linear Carousel with parallax effect [GIF] Threedimensional & Normal mode Installation TGLParallaxCarousel is ava

Matteo Tagliafico 440 Dec 17, 2022
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.

This project is unmaintained. Alex passed away in an accident in late 2019. His love of iOS development will always be remembered. AXPhotoViewer AXPho

Alex Hill 596 Dec 30, 2022
DTPhotoViewerController - A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.

DTPhotoViewerController Example Demo video: https://youtu.be/aTLx4M4zsKk DTPhotoViewerController is very simple to use, if you want to display only on

Tung Vo 277 Dec 17, 2022
An iOS app that helps you check, edit and delete metadata of photos, including but not limited to EXIF, TIFF...

MetaX A simple iOS app that helps you check, edit and delete metadata of photos, including but not limited to EXIF, TIFF... Feature List main metadata

Yuhan Chen 189 Dec 29, 2022
Jogendra 113 Nov 28, 2022
iOS app to automagically control device torch/flash and capture photos

BlobStar ✨ Version française ???? iOS application to automagically control the device torch/flash and capture photos. The software was quickly drafted

Ninja Inc 1 Oct 11, 2021
Starter project for Mars rover photos iOS app.

MarzyPan is an app that allows users to view photos taken by Mars rovers during their time on the planet. This is a starter project that has some UI

Ruben Hansen-Rojas 0 Dec 30, 2021
UnsplashPhotosApp - Photos app using Unsplash API

UnsplashPhotosApp If you like this open-source project please consider supportin

Watery Desert 27 Dec 18, 2022
FlickrSearchPhotos - Simple search photos application which uses Flickr REST API made in Swift

FlickrSearchPhotos - Simple search photos application which uses Flickr REST API made in Swift

 Mihai Erős 1 Jun 6, 2022
A framework that lists all photos in the album that contain faces.

FaceCollectionViewKit A framework that lists all photos in the album that contain faces. Features It uses the detection features of CIDetectorTypeFace

Serhat Akalın 2 Aug 30, 2022
A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack.

CollectionViewShelfLayout A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested

Pitiphong Phongpattranont 374 Oct 22, 2022
List a collection of items in a horizontally scrolling view. A scaling factor controls the size of the items relative to the center.

CAROUSEL List a collection of items in a horizontally scrolling view. A scaling factor controls the size of the items relative to the center. We speci

Ramotion 557 Dec 31, 2022
An iOS Framework Capture & record ARKit videos 📹, photos 🌄, Live Photos 🎇, and GIFs 🎆.

An iOS Framework that enables developers to capture videos ?? , photos ?? , Live Photos ?? , and GIFs ?? with ARKit content.

Ahmed Bekhit 1.5k Dec 24, 2022
Source code for iOS app "Photos for VK" — albums and photos manager for social network VKontakte

VK Photos (formally Photos for VK) VK Photos is an iOS app for manage albums and photos in social network VKontakte (vk.com) Screenshots Disclaimer ⚠️

Yury S. 29 Oct 8, 2022
This is an Instagram clone with a custom Parse backend that allows a user to post photos, view a global photos feed, and add comments!

Parstagram - Part II This is an Instagram clone with a custom Parse backend that allows a user to post photos, view a global photos feed, and add comm

Jose G Caudillo 0 Oct 30, 2021
A simple app that I created to migrate my photos from Lightroom Classic to Apple's Photos.app.

CustomPhotoImporter A simple app that I created to migrate my photos from Lightroom Classic to Apple's Photos.app. This is optimised for my specific n

Matias Korhonen 5 Jan 5, 2023
Deck is a library that provides a UI to reproduce stacked cards for SwiftUI.

Deck Deck is a library that provides a UI to reproduce stacked cards for SwiftUI. RPReplay_Final1624531727.mov Usage struct Card: View { var data

1amageek 21 Dec 14, 2022
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.

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 i

Seb Jachec 19 Oct 9, 2022