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 @@ -14,6 +14,7 @@ enum AppDefaultKeys: String {
case TripleTapGesture = "tripleTap"
case FramerBonjour = "framerConnect"
case KeepAwake = "keepAwake"
case HomePage = "homePage"
}


3 changes: 3 additions & 0 deletions Frameless/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let isIdleTimer = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.KeepAwake.rawValue) as? Bool
UIApplication.sharedApplication().idleTimerDisabled = isIdleTimer!
}
if NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.HomePage.rawValue) == nil {
NSUserDefaults.standardUserDefaults().setValue("", forKey: AppDefaultKeys.HomePage.rawValue)
}
}

func createIntroViewController() -> OnboardingViewController {
Expand Down
41 changes: 39 additions & 2 deletions Frameless/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14E26a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<customFonts key="customFonts">
Expand All @@ -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 @@ -293,6 +295,40 @@
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="56" id="o1b-pC-ppV">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="o1b-pC-ppV" id="FVL-Vx-Wlm">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Startup page" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tbH-dE-3Gp">
<rect key="frame" x="16" y="7" width="100" 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="URL to open upon browser start" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jLQ-ed-PAK">
<rect key="frame" x="16" y="26" width="180" 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>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="right" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="M9J-kn-pda">
<rect key="frame" x="193" y="13" width="399" height="30"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" none="YES" link="YES"/>
</accessibility>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="URL" enablesReturnKeyAutomatically="YES"/>
<connections>
<action selector="homePageChanged:" destination="lCY-Sl-eE7" eventType="editingDidEnd" id="AcR-70-q8D"/>
</connections>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="M9J-kn-pda" secondAttribute="trailing" constant="16" id="QYx-nE-Rna"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
Expand All @@ -304,6 +340,7 @@
<connections>
<outlet property="_browserSwitch" destination="fIL-z9-y1y" id="hd6-Uz-FAr"/>
<outlet property="_framerSwitch" destination="Vyj-7R-UEs" id="3vh-0s-wr9"/>
<outlet property="_homePageTextField" destination="M9J-kn-pda" id="xrO-oF-MZD"/>
<outlet property="_shakeSwitch" destination="4yd-mc-Ohq" id="hVN-0x-IGW"/>
<outlet property="_sleepSwitch" destination="rM4-QM-crQ" id="EkR-N9-K6T"/>
<outlet property="_swipeUpSwitch" destination="bpD-iZ-A9f" id="yal-l5-dtx"/>
Expand Down
4 changes: 2 additions & 2 deletions Frameless/LaunchScreen.xib
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E26a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
Expand Down
7 changes: 7 additions & 0 deletions Frameless/SettingsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SettingsTableViewController: UITableViewController {
@IBOutlet weak var _browserSwitch: UISwitch!
@IBOutlet weak var _framerSwitch: UISwitch!
@IBOutlet weak var _sleepSwitch: UISwitch!
@IBOutlet weak var _homePageTextField: UITextField!

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -26,6 +27,7 @@ class SettingsTableViewController: UITableViewController {
_browserSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.ForwardBackGesture.rawValue) as! Bool
_framerSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.FramerBonjour.rawValue) as! Bool
_sleepSwitch.on = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.KeepAwake.rawValue) as! Bool
_homePageTextField.text = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.HomePage.rawValue) as! String
}

override func didReceiveMemoryWarning() {
Expand Down Expand Up @@ -79,6 +81,11 @@ class SettingsTableViewController: UITableViewController {
NSUserDefaults.standardUserDefaults().setValue(value, forKey: AppDefaultKeys.KeepAwake.rawValue)
}

@IBAction func homePageChanged(sender: AnyObject) {
var value = (sender as! UITextField).text
NSUserDefaults.standardUserDefaults().setValue(value, forKey: AppDefaultKeys.HomePage.rawValue)
}

func checkControlsSettings() -> Bool {
var arr = [_shakeSwitch.on, _swipeUpSwitch.on, _tripleTapSwitch.on]
let filtered = arr.filter { $0 == true }
Expand Down
11 changes: 9 additions & 2 deletions Frameless/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class ViewController: UIViewController, UISearchBarDelegate, FramelessSearchBarD
_searchBar.framelessSearchBarDelegate = self
_searchBar.showsCancelButton = false
_searchBar.becomeFirstResponder()
_searchBar.text = NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.HomePage.rawValue) as! String
AppearanceBridge.setSearchBarTextInputAppearance()

_settingsBarView = UIView(frame: CGRectMake(0, self.view.frame.height, self.view.frame.width, 44))
Expand All @@ -107,8 +108,14 @@ class ViewController: UIViewController, UISearchBarDelegate, FramelessSearchBarD
if NSUserDefaults.standardUserDefaults().objectForKey(AppDefaultKeys.FramerBonjour.rawValue) as! Bool == true {
_framerBonjour.start()
}

_progressView.hidden = true

// load the URL immediately in case it is not empty (e.g. HomePage setting is set)
if _searchBar.text.isEmpty == false {
hideSearch()
loadURL(_searchBar.text)
} else {
_progressView.hidden = true
}
}

deinit {
Expand Down