UIPasteboard doesn't work in iOS9 Xcode7.0

心已入冬 提交于 2020-01-03 03:11:15

问题



i want to update my app to make compatible of iOS9.UIPasteboard's methods ware working perfectly till iOS8 but when i run in iOS9 there is no response from UIPasteboard. i mean to say, i'm not getting string or url or images. i read Apple'S Developer Document but can't find something useful.to get string from UIPasteboard i use following method..

id data;
        data = [UIPasteboard generalPasteboard].image;
        if(!data){
            data = [UIPasteboard generalPasteboard].string;
            if(!data){
                data = [UIPasteboard generalPasteboard].URL;
                if(!data){

                }else{
                    NSLog(@"\nLast Copied URL:[%@]",data);
                }
            }else{
                NSLog(@"\nLast Copied Text:[%@]",data);
            }
        }else{
            NSLog(@"\nImage Copied");
        }

any Guidance will be appreciated.
EDIT:
see screenshot when i copy text from browser

来源:https://stackoverflow.com/questions/33075125/uipasteboard-doesnt-work-in-ios9-xcode7-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!