Skip to content

Commit

Permalink
Improve a few UI components on the iOS app
Browse files Browse the repository at this point in the history
  • Loading branch information
romainhuet committed Aug 4, 2017
1 parent a88b5cd commit f4145ec
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ios/RocketRides/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
STPTheme.default().primaryBackgroundColor = .riderVeryLightGrayColor
STPTheme.default().primaryForegroundColor = .riderDarkBlueColor
STPTheme.default().secondaryForegroundColor = .riderDarkGrayColor
STPTheme.default().accentColor = .riderBlueColor
STPTheme.default().accentColor = .riderGreenColor

// Main API client configuration
MainAPIClient.shared.baseURLString = baseURLString
Expand Down
2 changes: 1 addition & 1 deletion ios/RocketRides/LocationSearchViewCell.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// LocationCell.swift
// LocationSearchViewCell.swift
// RocketRides
//
// Created by Romain Huet on 5/26/16.
Expand Down
3 changes: 1 addition & 2 deletions ios/RocketRides/LocationSearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class LocationSearchViewController: UIViewController, UITableViewDataSource, UIT

let searchBarFont = UIFont.systemFont(ofSize: 17.0)
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).font = searchBarFont
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).defaultTextAttributes = [NSFontAttributeName: searchBarFont]

UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).defaultTextAttributes = [NSFontAttributeName: searchBarFont, NSForegroundColorAttributeName: UIColor.riderDarkBlueColor]
}

override func viewWillAppear(_ animated: Bool) {
Expand Down
5 changes: 4 additions & 1 deletion ios/RocketRides/MainAPIClient.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// APIClient.swift
// MainAPIClient.swift
// RocketRides
//
// Created by Romain Huet on 5/26/16.
Expand Down Expand Up @@ -33,6 +33,9 @@ class MainAPIClient: NSObject, STPEphemeralKeyProvider {
return
}

// Important: For this demo, we're trusting the `amount` and `currency` coming from the client request.
// A real application should absolutely have the `amount` and `currency` securely computed on the backend
// to make sure the user can't change the payment amount from their web browser or client-side environment.
let parameters: [String: Any] = [
"source": source,
"amount": amount,
Expand Down
2 changes: 1 addition & 1 deletion ios/RocketRides/Ride.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// RideRequest.swift
// Ride.swift
// RocketRides
//
// Created by Romain Huet on 5/31/16.
Expand Down
1 change: 1 addition & 0 deletions ios/RocketRides/RideRequestViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class RideRequestViewController: UIViewController, STPPaymentContextDelegate, Lo

// Request location services authorization
locationManager.requestWhenInUseAuthorization()
locationManager.startUpdatingLocation()
}

// MARK: Button Handlers
Expand Down
4 changes: 2 additions & 2 deletions ios/RocketRides/RocketPathOverlay.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// CurvedPolylineRenderer.swift
// RocketPathOverlay.swift
// RocketRides
//
// Created by Joey Dong on 8/2/17.
Expand Down Expand Up @@ -43,7 +43,7 @@ class RocketPathOverlayRenderer: MKOverlayRenderer {

private let rocketPathOverlay: RocketPathOverlay

var lineWidth: CGFloat = 5.0
var lineWidth: CGFloat = 10.0
var strokeColor: UIColor?
var arcMultiplier: CGFloat = 1.5

Expand Down
4 changes: 2 additions & 2 deletions ios/RocketRides/UIView+Utility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

extension UIView {

/// Apply clipping mask on certain corners with corner radius
// Apply clipping mask on certain corners with corner radius
func layoutCornerRadiusMask(corners: UIRectCorner, cornerRadius: CGFloat) {
let cornerRadii = CGSize(width: cornerRadius, height: cornerRadius)
let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: cornerRadii)
Expand All @@ -21,7 +21,7 @@ extension UIView {
layer.mask = mask
}

/// Apply corner radius and rounded shadow path
// Apply corner radius and rounded shadow path
func layoutCornerRadiusAndShadow(cornerRadius: CGFloat) {
// Apply corner radius for background fill only
layer.cornerRadius = cornerRadius
Expand Down

0 comments on commit f4145ec

Please sign in to comment.