简体   繁体   中英

Does subclassing a UIAlertView to accept user input go against the HIG?

I've seen a lot of answers out on SO detailing how to accept user input on an UIAlertView, but I was wondering if doing so violates Apple's iOS Human Interface Guidelines.

According to the section on Alerts ,

Avoid creating unnecessary alerts... [alerts] are usually unnecessary if they... [a]sk for confirmation of user-initiated actions. To get confirmation for an action the user initiated, even a potentially risky action such as deleting a contact, you should use an action sheet.

However, I wish to use a Alert view to prompt the user to input a password, much like Apple does when a user purchases an app from App Store.

I'd appreciate any input!

As Apple does this in many locations, I don't think it violates the HIG. I can also say this with confidence because of something I learned at WWDC. I would advise you to look on the Apple Developer site under the prerelease documentation for iOS 5 on UIAlertView (unfortunately I can't say more on here since it is under NDA).

I can see how they would reject it for something their own app does such as login using an undocumented API (as said by Karithikeyan). However I think the odd alert view here and there can't harm your chances of getting in the store.(Used for input)

(To give an example of how I have used the Alert View differently without problems). I sometimes use the alert view for my loading indicators. I get the alerview and put the indicator inside while it spins, and I have had no problems doing this either.

My advice: use it with restraint but do not fear rejection. If it seems right to use, it probably is.

As far as i know ,

i dont think so that apple will reject bcoz my one of my app released in the appstore for using a UIAlertView to prompt user to enter login Credentials ,

my vote is you can go with it!

be sure you are using addTextFieldWithValue this method to create your alertview bz this is undocumented API , you will get rejected.

so better use normal methods to design your alert!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM