Snapchat-Like Menu! (Swift in Xcode)

Jared Davidson · 56K views · 2015 · 10:03

Open on YouTube

Software (other)UX & UI designtutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed for a swipeable, Snapchat-like paged scroll view, usually when asking how to fix or extend the code in newer Swift and Xcode versions.

Recommended by 3 people across 3 different months, 2015 to 2020.

What it is

A 10-minute 2015 iOS tutorial by Jared Davidson showing how to build a Snapchat-style swipeable menu in Swift 2 and Xcode. It adds XIB-based view controllers as child views inside a horizontally paging UIScrollView.

What people said

Recommends BrianS · 2016-08 · Stack Overflow · on “No bouncing on UIPageViewController?”

I ran into this as well. Here is a solid tutorial I found on YouTube to use UIScrollView for the same ends: [this video]

Recommends mert dökümcü · 2017-11 · Stack Overflow · on “How can I create a scrollable view in Swift?”

What you are looking for is PageViewController . Search this term in Google or YouTube and you will highly likely find tons of good tutorials. Also, check the following links: Another post in StackOverflow: UIPageViewController and storyboard [LINK] Apple's Documentation on Page View Controllers: [LINK] A video tutorial in Youtube: Snapchat-like menu [this video]

Recommends Tan Han Wei · 2019-08 · Stack Overflow · on “How to use a button created in XIB custom view to control setContentOffset in viewController.swift?”

I followed this tutorial to create a Snapchat-Like Menu: [this video] In short, the idea was to create custom views with XIB, and add them into a scrollview. I would like to add a "back" button to one of the custom views so that the scrollview will automatically scroll back to its initial view when the button is tapped. The Idea I had was to write a code inside the custom view's IBAction function to call UIScrollview's content offset delegate function. the following is the code in View Controller: class ViewController: UIViewController, UIScrollViewDelegate { //I'm naming the Scroll View as "scrollView" @IBOutlet weak var scrollView: UIScrollView! { didSet{ scrollView.delegate = self } } override

Cites yoadle · 2015-12 · Stack Overflow · on “Which view controller should I use?”

I would like to create a social media app with 4 main pages. It looks something like this. [LINK] The connection arrow is mean swipe direction. However, I m not sure use what kind of controller to suit my situation. I watched some tutorial like this [this video] . I am not sure using UIPageViewController , UIScrollView or customize a self controller. Also, if I use UIPageviewController how can I set the "middle" (the search) page always showing first? Also, if I use UIScrollView or UIPageViewController how can I swipe top like the image above?

Cites Nicholas Agger Lui · 2016-08 · Stack Overflow · on “Swift popupView not working (2 didMoveToParentViewController view exist)”

I have a 3 swipe ViewController created with this tutorial [this video] So, HomeViewController is the controller of those 3 views. the code is Class HomeViewController //...... func prepareScrollView(){ let V1 : FirstViewController = FirstViewController(nibName: "FirstViewController", bundle: nil) let V2 : SecondViewController = SecondViewController(nibName: "SecondViewController",bundle: nil) let V3 : ThirdViewController = ThirdViewController(nibName: "ThirdViewController",bundle: nil) self.addChildViewController(V1) self.scrollView.addSubview(V1.view) V1.didMoveToParentViewController(self) self.addChildViewController(V2) self.scrollView.addSubview(V2.view) V2.didMoveToParentViewController(self)

Cites Lucas Farleigh · 2016-11 · Stack Overflow · on “Everything in the paged scroll view is to the right”

I have looked at similar problems on stack overflow and google, however my problem is not solved. I designed an app which uses a page scroll view in the Main.storyboard, which scrolls horizontally between other storyboards[pages]. I used the video Snapchat-Like Menu [this video] by Jared Davidson to help me. Before, It was in the center, as I would expect it to. I think it changed when I updated to Xcode 8(But am not certain). However, everything is to the right. I think it changed when I updated to Xcode 8(But am not certain) I have tried updating the frames but it has been unsuccessful. Attached are some images to help show you the problem as well as my ViewController code. What could I do? Tha

Cites Aidan Sawyer · 2017-01 · Stack Overflow · on “How do make a UIScrollview only show one subview at a time”

I followed a tutorial: [this video] that teaches you how to make a snap-chat like menu in swift 3, where every time you swipe a new subview is put on the screen, but it is the only one and you need to swipe another time to get the next view. This tutorial was made in swift 2, but when I updated to swift 3 the scrollview is now acting like normal scroll view where it scrolls fluently. is there any way to fix this? code for main view controller: class ViewController: UIViewController { @IBOutlet weak var scrollView: UIScrollView! override func viewDidLoad() { super.viewDidLoad() let V1: View1 = View1(nibName: "View1", bundle: nil) let V2: View2 = View2(nibName: "View2", bundle: nil) let V3: View3 =

Cites Hussein Esmail · 2017-08 · Stack Overflow · on “Specific issue for CGSizeMake with Swift 3 Xcode 8”

I'm having an issue with the youtube video by Jared Davidson. [this video] At exactly 7 minutes, he writes the code line: self.ScrollView1.contentSize = CGSizeMake(self.view.frame.width * 2, self.view.frame.size.height) My error is showing that CGSizeMake is unavailable in Swift, but in the video it works perfectly. Here is my version of the code: import UIKit class VC1: UIViewController { @IBOutlet weak var ScrollView1: UIScrollView! override func viewDidLoad() { super.viewDidLoad() var V1 : View1 = View1(nibName: "View1", bundle: nil) var V2 : View2 = View2(nibName: "View2", bundle: nil) var V2Frame : CGRect = V2.view.frame self.addChildViewController(V1) self.ScrollView1.addSubview(V1.view) V1

Cites lucky13820 · 2017-12 · Stack Overflow · on “Unexpectedly found nil but I can print the value”

EDIT: Add some more relevant details. So for my app, I want to have three pages that show different weather information. I can scroll horizontally to view them. I followed this youtube video and the Github project for reference. [this video] [LINK] What I did is add a scroll view in the main storyboard. Then I create three Cocoa Touch class with xib. Each of them is subclass of UIViewController. Each xib will act as a page in the scroll view. This is the code I used for set up xib view. let xOrigin = self.view.frame.width let credit : CreditScreenView = CreditScreenView(nibName: "CreditScreenView", bundle: nil) mainScroll.addSubview(credit.view) let forcast : ForcastScreenView = ForcastScreenView

Cites ytsm · 2019-10 · Stack Overflow · on “Can't recognize UISwipeGesture on my ScrollView”

In my app, there is a scrollView(pageScrollView) which is a snapchat like interface ( [this video] ) However, when I try to use below code to get the gesture on the scroll view, it cannot detect, can anyone help me on this?? let leftSwipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(leftSwipedByUser(_:))) leftSwipeGesture.direction = .left self.pageScrollView.addGestureRecognizer(leftSwipeGesture) let rightSwipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(rightSwipedByUser(_:))) rightSwipeGesture.direction = .right self.pageScrollView.addGestureRecognizer(rightSwipeGesture) And the action is below: @objc func leftSwipedByUser(_ gesture:UISwipeGestureReco