Skip to content

Commit

Permalink
Merge pull request #2 from andregrillo/master
Browse files Browse the repository at this point in the history
Updated to MABS6.*
  • Loading branch information
agoncalvesos authored Jun 5, 2020
2 parents b620354 + 12d05a1 commit bb85c9d
Show file tree
Hide file tree
Showing 53 changed files with 779 additions and 60 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/*
!node_modules/q
!node_modules/child_process
!node_modules/child_process
.DS_Store
5 changes: 5 additions & 0 deletions node_modules/xcode/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions node_modules/xcode/RELEASENOTES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 62 additions & 23 deletions node_modules/xcode/lib/pbxProject.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions node_modules/xcode/lib/pbxWriter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions node_modules/xcode/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
<param name="ios-package" value="ImageEditorPlugin" />
</feature>
</config-file>
<dependency url="https://github.com/agoncalvesos/cordova-plugin-add-swift-support" id="cordova-plugin-add-swift-support"/>
<!--
<dependency url="https://github.com/agoncalvesos/cordova-plugin-add-swift-support" commit="513e43f94ae94ad609d49f24e7dca23a4c358095" id="cordova-plugin-add-swift-support"/>
<framework src="iOSPhotoEditor" type="podspec" embed="true" />
<framework src="iOSPhotoEditor" type="podspec" />-->

<source-file src="src/ios/ImageEditorPlugin.swift" />
<!-- <podspec>
<config>
Expand All @@ -23,9 +28,11 @@
<pods use-frameworks="true">
<pod name="iOSPhotoEditor" />
</pods>
</podspec>-->
<framework src="src/ios/libs/OSPhotoEditor/OSPhotoEditor.framework" target-dir="lib" framework="true" />
</podspec>
<framework src="src/libs/OSPhotoEditor/OSPhotoEditor.framework" target-dir="lib" framework="true" />-->
<framework src="src/ios/libs/OSPhotoEditor/OSPhotoEditor.framework" embed="true" custom="true" />

</platform>
<platform name="android">
<config-file parent="/*" target="res/xml/config.xml">
Expand Down
10 changes: 5 additions & 5 deletions src/ios/ImageEditorPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import OSPhotoEditor
func editImage(_ command: CDVInvokedUrlCommand) {
self.callbackId = command.callbackId;

var sourceType = UIImagePickerControllerSourceType.photoLibrary;
var sourceType = UIImagePickerController.SourceType.photoLibrary;
let sourceTypeString = command.arguments[0] as? String;
if ( sourceTypeString == "sourcetype" ){
if (command.arguments[1] as? String == "camera"){
Expand Down Expand Up @@ -101,10 +101,10 @@ extension ImageEditorPlugin: PhotoEditorDelegate {

extension ImageEditorPlugin: UIImagePickerControllerDelegate, UINavigationControllerDelegate {

func imagePickerController(_ picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [String : Any]) {
func imagePickerController(_ picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {

guard let image = info[UIImagePickerControllerOriginalImage] as? UIImage else {
guard let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else {
picker.dismiss(animated: true, completion: nil)
return
}
Expand All @@ -123,7 +123,7 @@ extension UIImage {

public func toBase64() -> String? {
let imageData: Data?
imageData = UIImageJPEGRepresentation(self, 1)//compression
imageData = self.jpegData(compressionQuality: 1)//compression
return imageData?.base64EncodedString()
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit bb85c9d

Please sign in to comment.