-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- UIScrollView - added automaticallyAdjustsContentInset toggle from i…
…nterface builder, based on contentInsetAdjustmentBehavior
- Loading branch information
1 parent
2f7005b
commit 7e382b9
Showing
2 changed files
with
31 additions
and
0 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
27 changes: 27 additions & 0 deletions
27
MHAppKit/Extensions/UIKit/UIScrollView+IBContentInsetAdjustment.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,27 @@ | ||
// | ||
// UIScrollView+IBContentInsetAdjustment.swift | ||
// MHAppKit | ||
// | ||
// Created by Milen Halachev on 19.08.19. | ||
// Copyright © 2019 Milen Halachev. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
extension UIScrollView { | ||
|
||
@available(iOS 11.0, *) | ||
@IBInspectable public var automaticallyAdjustsContentInset: Bool { | ||
|
||
get { | ||
|
||
return self.contentInsetAdjustmentBehavior != .never | ||
} | ||
set { | ||
|
||
self.contentInsetAdjustmentBehavior = newValue ? .automatic : .never | ||
} | ||
} | ||
} | ||
|