File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,11 +144,7 @@ - (void)setDateStringTextFieldText
144144- (void )setDateFieldVisibility
145145{
146146 // Only show the date field on iPad devices as the date is never shown on iPhone devices.
147- // Note: Trait collections can't be used here as not all iPhones are compact.
148- // Note: Also, getenv() needs to be used instead of uname() to get the device information on the simulator.
149-
150- NSString *deviceName = [NSString stringWithCString: getenv (" SIMULATOR_MODEL_IDENTIFIER" ) encoding: NSUTF8StringEncoding];
151- BOOL dateFieldHidden = [deviceName rangeOfString: @" iPad" ].location == NSNotFound ;
147+ BOOL dateFieldHidden = UIDevice.currentDevice .userInterfaceIdiom != UIUserInterfaceIdiomPad;
152148 self.dateStringLabel .hidden = dateFieldHidden;
153149 self.dateStringTextField .hidden = dateFieldHidden;
154150}
You can’t perform that action at this time.
0 commit comments