I\'m working on a basic iOS app which supports both portrait and landscape modes. When the iPhone simulator keyboard is open in landscape and I\'m switching the app
There is a library for editing plist files called plistlib. Here is my code:
import plistlib
file_name = ('path/to/com.apple.iphonesimulator.plist')
try:
p = plistlib.readPlist(file_name)
p["ConnectHardwareKeyboard"] = "NO"
plistlib.writePlist(p, file_name)
except:
print("Failure")
This reads the plist file, changes the ConnectHardwareKeyboard value to No and then writes the new file to the same location. This works for me, but let me know if there is a better way to do it. I'm still new at coding.