Code cannot be generated for uigetdir because the C standard library does not define any directory operations.
Directory operations are defined by Posix, but MATLAB Coder does not target Posix.
You can use coder.ceval to call Posix directory operations such as opendir() and related functions. You are then stuck presenting the information in some kind of graphical user interface. MATLAB Coder has no built-in support for graphics.