First and foremost, the invisible ink view is inside a private framework, and using private frameworks will cause your app to be rejected in the App Store reviewing process. Still, for the community's sake, here's your answer (I'm sorry I got it to you in Obj-C, I'll try and come back later to update it to Swift):
You need to go around using dlopen to load the ChatKit framework manually in your app:
dlopen("/System/Library/PrivateFrameworks/ChatKit.framework/ChatKit", RTLD_LAZY);
// or use RTLD_NOW if you need it loaded immediately
Then, instantiate a CKInvisibleInkImageEffectView using NSClassFromString:
id invisibleInk = [[NSClassFromString(@"CKInvisibleInkImageEffectView") alloc] initWithFrame: yourFrame];
[invisibleInk performSelector:@selector(setImage:) withObject: yourUIImage];
//You likely want to put the InvisibleInkView right over an UIImageView containing the very same image
That should do the trick for you. Remember to actually add the InvisibleInk view wherever you want using yourView.addSubview(invisibleInk)
, and have fun.