On iOS, if a superview’s userInteractionEnabled is NO, then all subviews are disabled as well?

You can override hitTest(_:withEvent:) to ignore the view itself, but still deliver touches to its subviews. class ContainerStackView : UIStackView { override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { let result = super.hitTest(point, with: event) if result == self { return nil } return result } }

Can I get the element by Tag from iOS?

Use the viewWithTag method. e.g. if your button is in your controller’s view and your button’s tag is 100 the following line will return the button: UIButton *button = (UIButton *)[self.view viewWithTag:100]; EDIT: Get view with particular tag in Swift – let view = self.view.viewWithTag(100) If you want to make sure you have the specific … Read more

Swift: Recursively cycle through all subviews to find a specific class and append to an array

Based on Aaron Brager and ullstrm answers Details Xcode 9.1, Swift 4, Xcode Version 10.3 (10G8), Swift 5 Solution extension UIView { class func getAllSubviews<T: UIView>(from parenView: UIView) -> [T] { return parenView.subviews.flatMap { subView -> [T] in var result = getAllSubviews(from: subView) as [T] if let view = subView as? T { result.append(view) } … Read more

What similar functionality method (viewWillAppear) exists on UIView?

How about the following from the UIView reference willMoveToSuperview:, didMoveToSuperview – Implement these methods as needed to track the movement of the current view in your view hierarchy. this will at least tell you when it is added to a view hierarchy but there is no guarantee that the view hierarchy is presented/viewable.

iOS9 popover always points to top-left corner of anchor

I had the exact same problem. I just resolved it by setting sourceRect in prepareForSegue: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { switch segue.identifier { case “Popover Identifier”?: if #available(iOS 9.0, *) { segue.destinationViewController?.popoverPresentationController?.sourceRect = anchorView.bounds } default: break } }

Convert a UIView origin point to its Window coordinate system

It sounds like your not converting between the proper views. A view’s frame is set to the coordinates of it’s superview, not its own internal coordinates, so if you were trying to convert the origin of a view to window coordinates, you would need to use the superview: [[self superview] convertPoint:self.frame.origin toView:theWindow]; However, it is … Read more

Change UIPopoverView background + arrow color

I found the solution. Subclassing is not necessary anymore with iOS8! The background can be accessed and changed like this from within the tableview -> navigation -> popoverPresentationController self.navigationController?.popoverPresentationController?.backgroundColor = UIColor.redColor() More information about this in WWDC session 2014.

Find Frame Coordinates After UIView Transform is Applied (CGAffineTransform)

One thing to keep in mind is that the transform changes the coordinate system, so you will need to be able to convert between the parent ‘view’ and the child (transformed) view. Also, transforms preserve the center of the transformed object but not any of the other coordinates. So you need to calculate things in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)