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
import Combine | |
import UIKit | |
public protocol CombineCompatible {} | |
// MARK: - UIControl | |
public extension UIControl { | |
final class Subscription<SubscriberType: Subscriber, Control: UIControl>: Combine.Subscription where SubscriberType.Input == Control { | |
private var subscriber: SubscriberType? | |
private let input: Control |
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
name: XXXX | |
attributes: | |
LastUpgradeCheck: 1140 | |
ORGANIZATIONNAME: "kankak, Inc." | |
options: | |
bundleIdPrefix: com.xxxx.xxxxxxxx | |
deploymentTarget: | |
iOS: 13.1.3 | |
configs: | |
Develop Debug: debug |
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
private extension UIActivityType { | |
static let postToLINE = UIActivityType("jp.naver.line.Share") | |
static let gmail = UIActivityType("com.google.Gmail.ShareExtension") | |
static let postToSlack = UIActivityType("com.tinyspeck.chatlyio.share") | |
static let facebookMessanger = UIActivityType("com.facebook.Messenger.ShareExtension") | |
static let tweetbot4 = UIActivityType("com.tapbots.Tweetbot4.shareextension") | |
static let evernote = UIActivityType("com.evernote.iPhone.Evernote.EvernoteShare") | |
static let bear = UIActivityType("net.shinyfrog.bear-iOS.Bear-iPhone-Sharing-Extension") | |
} |
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
// Workaround for Bundle resource when running on Xcode previews | |
// https://forums.swift.org/t/xcode-previews-swiftpm-resources-xcpreviewagent-crashed/51680/10 | |
// https://developer.apple.com/forums/thread/664295?answerId=673644022#673644022 | |
// https://gist.github.com/ctreffs/ad9d23e08d586cf75e4d1c3bb1b1061f | |
import class Foundation.Bundle | |
import class Foundation.ProcessInfo | |
private class BundleFinder {} |
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
import Foundation | |
struct EmailAddress: RawRepresentable, Codable { | |
let rawValue: String | |
init?(rawValue: String) { | |
let detector = try? NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue) | |
let range = NSRange(rawValue.startIndex..<rawValue.endIndex,in: rawValue) | |
let matches = detector?.matches(in: rawValue, options: [], range: range) | |
guard let match = matches?.first, matches?.count == 1 else { return nil } |
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
import CoreSpotlight | |
import Foundation | |
#if canImport(UniformTypeIdentifiers) | |
import UniformTypeIdentifiers | |
#endif | |
import MobileCoreServices | |
struct ShopIndexHandler { | |
static let `default` : ShopIndexHandler = .init() |
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
import UIKit | |
import ImageIO | |
extension UIImage { | |
public static func gifImage(data: Data) -> UIImage? { | |
guard let source = CGImageSourceCreateWithData(data as CFData, nil) else { | |
print("image doesn't exist") | |
return nil | |
} |
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
import Foundation | |
let intJson = #"{ "inUse": 1, "name": "Daiki Matsudate", "twitter": "d_date", "stars": 99999, "occupation": null}"# | |
let boolJson = #"{ "inUse": true, "name": "Daiki Matsudate", "twitter": "d_date", "stars": 99999, "occupation": null}"# | |
protocol Inherits { | |
associatedtype SuperType | |
var `super`: SuperType { get } | |
} |
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
import UIKit | |
open class VStackViewController: UIViewController { | |
public let scrollView: UIScrollView = .init() | |
public let stackView: UIStackView = { | |
let stackView: UIStackView = .init() | |
stackView.axis = .vertical | |
stackView.alignment = .fill | |
stackView.distribution = .equalSpacing | |
stackView.spacing = 0 |
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
let of = Observable.of(1,2,3) | |
.do(onNext: { print($0) }) | |
let just = Observable.just(4) | |
.do(onNext: { print($0) }) | |
let error = Observable<Any?>.error(FakeError()) | |
.do(onError: { print($0) }) | |
Observable.zip(of, just, error) | |
.subscribe() | |
.disposed(by: disposeBag) |
NewerOlder