Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Basically other objects on Swift like button or something else have an .isHidden value to hide the object or not. I'm wondering if I can do that with an array.
An array is a data structure and not a graphical element, and as such can't be hidden.
According to the Apple Docs .isHidden is a member of the UIView class, which an array is not.
I think the more interesting question is why would you want to hide an array? Swift has automatic memory management so if the array is no longer needed the System will dispose of it as required.
Iterate over your array and hide each element in turn:
for view in views {
view.isHidden = true
}
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
Can both be used interchangeably or one is preferred over the other in certain situations where one is better?
They are different and not interchangeable.
Like already mentioned in the comments isVisible is not even a part of UIView.
With isHidden you can hide a view, it has a getter and setter.
https://developer.apple.com/documentation/uikit/uiview/1622585-ishidden
isVisible is a property of some classes like NSWindow. It's read only and tells you if the instance is visible on the screen.
https://developer.apple.com/documentation/appkit/nswindow/1419132-isvisible
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have statically placed a single row within UIViewController inside a storyboard. I've specified 1 prototype cell within and set its value programmatically.
But at runtime I see an extra row within the tableview, is there something I can tweak within the Attribute inspector?
My attribute inspector looks like this.
Please try this-
yourTblView.tableFooterView = UIView()
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm new to swift and programming in general. I'm working on an app I didn't write, and am struggling to understand the existing code. To avoid dealing with protocol errors, I want to know if it's possible to reuse the functionality of a UIButtons IBAction on one view and call it's IBAction function in another view. If so How would I go about doing this. Your help is appreciated!
ContextScreen
https://controlc.com/1a91efca
(the button I'm trying to reuse)ContextMenuScreenViewController [a https://controlc.com/90847f01
the original location of the buttonOrderCreateViewController [a https://:controlc.com/3b52eefc
the original location of the refer order button(OrderCreateViewController)
ContextMenuScreenController: where I'd like to reuse the refer order button
Yoy can easily move the logic from IBAction to som function and call this function in IBAction and from any View what you need!
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is it possible to determine if view is dissapearing without additional BOOL field and setting it's value to YES/NO in -viewWillDissapear -viewDidDissapear?
I am trying to determine if view is not dissapearing casued by "back" button (pop to previous controller). Right now I have isNavigationInProgress property that do this for me.
Not sure I understand your question correctly.
However it looks like you are talking about isMovingFromParentViewController, isMovingToParentViewController, isBeingPresented, isBeingPresented and isBeingDismissed properties
These properties allows you to get the cause of -viewWillDissapear and -viewDidDissapear calls.
See more info on Apple site, UIViewController reference
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am trying to create a custom tableview cell
however, all my content inside keeps jumping around
This is how i put the objects in my view
and this is how the view renders during runtime
Why are my labels keep jumping ?
Using auto layout tend to move the objects.
Disable it if you don't really use it and it won't jump.