Skip to content

Commit 8abc7e6

Browse files
committed
Build out themes
1 parent c37b52e commit 8abc7e6

File tree

15 files changed

+238
-348
lines changed

15 files changed

+238
-348
lines changed

SwiftMessages.xcodeproj/project.pbxproj

+118-266
Large diffs are not rendered by default.

SwiftMessages.xcodeproj/xcuserdata/wtmoose.xcuserdatad/xcschemes/SwiftMessages.xcscheme

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
buildForAnalyzing = "YES">
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "867E214E1D4D01D500594A41"
18-
BuildableName = "SwiftMessages.app"
17+
BlueprintIdentifier = "86B48AEB1D5A41C900063E2B"
18+
BuildableName = "SwiftMessages.framework"
1919
BlueprintName = "SwiftMessages"
2020
ReferencedContainer = "container:SwiftMessages.xcodeproj">
2121
</BuildableReference>
@@ -32,7 +32,7 @@
3232
skipped = "NO">
3333
<BuildableReference
3434
BuildableIdentifier = "primary"
35-
BlueprintIdentifier = "867E21621D4D01D500594A41"
35+
BlueprintIdentifier = "86B48AF41D5A41C900063E2B"
3636
BuildableName = "SwiftMessagesTests.xctest"
3737
BlueprintName = "SwiftMessagesTests"
3838
ReferencedContainer = "container:SwiftMessages.xcodeproj">
@@ -52,8 +52,8 @@
5252
<MacroExpansion>
5353
<BuildableReference
5454
BuildableIdentifier = "primary"
55-
BlueprintIdentifier = "867E214E1D4D01D500594A41"
56-
BuildableName = "SwiftMessages.app"
55+
BlueprintIdentifier = "86B48AEB1D5A41C900063E2B"
56+
BuildableName = "SwiftMessages.framework"
5757
BlueprintName = "SwiftMessages"
5858
ReferencedContainer = "container:SwiftMessages.xcodeproj">
5959
</BuildableReference>
@@ -75,8 +75,8 @@
7575
runnableDebuggingMode = "0">
7676
<BuildableReference
7777
BuildableIdentifier = "primary"
78-
BlueprintIdentifier = "867E214E1D4D01D500594A41"
79-
BuildableName = "SwiftMessages.app"
78+
BlueprintIdentifier = "86B48AEB1D5A41C900063E2B"
79+
BuildableName = "SwiftMessages.framework"
8080
BlueprintName = "SwiftMessages"
8181
ReferencedContainer = "container:SwiftMessages.xcodeproj">
8282
</BuildableReference>
@@ -94,8 +94,8 @@
9494
runnableDebuggingMode = "0">
9595
<BuildableReference
9696
BuildableIdentifier = "primary"
97-
BlueprintIdentifier = "867E214E1D4D01D500594A41"
98-
BuildableName = "SwiftMessages.app"
97+
BlueprintIdentifier = "86B48AEB1D5A41C900063E2B"
98+
BuildableName = "SwiftMessages.framework"
9999
BlueprintName = "SwiftMessages"
100100
ReferencedContainer = "container:SwiftMessages.xcodeproj">
101101
</BuildableReference>

SwiftMessages.xcodeproj/xcuserdata/wtmoose.xcuserdatad/xcschemes/xcschememanagement.plist

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
<key>primary</key>
2828
<true/>
2929
</dict>
30+
<key>86B48AEB1D5A41C900063E2B</key>
31+
<dict>
32+
<key>primary</key>
33+
<true/>
34+
</dict>
35+
<key>86B48AF41D5A41C900063E2B</key>
36+
<dict>
37+
<key>primary</key>
38+
<true/>
39+
</dict>
3040
</dict>
3141
</dict>
3242
</plist>

SwiftMessagesUITests/Info.plist SwiftMessages/Info.plist

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
<key>CFBundleName</key>
1414
<string>$(PRODUCT_NAME)</string>
1515
<key>CFBundlePackageType</key>
16-
<string>BNDL</string>
16+
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
1818
<string>1.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1</string>
22+
<string>$(CURRENT_PROJECT_VERSION)</string>
23+
<key>NSPrincipalClass</key>
24+
<string></string>
2325
</dict>
2426
</plist>

SwiftMessages/MessageView.swift

