This file contains 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
// NoteViewController.swift | |
// The Media Menu Video Button Action | |
//.. | |
override func prepare(for segue: UIStoryboardSegue, sender: Any!) { | |
noteTitle = titleTextField.text! | |
// noteID = Current Note Unique ID |
This file contains 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
// VideosViewController.swift | |
} // END CLASS VideosViewController | |
// Helper function inserted by Swift migrator. | |
fileprivate func convertFromUIImagePickerControllerInfoKeyDictionary(_ input: [UIImagePickerController.InfoKey: Any]) -> [String: Any] { | |
return Dictionary(uniqueKeysWithValues: input.map {key, value in (key.rawValue, value)}) | |
} | |
// Helper function inserted by Swift migrator. |
This file contains 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
// VideosViewController.swift | |
func noCamera() { | |
let alertVC = PMAlertController(title: "Oooops!", description: "Your \(iDevice) Has No Camera!", image: UIImage(named: "CameraX"), style: .alert) | |
alertVC.addAction(PMAlertAction(title: "OK", style: .default, action: { () in | |
print("Do Nothing") | |
})) | |
This file contains 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
// VideosViewController.swift | |
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { | |
// Local variable inserted by Swift migrator. | |
let info = convertFromUIImagePickerControllerInfoKeyDictionary(info) | |
self.addVideoCofirmationMessageLabel.alpha = 1 | |
self.addVideoCofirmationMessageLabel.textColor = UIColor(red: 20/255, green: 180/255, blue: 24/255, alpha: 1.0) | |
self.addVideoCofirmationMessageLabel.text = "Saved Video of: " + self.videosNoteTitle |
This file contains 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
// VideosViewControler.swift | |
// Stop video if view is dismissed (back to Source view). | |
override func viewDidDisappear(_ animated: Bool) { | |
super.viewDidDisappear(animated) | |
if let videoPlayer = self.videoPlayer { | |
videoPlayer.player!.pause() | |
} |
This file contains 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
// VideosViewController.swift | |
@IBAction func playVideoButtonAction(_ sender: AnyObject) { | |
playVideo() | |
} | |
func playVideo() { | |
if videoURLText != nil { | |
This file contains 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
// VideosViewControlle.swift | |
@IBAction func viewLibraryButtonAction(_ sender: AnyObject) { | |
// Display Photo Library | |
videoController.sourceType = UIImagePickerController.SourceType.photoLibrary | |
videoController.mediaTypes = [kUTTypeMovie as String] | |
videoController.delegate = self | |
present(videoController, animated: true, completion: nil) |
This file contains 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
// VideosViewController.swift | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.navigationController?.navigationBar.tintColor = .white | |
if videosNoteTitle != nil { | |
addVideoToLabel.text = videosNoteTitle } | |
else { |
This file contains 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
// VideosViewController.swift | |
import UIKit | |
import CoreData | |
import MobileCoreServices | |
import AVKit | |
import Photos | |
class VideosViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { | |
NewerOlder