Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Frameless/AppDefaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum AppDefaultKeys: String {
case PanFromBottomGesture = "panFromBottom"
case ForwardBackGesture = "panLeftRight"
case TripleTapGesture = "tripleTap"
case NoBounceAnimation = "noBounceAnimation"
case FramerBonjour = "framerConnect"
case KeepAwake = "keepAwake"
}
Expand Down
3 changes: 3 additions & 0 deletions Frameless/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
if NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.ForwardBackGesture.rawValue) == nil {
NSUserDefaults.standardUserDefaults().setValue(true, forKey: AppDefaultKeys.ForwardBackGesture.rawValue)
}
if NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.NoBounceAnimation.rawValue) == nil {
NSUserDefaults.standardUserDefaults().setValue(false, forKey: AppDefaultKeys.NoBounceAnimation.rawValue)
}
if NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.FramerBonjour.rawValue) == nil {
NSUserDefaults.standardUserDefaults().setValue(true, forKey: AppDefaultKeys.FramerBonjour.rawValue)
}
Expand Down
36 changes: 36 additions & 0 deletions Frameless/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<string>ClearSans</string>
<string>ClearSans</string>
<string>ClearSans</string>
<string>ClearSans</string>
<string>ClearSans</string>
</mutableArray>
</customFonts>
<scenes>
Expand Down Expand Up @@ -231,6 +233,39 @@
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="56" id="uPj-nC-5Lr">
<rect key="frame" x="0.0" y="0.0" width="600" height="56"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="uPj-nC-5Lr" id="6m1-vc-xIG">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yWp-rS-VYz">
<rect key="frame" x="539" y="12" width="51" height="31"/>
<color key="onTintColor" red="0.61937248710000004" green="0.51502001289999999" blue="0.90843188760000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="toggleBounceSwitch:" destination="lCY-Sl-eE7" eventType="valueChanged" id="rSx-hI-vKN"/>
<action selector="toggleBrowserNavSwitch:" destination="lCY-Sl-eE7" eventType="valueChanged" id="1D1-zi-cLV"/>
</connections>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Disable bounce animations" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QD3-YR-0rp">
<rect key="frame" x="16" y="7" width="205" height="23"/>
<fontDescription key="fontDescription" name="ClearSans" family="Clear Sans" pointSize="17"/>
<color key="textColor" red="0.55673807860000002" green="0.55652600529999996" blue="0.57718861099999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="To disable page boundary bounce animations" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QmN-g9-1bx">
<rect key="frame" x="16" y="26" width="301" height="23"/>
<fontDescription key="fontDescription" name="ClearSans" family="Clear Sans" pointSize="12"/>
<color key="textColor" red="0.55673807860000002" green="0.55652600529999996" blue="0.57718861099999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="yWp-rS-VYz" firstAttribute="trailing" secondItem="6m1-vc-xIG" secondAttribute="trailingMargin" constant="-4" id="OJB-IV-hwF"/>
<constraint firstItem="yWp-rS-VYz" firstAttribute="top" secondItem="6m1-vc-xIG" secondAttribute="topMargin" constant="4" id="y2v-Uv-xZU"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="56" id="6mF-rO-eJu">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6mF-rO-eJu" id="Jrx-Hm-NhT">
Expand Down Expand Up @@ -302,6 +337,7 @@
</connections>
</tableView>
<connections>
<outlet property="_bounceSwitch" destination="yWp-rS-VYz" id="ODH-5y-bcd"/>
<outlet property="_browserSwitch" destination="fIL-z9-y1y" id="hd6-Uz-FAr"/>
<outlet property="_framerSwitch" destination="Vyj-7R-UEs" id="3vh-0s-wr9"/>
<outlet property="_shakeSwitch" destination="4yd-mc-Ohq" id="hVN-0x-IGW"/>
Expand Down
7 changes: 7 additions & 0 deletions Frameless/SettingsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class SettingsTableViewController: UITableViewController {
@IBOutlet weak var _swipeUpSwitch: UISwitch!
@IBOutlet weak var _tripleTapSwitch: UISwitch!
@IBOutlet weak var _browserSwitch: UISwitch!
@IBOutlet weak var _bounceSwitch: UISwitch!
@IBOutlet weak var _framerSwitch: UISwitch!
@IBOutlet weak var _sleepSwitch: UISwitch!

Expand All @@ -24,6 +25,7 @@ class SettingsTableViewController: UITableViewController {
_swipeUpSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.PanFromBottomGesture.rawValue) as! Bool
_tripleTapSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.TripleTapGesture.rawValue) as! Bool
_browserSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.ForwardBackGesture.rawValue) as! Bool
_bounceSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.NoBounceAnimation.rawValue) as! Bool
_framerSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.FramerBonjour.rawValue) as! Bool
_sleepSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.KeepAwake.rawValue) as! Bool
}
Expand Down Expand Up @@ -68,6 +70,11 @@ class SettingsTableViewController: UITableViewController {
NSUserDefaults.standardUserDefaults().setValue(value, forKey: AppDefaultKeys.ForwardBackGesture.rawValue)
}

@IBAction func toggleBounceSwitch(sender: AnyObject) {
var value = (sender as! UISwitch).on
NSUserDefaults.standardUserDefaults().setValue(value, forKey: AppDefaultKeys.NoBounceAnimation.rawValue)
}

@IBAction func toggleFramerSwitch(sender: AnyObject) {
var value = (sender as! UISwitch).on
NSUserDefaults.standardUserDefaults().setValue(value, forKey: AppDefaultKeys.FramerBonjour.rawValue)
Expand Down
5 changes: 5 additions & 0 deletions Frameless/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ class ViewController: UIViewController, UISearchBarDelegate, FramelessSearchBarD
}

func loadURL(urlString: String) {

// disable the typical webview bounce animations and keep the scrollView
// as it is.
_webView?.scrollView.bounces = !(NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.NoBounceAnimation.rawValue) as! Bool)

let addrStr = httpifyString(urlString)
let addr = NSURL(string: addrStr)
if let webAddr = addr {
Expand Down