uiviewcontroller

iOS - UIButton on UIPageControl not working

淺唱寂寞╮ 提交于 2019-12-31 05:22:05
问题 I am using UIPageControl as indicator between different page (view controllers) of my application. In each of the view controllers, I need to have a different button on the left corner on the UIPageControl. If I place a UIButton at that position on each of the view controllers, I see it on the UIPageControl but the buttons do not respond to the touch event. Is there something I am missing? Or is there an alternative to do this? Thanks. 回答1: I guess the page control and the view controller

Setting UIApplication statusBarHidden to YES does not work in iOS 7

折月煮酒 提交于 2019-12-31 02:01:10
问题 I've been using [UIApplication sharedApplication].statusBarHidden = YES; to hide the status bar when users enter specific UIViewControllers in iOS 6 and it worked great. In iOS 7 however it still shows a translucent overlay. 回答1: EDITED::: that is new updated answer : Do in plist file "View controller-based status bar appearance" to NO and write code [UIApplication sharedApplication].statusBarHidden = YES; in appdelegate 回答2: What worked for me was setting "Status bar is initially hidden" to

Swift popToRoot not working

心已入冬 提交于 2019-12-31 00:30:06
问题 This highlighted line is where should popToRoot proceed, after a successful registration it should redirect to Root View Controller. For some reason it's not working for me, literally nothing happens, not even error. I tried with self.navigationController?.popToRootViewControllerAnimated(true) 回答1: You don't appear to be using navigation controller at all, so I'd wager that self.navigationController is nil . You could use an unwind segue. So in your root view controller, add a method like so:

Present View Controller Over current tabBarController with NavigationController

江枫思渺然 提交于 2019-12-30 19:00:24
问题 When presenting or dismissing VC, I do not want to keep hiding and showing tabBar because it creates a poor user experience. Instead, I want present the next VC straight over the tab bar such that when I dismiss the nextVC by dragging slowly from left to right, I can see the tabBar hidden behind the view (As shown in image below) Note, my app has two tabs with two VCs(VCA,VCB) associated to it. Both VC also have navigation bar embedded. VCA segues to VCA1 and VCB segues to VCB1. At the moment

Why is self.view.subviews an empty array in viewDidLoad?

試著忘記壹切 提交于 2019-12-30 18:33:13
问题 I've created a bunch of UI elements using Interface Builder and hooked them up to my ViewController using IBOutlets. However, when I try to iterate through self.view.subviews in my ViewController's viewDidLoad method, I find that the subviews array is empty. ViewController.xib : UIView | - UILabel - UIButton - // ... more stuff - UIToolbar ViewController.m : #import "ViewController.h" @interface ViewController () // Interface elements @property IBOutlet UILabel *titleLabel; @property IBOutlet

Iphone UIButton not working in nested UIViews

拈花ヽ惹草 提交于 2019-12-30 17:23:05
问题 This is so damn simple im sure! Im missing something and im exhausted from trying to fix it. hopefully someone can help. The Button in CharacterView.m works but the button nested down in CharacterMale.m does not. I'm not using IB everything is done progmatically. What would cause one button to work and other not? ///////////////////////////////////////////////////////////////////////////////// CharacterController.m //////////////////////////////////////////////////////////////////////////////

Use entered text from view in other view in Swift (Xcode 6)

天涯浪子 提交于 2019-12-30 10:25:54
问题 I am almost completely new to Swift and Xcode so excuse my lack of knowledge in this field. At the moment I have a view controller with a label in it. I want to add a view before that, with a text field in which a user enters a name, the app then goes to the second view with the label in which the name entered by the user is placed on the label. I know this is very basic, but I cannot find any good solutions since I'm not quite sure what to search for. If anyone has a piece of code or a link

How to send and receive data in Today extensions

删除回忆录丶 提交于 2019-12-30 10:14:27
问题 I want to develop an app for iOS that have a Widget for notification center, but I don't know how I should send and receive data (pass data) between View Controller and And Today Extension. I tried to use structs, but it doesn't work, and also I used app groups but I don't want to use this method. let shared = NSUserDefaults(suiteName: "group.Demo.Share-Extension-Demo.mahdi") shared?.setObject("Hello", forKey: "kkk") 回答1: Apart from NSUserDefaults, you can use the NSNotificationCenter to send

How to access data from one view to another view?

元气小坏坏 提交于 2019-12-30 07:42:34
问题 I have an UITabBarController with two tabs: UINavigationController OptionsViewController : UIViewController How can I reach data (ie. UILabel.text ) set in OptionsViewController , in a new added modal View which has been invoked from UINavigationController ? Edit1: Scenario: After launching app I select the second tab bar called "Options" where I fill up a textField. The label is set to value from textField . Next I select first tab bar called "Main" where I have a button. I click the button

How to access data from one view to another view?

随声附和 提交于 2019-12-30 07:41:31
问题 I have an UITabBarController with two tabs: UINavigationController OptionsViewController : UIViewController How can I reach data (ie. UILabel.text ) set in OptionsViewController , in a new added modal View which has been invoked from UINavigationController ? Edit1: Scenario: After launching app I select the second tab bar called "Options" where I fill up a textField. The label is set to value from textField . Next I select first tab bar called "Main" where I have a button. I click the button