Questions tagged [superview]

137 questions
2
votes
2 answers

How do I get a UIViewController given a UITextView?

I'm handling code in a UITextViewDelegate. Each function there receives the UITextView instance that received the event, for example: - (void)textViewDidBeginEditing:(UITextView*)textView { } Inside that method however, only given the textView,…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
2
votes
1 answer

Propagate dragging touch to UIScrollView superview

I have been looking to all the other similar topics here, using UIGestureRecognizers, using hitTest:withEvent, pointInside:withEvent: etc. but nothing seems to be ok for what I need to achieve. Basically I have a main view (self.view of a common…
Fabrizio Prosperi
  • 1,398
  • 4
  • 18
  • 32
2
votes
4 answers

How to Insert View in Superview's View? (iOS)

I have the line of code below... How would I modify it to insert the subview in the superview's view named 'foo'? [[self superview] addSubview:copy3];
William LeGate
  • 540
  • 7
  • 18
1
vote
2 answers

How to move UIView outside its SuperView?

So, I have a custom UIView inside a UIScrollView. I am able to detect the touches Events in the customUIView. I am trying to drag the UIView outside the UIScrollView onto a Canvas (UIView). However, when it gets out of bounds from the SrollView, it…
nagendrarp
  • 13
  • 1
  • 4
1
vote
1 answer

How do I call a view controller method from another class in iOS?

I have a toolbar object that inherits from UIView and is a subview of "CanvasView" on the bottom of the screen on an iPad app. Basically I have buttons on this subview that should draw an image onto CanvasView, it's superview. I have tried many…
onetwopunch
  • 3,279
  • 2
  • 29
  • 44
1
vote
0 answers

Not able to call method in superview (although working in other part of app)

I've got a really annoying issue at the moment while trying to create an overlay to provide a greyed out interface when searching and then when it's touched dismiss it. I've adapted some code from another part of my app and to me they are completely…
user397801
1
vote
1 answer

What is called when removing a view from its superview?

Imagine I have a view controller called blueView and another called greenView. I then add greenView.view as a subview of blueView.view. Now suppose that after some user interaction, I'd like to remove greenView.view from blueView.view…
hemlocker
  • 1,012
  • 1
  • 9
  • 24
1
vote
3 answers

How to update Superview from its Subview in iPad?

I have a UISegmentedController i have 3 UIViewControllers Like photos,frames,gallery. I add those 3 Views in Superview Using 'addSubView'. In frames view i have added a subview that name as EditView. In EditView i have done some changes, i want to…
Yuvaraj.M
  • 9,741
  • 16
  • 71
  • 100
1
vote
2 answers

Swift multiple subviews and getting back to original TableView

I have created my own TabView the first tab is always the Home tab which contains a TableView . The other 3 Tabs Search, Menu and Inbox are subviews . I can go from Home to Search then Back to Home and it works Home to Menu then Back to Home and it…
user1591668
  • 2,591
  • 5
  • 41
  • 84
1
vote
2 answers

Could you explain "receiver" and "view - superview" in Swift?

override func draw(_ rect: CGRect) { let size: CGFloat = 20 let currencyLbl = UILabel(frame: CGRect(x: 5, y: (frame.size.height/2) - size, width: size, height: size)) currencyLbl.backgroundColor = #colorLiteral(red: 0.2549019754, green:…
1
vote
0 answers

iOS: Constrain Safe Area to Superview in nib file

I have a nib file that creates a view for my view controller. I want to use the Safe Area Layout Guide, so I checked off that box under the size inspector. However, the safe area (highlighted in blue) clearly doesn't match the height of the view.…
maddie
  • 1,854
  • 4
  • 30
  • 66
1
vote
3 answers

Removing buttons from a view

Is there a way to clear the view of all buttons? My code generates buttons every second, and I made a button that I want to clear them all off the screen. When I tried [brick.removeFromSuperview] (brick being the name of the button), it only deleted…
Chris
  • 7,270
  • 19
  • 66
  • 110
1
vote
2 answers

How to the grab the highest level Superview in iPhone App?

I want to be able to grab the main UIView for the application. So far, I have been calling [[[self.view superview] superview] superview] to traverse up the chain (or down, depending on how you look at it). The problem with this is that it is…
jschmidt
  • 2,898
  • 3
  • 24
  • 27
1
vote
0 answers

Swift in iOS 6 Plus simulator: Custom UIView/ImageView cannot fill the top of the container view

I am trying to create a custom UIView that uses a .xib file, in which a UIImageView was dragged in the xib for displaying pictures. I have the following UIView subclass, however, the custom view/image view cannot fill the very top of the…
TonyW
  • 18,375
  • 42
  • 110
  • 183
1
vote
0 answers

When to implement code to get global coordinate points in subview of a table view before it's displayed?

Here is a visual of what I am working with: image of view hierarchy * I'm looking to put a label titleLabel in the outermost view "UIView" that stays positioned above a subview in the table view cell (In the image, it would be the UIButton). My…
Sean
  • 340
  • 3
  • 11
1 2
3
9 10