Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6205" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="PEy-hN-KRP">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8173.3" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="PEy-hN-KRP">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6198"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8142"/>
</dependencies>
<scenes>
<!--Web View Controller-->
Expand All @@ -23,7 +24,7 @@
<searchBar contentMode="redraw" searchBarStyle="minimal" placeholder="Search or enter website name" translatesAutoresizingMaskIntoConstraints="NO" id="Gvr-ci-v7c">
<rect key="frame" x="86" y="19" width="514" height="44"/>
<color key="barTintColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="URL" returnKeyType="search"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="webSearch" returnKeyType="search"/>
<connections>
<outlet property="delegate" destination="PEy-hN-KRP" id="htm-12-hzg"/>
</connections>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ - (void)performSearch:(NSString *)text {
}

if (URL == nil) {
NSString *escapedText = [lowercaseText stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *googleSearch = @"http://www.google.com/search?q=";
URL = [NSURL URLWithString:[googleSearch stringByAppendingString:escapedText]];
NSURLComponents *URLComponents = [[NSURLComponents alloc] init];
URLComponents.scheme = @"https";
URLComponents.host = @"www.google.com";
URLComponents.path = @"/search";

NSURLQueryItem *queryItem = [NSURLQueryItem queryItemWithName:@"q" value:text];
URLComponents.queryItems = @[queryItem];

URL = URLComponents.URL;
}

self.searchBar.text = [URL absoluteString];
Expand Down