├── Documentation
└── Images
│ ├── mock-1.png
│ ├── mock-2.png
│ └── mock-3.png
├── Embed YouTube Videos
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Preview Content
│ └── Preview Assets.xcassets
│ │ └── Contents.json
├── UIApplication+Ext.swift
├── WebView.swift
├── String+Ext.swift
├── AppDelegate.swift
├── Base.lproj
│ └── LaunchScreen.storyboard
├── Info.plist
├── SceneDelegate.swift
└── ContentView.swift
├── Embed YouTube Videos.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcuserdata
│ └── leonardobilia.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── project.pbxproj
├── README.md
├── LICENSE
└── .gitignore
/Documentation/Images/mock-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonardobilia/Embed-YouTube-Videos/HEAD/Documentation/Images/mock-1.png
--------------------------------------------------------------------------------
/Documentation/Images/mock-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonardobilia/Embed-YouTube-Videos/HEAD/Documentation/Images/mock-2.png
--------------------------------------------------------------------------------
/Documentation/Images/mock-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/leonardobilia/Embed-YouTube-Videos/HEAD/Documentation/Images/mock-3.png
--------------------------------------------------------------------------------
/Embed YouTube Videos/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/Preview Content/Preview Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Embed YouTube Videos.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Embed YouTube Videos
2 | Simple SwiftUI app concept to exemplify how to extract the YouTube video code from all sort of URLs and Embed it using WebKit.
3 |
4 | 
5 | 
6 | 
7 |
--------------------------------------------------------------------------------
/Embed YouTube Videos.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/UIApplication+Ext.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIApplication+Ext.swift
3 | // Embed YouTube Videos
4 | //
5 | // Created by Leonardo Bilia on 30/03/20.
6 | // Copyright © 2020 Leonardo Bilia. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | extension UIApplication {
12 |
13 | func endEditing() {
14 | sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Embed YouTube Videos.xcodeproj/xcuserdata/leonardobilia.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Embed YouTube Videos.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/WebView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WebView.swift
3 | // Embed YouTube Videos
4 | //
5 | // Created by Leonardo Bilia on 30/03/20.
6 | // Copyright © 2020 Leonardo Bilia. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 | import WebKit
11 |
12 | struct WebView: UIViewRepresentable {
13 |
14 | let videoID: String
15 |
16 | func makeUIView(context: Context) -> WKWebView {
17 | return WKWebView()
18 | }
19 |
20 | func updateUIView(_ uiView: WKWebView, context: Context) {
21 | guard let youTubeURL = URL(string:"https://www.youtube.com/embed/\(videoID)") else { return }
22 | uiView.scrollView.isScrollEnabled = false
23 | uiView.load(URLRequest(url: youTubeURL))
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/String+Ext.swift:
--------------------------------------------------------------------------------
1 | //
2 | // String+Ext.swift
3 | // Embed YouTube Videos
4 | //
5 | // Created by Leonardo Bilia on 30/03/20.
6 | // Copyright © 2020 Leonardo Bilia. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | extension String {
12 |
13 | func extractYoutubeID() -> String? {
14 | let pattern = "((?<=(v|V)/)|(?<=be/)|(?<=(\\?|\\&)v=)|(?<=embed/))([\\w-]++)"
15 |
16 | let regex = try? NSRegularExpression(pattern: pattern, options: .caseInsensitive)
17 | let range = NSRange(location: 0, length: self.count)
18 |
19 | guard let result = regex?.firstMatch(in: self, range: range) else { return nil }
20 | return (self as NSString).substring(with: result.range)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Leonardo Bilia
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Embed YouTube Videos
4 | //
5 | // Created by Leonardo Bilia on 30/03/20.
6 | // Copyright © 2020 Leonardo Bilia. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 |
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 |
21 | // MARK: UISceneSession Lifecycle
22 |
23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24 | // Called when a new scene session is being created.
25 | // Use this method to select a configuration to create the new scene with.
26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
27 | }
28 |
29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
30 | // Called when the user discards a scene session.
31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
33 | }
34 |
35 |
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "scale" : "1x",
46 | "size" : "20x20"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "scale" : "2x",
51 | "size" : "20x20"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "scale" : "1x",
56 | "size" : "29x29"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "29x29"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "scale" : "1x",
66 | "size" : "40x40"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "scale" : "2x",
71 | "size" : "40x40"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "scale" : "1x",
76 | "size" : "76x76"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "scale" : "2x",
81 | "size" : "76x76"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "scale" : "2x",
86 | "size" : "83.5x83.5"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "scale" : "1x",
91 | "size" : "1024x1024"
92 | }
93 | ],
94 | "info" : {
95 | "author" : "xcode",
96 | "version" : 1
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 | UISceneConfigurations
28 |
29 | UIWindowSceneSessionRoleApplication
30 |
31 |
32 | UISceneConfigurationName
33 | Default Configuration
34 | UISceneDelegateClassName
35 | $(PRODUCT_MODULE_NAME).SceneDelegate
36 |
37 |
38 |
39 |
40 | UILaunchStoryboardName
41 | LaunchScreen
42 | UIRequiredDeviceCapabilities
43 |
44 | armv7
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | UISupportedInterfaceOrientations~ipad
53 |
54 | UIInterfaceOrientationPortrait
55 | UIInterfaceOrientationPortraitUpsideDown
56 | UIInterfaceOrientationLandscapeLeft
57 | UIInterfaceOrientationLandscapeRight
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## User settings
6 | xcuserdata/
7 |
8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
9 | *.xcscmblueprint
10 | *.xccheckout
11 |
12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
13 | build/
14 | DerivedData/
15 | *.moved-aside
16 | *.pbxuser
17 | !default.pbxuser
18 | *.mode1v3
19 | !default.mode1v3
20 | *.mode2v3
21 | !default.mode2v3
22 | *.perspectivev3
23 | !default.perspectivev3
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 |
28 | ## App packaging
29 | *.ipa
30 | *.dSYM.zip
31 | *.dSYM
32 |
33 | ## Playgrounds
34 | timeline.xctimeline
35 | playground.xcworkspace
36 |
37 | # Swift Package Manager
38 | #
39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40 | # Packages/
41 | # Package.pins
42 | # Package.resolved
43 | # *.xcodeproj
44 | #
45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
46 | # hence it is not needed unless you have added a package configuration file to your project
47 | # .swiftpm
48 |
49 | .build/
50 |
51 | # CocoaPods
52 | #
53 | # We recommend against adding the Pods directory to your .gitignore. However
54 | # you should judge for yourself, the pros and cons are mentioned at:
55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
56 | #
57 | # Pods/
58 | #
59 | # Add this line if you want to avoid checking in source code from the Xcode workspace
60 | # *.xcworkspace
61 |
62 | # Carthage
63 | #
64 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
65 | # Carthage/Checkouts
66 |
67 | Carthage/Build/
68 |
69 | # Accio dependency management
70 | Dependencies/
71 | .accio/
72 |
73 | # fastlane
74 | #
75 | # It is recommended to not store the screenshots in the git repo.
76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed.
77 | # For more information about the recommended setup visit:
78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
79 |
80 | fastlane/report.xml
81 | fastlane/Preview.html
82 | fastlane/screenshots/**/*.png
83 | fastlane/test_output
84 |
85 | # Code Injection
86 | #
87 | # After new code Injection tools there's a generated folder /iOSInjectionProject
88 | # https://github.com/johnno1962/injectionforxcode
89 |
90 | iOSInjectionProject/
91 |
92 | # DS Store
93 | #
94 | **/.DS_Store
95 | *.DS_Store
96 | .DS_Store
--------------------------------------------------------------------------------
/Embed YouTube Videos/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.swift
3 | // Embed YouTube Videos
4 | //
5 | // Created by Leonardo Bilia on 30/03/20.
6 | // Copyright © 2020 Leonardo Bilia. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SwiftUI
11 |
12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
21 |
22 | // Create the SwiftUI view that provides the window contents.
23 | let contentView = ContentView()
24 |
25 | // Use a UIHostingController as window root view controller.
26 | if let windowScene = scene as? UIWindowScene {
27 | let window = UIWindow(windowScene: windowScene)
28 | window.rootViewController = UIHostingController(rootView: contentView)
29 | self.window = window
30 | window.makeKeyAndVisible()
31 | }
32 | }
33 |
34 | func sceneDidDisconnect(_ scene: UIScene) {
35 | // Called as the scene is being released by the system.
36 | // This occurs shortly after the scene enters the background, or when its session is discarded.
37 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
38 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
39 | }
40 |
41 | func sceneDidBecomeActive(_ scene: UIScene) {
42 | // Called when the scene has moved from an inactive state to an active state.
43 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
44 | }
45 |
46 | func sceneWillResignActive(_ scene: UIScene) {
47 | // Called when the scene will move from an active state to an inactive state.
48 | // This may occur due to temporary interruptions (ex. an incoming phone call).
49 | }
50 |
51 | func sceneWillEnterForeground(_ scene: UIScene) {
52 | // Called as the scene transitions from the background to the foreground.
53 | // Use this method to undo the changes made on entering the background.
54 | }
55 |
56 | func sceneDidEnterBackground(_ scene: UIScene) {
57 | // Called as the scene transitions from the foreground to the background.
58 | // Use this method to save data, release shared resources, and store enough scene-specific state information
59 | // to restore the scene back to its current state.
60 | }
61 |
62 |
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/Embed YouTube Videos/ContentView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ContentView.swift
3 | // Embed YouTube Videos
4 | //
5 | // Created by Leonardo Bilia on 30/03/20.
6 | // Copyright © 2020 Leonardo Bilia. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 | import WebKit
11 |
12 | struct ContentView: View {
13 |
14 | @State private var youTubeURL: String = ""
15 | @State private var youTubeVideoID: String = ""
16 | @State private var validYouTubeURL = false
17 | @State private var showingAlert = false
18 |
19 | var body: some View {
20 |
21 | NavigationView {
22 | VStack {
23 | TextField("YouTube Video Link", text: $youTubeURL)
24 | .padding()
25 | .background(Color(.secondarySystemBackground))
26 | .cornerRadius(12)
27 | .padding(EdgeInsets(top: 24, leading: 24, bottom: 0, trailing: 24))
28 |
29 | Button(action: {
30 | if let videoID = self.youTubeURL.extractYoutubeID() {
31 | self.youTubeURL = ""
32 | self.youTubeVideoID = videoID
33 | self.validYouTubeURL = true
34 |
35 | } else {
36 | self.youTubeURL = ""
37 | self.showingAlert = true
38 | }
39 |
40 | }) {
41 | HStack {
42 | Image(systemName: "video.fill")
43 | .font(.headline)
44 | Text("Embed Video")
45 | .fontWeight(.semibold)
46 | .font(.headline)
47 | }
48 | .frame(minWidth: 0, maxWidth: .infinity)
49 | .foregroundColor(.white)
50 | .padding()
51 | .background(LinearGradient(gradient: Gradient(colors: [Color(.systemBlue), Color(.systemPurple)]), startPoint: .leading, endPoint: .trailing))
52 | .cornerRadius(12)
53 | .padding(.horizontal, 24)
54 | }
55 | .alert(isPresented: $showingAlert) {
56 | Alert(title: Text("Ops!!"), message: Text("It doesn't look like a valid YouTube link!"), dismissButton: .default(Text("Ok")))
57 | }
58 |
59 | Divider()
60 | .padding()
61 |
62 | if validYouTubeURL {
63 | WebView(videoID: self.youTubeVideoID)
64 | .frame(minHeight: 0, maxHeight: UIScreen.main.bounds.height * 0.3)
65 | .cornerRadius(12)
66 | .padding(.horizontal, 24)
67 | .padding(.top)
68 | }
69 |
70 | Spacer()
71 | }
72 | .navigationBarTitle("Embed Video")
73 | }
74 | .onTapGesture {
75 | UIApplication.shared.endEditing()
76 | }
77 | }
78 | }
79 |
80 | struct ContentView_Previews: PreviewProvider {
81 | static var previews: some View {
82 | ContentView()
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/Embed YouTube Videos.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 8F1508142432620200E1F51F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1508132432620200E1F51F /* AppDelegate.swift */; };
11 | 8F1508162432620200E1F51F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1508152432620200E1F51F /* SceneDelegate.swift */; };
12 | 8F1508182432620200E1F51F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1508172432620200E1F51F /* ContentView.swift */; };
13 | 8F15081A2432620200E1F51F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F1508192432620200E1F51F /* Assets.xcassets */; };
14 | 8F15081D2432620200E1F51F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F15081C2432620200E1F51F /* Preview Assets.xcassets */; };
15 | 8F1508202432620200E1F51F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F15081E2432620200E1F51F /* LaunchScreen.storyboard */; };
16 | 8F1508282432918800E1F51F /* WebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1508272432918800E1F51F /* WebView.swift */; };
17 | 8F15082A2432957C00E1F51F /* UIApplication+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1508292432957C00E1F51F /* UIApplication+Ext.swift */; };
18 | 8F15082C2432984700E1F51F /* String+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F15082B2432984700E1F51F /* String+Ext.swift */; };
19 | 8FB9D3BC24336088001CC629 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 8FB9D3BB24336088001CC629 /* README.md */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXFileReference section */
23 | 8F1508102432620200E1F51F /* Embed YouTube Videos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Embed YouTube Videos.app"; sourceTree = BUILT_PRODUCTS_DIR; };
24 | 8F1508132432620200E1F51F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
25 | 8F1508152432620200E1F51F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
26 | 8F1508172432620200E1F51F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
27 | 8F1508192432620200E1F51F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
28 | 8F15081C2432620200E1F51F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
29 | 8F15081F2432620200E1F51F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
30 | 8F1508212432620200E1F51F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | 8F1508272432918800E1F51F /* WebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebView.swift; sourceTree = ""; };
32 | 8F1508292432957C00E1F51F /* UIApplication+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Ext.swift"; sourceTree = ""; };
33 | 8F15082B2432984700E1F51F /* String+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Ext.swift"; sourceTree = ""; };
34 | 8FB9D3BB24336088001CC629 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | 8F15080D2432620200E1F51F /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | );
43 | runOnlyForDeploymentPostprocessing = 0;
44 | };
45 | /* End PBXFrameworksBuildPhase section */
46 |
47 | /* Begin PBXGroup section */
48 | 8F1508072432620200E1F51F = {
49 | isa = PBXGroup;
50 | children = (
51 | 8FB9D3BB24336088001CC629 /* README.md */,
52 | 8F1508122432620200E1F51F /* Embed YouTube Videos */,
53 | 8F1508112432620200E1F51F /* Products */,
54 | );
55 | sourceTree = "";
56 | };
57 | 8F1508112432620200E1F51F /* Products */ = {
58 | isa = PBXGroup;
59 | children = (
60 | 8F1508102432620200E1F51F /* Embed YouTube Videos.app */,
61 | );
62 | name = Products;
63 | sourceTree = "";
64 | };
65 | 8F1508122432620200E1F51F /* Embed YouTube Videos */ = {
66 | isa = PBXGroup;
67 | children = (
68 | 8F1508132432620200E1F51F /* AppDelegate.swift */,
69 | 8F1508152432620200E1F51F /* SceneDelegate.swift */,
70 | 8F1508172432620200E1F51F /* ContentView.swift */,
71 | 8F1508272432918800E1F51F /* WebView.swift */,
72 | 8F1508292432957C00E1F51F /* UIApplication+Ext.swift */,
73 | 8F15082B2432984700E1F51F /* String+Ext.swift */,
74 | 8F1508192432620200E1F51F /* Assets.xcassets */,
75 | 8F15081E2432620200E1F51F /* LaunchScreen.storyboard */,
76 | 8F1508212432620200E1F51F /* Info.plist */,
77 | 8F15081B2432620200E1F51F /* Preview Content */,
78 | );
79 | path = "Embed YouTube Videos";
80 | sourceTree = "";
81 | };
82 | 8F15081B2432620200E1F51F /* Preview Content */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 8F15081C2432620200E1F51F /* Preview Assets.xcassets */,
86 | );
87 | path = "Preview Content";
88 | sourceTree = "";
89 | };
90 | /* End PBXGroup section */
91 |
92 | /* Begin PBXNativeTarget section */
93 | 8F15080F2432620200E1F51F /* Embed YouTube Videos */ = {
94 | isa = PBXNativeTarget;
95 | buildConfigurationList = 8F1508242432620200E1F51F /* Build configuration list for PBXNativeTarget "Embed YouTube Videos" */;
96 | buildPhases = (
97 | 8F15080C2432620200E1F51F /* Sources */,
98 | 8F15080D2432620200E1F51F /* Frameworks */,
99 | 8F15080E2432620200E1F51F /* Resources */,
100 | );
101 | buildRules = (
102 | );
103 | dependencies = (
104 | );
105 | name = "Embed YouTube Videos";
106 | productName = "Embed YouTube Videos";
107 | productReference = 8F1508102432620200E1F51F /* Embed YouTube Videos.app */;
108 | productType = "com.apple.product-type.application";
109 | };
110 | /* End PBXNativeTarget section */
111 |
112 | /* Begin PBXProject section */
113 | 8F1508082432620200E1F51F /* Project object */ = {
114 | isa = PBXProject;
115 | attributes = {
116 | LastSwiftUpdateCheck = 1140;
117 | LastUpgradeCheck = 1140;
118 | ORGANIZATIONNAME = "Leonardo Bilia";
119 | TargetAttributes = {
120 | 8F15080F2432620200E1F51F = {
121 | CreatedOnToolsVersion = 11.4;
122 | };
123 | };
124 | };
125 | buildConfigurationList = 8F15080B2432620200E1F51F /* Build configuration list for PBXProject "Embed YouTube Videos" */;
126 | compatibilityVersion = "Xcode 9.3";
127 | developmentRegion = en;
128 | hasScannedForEncodings = 0;
129 | knownRegions = (
130 | en,
131 | Base,
132 | );
133 | mainGroup = 8F1508072432620200E1F51F;
134 | productRefGroup = 8F1508112432620200E1F51F /* Products */;
135 | projectDirPath = "";
136 | projectRoot = "";
137 | targets = (
138 | 8F15080F2432620200E1F51F /* Embed YouTube Videos */,
139 | );
140 | };
141 | /* End PBXProject section */
142 |
143 | /* Begin PBXResourcesBuildPhase section */
144 | 8F15080E2432620200E1F51F /* Resources */ = {
145 | isa = PBXResourcesBuildPhase;
146 | buildActionMask = 2147483647;
147 | files = (
148 | 8F1508202432620200E1F51F /* LaunchScreen.storyboard in Resources */,
149 | 8F15081D2432620200E1F51F /* Preview Assets.xcassets in Resources */,
150 | 8FB9D3BC24336088001CC629 /* README.md in Resources */,
151 | 8F15081A2432620200E1F51F /* Assets.xcassets in Resources */,
152 | );
153 | runOnlyForDeploymentPostprocessing = 0;
154 | };
155 | /* End PBXResourcesBuildPhase section */
156 |
157 | /* Begin PBXSourcesBuildPhase section */
158 | 8F15080C2432620200E1F51F /* Sources */ = {
159 | isa = PBXSourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | 8F15082C2432984700E1F51F /* String+Ext.swift in Sources */,
163 | 8F1508142432620200E1F51F /* AppDelegate.swift in Sources */,
164 | 8F1508282432918800E1F51F /* WebView.swift in Sources */,
165 | 8F15082A2432957C00E1F51F /* UIApplication+Ext.swift in Sources */,
166 | 8F1508162432620200E1F51F /* SceneDelegate.swift in Sources */,
167 | 8F1508182432620200E1F51F /* ContentView.swift in Sources */,
168 | );
169 | runOnlyForDeploymentPostprocessing = 0;
170 | };
171 | /* End PBXSourcesBuildPhase section */
172 |
173 | /* Begin PBXVariantGroup section */
174 | 8F15081E2432620200E1F51F /* LaunchScreen.storyboard */ = {
175 | isa = PBXVariantGroup;
176 | children = (
177 | 8F15081F2432620200E1F51F /* Base */,
178 | );
179 | name = LaunchScreen.storyboard;
180 | sourceTree = "";
181 | };
182 | /* End PBXVariantGroup section */
183 |
184 | /* Begin XCBuildConfiguration section */
185 | 8F1508222432620200E1F51F /* Debug */ = {
186 | isa = XCBuildConfiguration;
187 | buildSettings = {
188 | ALWAYS_SEARCH_USER_PATHS = NO;
189 | CLANG_ANALYZER_NONNULL = YES;
190 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
191 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
192 | CLANG_CXX_LIBRARY = "libc++";
193 | CLANG_ENABLE_MODULES = YES;
194 | CLANG_ENABLE_OBJC_ARC = YES;
195 | CLANG_ENABLE_OBJC_WEAK = YES;
196 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
197 | CLANG_WARN_BOOL_CONVERSION = YES;
198 | CLANG_WARN_COMMA = YES;
199 | CLANG_WARN_CONSTANT_CONVERSION = YES;
200 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
201 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
202 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
203 | CLANG_WARN_EMPTY_BODY = YES;
204 | CLANG_WARN_ENUM_CONVERSION = YES;
205 | CLANG_WARN_INFINITE_RECURSION = YES;
206 | CLANG_WARN_INT_CONVERSION = YES;
207 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
208 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
209 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
210 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
211 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
212 | CLANG_WARN_STRICT_PROTOTYPES = YES;
213 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
214 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
215 | CLANG_WARN_UNREACHABLE_CODE = YES;
216 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
217 | COPY_PHASE_STRIP = NO;
218 | DEBUG_INFORMATION_FORMAT = dwarf;
219 | ENABLE_STRICT_OBJC_MSGSEND = YES;
220 | ENABLE_TESTABILITY = YES;
221 | GCC_C_LANGUAGE_STANDARD = gnu11;
222 | GCC_DYNAMIC_NO_PIC = NO;
223 | GCC_NO_COMMON_BLOCKS = YES;
224 | GCC_OPTIMIZATION_LEVEL = 0;
225 | GCC_PREPROCESSOR_DEFINITIONS = (
226 | "DEBUG=1",
227 | "$(inherited)",
228 | );
229 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
230 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
231 | GCC_WARN_UNDECLARED_SELECTOR = YES;
232 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
233 | GCC_WARN_UNUSED_FUNCTION = YES;
234 | GCC_WARN_UNUSED_VARIABLE = YES;
235 | IPHONEOS_DEPLOYMENT_TARGET = 13.4;
236 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
237 | MTL_FAST_MATH = YES;
238 | ONLY_ACTIVE_ARCH = YES;
239 | SDKROOT = iphoneos;
240 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
241 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
242 | };
243 | name = Debug;
244 | };
245 | 8F1508232432620200E1F51F /* Release */ = {
246 | isa = XCBuildConfiguration;
247 | buildSettings = {
248 | ALWAYS_SEARCH_USER_PATHS = NO;
249 | CLANG_ANALYZER_NONNULL = YES;
250 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
252 | CLANG_CXX_LIBRARY = "libc++";
253 | CLANG_ENABLE_MODULES = YES;
254 | CLANG_ENABLE_OBJC_ARC = YES;
255 | CLANG_ENABLE_OBJC_WEAK = YES;
256 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
257 | CLANG_WARN_BOOL_CONVERSION = YES;
258 | CLANG_WARN_COMMA = YES;
259 | CLANG_WARN_CONSTANT_CONVERSION = YES;
260 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
261 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
262 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
263 | CLANG_WARN_EMPTY_BODY = YES;
264 | CLANG_WARN_ENUM_CONVERSION = YES;
265 | CLANG_WARN_INFINITE_RECURSION = YES;
266 | CLANG_WARN_INT_CONVERSION = YES;
267 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
268 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
269 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
270 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
271 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
272 | CLANG_WARN_STRICT_PROTOTYPES = YES;
273 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
274 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
275 | CLANG_WARN_UNREACHABLE_CODE = YES;
276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
277 | COPY_PHASE_STRIP = NO;
278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
279 | ENABLE_NS_ASSERTIONS = NO;
280 | ENABLE_STRICT_OBJC_MSGSEND = YES;
281 | GCC_C_LANGUAGE_STANDARD = gnu11;
282 | GCC_NO_COMMON_BLOCKS = YES;
283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
285 | GCC_WARN_UNDECLARED_SELECTOR = YES;
286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
287 | GCC_WARN_UNUSED_FUNCTION = YES;
288 | GCC_WARN_UNUSED_VARIABLE = YES;
289 | IPHONEOS_DEPLOYMENT_TARGET = 13.4;
290 | MTL_ENABLE_DEBUG_INFO = NO;
291 | MTL_FAST_MATH = YES;
292 | SDKROOT = iphoneos;
293 | SWIFT_COMPILATION_MODE = wholemodule;
294 | SWIFT_OPTIMIZATION_LEVEL = "-O";
295 | VALIDATE_PRODUCT = YES;
296 | };
297 | name = Release;
298 | };
299 | 8F1508252432620200E1F51F /* Debug */ = {
300 | isa = XCBuildConfiguration;
301 | buildSettings = {
302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303 | CODE_SIGN_STYLE = Automatic;
304 | DEVELOPMENT_ASSET_PATHS = "\"Embed YouTube Videos/Preview Content\"";
305 | DEVELOPMENT_TEAM = C8CWPZXDG8;
306 | ENABLE_PREVIEWS = YES;
307 | INFOPLIST_FILE = "Embed YouTube Videos/Info.plist";
308 | LD_RUNPATH_SEARCH_PATHS = (
309 | "$(inherited)",
310 | "@executable_path/Frameworks",
311 | );
312 | PRODUCT_BUNDLE_IDENTIFIER = "com.codableme.Embed-YouTube-Videos";
313 | PRODUCT_NAME = "$(TARGET_NAME)";
314 | SWIFT_VERSION = 5.0;
315 | TARGETED_DEVICE_FAMILY = "1,2";
316 | };
317 | name = Debug;
318 | };
319 | 8F1508262432620200E1F51F /* Release */ = {
320 | isa = XCBuildConfiguration;
321 | buildSettings = {
322 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
323 | CODE_SIGN_STYLE = Automatic;
324 | DEVELOPMENT_ASSET_PATHS = "\"Embed YouTube Videos/Preview Content\"";
325 | DEVELOPMENT_TEAM = C8CWPZXDG8;
326 | ENABLE_PREVIEWS = YES;
327 | INFOPLIST_FILE = "Embed YouTube Videos/Info.plist";
328 | LD_RUNPATH_SEARCH_PATHS = (
329 | "$(inherited)",
330 | "@executable_path/Frameworks",
331 | );
332 | PRODUCT_BUNDLE_IDENTIFIER = "com.codableme.Embed-YouTube-Videos";
333 | PRODUCT_NAME = "$(TARGET_NAME)";
334 | SWIFT_VERSION = 5.0;
335 | TARGETED_DEVICE_FAMILY = "1,2";
336 | };
337 | name = Release;
338 | };
339 | /* End XCBuildConfiguration section */
340 |
341 | /* Begin XCConfigurationList section */
342 | 8F15080B2432620200E1F51F /* Build configuration list for PBXProject "Embed YouTube Videos" */ = {
343 | isa = XCConfigurationList;
344 | buildConfigurations = (
345 | 8F1508222432620200E1F51F /* Debug */,
346 | 8F1508232432620200E1F51F /* Release */,
347 | );
348 | defaultConfigurationIsVisible = 0;
349 | defaultConfigurationName = Release;
350 | };
351 | 8F1508242432620200E1F51F /* Build configuration list for PBXNativeTarget "Embed YouTube Videos" */ = {
352 | isa = XCConfigurationList;
353 | buildConfigurations = (
354 | 8F1508252432620200E1F51F /* Debug */,
355 | 8F1508262432620200E1F51F /* Release */,
356 | );
357 | defaultConfigurationIsVisible = 0;
358 | defaultConfigurationName = Release;
359 | };
360 | /* End XCConfigurationList section */
361 | };
362 | rootObject = 8F1508082432620200E1F51F /* Project object */;
363 | }
364 |
--------------------------------------------------------------------------------