Posts

Showing posts from February, 2021

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...

#define array object in objective C iOS

 Solution: You can define only the values that contains single element.You cannot be able to define NSArray using define in Objective C. So better you can use the values in local variable.

How to check contains of object in one array in objective C iOS

 Solution: NSArray *arr = @[@1,@2,@3]; int value = 1; if([arr contains:value]) { NSlog("yes it's Available"); } else { NSlog("not Available"); }

Collection NSArrayM was mutated while being enumerated iOS swift

 Problem: While deleting an object from array produces error array was never muted while enumerated. Solution: You can easily get what the error is?. Because it says "array was muted while being enumerated".If you are using one array inside loop if you are deleting one object in the array it will be affect the loop count.So better you can use for each looping.In that count will not be used for enumeration.If ou delete objects it will not affect the loop...

Terminating app due to uncaught exception 'NSGenericException', reason: Collection NSArray was mutated while being enumerated mutablecopy

Problem: Mutable copy the coredata object and use as new object in iOS swift.   Solution: You cannot be able to mutablecopy the coredata object.So better using creating a new object and assign the values from the previous object.