ergoon / rgpageviewcontroller Goto Github PK
View Code? Open in Web Editor NEWA custom UIPageViewController written in Swift
License: MIT License
A custom UIPageViewController written in Swift
License: MIT License
target 'Project' do
use_frameworks!
pod 'RxSwift'
pod 'RxCocoa'
pod 'RxAlamofire'
pod 'NVActivityIndicatorView'
pod 'RGPageViewController'
end
When I run pod install
, it gives me the error :
Cocoa Pods - [!] Unable to find a specification for
RGPageViewController
I have RGPageViewController in NavigationController. It is working as expected. However, the bottom border line is missing from Navigation Bar when user opens a view controller from the RGPageViewController. I am not sure if this is related with RGPageViewController.
It seems that barTop no fit for me ,I ignore by adding a debug flag
let yeshen_debug = false
"
var barTop: CGFloat = tabbarTop
// remove hairline image in navigation bar if attached to top
if let navController = navigationController where !navController.navigationBar.hidden {
barTop = tabbarTop + 44
navController.navigationBar.hideHairline()
}
"
if(yeshen_debug){ barTop = 0 }
Hello,
I have a problem that sometimes, the viewControllerForPageAtIndex function is being called twice when a new page is loaded. This prevents me from calling javascript on the current web view.
2015-02-02 20:15:46.899 微事通[7571:208641] The view hierarchy is not prepared for the constraint: <NSLayoutConstraint:0x7f947bd87220 V:[_UILayoutGuide:0x7f947bd700f0]-(0)-[UIToolbar:0x7f947bf22390]>
When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView _viewHierarchyUnpreparedForConstraint:] to debug.
2015-02-02 20:15:46.900 微事通[7571:208641] *** Assertion failure in -[UIView _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/NSLayoutConstraint_UIKitAdditions.m:560
2015-02-02 20:15:46.903 微事通[7571:208641] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Impossible to set up layout with view hierarchy unprepared for constraint.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107483f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109478bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000107483d9a +[NSException raise:format:arguments:] + 106
3 Foundation 0x0000000107b5e5df -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 UIKit 0x000000010883acf2 __120-[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:]_block_invoke_2 + 177
5 UIKit 0x000000010883abe7 -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 377
6 UIKit 0x000000010883aea4 -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:] + 30
7 UIKit 0x000000010883afcc -[UIView(UIConstraintBasedLayout) _tryToAddConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 243
8 UIKit 0x000000010883b30b __50-[UIView(UIConstraintBasedLayout) addConstraints:]_block_invoke + 188
9 Foundation 0x0000000107ae7d6e -[NSISEngine withBehaviors:performModifications:] + 155
10 UIKit 0x000000010883b240 -[UIView(UIConstraintBasedLayout) addConstraints:] + 263
11 微事通 0x0000000107134cad TFCX11DkqqBDbtsAb20RGPageViewController14layoutSubviewsfS0_FT_T + 10301
12 微事通 0x000000010713239c TFCX11DkqqBDbtsAb20RGPageViewController22viewWillLayoutSubviewsfS0_FT_T + 60
13 微事通 0x00000001071323d2 TToFCX11DkqqBDbtsAb20RGPageViewController22viewWillLayoutSubviewsfS0_FT_T + 34
14 UIKit 0x00000001082398da -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 368
15 QuartzCore 0x000000010804bde8 -[CALayer layoutSublayers] + 150
16 QuartzCore 0x0000000108040a0e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
17 UIKit 0x000000010822d847 -[UIView(Hierarchy) layoutBelowIfNeeded] + 611
18 UIKit 0x0000000108321f06 -[UITabBarController _layoutViewController:] + 500
19 UIKit 0x0000000108322014 -[UITabBarController _wrapperViewForViewController:] + 252
20 UIKit 0x0000000108328e92 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 378
21 UIKit 0x0000000108325069 -[UITabBarController _setSelectedViewController:] + 311
22 UIKit 0x00000001082315ce +[UIView(Animation) performWithoutAnimation:] + 65
23 UIKit 0x0000000108322106 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 221
24 UIKit 0x0000000108322dfe -[UITabBarController viewWillAppear:] + 121
25 UIKit 0x00000001082e9821 -[UIViewController _setViewAppearState:isAnimating:] + 487
26 UIKit 0x00000001082c3cd8 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 567
27 UIKit 0x00000001081e3331 _applyBlockToCFArrayCopiedToStack + 314
28 UIKit 0x00000001081e31ab _afterCACommitHandler + 516
29 CoreFoundation 0x00000001073b8dc7 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
30 CoreFoundation 0x00000001073b8d20 __CFRunLoopDoObservers + 368
31 CoreFoundation 0x00000001073aeb53 __CFRunLoopRun + 1123
32 CoreFoundation 0x00000001073ae486 CFRunLoopRunSpecific + 470
33 GraphicsServices 0x000000010c1679f0 GSEventRunModal + 161
34 UIKit 0x00000001081c0420 UIApplicationMain + 1282
35 微事通 0x000000010715ad3e top_level_code + 78
36 微事通 0x000000010715ad7a main + 42
37 libdyld.dylib 0x0000000109c52145 start + 1
38 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Is there a way I can center the tabs to have equal widths. My tabs are only 2 displayed at the top
i want to set current index to tab 2 for the first time launch the app.
How to remove bounces effect?
As suggested in "Install" section of Readme, I just copy RGPageViewController.swift file in my project.
Unfortunately there are a lot of compile errors, first at line 142:
self.view.addConstraints(constraints)
"Cannot invoke 'addContraints' with an argument list of type '(NSMutableArray!)'"
Other errors are all where you use "as" with the error:
" 'Any object' is not convertible to .... :did you mean to use 'as!' to force downcast?"
Not sure if anyone else has had this issue but I've just tested one of my applications with xCode 9 beta and iOS 11 beta and all of a sudden the tabbar will not slide and I am not able to select any of the other tabs.
This is a awesome lib and thank you for that , Can you tell how to add navigationItem.rightBarButtonItem in UIViewController i have try adding rightButton in UIViewController but it will not showed in my UI, but when i add bar button on RGPageViewController it showed perfectly can you tell me how to add button from my UIViewContorller ? because it need to access the content of my UIViewController when button clicked
Does anyone have this working well? It seems to not be consistent, instead of switching views at bottom of list it switches sometimes before. Sometimes it does not switch at all. I believe this is because the two gestures (ScrollView down/up swipe) and PageView are conflicting.
Hi,
above mentioned problem presents itself when adding:
func pageViewController(_ pageViewController: RGPageViewController, willChangePageTo index: Int, fromIndex from: Int) { print("Will change page") }
I inserted it into your example and it wasn't called either.
How to change Y position of Tab bar , any delegate method for that?
hi, thx for this implementation and as title, how to reload data ?
App is crashing on iOS 11 and below but working perfectly fine on iOS 12 using xcode 11.
Collectionview Cell is being returned nil in iOS 11 on dequeCell withIdentifier.
Error overriding touchesBegan, touchesMoved, touchesEnded
"Error overriding method with selector 'touchesMoved:
withEvent' has incompatible type.... "
Hi. How to add bottom border to tabView? (https://cloud.githubusercontent.com/assets/7591019/10017028/08d2c8bc-614d-11e5-9d8e-dda731d874ce.png)
First of all, thanks for sharing your pager with us...Unfortunately I am having problem when using your library.
When I applied this example with UITabBarController, there are some issue.
1. View Between Pager Tab and TabBarItem can't scroll to down completely.
2. This issue may be related to view controller constraints inside pager and tabbar. Can't tell for sure yet. But, please take a look
If you don't mind, updating example project with UITabBarController and TopBar support is appreciated. So, I can check if I am doing anything wrong.
Best Regards
This is a awesome lib and thank you for that , Can you tell how to add navigationItem.rightBarButtonItem in UIViewController i have try adding rightButton in UIViewController but it will not showed in my UI, but when i add bar button on RGPageViewController it showed perfectly can you tell me how to add button from my UIViewContorller ? because it need to access the content of my UIViewController when button clicked
This was just a request for your example project update because it only show using it with Single View Controller inside Pager.
So, how do we use it for different UIViewController?
Any Help?
Hello,
How to present an alert view from my content view controller ? When I perform alertView.show()
I got this error in the console:
Attempt to present <UIAlertController: 0x7fb321cdba20> on <_UIAlertShimPresentingViewController: 0x7fb321c68390> whose view is not in the window hierarchy!
Thanks for your help
if i use your code like this :
let cv = MainViewController()
window!.rootViewController = UINavigationController(rootViewController: cv)
view look some bugs.
https://puu.sh/ubORP/9ec2e07cec.png
From the look of this image, Tab Items are on left side with same tab spacing...it will be better if all 6 tabs are show properly like UITabBarController rotation on tabitems.
Just an advice my friend....
Thanks for creating such beautiful library.
Hello,
I used your awesome project in my app but the tab bar hide a part of my table view. How to fix that ?
Thanks
Hi I'm using RGPageViewController with multiple tabs and its working good
But when I try to use it with only 1 tab its freezing in the below line
tabScrollView.layoutIfNeeded()
Do you know how can I fix that?
I add UITableiViewController to Example's storyboard
code change below
` func pageViewController(_ pageViewController: RGPageViewController, viewControllerForPageAt index: Int) -> UIViewController? {
if (movies.count == 0) || (index >= movies.count) {
return nil
}
// Create a new view controller and pass suitable data.
let dataViewController = storyboard!.instantiateViewController(withIdentifier: "tableView") as! UITableViewController
//dataViewController.movieData = movies[index]
return dataViewController
}`
First of all,its the first library which can use dynamic tab and dynamic content for each tab without need to initiate view controllers manually like other library do.You just use one controller and change data according to each index.Yeah pretty smart one.Thanks for your hard work...
But,I really do have some problem.If you have some time,can you fix it?
When rotating the device,it appear like that..
@eRGoon
Hi,
I want to show next viewcontroller's some part in the current viewcontroller so that user can know that he can swipe to go through different viewcontrollers.
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.