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 | |
import Combine | |
// see: not working https://gist.github.com/susieyy/3e1059d5dc9d0f2278db07e3fb73332f | |
// Use Future to work around an issue where the Combine's MergeMany operator may not perform background processing. | |
// $ swift --version | |
// Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8) | |
// Target: x86_64-apple-darwin20.1.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
import Foundation | |
import Combine | |
// see: workaround https://gist.github.com/susieyy/95e8f55fd077162c7e02c13b541e8309 | |
// Examines an issue where the MergeMany operator in Combine may not perform background processing. | |
// $ swift --version | |
// Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8) | |
// Target: x86_64-apple-darwin20.1.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
java -jar ./swagger-codegen-cli.jar config-help -l swift | |
CONFIG OPTIONS | |
sortParamsByRequiredFlag | |
Sort method arguments to place required parameters before optional parameters. (Default: true) | |
ensureUniqueParams | |
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true) | |
allowUnicodeIdentifiers |
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 transition = CATransition() | |
transition.duration = 0.2 | |
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) | |
transition.type = kCATransitionFade | |
navigationController?.view.layer.addAnimation(transition, forKey: nil) | |
navigationController?.pushViewController(con, animated: true) |
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
final class OverridedCell: UITableViewCell { | |
static let identifier = "OverridedCell" | |
override init(style: UITableViewCellStyle, reuseIdentifier: String?) { | |
super.init(style: style, reuseIdentifier: reuseIdentifier) | |
prepareView() | |
} | |
required init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") |
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
final class SearchContainerViewController: UIViewController { | |
let hoge: Hoge | |
convenience init(hoge: Hoge) { | |
self.init(nibName: nil, bundle: nil) | |
self.hoge = hoge | |
} | |
override init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) { super.init(nibName: nil, bundle: nil) } | |
required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } |
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
final class SwipeContainerViewController: UIPageViewController { | |
convenience init() { | |
self.init(transitionStyle: .Scroll, navigationOrientation: .Horizontal, options: nil) | |
} | |
override init(transitionStyle style: UIPageViewControllerTransitionStyle, navigationOrientation: UIPageViewControllerNavigationOrientation, options: [String : AnyObject]?) { | |
super.init(transitionStyle: style, navigationOrientation: navigationOrientation, options: options) | |
} | |
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
// Hide | |
cell.separatorInset = UIEdgeInsets(top: 0, left: tableView.bounds.width, bottom: 0, right: 0) | |
cell.layoutMargins = UIEdgeInsetsZero | |
// Show | |
cell.separatorInset = UIEdgeInsetsZero | |
cell.layoutMargins = UIEdgeInsetsZero |
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
extension UIViewController { | |
var previousViewController: UIViewController? { | |
guard let navigationController = navigationController else { return nil } | |
let count = navigationController.viewControllers.count | |
return count < 2 ? nil : navigationController.viewControllers[count - 2] | |
} | |
} |
NewerOlder