Created
September 28, 2019 20:58
-
-
Save ibejohn818/6b10d119f45edadcf9171afbaaa9e979 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // S3Xfer | |
| // | |
| // Created by John Hardy on 11/17/18. | |
| // Copyright © 2018 John Hardy. All rights reserved. | |
| // | |
| import UIKit | |
| import AWSCore | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view, typically from a nib. | |
| let key = "asdf" | |
| let sec = "asdf" | |
| let bucket = "ios-sdk-uploads" | |
| let creds = AWSStaticCredentialsProvider(accessKey: key, secretKey: sec) | |
| let conf = AWSServiceConfiguration(region: .USWest2, credentialsProvider: creds) | |
| AWSServiceManager.default()?.defaultServiceConfiguration = conf | |
| } | |
| @IBAction func handlePhotos(_ sender: Any) { | |
| if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) { | |
| let photoVC = UIImagePickerController() | |
| photoVC.delegate = self | |
| photoVC.sourceType = .photoLibrary | |
| present(photoVC, animated: true) | |
| } | |
| } | |
| } | |
| extension ViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { | |
| func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { | |
| print(info) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment