Postsurgical intraocular lens (IOL) infection caused by pathogenic bacteria can result in blindness and often requires a secondary operation to replace the contaminated lens. The incorporation of an antibacterial property onto the IOL surface can prevent bacterial infection and postoperative endophthalmitis. This study describes a polymeric nanopillar array (NPA) integrated onto an IOL, which captures and eradicates the bacteria by rupturing the bacterial membrane. This is accomplished by changing the behavior of the elastic nanopillars using bending, restoration, and antibacterial surface modification. The combination of the polymer coating and NPA dimensions can decrease the adhesivity of corneal endothelial cells and posterior capsule opacification without causing cytotoxicity. An ionic antibacterial polymer layer is introduced onto an NPA using an initiated chemical vapor deposition process. This improves bacterial membrane rupture efficiency by increasing the interactions between the bacteria and nanopillars and damages the bacterial membrane using quaternary ammonium compounds. The newly developed ionic polymer-coated NPA exceeds 99% antibacterial efficiency againstStaphylococcus aureus, which is achieved through topological and physicochemical surface modification. Thus, this paper provides a novel, efficient strategy to prevent postoperative complications related to bacteria contamination of IOL after cataract surgery.