-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb9959a
commit a1c1716
Showing
9 changed files
with
92 additions
and
75 deletions.
There are no files selected for viewing
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
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
35 changes: 35 additions & 0 deletions
35
SAHistoryNavigationViewController/SAHistoryExtension.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// SAHistoryExtension.swift | ||
// SAHistoryNavigationViewController | ||
// | ||
// Created by 鈴木大貴 on 2017/01/28. | ||
// Copyright (c) 2015年 鈴木大貴. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
public protocol SAHistoryCompatible { | ||
associatedtype CompatibleType | ||
var sah: CompatibleType { get } | ||
} | ||
|
||
public extension SAHistoryCompatible { | ||
public var sah: SAHistoryExtension<Self> { | ||
return SAHistoryExtension(self) | ||
} | ||
} | ||
|
||
public final class SAHistoryExtension<Base> { | ||
public let base: Base | ||
public init(_ base: Base) { | ||
self.base = base | ||
} | ||
} | ||
|
||
extension UIViewController: SAHistoryCompatible {} | ||
|
||
extension SAHistoryExtension where Base: UIViewController { | ||
public var navigationController: SAHistoryNavigationViewController? { | ||
return base.navigationController as? SAHistoryNavigationViewController | ||
} | ||
} |
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
25 changes: 0 additions & 25 deletions
25
SAHistoryNavigationViewController/UINavigationController+History.swift
This file was deleted.
Oops, something went wrong.
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
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
8 changes: 4 additions & 4 deletions
8
SAHistoryNavigationViewControllerSample/Pods/Pods.xcodeproj/project.pbxproj
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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