An electronic device (401, 1401, 1501, 1601) comprising: a sensor; a touch screen; and a processor configured to: activate a first area (447, 1447, 1450) corresponding to at least a part of the touch screen for determining whether a cover device (470, 1480, 1580, 1670) mounted to the electronic device (401, 1401, 1501, 1601) opens or closes, and determine whether the cover device (470, 1480, 1580, 1670) opens or closes based on a touch input corresponding to a specific pattern included in the cover device (470, 1480, 1580, 1670) sensed through the activated first area (447, 1447, 1450) of the touch screen and based on information on whether the cover device (470, 1480, 1580, 1670) is in proximity to the electronic device (401, 1401, 1501, 1601), sensed through the sensor; and where further, in determining whether the cover device (470, 1480, 1580, 1670) opens or closes, the processor is configured to account for whether the cover device is tilted with respect to the electronic device (401, 1401, 1501, 1601) in accordance with whether the touch input received in the first area (447, 1447, 1450) corresponds to the specific pattern being tilted. a sensor; a touch screen; and a processor configured to: activate a first area (447, 1447, 1450) corresponding to at least a part of the touch screen for determining whether a cover device (470, 1480, 1580, 1670) mounted to the electronic device (401, 1401, 1501, 1601) opens or closes, and determine whether the cover device (470, 1480, 1580, 1670) opens or closes based on a touch input corresponding to a specific pattern included in the cover device (470, 1480, 1580, 1670) sensed through the activated first area (447, 1447, 1450) of the touch screen and based on information on whether the cover device (470, 1480, 1580, 1670) is in proximity to the electronic device (401, 1401, 1501, 1601), sensed through the sensor; and where further, in determining whether the cover device (470, 1480, 1580, 1670) opens or closes, the processor is configured to account for whether the cover device is tilted with respect to the electronic device (401, 1401, 1501, 1601) in accordance with whether the touch input received in the first area (447, 1447, 1450) corresponds to the specific pattern being tilted. activate a first area (447, 1447, 1450) corresponding to at least a part of the touch screen for determining whether a cover device (470, 1480, 1580, 1670) mounted to the electronic device (401, 1401, 1501, 1601) opens or closes, and determine whether the cover device (470, 1480, 1580, 1670) opens or closes based on a touch input corresponding to a specific pattern included in the cover device (470, 1480, 1580, 1670) sensed through the activated first area (447, 1447, 1450) of the touch screen and based on information on whether the cover device (470, 1480, 1580, 1670) is in proximity to the electronic device (401, 1401, 1501, 1601), sensed through the sensor; and where further, in determining whether the cover device (470, 1480, 1580, 1670) opens or closes, the processor is configured to account for whether the cover device is tilted with respect to the electronic device (401, 1401, 1501, 1601) in accordance with whether the touch input received in the first area (447, 1447, 1450) corresponds to the specific pattern being tilted.