CGRect rect = new CGRect(0, 0, 100, 100); CGPoint point = new CGPoint(50, 50); bool containsPoint = rect.Contains(point); // containsPoint = true
CGRect rect1 = new CGRect(0, 0, 100, 100); CGRect rect2 = new CGRect(25, 25, 50, 50); bool containsRect = rect1.Contains(rect2); // containsRect = trueIn this example, two CGRect objects are created. The first rectangle has origin (0, 0) and size (100, 100), while the second rectangle has origin (25, 25) and size (50, 50). The Contains method is called on the first CGRect object with the second CGRect object passed as an argument. The boolean result is true because the second rectangle is completely inside the first rectangle. Package library: In order to use the CGRect Contains method in C# development for iOS, you would use the Core Graphics framework. This framework provides low-level graphics capabilities for iOS applications. The CGRect structure is part of this framework, and the Contains method is a function provided by the structure.