I am working on an app which uses ECSlidingViewController to implement a drawer menu.
I need to keep the menu always open on the home screen but keep it hidden and only open it on swipe when I am on the other views.
Does the lib allow that kind of behaviour ?
Any advice is welcome.
Thank you in advance
I've found the solution (which was quite easy actually)
Opening the sliding menu at startup
self.slidingViewController().anchorTopViewToRightAnimated(true);
Disabling gestures on the menu
self.slidingViewController().panGesture.enabled = false;
(you should set this to true again when you change view and need the menu to respond to gestures)
There is just one problem, I can't make anchorTopViewToRightAnimated work after I change topView.
Any ideas why ?
EDIT:
I'm calling anchorTopViewToRightAnimated in viewDidAppear -> not working (after viewChange)
If I try to call that method on button click it works fine, so it must be that ECSlidingView isn't ready or smthg like that but as there are no notifications or whatsoever I can't know when to call the method.
I could subclass ECSlidingViewController but would rather avoid it if possible
Related
I'm working on a new codebase that has everything laid out in storyboards and I'm trying to implement the new ASAuthorizationAppleIDButton button as part of the new Sign In With Apple feature.
Reading online it looks like I can add a UIButton to the view and then override the class to be ASAuthorizationAppleIDButton. Easy enough. The weird parts comes when I try and wire that button up to an action in the VC. I can't do it. Even if I go the other way and drag from the button to the VC, the action item is missing from the connection menu.
Has anyone had success adding and interacting with this button from a storyboard? I'd prefer not to redo the entire view just because of this one issue.
ASAuthorizationAppleIDButton is not a button but its a control. And this is stated in that way to avoid misuse of this as a button. And only one action is associated with it which cannot be override. The only control you get is to use the delegate method of
didCompleteWithAuthorization & didCompleteWithError.
So if you want to use/include some extra selector or methods. you can add those in these delegate- methods.
I recently try to develop an application in swift and wanted to make a navigation bar which is the same on every single view.
I tried different approaches. The best one so far was a solution from another stack overflow-question you can see here
The solution from Jacob King works for me, but because I am relatively new in Swift, I am concerned if his approach would add a second, third, fourth,... navigation bar every time I navigate between two views, which both inherit the navigation bar? And if that is true, how can I solve this problem?
Thanks for all efforts in advance.
From the looks of the code, he says you would need to declare each ViewController. In his case, when he taps the open search button the code would execute the open search function, so from the looks of it it would not create infinite amounts of navigation bars. Remember in the future after implementing your code you can always build and run your application to test things like these to make sure I’m right. It never hurts to try! - Colin
you have to create a viecontroller class with a navigation bar and then all the viecontrollere you will have to put
miaviewcontroller: viewcontroller_with_bar
I have 2 viewControllers that i switch between using a UIPageController. Everything works fine and the dots switch correctly to the right controller, but when clicked they don't do anything.
I'm using a container view to have the dots in the middle of the screen and using delegation to update them.
Everything is set up using storyboards. If I try to connect value changed it doesn't get touch events, same thing if I try to set the action programmatically.
Don't "use delegation to update them". Implement the data source methods presentationCountForPageViewController: and presentationIndexForPageViewController:, and the UIPageViewController automatically creates a page control where updating and tapping both "just work".
(Otherwise, if you try to use an independent page control, you'll have to implement your own Value Changed event handler for it; it won't do anything by itself.)
I got some troubles making button for open/close leftside menu.
I made a button, but I can not configure it correctly, because I can't recognize whether the left view is open. It can be opened by swipe(special MMDrawer method), so I can't use a regular BOOL variable lika 'isOpen'. Also, I find it difficult to find a property for left view status (open/close).
I was surprised, that noone had trouble like this.
You could use the openSide property of MMDrawerController.
The current open side of the drawer.
Note this value will change as soon as a pan gesture opens a drawer, or when a open/close animation is finished.
As soon as the left view is opened, the value should change to MMDrawerSideLeft.
I am attempting to add a toolbar as an input accessory, and as such have added it via xcode storyboard editor to the view controller (and not within the view). This was as specified in this tutorial(which seems to be written for an earlier version of xcode): reference
My issue: "8.) Now we need to open the toolbar item itself. Double click Toolbar in the document window."
This is no longer valid behavior in Xcode 4.6 it appears, so I ask you: how do I add button items to a toolbar? I would prefer to avoid doing it programmatically (Still reasonably new to xcode development and normally make my GUIs with storyboards) but if I have to, I have to.
Many thanks!
If you're doing what I think you are doing, adding UIBarButtonItems to a UIToolbar, then you simply drag a Bar Button Item out to the toolbar.
However, I would assume that what they mean when they say 'double-click' is not what people normally think of when they think double click. Try double clicking slowly this often does the trick.
Found the issue - it was appearing behind the UIView. However you dont ever need to graphically interact witha toolbar, you can just drag-and-drop controls onto it in the sidebar. If there is a need for more info on this message me or vote up.