Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
493 views
in Technique[技术] by (71.8m points)

ios6 - Exclude AirDrop and Add to Reading List from apps build with iOS 6 SDK

I have a UIActivityViewController in my iOS 6 app, I am pushing an update but I'm not yet compiling it with iOS 7 SDK.

Is there any way to disable Add to Reading List and AirDrop in my UIActivityViewController in iOS7 without recompiling with iOS 7 SDK?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

excludedActivityTypes is a valid property in iOS 6.0 and above, so you can leverage that. The constants you need (UIActivityTypeAddToReadingList and UIActivityTypeAirDrop) are not available so what you can do is use their literal values (most likely the same as the variable name) until you recompile with the iOS 7 SDK (Which I suggest you do. It is not likely that Apple would change a constant value but it is better programming practice to use the variable instead of its literal). I imagine these values would be ignored in iOS 6.x and not cause any problems since any UIActivity can define its own name so the system has no way of validating a given type. It most likely will just add them to an internal ignore list.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...