ios - Go to new view on change of search bar swift -
i need go new table view on beginning editing of search bar in current view shown in picture below.
so far have created segue per this answer, , used following code in current controller search bar.
declarations:
lazy var searchbar:uisearchbar = uisearchbar(frame: cgrectmake(0, 40, 140, 40))
in viewdidload:
searchbar.delegate = self;
and following function (showsearchresults
id of segue):
func searchbartextdidbeginediting(searchbar: uisearchbar){ self.performseguewithidentifier("showsearchresults", sender: self) }
what want happen new controller appear when click onthe search box, error:
2016-07-28 15:42:25.750 abcapp[7745:3279712] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'receiver (<abcapp.homepageviewcontroller: 0x7b08e910>) has no segue identifier 'showsearchresults'' *** first throw call stack: ----- libc++abi.dylib: terminating uncaught exception of type nsexception
any idea?
Comments
Post a Comment