All Questions
Tagged with objective-c uiview
5,998
questions
0
votes
1
answer
44
views
Inserting subview into view where I've added subviews and sublayers
I have the following set-up of CAShapeLayers and UIViews attached to a UIView:
[self.layer addSublayer:self.shapeLayer1];
if (someCase)
{
[self.layer addSublayer:self.shapeLayerOptional];
}
[...
0
votes
1
answer
29
views
Having trouble converting point that's on a rotated view with a (0, .5) anchor point
I have the following view set up:
Where the anchor point for V3 is (0, .5) and it can be rotated by a UIPanGestureRecognizer that's attached to V4. I'm trying to translate a point on V4 to V1s ...
0
votes
1
answer
50
views
Why are the margins of the root view and a subview with the same frame different?
I am simply trying to create a colored border along the margins of two subviews, one of which is defined in ViewController and the other in a UIView subclass. Both are subviews of the root view. I ...
1
vote
1
answer
83
views
Is there a way to convert Objective-C CATransition animation into Swift?
I'm working on outdated & unfinished project with migrating Objective-C code to Swift.
Trying to recreate UIView+stateTransition .h and .m files into Swift without any luck yet. If somebody has ...
0
votes
0
answers
392
views
Why do safeAreaInsets return 0 for the root view of the main view controller?
I have an app with a single view controller.
This code:
NSLog(@"%@", NSStringFromUIEdgeInsets(self.view.safeAreaInsets));
Logs this:
{0, 0, 0, 0}
Apple documentation states:
For the view ...
0
votes
1
answer
342
views
Detecting visibility percentage of a UIView in iOS views
I need to find out whether a target UIView object is visible on the screen. From my research, it looks like the consensus is to check if the window property of UIView object is the keyWindow. But this ...
0
votes
1
answer
163
views
How do I add both shadow and rounded corners to a UIVisualEffectView?
I'm using a container for elements which I'd like for it to be blurred. In order to add rounded corners I modified the layer while for the shadow I created a second view named containerShadow and ...
0
votes
1
answer
504
views
How to get the URL of current wkwebview that was opened in a new tab?
I have a WkWebview that opens a child WkWebview in a new tab. I am trying to display the URL of the current webview to the user at the top in the navigation bar. I'm able to achieve this using the ...
1
vote
0
answers
159
views
I need to move and rotate view around point in the screen with pan gesture
I want to make the view rotate and move around the center of the screen.
Here is visual representation of what I want to achieve. Image
And my current solution:
@objc func circleMoved(_ gesture: ...
0
votes
1
answer
1k
views
UIButton title text color change
I have a UIButton in a custom UIView. In the view, I have a function setDisabled:(BOOL)disabled which is called when I want to change the appearance of the UIView.
\\ Method 1
- (void) setDisabled:(...
0
votes
1
answer
112
views
Overlay a smaller rectangle on a UIImage
I want to overlay a rectangle within an image. This code below currently works but it returns a rect with a thin frame. I cant change the rect frame width. One way to return a custom rect with thicker ...
0
votes
1
answer
174
views
How do I hide the suggestion bar on iOS 15?
I have on OpenGL window that is also used for text input when a text element is clicked in our engine
@interface MyGLView : UIView <UIKeyInput, UITextInput, UITextInputTraits>
Whenever this ...
0
votes
2
answers
89
views
How to add uiviews vertically (not horizontally) using cgrect with a loop objective c
I have been trying to add uiviews vertically and not horizontally (in other words in a column and not in a row) but I don't think I understand the code properly. I can change and alter things and I ...
0
votes
1
answer
632
views
UIButton in a custom UIView is not being triggered when tapped upon
I've placed a UIButton inside a custom UIView, CustomButtonView. The UIButton is not responding to tap/click events, and its appropriate selector method is not being triggered. Here's my code below; ...
2
votes
2
answers
1k
views
UIView hidden is not getting set
I have a UIView subclass that is added as an arranged subview of a UIStackView. Depending on the data in the model, I want to either hide or show the arranged subview (called myView), but the problem ...