This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'deploy/1.9.0' into productive
- Loading branch information
Showing
29 changed files
with
330 additions
and
199 deletions.
There are no files selected for viewing
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
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
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
5 changes: 1 addition & 4 deletions
5
Frameworks/HandyUIKit/Extensions/NSAttributedStringExtension.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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Created by Cihat Gündüz on 11.02.19. | ||
|
||
import UIKit | ||
|
||
extension UIWindow { | ||
/// Returns the currently visible view controller if any reachable within the window. | ||
public var visibleViewController: UIViewController? { | ||
return UIWindow.visibleViewController(from: rootViewController) | ||
} | ||
|
||
/// Recursively follows navigation controllers, tab bar controllers and modal presented view controllers starting | ||
/// from the given view controller to find the currently visible view controller. | ||
/// | ||
/// - Parameters: | ||
/// - viewController: The view controller to start the recursive search from. | ||
/// - Returns: The view controller that is most probably visible on screen right now. | ||
public static func visibleViewController(from viewController: UIViewController?) -> UIViewController? { | ||
switch viewController { | ||
case let navigationController as UINavigationController: | ||
return UIWindow.visibleViewController(from: navigationController.visibleViewController ?? navigationController.topViewController) | ||
|
||
case let tabBarController as UITabBarController: | ||
return UIWindow.visibleViewController(from: tabBarController.selectedViewController) | ||
|
||
case let presentingViewController where viewController?.presentedViewController != nil: | ||
return UIWindow.visibleViewController(from: presentingViewController?.presentedViewController) | ||
|
||
default: | ||
return viewController | ||
} | ||
} | ||
} | ||
|
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,46 @@ | ||
// Created by Cihat Gündüz on 11.02.19. | ||
|
||
import UIKit | ||
|
||
@IBDesignable | ||
public class RoundableView: UIView { | ||
@IBInspectable public var cornerRadius: CGFloat = 0 { | ||
didSet { | ||
update() | ||
} | ||
} | ||
|
||
override public init(frame: CGRect) { | ||
super.init(frame: frame) | ||
setup() | ||
} | ||
|
||
public required init?(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder) | ||
setup() | ||
} | ||
|
||
override public func prepareForInterfaceBuilder() { | ||
super.prepareForInterfaceBuilder() | ||
setup() | ||
update() | ||
} | ||
|
||
override public func awakeFromNib() { | ||
super.awakeFromNib() | ||
update() | ||
} | ||
|
||
override public func layoutSubviews() { | ||
super.layoutSubviews() | ||
update() | ||
} | ||
|
||
private func setup() { | ||
clipsToBounds = true | ||
} | ||
|
||
private func update() { | ||
layer.cornerRadius = cornerRadius | ||
} | ||
} |
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,10 @@ | ||
// Created by Cihat Gündüz on 11.02.19. | ||
|
||
import UIKit | ||
|
||
@IBDesignable | ||
public class TemplateButton: UIButton { | ||
override public func setImage(_ image: UIImage?, for state: UIControl.State) { | ||
super.setImage(image?.withRenderingMode(.alwaysTemplate), for: state) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Frameworks/HandyUIKit/IBDesignables/TemplateImageView.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,16 @@ | ||
// Created by Cihat Gündüz on 11.02.19. | ||
|
||
import UIKit | ||
|
||
@IBDesignable | ||
public class TemplateImageView: UIImageView { | ||
override public var image: UIImage? { | ||
get { | ||
return super.image | ||
} | ||
|
||
set { | ||
super.image = newValue?.withRenderingMode(.alwaysTemplate) | ||
} | ||
} | ||
} |
Oops, something went wrong.