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
| // WaitView.swift | |
| // | |
| // Created by Arpit Soni on 8/20/17. | |
| // Copyright © 2017 Arpit Soni. All rights reserved. | |
| import UIKit | |
| import PlaygroundSupport | |
| let viewFrame = CGRect(x: 0, y: 0, width: 500, height: 500) | |
| let view = UIView(frame: viewFrame) |
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
| require 'xcodeproj' | |
| require 'dotenv' | |
| # Dotenv.load('.env.lprojs') | |
| localizations = ENV['LOCALIZATIONS'].split(',') | |
| puts "Localizations: " + localizations.inspect | |
| project = Xcodeproj::Project.open('LocalizationPrototype.xcodeproj') | |
| target = project.targets.first | |
| parent_group = project.groups.first |
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
| public protocol OptionSetStringIntializing { | |
| init?(_ stringValue: String) | |
| } | |
| public extension OptionSet { | |
| static func decode<T>(from strings: [String]) -> T where T: OptionSet, T: OptionSetStringIntializing { | |
| var options: T = [] | |
| strings.forEach { (str) in |
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
| desc "Save all devices for a dev provisioning profile to devices.txt" | |
| lane :get_devices_dev_profile do | |
| require "spaceship" | |
| Spaceship::Portal.login() | |
| bundle_id = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier).first | |
| profile = Spaceship::Portal.provisioning_profile.development.find_by_bundle_id(bundle_id: bundle_id).first | |
| devices = profile.devices | |
| File.open('devices.txt', 'w') do |f| | |
| f.puts "Device ID\tDevice Name" | |
| devices.each do |device| |
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
| desc "Gets the build number from develop, returns incremented number" | |
| lane :incremented_build_number do | |
| # the truth for the current build number is on develop, switch branch and get the number | |
| orig_git_branch = git_branch | |
| sh("git checkout develop") | |
| build_number = get_build_number.to_i + 1 | |
| sh("git checkout #{orig_git_branch}") | |
| build_number | |
| end |
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 | |
| class HyperlinkLabel: UILabel { | |
| var stringAndUrl: [String: URL] = [:] { | |
| didSet { | |
| attributedText = attributedText() | |
| } | |
| } | |
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
| protocol SafeValueForKeyPath {} | |
| extension SafeValueForKeyPath where Self: CFXManagedObject { | |
| func safeValueForKeyPath<Value>(_ keyPath: KeyPath<Self, Value?>) -> Value? { | |
| let keyPathStr = NSExpression(forKeyPath: keyPath).keyPath | |
| return managedObjectContext?.performAndWait { | |
| return value(forKeyPath: keyPathStr) as? Value | |
| } | |
| } | |
| } |
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
| // swiftlint:disable all | |
| // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen | |
| {% if catalogs %} | |
| {% set enumName %}{{param.enumName|default:"Colors"}}{% endset %} | |
| {% set colorType %}{{param.colorTypeName|default:"Color"}}{% endset %} | |
| {% set forceNamespaces %}{{param.forceProvidesNamespaces|default:"false"}}{% endset %} | |
| {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} | |
| #if os(macOS) | |
| import AppKit |
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
| // swiftlint:disable all | |
| // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen | |
| {% if catalogs %} | |
| {% set enumName %}{{param.enumName|default:"Images"}}{% endset %} | |
| {% set enumNameForStrings %}{{param.enumNameForStrings|default:"ImageNames"}}{% endset %} | |
| {% set imageType %}{{param.imageTypeName|default:"Image"}}{% endset %} | |
| {% set forceNamespaces %}{{param.forceProvidesNamespaces|default:"false"}}{% endset %} | |
| {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} | |
| #if os(macOS) |
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
| protocol HyperLinkTextViewDelegate: class { | |
| func textView(textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool | |
| } | |
| /// converts text to attributedText with clickable strings | |
| class HyperLinkTextView: UITextView, UITextViewDelegate { | |
| weak var hyperLinkTextViewDelegate: HyperLinkTextViewDelegate? | |
| var additionalAttributesForLinkText: [NSAttributedString.Key : Any] = [:] |
OlderNewer