<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi everyone,<div class=""><br class=""></div><div class="">I think we all agree that #selector(...) and #keyPath(...) are great to write safe Swift code when interoperating with these Objective-C patterns.</div><div class=""><br class=""></div><div class="">How complicated would it be to have a similar functionality to write type safe NSPredicates ?</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">class Test {</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; var value: Int = 0</font></div><div class=""><font face="Menlo" class="">}</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">let test = Test()</font></div><div class=""><font face="Menlo" class="">let myPredicate = #predicate(myValue == 3)</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><div class=""><span style="font-family: Menlo;" class="">myPredicate.evaluateWithObject(test) // =&gt; false</span></div></div><div class=""><span style="font-family: Menlo;" class=""><br class=""></span></div><div class=""><font face="Menlo" class="">test.value = 3</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><span style="font-family: Menlo;" class="">myPredicate.evaluateWithObject(test) // =&gt; true</span></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="SFUIText-Regular" class="">Regards,</font></div><div class=""><font face="SFUIText-Regular" class="">Jérôme Alves</font></div></div></body></html>