+28-15
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,37 @@ public class MessageView: UIView, Identifiable, MarginAdjustable {
6565
*/
6666

6767
public func configureErrorTheme() {
68-
iconImageView?.image = Icon.Error.image
68+
let backgroundColor = UIColor(red: 249.0/255.0, green: 66.0/255.0, blue: 47.0/255.0, alpha: 1.0)
69+
let foregroundColor = UIColor.whiteColor()
70+
configureTheme(backgroundColor: backgroundColor, foregroundColor: foregroundColor, iconImage: Icon.Error.image)
71+
}
72+
73+
public func configureWarningTheme() {
74+
let backgroundColor = UIColor(red: 238.0/255.0, green: 189.0/255.0, blue: 34.0/255.0, alpha: 1.0)
75+
let foregroundColor = UIColor.whiteColor()
76+
configureTheme(backgroundColor: backgroundColor, foregroundColor: foregroundColor, iconImage: Icon.Warning.image)
77+
}
78+
79+
public func configureInfoTheme() {
80+
let backgroundColor = UIColor(red: 225.0/255.0, green: 225.0/255.0, blue: 225.0/255.0, alpha: 1.0)
81+
let foregroundColor = UIColor.darkTextColor()
82+
configureTheme(backgroundColor: backgroundColor, foregroundColor: foregroundColor, iconImage: Icon.Info.image)
83+
}
84+
85+
public func configureTheme(backgroundColor backgroundColor: UIColor, foregroundColor: UIColor, iconImage: UIImage) {
86+
iconImageView?.image = iconImage
6987
iconLabel?.text = nil
70-
iconImageView?.tintColor = UIColor.whiteColor()
88+
iconImageView?.tintColor = foregroundColor
7189
let backgroundView = self.backgroundView ?? self
72-
backgroundView.backgroundColor = UIColor(red: 249.0/255.0, green: 66.0/255.0, blue: 47.0/255.0, alpha: 1.0)
73-
iconLabel?.textColor = UIColor.whiteColor()
74-
titleLabel?.textColor = UIColor.whiteColor()
75-
bodyLabel?.textColor = UIColor.whiteColor()
90+
backgroundView.backgroundColor = backgroundColor
91+
iconLabel?.textColor = foregroundColor
92+
titleLabel?.textColor = foregroundColor
93+
bodyLabel?.textColor = foregroundColor
94+
button?.backgroundColor = foregroundColor
95+
button?.tintColor = backgroundColor
96+
button?.contentEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10)
97+
button?.layer.cornerRadius = 5.0
7698
}
77-
78-
// public func configureWarningTheme() {
79-
//
80-
// }
81-
//
82-
// public func configureInfoTheme() {
83-
// backgroundColor = UIColor.lightGrayColor()
84-
// bodyLabel?.textColor = UIColor.darkTextColor()
85-
// }
8699

