Develop a coded solution for iOS app

$50

$50 Upwork 技术与编程 海外
743天前

详细信息

I am trying to copy a photo image to paste to Instagram Stories as the background image, and in parallel, copy a string, to manually paste thereafter via the Instagram Stories Link feature. I have developed a workaround solution that works, but lacks in reliability. I've appended it below. For example, if the Instagram mobile app had already been closed, then my workaround won't work. In addition, there are times when a prompt to "Allow Paste" pops up prior to pasting to Instagram, and in those instances, the delay again causes the workaround to fail. I have seen this is request is possible in examining the "NGL" iOS app, and am wondering how I might able to replicate their share behavior. The deliverable is this coded solution in Swift. My workaround (I had to replace bracket with parentheses in order to paste into job description): func presentToIG(with instagramUrlScheme: URL, _ pngImage: Data) ( let pasteboardItems = [["com.instagram.sharedSticker.backgroundImage": pngImage]] let pasteboardOptions: [UIPasteboard.OptionsKey: Any] = [.expirationDate: Date().addingTimeInterval(60 * 5)] UIPasteboard.general.setItems(pasteboardItems, options: pasteboardOptions) UIApplication.shared.open(urlScheme, options: [:]) ( isDone in if isDone ( DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.8) ( UIPasteboard.general.string = urlLinkString ) ) ) )

免责声明

该外包需求信息来源于站外平台,本站仅提供公开信息部分字段展示与订阅服务,更多请查看免责声明

关注公众号,不定期副业成功案例分享
关注公众号

不定期副业成功案例分享

领先一步获取最新的外包任务吗?

立即订阅

类似推荐