Post

Replies

Boosts

Views

Activity

Save UIImage with CATransform3D applied
I have a 3х3 Matrix which I need to apply to UIImage and save it in Documents folder. I successfully converted the 3x3 Matrix (represented as [[Double]]) to CATrasform3D and then I have broken my head with trying to figure out how to apply it to UIImage. The only property where I can I apply it is UIView(or UIImageView in case with working with UIImage) transform property. But it has nothing to do with UIImage itself. I can't save the UIImage from transformed the UIImageView with all the transformations. And all the CoreGraphic methods (like concatenate for CGContext) only work with affine transformations which not suits for me. Please give me a hint what direction I should look. Does Apple has native methods or I have to use 3rd party frameworks for this functionality?
1
0
391
Aug ’24
Getting String representation of Swift ReferenceWritableKeyPath is failed (returns pointer instead of type)
I have a Product class inherited from Realm Object: @objc class Product: Object { @Persisted(primaryKey: true) var id: String = "" @Persisted var externalId: String? @Persisted var name: String? } I try to write a universal method for objects update which takes dictionary with keyPaths and values and update object with this Realm method: func setValue(_ value: Any?, forKey key: String) This is a computed variable for getting String representation of KeyPath: fileprivate extension KeyPath { var asString: String { let wholeString = String(describing: self) let dropLeading = "\\" + String(describing: Root.self) + "." let keyPathString = "\(wholeString.dropFirst(dropLeading.count))" return keyPathString } } And it's perfectly works during debug mode, but when I build an app with Release scheme instead of "Product.name" it returns something like "\Product.<computed 0x000000010c51ed18 (Bool)> and the app crashed trying to set value for this keypath. If anyone has idea how to fix this, it would be really appreciated.
1
0
381
Sep ’23
Exception 'NSJSONReadingAssumeTopLevelDictionary and NSJSONReadingAllowFragments cannot be set at the same time'
After upgrading an Xcode to 13.0 version and recompiling my app with it on a device I started getting this exception: libc++abi: terminating with uncaught exception of type NSException dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspectionDYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSJSONReadingAssumeTopLevelDictionary and NSJSONReadingAllowFragments cannot be set at the same time' terminating with uncaught exception of type NSException It seems that the problem is with the new option topLevelDictionaryAssume added in JSONSerialization.ReadingOptions, available only for ios15. What I've tried: I've checked all places where I had .allowFragments and replaced it with topLevelDictionaryAssume. It didn't help. Any advice would be appreciated.
2
0
503
Sep ’21
tab(⇥) button in Xcode 12.4 doesn't work
I've faced some really weird problem in Xcode. In one of my projects in some specific git branch, when I tap 'tab'(⇥) button it doesn't work. In other projects or another git brach of the project it works fine. What I tried: Restarted xcode Restarted Macbook Cleaned derived data Cleaned build folder Deleted project and cloned it again from remote repository Deleted xcode and reinstalled it again Updated xcproject to recommended settings Nothing has helped. I also had Xcode 11 installed. And it was crashing, when I pressed tab button in the project in that branch. I deleted it and it also didn't helper My suppose is I've broken some project settings during merge and solving conflicts, that somehow affected tab button behaviour. I don't know where to start research to fix it. Any help would be really appreciated.
0
2
397
Mar ’21