daisuke310vvv / popupcontroller Goto Github PK
View Code? Open in Web Editor NEWPopupController is a controller for showing temporary popup view.
License: MIT License
PopupController is a controller for showing temporary popup view.
License: MIT License
I did exactly like your example but when i tap the button to call the popup it crash right here
in PopupSBVC.swift
class func instance() -> PopupSBVC {
let storyboard = UIStoryboard(name: "PopupSBVC", bundle: nil)
return storyboard.instantiateInitialViewController() as! PopupSBVC
}
in my Viewcontroller.swift
@IBAction func rightBtnClicked(sender: AnyObject) {
PopupController
.create(self)
.show(PopupSBVC.instance())
}
I had the storyboard name PopupSBVC
please help, many thanks
Hi Hansome Boy,
I want ask you a question, if I want to make the background view which is the dark view cover the navigation bar as well as tabbar , how should I do?
many thks if you can tell me.
Hello,
i have tried to setup the custom property dismissWhenTaps but i can not to set it in false. Putting true or false, the behavior is always like true.
NIce work...
Hello, please add swift 3 code thanks!
CocoaPods
and Carthage
are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.
It would be cool to add the Manual installation guide in your README.md
. You can take a look at my iOS Readme Template to see how you can do it.
I use self.dismiss function but the parent viewcontroller is dismissed
support swift 4.2
I've got some trouble with iOS, there is like a value is substract of inset top in the scrollView.
I've find a way to figure out with an hardcoding value to add on contentInsetTop in updateLayouts, but it is so ugly. This substract exactly the height of navigationBar (64)
Something like that could be better
func updateLayouts() {
guard let child = self.childViewControllers.last as? PopupContentViewController else { return }
popupView.frame.size = child.sizeForPopup(self, size: maximumSize, showingKeyboard: isShowingKeyboard)
popupView.frame.origin.x = layout.origin(popupView).x
baseScrollView.frame = view.frame
var toAdd: CGFloat = 0
if #available(iOS 11, *) {
// Find a way to get the weird bottom inset of scrollView in iOS 11 (navigation bar height)
}
baseScrollView.contentInset.top = layout.origin(popupView).y + toAdd
defaultContentOffset.y = -baseScrollView.contentInset.top
}
Set the new attribute on scrollView available in iOS doesnt solve my problem
self.baseScrollView.contentInsetAdjustmentBehavior = .never
Here's two screenshot, one made in iOS 10, other in iOS 11. You can see the difference of inset.
How can i dismiss the popup when the user taps a button inside the viewcontroller.
i tried dismis but not working as its not a viewcontrollers method, its a popupcontroller method.
I found a small bug in your ReadMe usage Instructions.
PopupController .create(self) .show(AnyPopupViewController())
Since you don't have a .show() method (anymore) I think it should be
PopupController .create(self) .presentPopupController(AnyViewController()) { (void) in //code }
BlackFilter(alpha: CGFloat) not work.
in slide up animation there is
self.baseScrollView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.7)
instead
self.baseScrollView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(alpha)
If it has, copy PopupController.swift to my project is the right way?
My config pgsql timezone: UTC
My create function:
create function ufn_test_date() returns json
language plpgsql
as
$$
declare
data_return json;
begin
drop table if exists temp_date;
create temp table temp_date as
select now();
-----------------------------------------------------------------------------------------------
select json_agg(t)
from (select sdc.*from temp_date sdc) t
into data_return;
return data_return;
-----------------------------------------------------------------------------------------------
end
$$;
========NOW RUN IN pg-client========
select ufn_test_date();
return: [{"now":"2021-09-21T10:49:53.272196+00:00"}]
2 time values are 4 hours apart, pls help me :(
Is anyone getting swift compiler warning, that says
Result of call to 'show' is unused
App crashes due to this:
return storyboard.instantiateInitialViewController() as! PopupView
I am showing a PopUp when I click on the cell in TableView
. PopUp disappears when I tap outside the PopUp view. But the problem is, I have a tabBar having 3 tabs at the the bottom of the screen and when I tap on the tabBar, the viewController related to clicked tab appears. Since alpha is 0.7 the background appears to be slightly dark, but the items in background are clickable when we tap outside PopUp view.
I don't want that to happen. When I tap anywhere outside the PopUp it should just disappear and I should be able to the TableView
properly. Please fix this issue.
Hey,
How should I pass data form my parentViewController to the popViewController?
Hi,
I am trying to run it on an iPad split view, like Settings. However, when the origin is calculated, it seems that the width of the iPad screen is used size: CGSize = UIScreen.main.bounds.size
, rather than the width of the view, which would be much narrower. This causes the popup to go off screen.
I have found this enum (below) which seems responsible for the origin of the popup but I can't see how I could configure the behaviour to work with the split view, as the customisation only seems to accept the actual enum value (top, center, bottom). Do you maybe have any pointers?
Thanks!
`
public enum PopupLayout {
case top, center, bottom
func origin(_ view: UIView, size: CGSize = UIScreen.main.bounds.size) -> CGPoint {
switch self {
case .top: return CGPoint(x: (size.width - view.frame.width) / 2, y: 0)
case .center: return CGPoint(x: (size.width - view.frame.width) / 2, y: (size.height - view.frame.height) / 2)
case .bottom: return CGPoint(x: (size.width - view.frame.width) / 2, y: size.height - view.frame.height)
}
}
}
`
it was when the version with carthage
Hi,
I have clean xib which is just an empty view with sizeForPopup function inside. I am trying to call presentPopupController from my UITableViewController as follow:
let anyPopupViewController = DetailNewsViewController()
let popupController = PopupController.create(self)
popupController.presentPopupController(anyPopupViewController, completion: nil)
But the the TableView is scrollable and in result popup view will stay on that area and will scroll away without disappearing.
Is there anyway to call PopupView from a higher level like NavigationBar and not the UITableViewController? I am guessing this would solve the TableView or I might be mistaking.
Update: I fotgot to mention, if I scroll down in tableView and tap on any row the popup view will show up at the top not in the current view.
Many thanks,
my code:
var closeHandler: (() -> Void)?`` @IBAction func ____btnCloseAction(sender: AnyObject) { closeHandler?() }
is now action but popup not close
How to set frame y of Popview when keyboard is show?
Thank you!
Is it possible to pass data to DemoPopupViewController like a string or nsdata?
How to get popView frame size from inside PopupController?
Your delegate variable and protocol is private, make it public...
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.