This file contains hidden or 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
| // Image+Trim.swift | |
| // | |
| // Copyright © 2020 Christopher Zielinski. | |
| // https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177 | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
| import SwiftUI | |
| extension Calendar { | |
| func generateDates( | |
| inside interval: DateInterval, | |
| matching components: DateComponents | |
| ) -> [Date] { | |
| var dates: [Date] = [] | |
| dates.append(interval.start) |
This file contains hidden or 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
| import Foundation | |
| import UIKit | |
| import CoreText | |
| // You can run this by copying this file into a Swift playground. | |
| extension String { | |
| // Returns the number of glyphs used to render the string. If this string | |
| // should behave like a single emoji character (regardless of whether it is, |
This file contains hidden or 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
| // Don't forget to add to the project: | |
| // 1. DeepLabV3 - https://developer.apple.com/machine-learning/models/ | |
| // 2. CoreMLHelpers - https://github.com/hollance/CoreMLHelpers | |
| enum RemoveBackroundResult { | |
| case background | |
| case finalImage | |
| } | |
| extension UIImage { |
This file contains hidden or 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
| // Image+Trim.swift | |
| // | |
| // Copyright © 2020 Christopher Zielinski. | |
| // https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177 | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
| import Cocoa | |
| import UniformTypeIdentifiers | |
| extension UTTagClass { | |
| static let deviceModelCode = UTTagClass(rawValue: "com.apple.device-model-code") | |
| } | |
| extension UTType { | |
| static let macBook = UTType("com.apple.mac.laptop") | |
| static let macBookWithNotch = UTType("com.apple.mac.notched-laptop") |
This file contains hidden or 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
| // MARK: - SceneDelegate | |
| class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
| var window: UIWindow? | |
| func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
| let navigationController = UINavigationController(navigationBarClass: NavigationBar.self, toolbarClass: nil) | |
| (navigationController.navigationBar as! NavigationBar).preferredHeight = 88 | |
| navigationController.setViewControllers([ViewController()], animated: false) | |
This file contains hidden or 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
| /******************************************************************************* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2023 DigiDNA - www.imazing.com | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
| import SwiftUI | |
| public struct UniformWindowGroup<Content: View>: Scene { | |
| var id: String? | |
| var maxWidth: CGFloat | |
| var maxHeight: CGFloat | |
| var aspectRatio: CGFloat | |
| var content: Content | |
| @State private var setSize: CGSize? |