romaonthego / refrostedviewcontroller Goto Github PK
View Code? Open in Web Editor NEWiOS 7/8 style blurred view controller that appears on top of your view controller.
License: MIT License
iOS 7/8 style blurred view controller that appears on top of your view controller.
License: MIT License
Please see error below :
Resolving dependencies for target `Pods' (iOS 6.0)
REFrostedViewController
.Hello, I am trying to implement the REfrostedviewcontroller (FVC) in only the detail side of the UISplitViewController (SVC). I have tried many things but not able to get it to work.
For a first attempt, I set the detail view of SVC to be the DEMOrootviewcontroller. I got the FVC to be working either from the left side or right side or both sides. However, the "original" detail view (which is a tableVC) was not getting updated. I sent data to this tableVC via a delegate and still the tableVC was not behaving as it used to.
Then, I kept the original configuration i.e. the detail view was the original tableVC. However, in this case, the FVC does not work - the menu does not show up. I noticed that the self.frostedviewcontroller is nil, since the parentVC is the SVC and not the FVC.
There were other trys - were not successful. Is there any way to accomplish the above? Thank you.
Currently when calling setContentViewController
to a new VC, the view does not get updated on-screen. It seems that it assumes you're always modifying an existing UIViewController (in your example a UINavigationController) by replacing the view controllers in its stack.
I'm looking to fully replace the contentViewController then dismiss the menu -- possible?
Right now, I don't see any functionality for animation and changing the UIStatusBar style on menu hide/show. If I am using a black style for the frosted drawer I would prefer a white status bar, however the status bar has to be black for all other view controllers in the app.
UITableView editing is failing when pan gesture is enabled.
Hi,
I have an application that uses the following navigation flow:
When the navigation bar is not translucent, this is acceptable, but this is not working when the bar is translucent because the menu content is under the translucent bar.
Could you make sure (or add a BOOL property to make sure) the menu is always displayed on top of everything?
Anyhow, great control, good job!
A public property should be provided for the REFrostedViewController
class.
Currently, if a keyboard is active when the side menu is invoked then the keyboard remains active whereas a more intuitive behaviour would be to dismiss the keyboard, if possible.
One of the things standing in my way of adopting this control is the fact that the blurred image is static. If the view behind the menu changes, it breaks the whole effect. So I was thinking even just a simple timer that refreshes the blur image every x milliseconds would be a simple way to achieve that. I don't know what the performance hit would be. I've been intending to implement it myself but haven't had the chance so thought I'd suggest it in case you've already considered this.
This control is at once both clever and beautiful, but its programmatic interface leaves a little to be desired, imo. My biggest complaint is how you have to use it. REFrostedViewController is a sublcass of UIViewController, and the demo project implies that it is intended to be subclassed again into another view controller that represents the menu and is then presented from an arbitrary other view controller.
This seems awkward and unintuitive to me, and I still haven't figured out how to properly use a different kind of view controller (UINavigationController, UITableViewController) as the menu.
I think it would be magnitudes easier to use if it were refactored as a container controller (see https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html) and exposed two child view controller properties/setters for the menuViewController and the contentViewController. Then you could simply wire it up to any two existing view controllers (no matter what type they are) and it would just work.
I'd like to limit the width for menus with a direction of left/right, so that (especially on iPads) the menu doesn't end up taking the whole screen.
I figured that I'd have to set limitMenuViewSize
to YES
and set minimumMenuViewSize
to the maximum size.
First, it's a bit confusing to call the property "minimumMenuViewSize" when it describes the "maximum" dimensions of the menu.
Secondly, and more importantly, it's awkward to handle rotation situations properly with the limits enabled. Let's say you set it to something like CGSizeMake(300, 1024)
, the menu will be filling the screen vertically and be 300 points wide. If you rotate the device now, the menu will remain at 1024 and screw up the user experience. The only way to work around this is to manually "fix" the width/height after a rotation - and that wouldn't feel very good.
What I'd like to see is to be able to assign a zero value to either the width or height, so that it limits the size of the menu in one dimension while keeping it properly sized in the other direction.
So for instance, a menu that has a maximum width of 300, but fills the height of the screen, could be defined as follows:
menu.maximumMenuSize = CGSizeMake(300, 0);
Respectively, having the default behaviour would be like this:
menu.maximumMenuSize = CGSizeMake(0, 0); // or CGSizeZero
By respecting the zero value in both directions, it would also allow you to get rid of the limitMenuViewSize
flag at all, which would simplify the API.
When the liveBlur option is on, the image that becomes blurred is completely desaturated. turning liveBlur off solves the problem, except that the blurred image isn't updated everytime the menu is opened so if the things behind the menu have moved, the blurred image is now incorrect.
I have an application that on the didFinishLaunchingWithOptions determines if the rootviewcontroller will be the login or dashboard depending if the user has is authenticated.
If the login screen is presented as soon as the user enters his credentials the dashboard screen needs to show up.
I have a method on my MenuViewController that handles the didselectrow of the table and displays the new selected screen. I did get to call this method from my login screen to display the dashboard but it does nothing.
How can I get to display my dashboard from the login screen?
I did a method on my appDelegate that changes the window rootviewcontroller, I know this is not the correct way is just something to keep my application running in the meanwhile.
When panGesture is enabled, the top controller (has a tableView inside) doesn't scroll up and down properly on same cells (pretty random cells). When this occurs, the menu's pan gesture is triggered instead.
I have also noticed this problem when the Left Menu has a table view.
I have been trying to get it to work for both gestures, but not successful so far.
Several notifications could be provided:
bottom support for sliding from the bottom side? Urgent need thank you!
Do you plan to add support for sliding from the right side?
Using the amazon kindle app you can see the background view darken in real time as the drawer slides out and lighten in real time as the drawer slides in.
With REFrostedViewController the darkening and lightening is performed in a single animation.
To test this, simply tap & hold, and drag the menu the entire way out. Upon releasing you will see the background view darken quickly.
Would there be a way to make this act closer to the amazon kindle app?
How would i Place the whole view controller on the right instead of the left?
How do I change the position of the table view in the side bar. I want to move it up. The code set it was set automatically but I didn't understand that.
Hi~, I'm use your project in my project, I fount a question. When I tap a UITextFiled or UITextView to copy/paste something, a issue comes: "CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update." It's make me trouble, I can't fixed it. If you have free time, please help me. Thank you.
When setting menuViewController
property to a nil value, the app crashes.
This should be allowed if the developer wants to remove the menu from the view hierarchy dynamically at runtime.
This problem is caused by re_screenshot in UIView+REFrostedViewController.h
I've changed the implementation to
UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
And this fixed the problem.
Seems the project was not added.
The issue also exists in your storyboard example.
It only shows up on the iPhone, not the iPad. Run the example. The first VC does not resize.
I am having the same issue. I was thinking it was something to do with my code, but after finding that the issue also exists in the example, I believe something might've been missed. Quite peculiar that the problem is only showing up on the iPhone.
I'm using a UICollectionView inside my VC and a single button. On device rotation, the container rotates but the inner VCs don't resize. Help?
I am trying to set this up using a storyboard layout but I cannot get this to work.
I.e. from the menu controller didSelect... I try the following:
ProfileViewController *profileViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ProfileViewController"];;
self.navigationController.viewControllers = @[profileViewController];
This crashes with:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
Hi ..
Can I disable reloading view controllers while it changing from the menu ?
When the menu view controller is changed later at runtime, the new menu assigned is not the one displayed.
I attempted to fix this with #58 but that created different bugs.
The issue:
At attempted to fake a fix by setting the drawer's animation duration to 0 but that still created a little bit of a stutter. I'm not sure what the right answer for this is.
Edit: I suppose I should ask--is there already a mechanism in place that would let me do this from the frostedViewController?
I'm using REFrostedViewControllerStoryboards and have a tableviewcontroller for the "home" controller. On the menu I have a sort option, but when I tap on it the tableviewcontroller viewdidload is always called like it is a new controller instantiation each time. How do I use the menu, but keep the "home" controller in a state that I can sort, etc.
Thanks
When you launch the app for the first time and try swipe your finger across the screen, the frosted view controller comes out with a jerk.
This does not happen hence after. It works well second time onwards ...
Touch gestures (tap, swipe) do not work properly when using a UITabBarController and the orientation changes to landscape. Here is how to reproduce the problem:
Have the ability to set two menu controllers; one for each side instead of just a single view controller.
Is there anyway to highlight which is the current ViewController selected from the menu?
the startpoint of the menu is 0,0 of the total screen. the status bar is covering the first 20px. with >= 7.0 the behavior is just fine but not below. looking for a solution, but maybe you already know? thanks
Steps to reproduce:
Expected behaviour:
The menu should not do the opening slide animation again. It should stay still when already open.
I've noticed that in some cases, the viewWillAppear: method gets called twice in the child view controller. This usually happens when dismissing a modal view presented by the content view controller.
This may in some cases create unexpected side effects if some logics are to run in viewWillAppear:
A temporary workaround is to add the following three methods,
-(BOOL)shouldAutomaticallyForwardAppearanceMethods{
return NO;
}
-(BOOL)shouldAutomaticallyForwardRotationMethods{
return NO;
}
-(BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers{
return NO;
}
to REFrostedViewController.
Not sure if this is the best solution. Any ideas?
Edit: This actually breaks the codes somehow. Tapping on the menu icon doesn't always bring out the menu as the result..
Is there a pattern in place to expand the frosted view to take up the entire width of the screen?
For example, if I put a search bar in the side menu, I'd like the menu to expand to fill the screen while the search is in focus, and then shrink back do to "most" of the screen when the search is not in focus.
I tried manually adjusting the menuSize but I'm unsure of how to make the menu resize while it is open.
Thanks!
For some design reasons, I need the background of the cells to appear white when I click on them, I basically do it by adding those lines in the method cellForRowAtIndexPath in the DemoMenuViewController:
UIImageView *bgView = [[UIImageView alloc]initWithFrame:cell.frame];
bgView.backgroundColor = [UIColor whiteColor];
cell.selectedBackgroundView = bgView;
There is like an offset between the actual cell and the white background when the menu is hiding. Hardly noticeable, I would say it's a minor issue but I'll see what I can do and work on it :)
Hi Roman,
I've tried this library on the iphone 4 with ios7 running, and found a small interesting issue.
liveBlur mode depends now on ios version, but I believe that on older devices (iphone 4) this blur is turned off for better performance. So, by default, I get this picture (below).
Manually setting liveBlur to NO helps.
You might want to reflect this issue in the documentation, or elsewhere.
Thanks for your work. :)
The default behaviour of REFrostedViewController seems to have changed between iOS 7.0 and 7.1. In 7.0, live updating is enabled by default, while in 7.1 it is disabled. You can still get live updating in the latter case by setting the liveBlur
property of REFrostedViewController
to YES
, but it might be a good idea to explicitly make this the default to avoid inconsistent behaviour between OS versions.
For example I have left REFrostedViewController.
With standard parameters.
If I drag menu to the right - it resize yourself but not content.
If it possible to disable this gestures without disable anything else or enable resize content? I prefer second way :)
I have 3 View Controllers in my storyboard....Root, Menu & Content.
Prior to adding this menu, the Content would rotate fine on my iPad (basically just a collection view and a navbar).
After adding this control (and the Root & Menu controllers), the screen rotates fine, but the Content controller does NOT rotate, leaving the navbar title not centered, and the sizing of the collection view doesn't change (to allow more columns on landscape).
Manual installation says "All you need to do is drop REFrostedViewController files into your project", but you actually need to link against the Accelerate framework for it to build.
The app crashes when a menu method is called and no menu is set.
The view controller should simply ignore these calls if no menu is set.
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.