iOS: How to Detect subview position around view - ios

I have a Label named "Lable_Match" (in self.view)
and a UIView(in self.view).
In that View there are 1000+ labels.
and view is move using touch move method. and When user move View and he touch end that time check view subview lable is on the "Lable_Match" if any one lable is on this so the check text are same or not.

I believe you want to use this method:
[self.view convertRect:self.label.frame fromView:self.view.subview];
from this post: How to get the frame of a view inside another view?
This will give you the adjusted position of the label form your list of 1000+ labels. You can then compare that to the label of Label_match , then compare their text

In response to your question my question is there any way to find the location of your label. If you have the fixed location for label then you can match current taped area and the label area and find the text. Or if you have a fixed sized label you can manipulate it and able to get the label text

Related

UITextView scrollRangeToVisible make range visible appear at the top

I am currently using UITextView. When I use scrollRangeToVisible it works but it brings the range to the bottom of the screen. How can I bring this range to the top of the screen. TLDR: UITextview method scrollRangeToVisible brings the characters of interest to bottom of view. I want it to come to top of view. How can I do this? Thank you
One approach is to:
find the bounding box of the range you want at the top
if it's below the current top line, add the height of the text view
then call .scrollRectToVisible()
You also need some error and bounds checking. I put together an extension you can try out if you wish: https://gist.github.com/DonMag/19daac863553c51725a56f0bc3296076

Expandable view and text

I'm trying to create an iOS app and I want something like the pics below which when I tap the down arrow, the text and view expand.
I have no idea how it would be possible or even what should I call it.
Expanded one:
Edit:
StoryBoard:
There is a view for Video player top and a ScrollView down which contains an image and a tableview. what i want is that put the above feature(2 pics above) instead of that image. and scroll all image and tableview up to be behind of video player view
Using Autolaout you extend the height of your textview based on content size and your view
You need self sizing cell with tableview automatic dimension you can find tutorial for that
in label set number of lines 2 and line break mode to truncate tail initially ,
on tap of button action you need to set number of line 0 and line break mode world wrap , and use beginUpdate and endUpdate tableview
You have to add action (selector) to the button and in it you have to modify the frame and properties of containting view. Please post some code/storyboard for detailed answer.

How to show dynamic label on image view programmatically in Swift 2

I have a view controller which contains 5 image views which I connected them to a class which controls the functions and actions for them! but I need to show dynamic UI Label on them, in the right bottom corner of each one, but don't know how to do that.
This is my current view controller:
But I want to make it look like this:
UPDATE :
My problem in Xcode if I try to add the label view in the story board it adds the label after image view not on it:
I managed to recreate your problem - and I found a solution!
If you add an empty UIView first, you can add the image and the label to that view.
You end up with a stack of UIView, each one containing an image and a label, and you can position the label anywhere you want within the UIView

PageControl placing the marker in the position I want ios 9

I am creating a screen of an application that contains inside a custom cell one pageControll. It is already working properly but by default his marker comes down the contentView. How can I make the marker in the position I say? In case a little but within the above contentView
this is my screen:
I can think of two possible solutions.
Instead of adding the pageControl to the the cell's content view, add it instead as a child of the red view you have there.
In interface build add a constraint between the bottom of the content view and the pageControl.
Either should achieve the result you're looking for, if I understand you correctly.

Custom UIbutton down part does not recognize touchup inside

I created a custom UIbutton and placed it onto a view which shows certain information about a package.I want the whole area to be touchable as button that was my starting point.THe problem is that only the upper half of the custom button is touchable and the down part is ignored.I set the background color to a solid one and the frame seems to be ok.
UPDATE: If i add the same custom button to superview it seems to be ok but the coordinates are not right in this case.I need to convert the coordinates of the subview to super view.
After struggling so many hours i figured out that my outer frame was smaller than it was supposed to be.

Resources