![]() ![]() In viewDidLoad of your ViewController, do this: navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem. Improving on JP Aquino's code for Swift 5 for share action rightBarButtonItem on the Navigation Controller. Refresh the page, check Medium ’s site status, or find something interesting to read. plain, target: self, action: #selector(share(sender:)))Ĭreate the function func share(sender:UIView) Create an Image Slideshow in Swift by Ivano Di Gese Better Programming Write Sign up Sign In 500 Apologies, but something went wrong on our end. On ViewDidLoad navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Share", style. This is how I implemented sharing with Swift 4/5 using a right button on the Navigation Controller. Self.present(activityViewController, animated: true, completion: nil) ,ĪctivityViewController.isModalInPresentation = true In your ViewController.swift, modify the IBAction func share (The function that got created when you connected the button to the view controller. ] as? UIActivityItemsConfigurationReadingĪctivityViewController.excludedActivityTypes = [ Beautiful and high-fidelity widgets for current iOS design language. This line remove the arrow of the popover to show in iPadĪctivityViewController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.downĪctivityViewController.popoverPresentationController?.sourceRect = CGRect(x: 150, y: 150, width: 0, height: 0)ĪctivityViewController.activityItemsConfiguration = [ This lines is for the popover you need to show in iPadĪctivityViewController.popoverPresentationController?.sourceView = (sender as! UIButton) Using the Windows Package Manager: winget install Swift. In PowerPoint just right-click the slide you want assistance with and choose Link to this Slide. (It looks like the old art Apple used for the home button) Youll get a pop-up with all the choices that you can insert into your app. ![]() Open Main.storyboard and click on the View underneath View Controller. Using the official installer: Download the latest package release. Next were going to add some elements to our Main.storyboard. Notice that Windows Package Manager release may be behind the official release. Let activityViewController : UIActivityViewController = UIActivityViewController(ĪctivityItems:, applicationActivities: nil) Swift can be installed through the official installer directly, or using the Windows Package Manager as well. You probably want UIDocumentInteractionController for that. Let image : UIImage = UIImage(named: "your-image-name")! This does not allow you to share text or images to other apps. When this process is complete, you will be able to set up recurring deposits and wire. Let secondActivityItem : NSURL = NSURL(string: "")! Let firstActivityItem = "Description you want." ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |