Skip to content

Commit b5096f4

Browse files
authored
Bugfix/hw 67819 insights cocoapod integration issue (#244)
* made UINavigationBar theme customization optional * 1.0.0-beta08 release * reverted version due to failing uI tests for iOS 13.7 * reverted changes in travis.yaml
1 parent a6c3605 commit b5096f4

File tree

11 files changed

+53
-55
lines changed

11 files changed

+53
-55
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
[1.0.0-beta08](https://github.com/hyperwallet/hyperwallet-ios-ui-sdk/releases/tag/1.0.0-beta08)
5+
-------------------
6+
- Fixed Cocoapod Insights Integration issue
7+
- Made UINavigationBar Theme customization optional
8+
49
[1.0.0-beta07](https://github.com/hyperwallet/hyperwallet-ios-ui-sdk/releases/tag/1.0.0-beta07)
510
-------------------
611
- Fixed Cocoapod issue

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta08"
2-
github "hyperwallet/hyperwallet-ios-insight" "1.0.0-beta03"
2+
github "hyperwallet/hyperwallet-ios-insight" "1.0.0-beta04"

Cartfile.private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "JanGorman/Hippolyte" "0.8.0"
1+
github "JanGorman/Hippolyte" "1.2.2"
22
github "httpswift/swifter" "1.4.7"

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
github "JanGorman/Hippolyte" "0.8.0"
1+
github "JanGorman/Hippolyte" "1.2.2"
22
github "httpswift/swifter" "1.4.7"
3-
github "hyperwallet/hyperwallet-ios-insight" "1.0.0-beta03"
3+
github "hyperwallet/hyperwallet-ios-insight" "1.0.0-beta04"
44
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta08"

Common/Sources/Helper/ThemeManager.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@ import UIKit
2323
public class ThemeManager: NSObject {
2424
/// Applies default visual styles to the Hyperwallet user interface components.
2525
public static func applyTheme() {
26-
applyToUINavigationBar()
2726
applyToProcessingView()
2827
applyToSpinnerView()
29-
registerFonts
3028
}
3129

3230
/// Applies White Theme visual styles to the Hyperwallet user interface components.
3331
public static func applyWhiteTheme() {
3432
Theme.themeColor = .white
3533
Theme.tintColor = UIColor(red: 0, green: 0.48, blue: 1, alpha: 1)
3634
Theme.Button.color = Theme.tintColor
35+
Theme.Button.linkColor = Theme.tintColor
3736
Theme.Icon.primaryColor = Theme.tintColor
3837
Theme.SpinnerView.activityIndicatorViewColor = Theme.tintColor
3938
Theme.NavigationBar.shadowColor = UIColor(rgb: 0xe3e3e5)
4039
ThemeManager.applyTheme()
4140
}
4241

43-
private static func applyToUINavigationBar() {
42+
/// Applies Custom Theme visual styles to the `UINavigationBar` interface component.
43+
public static func applyToUINavigationBar() {
4444
let proxy = UINavigationBar.appearance()
4545
if #available(iOS 11.0, *) {
4646
proxy.largeTitleTextAttributes =
@@ -89,8 +89,4 @@ public class ThemeManager: NSObject {
8989
proxy.activityIndicatorBackgroundColor = Theme.SpinnerView.backgroundColor
9090
proxy.viewBackgroundColor = Theme.SpinnerView.backgroundColor
9191
}
92-
93-
private static let registerFonts: Void = {
94-
UIFont.register("hw_mobile_ui_sdk_icons", type: "ttf")
95-
}()
9692
}

Common/Sources/HyperwalletUI.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public final class HyperwalletUI: NSObject {
5050
}
5151

5252
private init(_ provider: HyperwalletAuthenticationTokenProvider) {
53+
//Register custom fonts
54+
UIFont.register("hw_mobile_ui_sdk_icons", type: "ttf")
5355
Hyperwallet.setup(provider)
5456
HyperwalletInsights.setup()
5557
}

Demo/AppDelegate.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2929
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
3030
// Override point for customization after application launch.
3131

32-
// ThemeManager.applyWhiteTheme()
32+
window?.tintColor = .systemBlue
33+
window?.backgroundColor = Theme.UITableViewController.backgroundColor
34+
// ThemeManager.applyWhiteTheme()
3335
ThemeManager.applyTheme()
36+
ThemeManager.applyToUINavigationBar()
3437
// Set the default tint color
35-
window?.tintColor = .systemBlue
3638

3739
return true
3840
}

Demo/Base.lproj/Main.storyboard

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="wCK-zt-ysg">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="wCK-zt-ysg">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
34
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.70"/>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
57
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
68
</dependencies>
7-
<customFonts key="customFonts">
8-
<array key="hw_mobile_ui_sdk_icons.ttf">
9-
<string>hw_mobile_ui_sdk_icons</string>
10-
</array>
11-
</customFonts>
129
<scenes>
1310
<!--Account Settings-->
1411
<scene sceneID="90C-vr-vjd">
1512
<objects>
16-
<tableViewController id="h5h-EX-xDl" customClass="ViewController" customModule="HyperwalletExampleApp" customModuleProvider="target" sceneMemberID="viewController">
17-
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="Krd-9H-To6">
18-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
13+
<tableViewController id="h5h-EX-xDl" customClass="ViewController" customModule="Demo" customModuleProvider="target" sceneMemberID="viewController">
14+
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="Krd-9H-To6">
15+
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
1916
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2017
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
2118
<prototypes>
22-
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="TopCell" rowHeight="120" id="mqC-LT-GSO" customClass="TopCell" customModule="HyperwalletExampleApp" customModuleProvider="target">
23-
<rect key="frame" x="0.0" y="28" width="600" height="120"/>
19+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="TopCell" rowHeight="120" id="mqC-LT-GSO" customClass="TopCell" customModule="Demo" customModuleProvider="target">
20+
<rect key="frame" x="0.0" y="28" width="414" height="120"/>
2421
<autoresizingMask key="autoresizingMask"/>
2522
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="mqC-LT-GSO" id="obu-O4-ovs">
26-
<rect key="frame" x="0.0" y="0.0" width="600" height="119.5"/>
23+
<rect key="frame" x="0.0" y="0.0" width="414" height="120"/>
2724
<autoresizingMask key="autoresizingMask"/>
2825
<subviews>
2926
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="svg-8N-6bE">
30-
<rect key="frame" x="137" y="29" width="432" height="21"/>
27+
<rect key="frame" x="137" y="29" width="246" height="21"/>
3128
<constraints>
3229
<constraint firstAttribute="height" constant="21" id="NX4-BJ-HlD"/>
3330
</constraints>
@@ -36,7 +33,7 @@
3633
<nil key="highlightedColor"/>
3734
</label>
3835
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3tB-Dy-Uuo">
39-
<rect key="frame" x="137" y="48" width="432" height="21"/>
36+
<rect key="frame" x="137" y="48" width="246" height="21"/>
4037
<constraints>
4138
<constraint firstAttribute="height" constant="21" id="IMf-Ps-lhQ"/>
4239
</constraints>
@@ -45,7 +42,7 @@
4542
<nil key="highlightedColor"/>
4643
</label>
4744
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nuD-M0-zEI">
48-
<rect key="frame" x="137" y="67" width="432" height="21"/>
45+
<rect key="frame" x="137" y="67" width="246" height="21"/>
4946
<constraints>
5047
<constraint firstAttribute="height" constant="21" id="LF0-kB-nFq"/>
5148
</constraints>
@@ -85,15 +82,15 @@
8582
<outlet property="phoneLabel" destination="3tB-Dy-Uuo" id="eHe-ve-mBq"/>
8683
</connections>
8784
</tableViewCell>
88-
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="LabelCell" rowHeight="80" id="gTh-zb-JIg" customClass="HeadlineCell" customModule="HyperwalletExampleApp" customModuleProvider="target">
89-
<rect key="frame" x="0.0" y="148" width="600" height="80"/>
85+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="LabelCell" rowHeight="80" id="gTh-zb-JIg" customClass="HeadlineCell" customModule="Demo" customModuleProvider="target">
86+
<rect key="frame" x="0.0" y="148" width="414" height="80"/>
9087
<autoresizingMask key="autoresizingMask"/>
9188
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="gTh-zb-JIg" id="zy6-Dy-o7Q">
92-
<rect key="frame" x="0.0" y="0.0" width="600" height="79.5"/>
89+
<rect key="frame" x="0.0" y="0.0" width="414" height="80"/>
9390
<autoresizingMask key="autoresizingMask"/>
9491
<subviews>
9592
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uFo-O2-ca8">
96-
<rect key="frame" x="20" y="45" width="560" height="17"/>
93+
<rect key="frame" x="20" y="45" width="374" height="17"/>
9794
<constraints>
9895
<constraint firstAttribute="height" constant="17" id="3i0-r0-gDm"/>
9996
</constraints>
@@ -102,7 +99,7 @@
10299
<nil key="highlightedColor"/>
103100
</label>
104101
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YKf-MB-uhb">
105-
<rect key="frame" x="20" y="13" width="560" height="20.5"/>
102+
<rect key="frame" x="20" y="13" width="374" height="20.5"/>
106103
<constraints>
107104
<constraint firstAttribute="height" constant="20.5" id="vvk-O7-uBH"/>
108105
</constraints>
@@ -142,10 +139,9 @@
142139
<objects>
143140
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="wCK-zt-ysg" sceneMemberID="viewController">
144141
<toolbarItems/>
145-
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" barStyle="black" translucent="NO" id="VZ2-Ya-dU8">
146-
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
142+
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="VZ2-Ya-dU8">
143+
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
147144
<autoresizingMask key="autoresizingMask"/>
148-
<color key="barTintColor" red="0.10552009179999999" green="0.8118787274" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
149145
</navigationBar>
150146
<nil name="viewControllers"/>
151147
<connections>

HyperwalletUISDK.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'HyperwalletUISDK'
3-
spec.version = '1.0.0-beta07'
3+
spec.version = '1.0.0-beta08'
44
spec.summary = 'Hyperwallet UI SDK for iOS to integrate with Hyperwallet Platform'
55
spec.homepage = 'https://github.com/hyperwallet/hyperwallet-ios-ui-sdk'
66
spec.license = { :type => 'MIT', :file => 'LICENSE' }
@@ -17,7 +17,7 @@ Pod::Spec.new do |spec|
1717
spec.subspec "Common" do |common|
1818
common.resources = ['Common/**/*.xcassets', 'Common/**/*.ttf', 'Common/**/*.xib', 'Common/**/*.strings']
1919
common.source_files = "Common/Sources/**/*.{swift,h}"
20-
common.dependency 'Insights', '1.0.0-beta03'
20+
common.dependency 'Insights', '1.0.0-beta04'
2121
end
2222

2323
spec.subspec "TransferMethodRepository" do |transferMethodRepository|

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ Adding one or more of these frameworks allows users to explore the particular fu
3434
### Carthage
3535
Specify it in your Cartfile:
3636
```ogdl
37-
github "hyperwallet/hyperwallet-ios-ui-sdk" "1.0.0-beta07"
37+
github "hyperwallet/hyperwallet-ios-ui-sdk" "1.0.0-beta08"
3838
```
3939
Add desired modules using the `Linked Frameworks and Libraries` option to make them available in the app.
4040
Use `import <module-name>` to add the dependency within a file
4141

4242
### CocoaPods
4343
- Install a specific framework (install one or more frameworks based on your requirement)
4444
```ruby
45-
pod "HyperwalletUISDK/TransferMethod", "1.0.0-beta07"
46-
pod "HyperwalletUISDK/Transfer", "1.0.0-beta07"
47-
pod "HyperwalletUISDK/Receipt", "1.0.0-beta07"
45+
pod "HyperwalletUISDK/TransferMethod", "1.0.0-beta08"
46+
pod "HyperwalletUISDK/Transfer", "1.0.0-beta08"
47+
pod "HyperwalletUISDK/Receipt", "1.0.0-beta08"
4848
```
4949
- To install all available modules (TransferMethod, Transfer, Receipt)
5050
```ruby
51-
pod 'HyperwalletUISDK', '~> 1.0.0-beta07'
51+
pod 'HyperwalletUISDK', '~> 1.0.0-beta08'
5252
```
5353
Use `import HyperwalletUISDK` to add the dependency within a file.
5454

@@ -57,8 +57,7 @@ After you're done installing the SDK, you need to initialize an instance in orde
5757

5858
### Setup the UI Style
5959
HyperwalletUISDK provides default themes for all the modules(e.g. TransferMethod, Receipt). If you import HyperwalletUISDK, in order to
60-
apply all the default themes, firstly you will have to call ThemeManager.applyTheme which will apply the basic theme. Secondly, you need to apply
61-
the themes for all the modules in HyperwalletUISDK.
60+
apply the default theme, you will have to call `ThemeManager.applyTheme()` which will apply the basic theme to ProcessingView and SpinnerView. If you want Hyperwallet custom theme for UINavigationBar then add `ThemeManager.applyToUINavigationBar()`
6261
For example:
6362
```swift
6463
...
@@ -72,16 +71,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7271
// Optional - Define the HyperwalletUISDK on the `Theme` object. See the section `Customize the visual style`.
7372

7473
// Set the default tint color
75-
window?.tintColor = Theme.tintColor
74+
window?.tintColor = .systemBlue
7675
// Avoid to display a black area during the view transaction in the UINavigationBar.
77-
window?.backgroundColor = Theme.ViewController.backgroundColor
76+
window?.backgroundColor = Theme.UITableViewController.backgroundColor
7877

7978
// Apply basic theme
8079
ThemeManager.applyTheme()
81-
// Apply TransferMethod theme
82-
ThemeManager.applyTransferMethodTheme()
83-
// Apply Receipt theme
84-
ThemeManager.applyReceiptTheme()
8580
return true
8681
}
8782
}
@@ -414,9 +409,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
414409

415410
ThemeManager.applyWhiteTheme()
416411
// Set the default tint color
417-
window?.tintColor = Theme.tintColor
412+
window?.tintColor = .systemBlue
418413
// Avoid to display a black area during the view transaction in the UINavigationBar.
419-
window?.backgroundColor = Theme.ViewController.backgroundColor
414+
window?.backgroundColor = Theme.UITableViewController.backgroundColor
420415

421416
return true
422417
}
@@ -433,6 +428,8 @@ Theme.Label.textColor = UIColor(red: 0 / 255, green: 45 / 255, blue: 67 / 255, a
433428
Theme.Label.errorColor = .red
434429
```
435430

431+
Note: If you do not use `ThemeManager.applyToUINavigationBar()`, then any changes done to Theme.NavigationBar.xxx will not be reflected.
432+
436433
## Error Handling
437434
In Hyperwallet UI SDK, we categorized HyperwalletException into three groups, which are input errors (business errors), network errors and unexpected errors.
438435

Transfer/Sources/TransferButtonCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extension TransferButtonCell {
102102

103103
@objc dynamic var buttonTitleLabelColor: UIColor! {
104104
get { return button.titleLabel?.textColor }
105-
set { button.titleLabel?.textColor = newValue }
105+
set { button.setTitleColor(newValue, for: .normal) }
106106
}
107107

108108
@objc dynamic var buttonBackgroundColor: UIColor! {

0 commit comments

Comments
 (0)