uiviewcontroller

How to get UIScrollView vertical direction in Swift?

柔情痞子 提交于 2020-01-09 03:10:29
问题 How can I get the scroll/swipe direction for up/down in a VC? I want to add a UIScrollView or something else in my VC that can see if the user swipes/scrolls up or down and then hide/show a UIView depending if it was an up/down gesture. 回答1: If you use an UIScrollView then you can take benefit from the scrollViewDidScroll: function. You need to save the last position (the contentOffset ) it have and the update it like in the following way: // variable to save the last position visited,

Add a UIView above all, even the navigation bar

与世无争的帅哥 提交于 2020-01-08 18:21:40
问题 I want to display, above any other views, even the navigation bar, a kind of "pop-up" view that looks like this: full screen black background with a 0.5 alpha to see the other UIViewController underneath. a UIView window in the middle with some information, (a calendar if you want to know everything). To do that, I've created a UIViewController that contains the two UIViews (background and window), and I'm trying to display it. I've tried a simple [mySuperVC addSubview:myPopUpVC.view] , but I

Add a UIView above all, even the navigation bar

若如初见. 提交于 2020-01-08 18:20:38
问题 I want to display, above any other views, even the navigation bar, a kind of "pop-up" view that looks like this: full screen black background with a 0.5 alpha to see the other UIViewController underneath. a UIView window in the middle with some information, (a calendar if you want to know everything). To do that, I've created a UIViewController that contains the two UIViews (background and window), and I'm trying to display it. I've tried a simple [mySuperVC addSubview:myPopUpVC.view] , but I

Add a UIView above all, even the navigation bar

回眸只為那壹抹淺笑 提交于 2020-01-08 18:20:11
问题 I want to display, above any other views, even the navigation bar, a kind of "pop-up" view that looks like this: full screen black background with a 0.5 alpha to see the other UIViewController underneath. a UIView window in the middle with some information, (a calendar if you want to know everything). To do that, I've created a UIViewController that contains the two UIViews (background and window), and I'm trying to display it. I've tried a simple [mySuperVC addSubview:myPopUpVC.view] , but I

iOS Adding Menu Causes Crash When Not First View

邮差的信 提交于 2020-01-07 05:48:07
问题 I am using a storyboard to switch between views. Pretty simple, until I try to add ECSlidingViewController. If I add the above slide menu to the first view I call using this: self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Main"]; If I set @"Main" to @"Speakers", the view loads just fine. I get the slide menu and everything. @"Main" also loads just fine. However, if I load @"Main" first like in the code above, then switch views to the one I've designated

Is is possible to communicate between UINavigationController and web page loaded inside UIWebView?

◇◆丶佛笑我妖孽 提交于 2020-01-07 05:35:34
问题 I am new to iOS development. I will try my best to explain my question, please pardon me if you find it silly. I was wondering if one can load a subview in a UINavigationController by clicking a link inside a UIWebView. Explaining it further, let's say there is UINavigationController that has a subview and that subview has a UIWebView called A, and there is another subview(that is not loaded yet) called B. Is is possible to load B (or perform any other native Objective C event) when user taps

Why doesn't setting the value property of this UISlider update its position?

故事扮演 提交于 2020-01-07 04:44:30
问题 ...ViewController.h: @property (nonatomic, strong) IBOutlet UISlider *slider; ...ViewController.m: @synthesize slider; - (void)viewDidLoad { [super viewDidLoad]; ... currentValue = 50; self.slider.value = currentValue; // Do any additional setup after loading the view, typically from a nib. } .xib: The UISlider in my interface is connected to the slider property. Behavior: The slider sits all the way to the right at value 100 when it is supposed to be in the middle. An action I set up

Unable to set property of a UIViewController ios

*爱你&永不变心* 提交于 2020-01-07 03:08:51
问题 I have a view controller which extends UIViewController. @interface MyViewController : UIViewController @property (weak, nonatomic) IBOutlet UITextView *phoneTxt; @property (nonatomic, strong) NSDictionary *data; @end However when I try to set the property of the view controller by: MyViewController *vvc = (MyViewController *)[sb instantiateViewControllerWithIdentifier:@"MyVC"]; vvc.data = data; I get following error: 'NSInvalidArgumentException', reason: '-[UIViewController setData:]:

Unable to set property of a UIViewController ios

青春壹個敷衍的年華 提交于 2020-01-07 03:07:44
问题 I have a view controller which extends UIViewController. @interface MyViewController : UIViewController @property (weak, nonatomic) IBOutlet UITextView *phoneTxt; @property (nonatomic, strong) NSDictionary *data; @end However when I try to set the property of the view controller by: MyViewController *vvc = (MyViewController *)[sb instantiateViewControllerWithIdentifier:@"MyVC"]; vvc.data = data; I get following error: 'NSInvalidArgumentException', reason: '-[UIViewController setData:]:

Passing a delegate to another view controller's delegate

空扰寡人 提交于 2020-01-07 02:59:33
问题 I'm working to build one feature in an app written in Objective-C. I can't post code but I will try to be descriptive with my world. The problem i'm facing is related to delegates. AlphaViewController has ConnectionView as one of its delegate . It helps to add perform some operation on data provided to AlphaViewController and we show output on AlphaViewController's view. When you click on a button in AlphaViewController , I show an UIAlertController . From which I can click a button to open