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
| #!/usr/bin/env xcrun --sdk macosx swift | |
| import Foundation | |
| enum Configuration: String { | |
| case debug = "Debug" | |
| case release = "Release" | |
| } | |
| // Get Info.plist path |
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
| struct User { | |
| let username: String | |
| } | |
| final class user Service { | |
| static let shared = Service() | |
| var user: User? | |
| } |
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 | |
| extension URL { | |
| /// Returns an url for App Store app. | |
| /// | |
| /// Example: [itms-apps://itunes.apple.com/app/id1434568484?action=write-review]() | |
| /// | |
| /// - Parameters: | |
| /// - id: The id of the app. |
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
| // Create an interator class | |
| class ElementIterator<T>: IteratorProtocol { | |
| typealias Element = T | |
| let element: T | |
| init(element: T) { | |
| self.element = element | |
| } |
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
| language: swift | |
| osx_image: xcode10.2 | |
| env: | |
| matrix: | |
| - DESTINATION="platform=iOS Simulator,OS=12.2,name=iPhone X" | |
| - DESTINATION="platform=tvOS Simulator,OS=12.2,name=Apple TV 4K" | |
| before_script: cd Texstyle |
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
| on: pull_request | |
| name: Test | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: macOS-latest | |
| strategy: | |
| matrix: | |
| destination: ['platform=iOS Simulator,OS=12.2,name=iPhone X', 'platform=tvOS Simulator,OS=12.2,name=Apple TV 4K'] | |
| steps: |
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
| @propertyWrapper | |
| struct Logging<T> { | |
| var value: T | |
| init(wrappedValue value: T) { | |
| self.value = value | |
| } | |
| var wrappedValue: T { |
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
| final class ViewController: UIViewController { | |
| } | |
| #if canImport(SwiftUI) && DEBUG | |
| import SwiftUI | |
| struct ViewControllerRepresentable: UIViewRepresentable { | |
| func makeUIView(context: Context) -> UIView { |
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 UIKit | |
| public extension UIColor { | |
| /// Creates a color object that generates its color data dynamically using the specified colors. For early SDKs creates light color. | |
| /// - Parameters: | |
| /// - light: The color for light mode. | |
| /// - dark: The color for dark mode. | |
| convenience init(light: UIColor, dark: UIColor) { | |
| if #available(iOS 13.0, tvOS 13.0, *) { |
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 UIKit | |
| public extension UIImageAsset { | |
| /// Creates an image asset with registration of tht eimages with the light and dark trait collections. | |
| /// - Parameters: | |
| /// - lightModeImage: The image you want to register with the image asset with light user interface style. | |
| /// - darkModeImage: The image you want to register with the image asset with dark user interface style. | |
| convenience init(lightModeImage: UIImage?, darkModeImage: UIImage?) { | |
| self.init() |