Posts

button title after image swift iOS || Align button title before button image iOS swift

 Solution: You can align the text in front of the button then you can set the image is possible like below:       cell. button . semanticC ontentAttribute  =  UIApplication . shared           . userInterfaceLayoutDirection  == . rightToLeft  ? . forceLeftToRight  : . forceRightToLeft

Take screenshot in iOS simulator

 Solution: You can easily take screenshots in the simulator.Just open the simulator and click command+S it will take screenshot in your simulator. Captured screenshot will be saved in the desktop on our Mac.

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

Use zoom and touch gesture in a single View iOS swift

 Solution: You can use touch gesture as well as pan gesture in a single view.Scroll view used for zoom then you can just add one line that will say pan gesture for 2taps required. You can add pan gesture with two touches in scrollView with number of taps required = 2.Then if you touch with single finger it will act as touch.If you use two fingers then it will act as pan gesture...