Posts

Showing posts from March, 2021

Get the bound box for a cgPath with +10 of width and height in swift iOS

 Solution:      let  selectionBox = appenedPath. boundingBox . insetB y (dx:  -10.0 , dy:  -10.0 )

Compare array contains same object iOS swift

 Solution: We had an option that will compare single array with its object's all are equal or different. In that we can use "Set" function like below. Code: let myArrayA = [1,2,3] let myArrayB = [1,1,1] If(Set(myArrayA).count == myArrayA.count) { print("different") } else { print("same") }  If(Set(myArrayB).count == myArrayB.count) { print("different") } else { print("same") }  The first one returns different and the second one returns same...Happy coding....

Copy Nsobject into new one iOS objective C

 Solution: You can use copywithzone function to create new entire nsobject and return it to your other class.You just call the NSObject.copy to get the entire copied object in iOS. If you did before creating this method it will be crashed.If you use the above method you will be easily handle the copy of our nsobject. Objective C: Declare the method in .h file and implement it in .m file to access it in anywhere.. -(id)copyWithZone:(NSZone *)zone { }

ACEDrawingVIew while clear after draw any objects black background object came || Blackbox around draw rect iOS swift

 Solution: In clear if you did aceView background color set to white then that issue will come. In clear you have to do clear the patharray,Undosteps,Redosteps and also clear the background color. You must have to set the backgroundcolor as clear color.After that issue will be resolved