-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f3ab84
commit 1167714
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"liveServer.settings.port": 5501 | ||
"liveServer.settings.port": 5502 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import UIKit | ||
|
||
class MainViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { | ||
|
||
// Connect this to your "Add Story" button in Interface Builder | ||
@IBAction func addStoryButtonTapped(_ sender: UIButton) { | ||
let imagePicker = UIImagePickerController() | ||
imagePicker.delegate = self | ||
imagePicker.sourceType = .camera // or .photoLibrary if you prefer | ||
present(imagePicker, animated: true, completion: nil) | ||
} | ||
|
||
// MARK: - UIImagePickerControllerDelegate | ||
|
||
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { | ||
if let image = info[.originalImage] as? UIImage { | ||
// Handle the selected image here, you can save it, process it, or upload it | ||
// You might want to navigate the user to another screen for editing or adding captions | ||
} | ||
picker.dismiss(animated: true, completion: nil) | ||
} | ||
|
||
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { | ||
picker.dismiss(animated: true, completion: nil) | ||
} | ||
} |