Closed Sweeper777 closed 8 years ago
Have you done any experiments with this?
What could be changed to make this work? Because I don't normally use storyboards I don't have good ideas to fix this.
Which view is the superview of EZLoadindActivity? You should set the superview of EZLoadingActivity to be the current view controller's view
In that case when you are loading something, and the view changes behind, there are bugs and weird stuff happening. If you can catch them and fix them then feel free to send a pull request
I fixed it! Since I am quite new to github, I don't know how to create a Pull Request. I'll tell you where to change.
In EZLoadingActivity.swift line 108:
center = CGPoint(x: UIScreen.mainScreen().bounds.midX, y: UIScreen.mainScreen().bounds.midY)
Change the above line to
center = CGPoint(x: topMostController!.view.bounds.midX, y: topMostController!.view.bounds.midY)
And it should work on modally presented view controllers now. For the master detail views, I haven't found a solution yet.
I forgot to mention, the midX
in the above code comes from the midX
implementation in EZSwiftExtensions.
Oh, you just go inside the file and click edit, then click the big button at bottom to send a pull request.
Will this affect normal loading activities? Which aren't presented modally?
Just in case you didn't get the notification for pull requests.
Thanks 👍
I tried to present an
EZLoadingActivity
in a Form Sheet view controller and it is off centred. It appears at about the bottom left corner of the form sheet. It isn't centred either when it is in a master-detail view controller.To reproduce, create a view controller A in the storyboard. Add a button that triggers a segue like this:
Connect the segue to view controller B.
In view controller B
viewDidLoad
, show the EZLoadingActivity.I think this is due to showing the view in the
window
. Can you do something about it so that it always appears centered in the current view controller?