ios - Keypads showing on different views, causes UIKeyboardLayoutAlignmentView constraint error -


i've had crash report, it's real edge case. launch pin security view applicationwillenterforeground (the feature optional). however, have form sheets use in situations in app.

so pin view added subview on window , keypad presented.

when form sheet showing, appears on top of pin view (which wrong) , action on form sheet causes crash, when showing keypad.

so believe need dismiss form sheets if application resigns / becomes active.

i've looked sending notification form sheet in applicationwillenterforeground, i'll have firstly determine if form sheet visible add method dismiss every form sheet.

this seems lot of work edge case, can suggest alternative approach?

for completeness here's error...

the layout constraints still need update after sending -updateconstraints <_uikeyboardlayoutalignmentview: 0x14e59b790; frame = (0 0; 0 0); userinteractionenabled = no; layer = >. _uikeyboardlayoutalignmentview or 1 of superclasses may have overridden -updateconstraints without calling super. or, may have dirtied layout constraints in middle of updating them. both programming errors.

i've seen this... nsinteralinconsistencyexception - uikeyboardlayoutalignmentview

however, i'd still need end editing in various form sheets, can't access applicationwillenterforeground.

ok, after researching issue discovered needed observe application state. on notification check if various objects load , if so, resignfirstresponder when keyboard shown (aka editing) (i had text field in uialertview), dismiss uialertview , dismiss in view controller used in dialog.

shesh... not simple hoping. although edge case me, figured should fix it.

i found dissmiss alertviews https://github.com/sdarlington/wslviewautodismiss

which save me lot of hassle in simpler scenarios.

apparently since ios4, apple recommends cancelling uialertviews , uiactionsheets when application becomes active.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -