Patent attributes
An image forming apparatus includes a first moving member moving between a first position which is a position not in contact with a recording material and a second position which is a position in contact with the recording material, and a second moving member positioned in a third position in a state where an attachable/detachable unit is not attached to an apparatus main body and in a fourth position in a state where the attachable/detachable unit is attached to the apparatus main body. An optical sensor includes a light-emitting portion and a light-receiving portion, and a flag member moves between a transmission position and a light-shielding position and moves in conjunction with movement of the first moving member from the first position to the second position and with a movement of the second moving member from the third position to the fourth position.