Help us understand the problem. What is going on with this article?

フワっとしたPopupを出してみる。

More than 1 year has passed since last update.

見た目

movie.gif

(gifだとわかりづらい…orz)

処理抜粋

PopupViewController.swift
    override func viewDidLoad() {
        super.viewDidLoad()

        self.baseViewWidthConstraint.constant = 0
        self.baseViewHeightConstraint.constant = 0
        self.view.layoutIfNeeded()
    }

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        self.baseViewWidthConstraint.constant = 250
        self.baseViewHeightConstraint.constant = 250

        UIView.animate(withDuration: 1.2, delay: 0.3, usingSpringWithDamping: 0.6, initialSpringVelocity: 10, options: .curveEaseOut, animations: { () -> Void in

            self.baseView.alpha = 1.0
            self.view.layoutIfNeeded()

        }, completion: nil)
    }

・AutoLayoutでPopupのサイズをいじってアニメーションを実現しています。
・高さも変えるため、baseViewのHeightの制約のPriorityを下げています。

コードはこちらです。

https://github.com/tony1224/PopupAnimationSample

もう少し滑らかでくっきりとバウンドがわかるような処理にしたい(´・ω・`)

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした