Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // 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)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement