Skip to content

Commit

Permalink
Fix #200
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamazz committed Nov 27, 2019
1 parent 4dbe248 commit 57fa35e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Demo/PopTip Demo/AutolayoutView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// AutolayoutView.swift
// PopTip Demo
//
// Created by Andrea Mazzini on 27/11/2019.
// Copyright © 2019 Andrea Mazzini. All rights reserved.
//

import Foundation
18 changes: 18 additions & 0 deletions Demo/PopTip Demo/AutolayoutView.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
</view>
</objects>
</document>
3 changes: 2 additions & 1 deletion Source/PopTip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ open class PopTip: UIView {
self.customView?.removeFromSuperview()
self.customView = customView
addSubview(customView)
customView.layoutIfNeeded()
from = frame

show(duration: duration)
Expand Down Expand Up @@ -752,6 +751,8 @@ open class PopTip: UIView {

setNeedsLayout()
performEntranceAnimation {
self.customView?.layoutIfNeeded()

if let tapRemoveGesture = self.tapRemoveGestureRecognizer {
self.containerView?.addGestureRecognizer(tapRemoveGesture)
}
Expand Down

0 comments on commit 57fa35e

Please sign in to comment.