87100
/*
88101
MARK: - Configuring the content
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "infoIcon.pdf"
6+
}
7+
],
8+
"info" : {
9+
"version" : 1,
10+
"author" : "xcode"
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "warningIcon.pdf"
6+
}
7+
],
8+
"info" : {
9+
"version" : 1,
10+
"author" : "xcode"
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Binary file not shown.

SwiftMessages/Resources/MessageView.xib

+15-14
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1414
<subviews>
1515
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Nx9-Zd-fca">
16-
<rect key="frame" x="28" y="8" width="544" height="87"/>
16+
<rect key="frame" x="28" y="28" width="544" height="47"/>
1717
<subviews>
18-
<view contentMode="scaleToFill" horizontalHuggingPriority="252" translatesAutoresizingMaskIntoConstraints="NO" id="GEX-VM-06d" userLabel="Icon container">
19-
<rect key="frame" x="0.0" y="24" width="32" height="39"/>
18+
<view contentMode="scaleToFill" horizontalHuggingPriority="252" horizontalCompressionResistancePriority="752" translatesAutoresizingMaskIntoConstraints="NO" id="GEX-VM-06d" userLabel="Icon container">
19+
<rect key="frame" x="0.0" y="4" width="32" height="39"/>
2020
<subviews>
21-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="😬" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Bu-DY-qZo" userLabel="Icon label">
21+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" text="😬" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Bu-DY-qZo" userLabel="Icon label">
2222
<rect key="frame" x="0.0" y="0.0" width="32" height="39"/>
2323
<fontDescription key="fontDescription" type="system" pointSize="32"/>
2424
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
2525
<nil key="highlightedColor"/>
2626
</label>
27-
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="252" verticalHuggingPriority="251" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="PbA-QP-XpA" userLabel="Icon image view">
28-
<rect key="frame" x="0.0" y="11" width="32" height="18"/>
27+
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="PbA-QP-XpA" userLabel="Icon image view">
28+
<rect key="frame" x="0.0" y="6" width="32" height="27"/>
2929
</imageView>
3030
</subviews>
3131
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
@@ -41,25 +41,26 @@
4141
</constraints>
4242
</view>
4343
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="MKC-Mf-yZN">
44-
<rect key="frame" x="52" y="21" width="415" height="45"/>
44+
<rect key="frame" x="52" y="1" width="405" height="45"/>
4545
<subviews>
4646
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="[Title]" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8T6-4T-ytS">
47-
<rect key="frame" x="0.0" y="0.0" width="415" height="20"/>
47+
<rect key="frame" x="0.0" y="0.0" width="405" height="20"/>
4848
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
4949
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
5050
<nil key="highlightedColor"/>
5151
</label>
5252
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="[Message Body]" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dFP-4Z-N2a">
53-
<rect key="frame" x="0.0" y="25" width="415" height="20"/>
53+
<rect key="frame" x="0.0" y="25" width="405" height="20"/>
5454
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
5555
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
5656
<nil key="highlightedColor"/>
5757
</label>
5858
</subviews>
5959
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
6060
</stackView>
61-
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="252" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VCW-IQ-FfQ">
62-
<rect key="frame" x="487" y="29" width="57" height="30"/>
61+
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="252" horizontalCompressionResistancePriority="752" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VCW-IQ-FfQ">
62+
<rect key="frame" x="477" y="10" width="67" height="28"/>
63+
<inset key="contentEdgeInsets" minX="0.0" minY="0.0" maxX="10" maxY="10"/>
6364
<state key="normal" title="[Button]"/>
6465
</button>
6566
</subviews>
@@ -68,8 +69,8 @@
6869
</subviews>
6970
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
7071
<constraints>
71-
<constraint firstAttribute="bottomMargin" secondItem="Nx9-Zd-fca" secondAttribute="bottom" id="SPZ-ev-Lj3"/>
72-
<constraint firstItem="Nx9-Zd-fca" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="topMargin" id="UDP-8w-ZKv"/>
72+
<constraint firstAttribute="bottomMargin" secondItem="Nx9-Zd-fca" secondAttribute="bottom" constant="20" id="SPZ-ev-Lj3"/>
73+
<constraint firstItem="Nx9-Zd-fca" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="topMargin" constant="20" id="UDP-8w-ZKv"/>
7374
<constraint firstItem="Nx9-Zd-fca" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leadingMargin" constant="20" id="jKx-hQ-JzW"/>
7475
<constraint firstAttribute="trailingMargin" secondItem="Nx9-Zd-fca" secondAttribute="trailing" constant="20" id="pcN-dq-ceM"/>
7576
</constraints>
@@ -94,6 +95,6 @@
9495
</view>
9596
</objects>
9697
<resources>
97-
<image name="errorIcon" width="18" height="18"/>
98+
<image name="errorIcon" width="27" height="27"/>
9899
</resources>
99100
</document>

SwiftMessages/MessageViewIOS8.xib SwiftMessages/Resources/MessageViewIOS8.xib

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
33
<dependencies>
4-
<deployment identifier="iOS"/>
54
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
65
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
76
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
@@ -22,8 +21,8 @@
2221
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
2322
<nil key="highlightedColor"/>
2423
</label>
25-
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="252" verticalHuggingPriority="251" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="q3r-OQ-1bR" userLabel="Icon image view">
26-
<rect key="frame" x="20" y="35" width="32" height="18"/>
24+
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="252" verticalHuggingPriority="251" misplaced="YES" image="errorIcon" translatesAutoresizingMaskIntoConstraints="NO" id="q3r-OQ-1bR" userLabel="Icon image view">
25+
<rect key="frame" x="20" y="31" width="32" height="27"/>
2726
</imageView>
2827
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hRn-ww-fBK" userLabel="Text container">
2928
<rect key="frame" x="72" y="21" width="492" height="45"/>
@@ -96,6 +95,6 @@
9695
</view>
9796
</objects>
9897
<resources>
99-
<image name="errorIcon" width="18" height="18"/>
98+
<image name="errorIcon" width="27" height="27"/>
10099
</resources>
101100
</document>

SwiftMessages/SwiftMessages.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// SwiftMessages.h
3+
// SwiftMessages
4+
//
5+
// Created by Tim Moose on 8/9/16.
6+
// Copyright © 2016 SwiftKick Mobile. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
//! Project version number for SwiftMessages.
12+
FOUNDATION_EXPORT double SwiftMessagesVersionNumber;
13+
14+
//! Project version string for SwiftMessages.
15+
FOUNDATION_EXPORT const unsigned char SwiftMessagesVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like #import <SwiftMessages/PublicHeader.h>
18+
19+

SwiftMessagesTests/SwiftMessagesTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SwiftMessagesTests.swift
33
// SwiftMessagesTests
44
//
5-
// Created by Timothy Moose on 7/30/16.
6-
// Copyright © 2016 SwiftKick Mobile LLC. All rights reserved.
5+
// Created by Tim Moose on 8/9/16.
6+
// Copyright © 2016 SwiftKick Mobile. All rights reserved.
77
//
88

99
import XCTest

SwiftMessagesUITests/SwiftMessagesUITests.swift

-36
This file was deleted.

0 commit comments

Comments
 (0)