Indicate if view dissapearing [closed] - ios

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

Related

What is the difference between view.isHidden vs view.isVisible? [closed]

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

Is it possible to call an IBAction UIButton from another view? [closed]

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!

Is there a .isHidden function for an array? [closed]

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
}

Spacing between two barButtons in Navigation Bar-ios [closed]

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
iOS
I have three right bar buttons items in my navigation Bar.
I want to change the default spacing between them to zero, so that all the buttons stick to each other?
You can try adding a spacer (UIBarButtonSystemItemFixedSpace) with a negative value. See this answer for more details.
Another approach could be using a custom item with a smaller size than its content then allowing drawing outside out of its bounds using UIView.clipToBounds property.

trying to arrange items in tableview cell- and they keep jumping [closed]

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.

Resources