-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from naveen-c/master
Scroll behaviour handling
- Loading branch information
Showing
4 changed files
with
83 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// ContentHeader.swift | ||
// ContentSheet | ||
// | ||
// Created by Naveen Chaudhary on 30/07/18. | ||
// | ||
|
||
public class ContentHeaderView: UIView { | ||
|
||
public override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
self.isTranslucent = true | ||
} | ||
|
||
public required init?(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder) | ||
self.isTranslucent = true | ||
} | ||
|
||
public var isTranslucent: Bool = true { | ||
didSet { | ||
if isTranslucent { | ||
self._setBlurrEffect(true) | ||
} else { | ||
self._setBlurrEffect(false) | ||
} | ||
} | ||
} | ||
|
||
fileprivate var _blurEffectView: UIVisualEffectView? | ||
|
||
private func _setBlurrEffect(_ add: Bool) { | ||
let onView = self | ||
if add { | ||
let blurEffectStyle: UIBlurEffectStyle | ||
if #available(iOS 10.0, *) { | ||
blurEffectStyle = .regular | ||
} else { | ||
blurEffectStyle = .light | ||
} | ||
let blurEffect = UIBlurEffect(style: blurEffectStyle) | ||
_blurEffectView = UIVisualEffectView(effect: blurEffect) | ||
if let blurEffectView = _blurEffectView { | ||
blurEffectView.backgroundColor = UIColor.clear | ||
blurEffectView.frame = onView.bounds | ||
onView.insertSubview(blurEffectView, at: 0) | ||
} | ||
} else { | ||
onView.alpha = 1 | ||
if let blurEffectView = _blurEffectView { | ||
blurEffectView.removeFromSuperview() | ||
} | ||
_blurEffectView = 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
8 changes: 8 additions & 0 deletions
8
Example/FKWidgetSheet.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.