generated from capacitor-community/.github
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from capacitor-community/feature/enable-ios-pla…
…tform feature: enabled plugin support on iOS platform
- Loading branch information
Showing
23 changed files
with
1,662 additions
and
23 deletions.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'json' | ||
|
||
package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'CapacitorCommunityFileOpener' | ||
s.version = package['version'] | ||
s.summary = package['description'] | ||
s.license = package['license'] | ||
s.homepage = package['repository']['url'] | ||
s.author = package['author'] | ||
s.source = { :git => package['repository']['url'], :tag => s.version.to_s } | ||
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}' | ||
s.ios.deployment_target = '13.0' | ||
s.dependency 'Capacitor' | ||
s.swift_version = '5.1' | ||
end |
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,24 @@ | ||
// | ||
// MimeTypeConverter.swift | ||
// CapacitorCommunityFileOpener | ||
// | ||
// Created by Alex Ryltsov on 19.08.2022. | ||
// | ||
|
||
import Foundation | ||
import MobileCoreServices | ||
|
||
public struct MimeTypeConverter { | ||
|
||
public static func mimeToUti(_ mimeType: String) -> String? { | ||
guard let contentType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, nil) else { return nil } | ||
|
||
return contentType.takeRetainedValue() as String | ||
} | ||
|
||
public static func fileExtensionToUti(_ ext: String) -> String? { | ||
guard let contentType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, ext as CFString, nil) else { return nil } | ||
return contentType.takeRetainedValue() as String | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.