I Want the text color of UIlabel to be yellow on dark mode and black in normal mode.
You can define a Color Sets in your asset catalog with different variants for light and dark mode:
You can then use the color in Interface Builder or code with UIColor(named: "Color")
.
It will also adapt to appearance changes automatically.