ios do theme, text styles

This commit is contained in:
Emin 2024-08-04 23:14:53 +05:00
parent 09d92aec73
commit 207bc0cd02
21 changed files with 811 additions and 40 deletions

View file

@ -263,6 +263,19 @@
4B4153B52BF9695500EE4B02 /* MWMTextToSpeechTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B4153B42BF9695500EE4B02 /* MWMTextToSpeechTests.mm */; };
524634C62C53BC3100FDCABA /* Auth.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524634C22C53BB3A00FDCABA /* Auth.storyboard */; };
524634CD2C57232400FDCABA /* TourismMain.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524634CC2C57232400FDCABA /* TourismMain.storyboard */; };
528D72A12C5BBBF700D53210 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 528D72A02C5BBBF700D53210 /* Colors.xcassets */; };
52D588A92C5CD56200AB96B3 /* Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D588A82C5CD56200AB96B3 /* Color.swift */; };
52D588BA2C5CE2E800AB96B3 /* Font.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D588B92C5CE2E800AB96B3 /* Font.swift */; };
52D588C52C5CEAF900AB96B3 /* Gilroy-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BB2C5CEAF800AB96B3 /* Gilroy-Thin.ttf */; };
52D588C62C5CEAF900AB96B3 /* Gilroy-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BC2C5CEAF800AB96B3 /* Gilroy-Bold.ttf */; };
52D588C72C5CEAF900AB96B3 /* Gilroy-Heavy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BD2C5CEAF800AB96B3 /* Gilroy-Heavy.ttf */; };
52D588C82C5CEAF900AB96B3 /* Gilroy-UltraLight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BE2C5CEAF800AB96B3 /* Gilroy-UltraLight.ttf */; };
52D588C92C5CEAF900AB96B3 /* Gilroy-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BF2C5CEAF800AB96B3 /* Gilroy-Medium.ttf */; };
52D588CA2C5CEAF900AB96B3 /* Gilroy-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C02C5CEAF800AB96B3 /* Gilroy-Black.ttf */; };
52D588CB2C5CEAF900AB96B3 /* Gilroy-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C12C5CEAF800AB96B3 /* Gilroy-Regular.ttf */; };
52D588CC2C5CEAF900AB96B3 /* Gilroy-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C22C5CEAF800AB96B3 /* Gilroy-SemiBold.ttf */; };
52D588CD2C5CEAF900AB96B3 /* Gilroy-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C32C5CEAF800AB96B3 /* Gilroy-Light.ttf */; };
52D588CE2C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C42C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf */; };
52E2D3A42C59F9CE00A8843A /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E2D3A32C59F9CE00A8843A /* WelcomeViewController.swift */; };
52E2D3A62C5A017400A8843A /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E2D3A52C5A017400A8843A /* HomeViewController.swift */; };
6741A9421BF340DE002C974C /* sound-strings in Resources */ = {isa = PBXBuildFile; fileRef = 5605022E1B6211E100169CAD /* sound-strings */; };
@ -1187,6 +1200,19 @@
4B4153B42BF9695500EE4B02 /* MWMTextToSpeechTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMTextToSpeechTests.mm; sourceTree = "<group>"; };
524634C22C53BB3A00FDCABA /* Auth.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Auth.storyboard; sourceTree = "<group>"; };
524634CC2C57232400FDCABA /* TourismMain.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = TourismMain.storyboard; sourceTree = "<group>"; };
528D72A02C5BBBF700D53210 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = "<group>"; };
52D588A82C5CD56200AB96B3 /* Color.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Color.swift; sourceTree = "<group>"; };
52D588B92C5CE2E800AB96B3 /* Font.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Font.swift; sourceTree = "<group>"; };
52D588BB2C5CEAF800AB96B3 /* Gilroy-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Thin.ttf"; sourceTree = "<group>"; };
52D588BC2C5CEAF800AB96B3 /* Gilroy-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Bold.ttf"; sourceTree = "<group>"; };
52D588BD2C5CEAF800AB96B3 /* Gilroy-Heavy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Heavy.ttf"; sourceTree = "<group>"; };
52D588BE2C5CEAF800AB96B3 /* Gilroy-UltraLight.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-UltraLight.ttf"; sourceTree = "<group>"; };
52D588BF2C5CEAF800AB96B3 /* Gilroy-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Medium.ttf"; sourceTree = "<group>"; };
52D588C02C5CEAF800AB96B3 /* Gilroy-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Black.ttf"; sourceTree = "<group>"; };
52D588C12C5CEAF800AB96B3 /* Gilroy-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Regular.ttf"; sourceTree = "<group>"; };
52D588C22C5CEAF800AB96B3 /* Gilroy-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-SemiBold.ttf"; sourceTree = "<group>"; };
52D588C32C5CEAF800AB96B3 /* Gilroy-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Light.ttf"; sourceTree = "<group>"; };
52D588C42C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-ExtraBold.ttf"; sourceTree = "<group>"; };
52E2D3A32C59F9CE00A8843A /* WelcomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = "<group>"; };
52E2D3A52C5A017400A8843A /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; };
5605022E1B6211E100169CAD /* sound-strings */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "sound-strings"; path = "../../data/sound-strings"; sourceTree = "<group>"; };
@ -2689,6 +2715,7 @@
5236A3692C52588000E3A7AD /* Tourism */ = {
isa = PBXGroup;
children = (
52D588B62C5CE10200AB96B3 /* Fonts */,
5236A36C2C5258AC00E3A7AD /* Presentation */,
);
path = Tourism;
@ -2697,12 +2724,23 @@
5236A36C2C5258AC00E3A7AD /* Presentation */ = {
isa = PBXGroup;
children = (
528D729F2C5BB7D100D53210 /* Theme */,
52B189982C53B9FD00B5B6F9 /* Auth */,
52B189972C53B9E900B5B6F9 /* Home */,
);
path = Presentation;
sourceTree = "<group>";
};
528D729F2C5BB7D100D53210 /* Theme */ = {
isa = PBXGroup;
children = (
528D72A02C5BBBF700D53210 /* Colors.xcassets */,
52D588A82C5CD56200AB96B3 /* Color.swift */,
52D588B92C5CE2E800AB96B3 /* Font.swift */,
);
path = Theme;
sourceTree = "<group>";
};
52B189972C53B9E900B5B6F9 /* Home */ = {
isa = PBXGroup;
children = (
@ -2721,6 +2759,23 @@
path = Auth;
sourceTree = "<group>";
};
52D588B62C5CE10200AB96B3 /* Fonts */ = {
isa = PBXGroup;
children = (
52D588C02C5CEAF800AB96B3 /* Gilroy-Black.ttf */,
52D588BC2C5CEAF800AB96B3 /* Gilroy-Bold.ttf */,
52D588C42C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf */,
52D588BD2C5CEAF800AB96B3 /* Gilroy-Heavy.ttf */,
52D588C32C5CEAF800AB96B3 /* Gilroy-Light.ttf */,
52D588BF2C5CEAF800AB96B3 /* Gilroy-Medium.ttf */,
52D588C12C5CEAF800AB96B3 /* Gilroy-Regular.ttf */,
52D588C22C5CEAF800AB96B3 /* Gilroy-SemiBold.ttf */,
52D588BB2C5CEAF800AB96B3 /* Gilroy-Thin.ttf */,
52D588BE2C5CEAF800AB96B3 /* Gilroy-UltraLight.ttf */,
);
path = Fonts;
sourceTree = "<group>";
};
52E2D39B2C58E72900A8843A /* Screens */ = {
isa = PBXGroup;
children = (
@ -4042,6 +4097,7 @@
6741A9591BF340DE002C974C /* 05_khmeros.ttf in Resources */,
34AB66801FC5AA330078E451 /* MWMiPhoneRoutePreview.xib in Resources */,
6741A95B1BF340DE002C974C /* 06_code2000.ttf in Resources */,
52D588CA2C5CEAF900AB96B3 /* Gilroy-Black.ttf in Resources */,
471A7BC22481D44B00A0D4C1 /* BookmarkTitleCell.xib in Resources */,
6741A99F1BF340DE002C974C /* 07_roboto_medium.ttf in Resources */,
FA637ED329A500BE00D8921A /* drules_proto_outdoors_light.txt in Resources */,
@ -4057,6 +4113,7 @@
676507611C10559B00830BB3 /* colors.txt in Resources */,
6741A9711BF340DE002C974C /* copyright.html in Resources */,
4A300ED51C6DCFD400140018 /* countries-strings in Resources */,
52D588CB2C5CEAF900AB96B3 /* Gilroy-Regular.ttf in Resources */,
6741A9491BF340DE002C974C /* countries.txt in Resources */,
6741A9871BF340DE002C974C /* drules_proto_default_light.bin in Resources */,
6741A97E1BF340DE002C974C /* drules_proto_default_dark.bin in Resources */,
@ -4071,12 +4128,14 @@
34F73F9F1E082FF800AC1FD6 /* Localizable.strings in Resources */,
340E1EF21E2F614400CE49BF /* Main.storyboard in Resources */,
F6E2FE521E097BA00083EBEC /* MWMActionBarButton.xib in Resources */,
52D588CC2C5CEAF900AB96B3 /* Gilroy-SemiBold.ttf in Resources */,
EDBD68072B625724005DD151 /* LocationServicesDisabledAlert.xib in Resources */,
993DF0CA23F6BD0600AC231A /* ElevationDetailsViewController.xib in Resources */,
F623DA6F1C9C2E62006A3436 /* MWMAddPlaceNavigationBar.xib in Resources */,
6741A9991BF340DE002C974C /* MWMAlertViewController.xib in Resources */,
4501B1942077C35A001B9173 /* resources-xxxhdpi_light in Resources */,
3467CEB7202C6FA900D3C670 /* BMCNotificationsCell.xib in Resources */,
52D588C62C5CEAF900AB96B3 /* Gilroy-Bold.ttf in Resources */,
4761BE2B252D3DB900EE2DE4 /* SubgroupCell.xib in Resources */,
99F9A0E72462CA1700AE21E0 /* DownloadAllView.xib in Resources */,
349D1AD51E2E325B004A2006 /* BottomMenuItemCell.xib in Resources */,
@ -4095,6 +4154,7 @@
34D3B0331E389D05004100F9 /* MWMEditorCategoryCell.xib in Resources */,
F6E2FDCB1E097BA00083EBEC /* MWMEditorNotesFooter.xib in Resources */,
34D3B0391E389D05004100F9 /* MWMEditorSelectTableViewCell.xib in Resources */,
52D588CD2C5CEAF900AB96B3 /* Gilroy-Light.ttf in Resources */,
34AB663B1FC5AA330078E451 /* RouteManagerViewController.xib in Resources */,
34D3B03F1E389D05004100F9 /* MWMEditorSwitchTableViewCell.xib in Resources */,
467F341B2BCA928B00CDC7DE /* MWMEditorSegmentedTableViewCell.xib in Resources */,
@ -4104,6 +4164,7 @@
6741A96D1BF340DE002C974C /* MWMLocationAlert.xib in Resources */,
3406FA191C6E0D8F00E9FAD2 /* MWMMapDownloadDialog.xib in Resources */,
A630D1EA207CA95900976DEA /* Localizable.stringsdict in Resources */,
52D588C92C5CEAF900AB96B3 /* Gilroy-Medium.ttf in Resources */,
F6E2FD591E097BA00083EBEC /* MWMMapDownloaderButtonTableViewCell.xib in Resources */,
F62607FF207B83C400176C5A /* MWMSpinnerAlert.xib in Resources */,
F6E2FD621E097BA00083EBEC /* MWMMapDownloaderLargeCountryTableViewCell.xib in Resources */,
@ -4144,6 +4205,7 @@
F6E2FF061E097BA00083EBEC /* SearchHistoryClearCell.xib in Resources */,
BB7626B61E85599C0031D71C /* icudt73l.dat in Resources */,
34AB665C1FC5AA330078E451 /* TransportTransitIntermediatePoint.xib in Resources */,
52D588CE2C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf in Resources */,
F6E2FF151E097BA00083EBEC /* SearchHistoryQueryCell.xib in Resources */,
F6E2FEE81E097BA00083EBEC /* MWMSearchNoResults.xib in Resources */,
34AB660E1FC5AA320078E451 /* NavigationControlView.xib in Resources */,
@ -4158,6 +4220,7 @@
F6D67CDE2062BBA60032FD38 /* MWMBCCreateCategoryAlert.xib in Resources */,
3490D2E31CE9DD2500D0B838 /* MWMSideButtonsView.xib in Resources */,
F6E2FE2E1E097BA00083EBEC /* MWMStreetEditorEditTableViewCell.xib in Resources */,
52D588C72C5CEAF900AB96B3 /* Gilroy-Heavy.ttf in Resources */,
3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */,
F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */,
447DB4C42BA78665000DF4C2 /* MWMOsmReauthAlert.xib in Resources */,
@ -4175,6 +4238,7 @@
6741A9901BF340DE002C974C /* resources-mdpi_dark in Resources */,
6741A9981BF340DE002C974C /* resources-xhdpi_light in Resources */,
6741A9611BF340DE002C974C /* resources-xhdpi_dark in Resources */,
52D588C52C5CEAF900AB96B3 /* Gilroy-Thin.ttf in Resources */,
6741A94D1BF340DE002C974C /* resources-xxhdpi_light in Resources */,
3404F49E2028A2430090E401 /* BMCActionsCell.xib in Resources */,
6741A9551BF340DE002C974C /* resources-xxhdpi_dark in Resources */,
@ -4183,6 +4247,8 @@
44360A112A7D35440016F412 /* TransportRuler.xib in Resources */,
6741A9421BF340DE002C974C /* sound-strings in Resources */,
F69018BD1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */,
52D588C82C5CEAF900AB96B3 /* Gilroy-UltraLight.ttf in Resources */,
528D72A12C5BBBF700D53210 /* Colors.xcassets in Resources */,
6741A97D1BF340DE002C974C /* synonyms.txt in Resources */,
CDB4D4D7222D248900104869 /* CarPlayStoryboard.storyboard in Resources */,
4707E4B42372FF480017DF6E /* PlacePage.storyboard in Resources */,
@ -4278,6 +4344,7 @@
47E8163323B17734008FD836 /* MWMStorage+UI.m in Sources */,
993DF11123F6BDB100AC231A /* UILabelRenderer.swift in Sources */,
34AB66471FC5AA330078E451 /* RouteManagerTableView.swift in Sources */,
52D588BA2C5CE2E800AB96B3 /* Font.swift in Sources */,
9989273C2449E60200260CE2 /* BottomMenuInteractor.swift in Sources */,
47DF72B922520CE20004AB10 /* MWMRoutingOptions.mm in Sources */,
999FC12023ABA9AD00B0E6F9 /* SearchStyleSheet.swift in Sources */,
@ -4464,6 +4531,7 @@
ED79A5AB2BD7AA9C00952D1F /* LoadingOverlayViewController.swift in Sources */,
34AB66111FC5AA320078E451 /* NavigationTurnsView.swift in Sources */,
475ED78624C7C7300063ADC7 /* ValueStepperViewRenderer.swift in Sources */,
52D588A92C5CD56200AB96B3 /* Color.swift in Sources */,
3490D2E11CE9DD2500D0B838 /* MWMSideButtonsView.mm in Sources */,
47F4F21523A6F06F0022FD56 /* AvailableMapsDataSource.swift in Sources */,
99012852244732DB00C72B10 /* BottomTabBarBuilder.swift in Sources */,

View file

@ -107,24 +107,34 @@
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>OrganicMaps</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>ANY</string>
<key>NSUbiquitousContainerName</key>
<string>OrganicMaps</string>
</dict>
<key>iCloud.app.organicmaps.debug</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>OrganicMapsDEBUG</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>ANY</string>
<key>NSUbiquitousContainerName</key>
<string>OrganicMapsDEBUG</string>
</dict>
</dict>
<key>UIAppFonts</key>
<array>
<string>FredokaOne-Regular.ttf</string>
<string>Gilroy-Black.ttf</string>
<string>Gilroy-Heavy.ttf</string>
<string>Gilroy-ExtraBold</string>
<string>Gilroy-Bold.ttf</string>
<string>Gilroy-SemiBold.ttf</string>
<string>Gilroy-Medium.ttf</string>
<string>Gilroy-Regular.ttf</string>
<string>Gilroy-Light.ttf</string>
<string>Gilroy-Thin.ttf</string>
<string>Gilroy-UltraLight.ttf</string>
</array>
<key>UIApplicationShortcutItems</key>
<array>
@ -236,26 +246,5 @@
</dict>
</dict>
</array>
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.app.organicmaps</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>ANY</string>
<key>NSUbiquitousContainerName</key>
<string>OrganicMaps</string>
</dict>
<key>iCloud.app.organicmaps.debug</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>ANY</string>
<key>NSUbiquitousContainerName</key>
<string>OrganicMapsDEBUG</string>
</dict>
</dict>
</dict>
</plist>

View file

@ -2,24 +2,39 @@ import UIKit
class HomeViewController: UIViewController {
private let label: UILabel = {
private let label1: UILabel = {
let label = UILabel()
label.text = "Hello, World!"
label.text = "Label 1"
label.textAlignment = .center
label.translatesAutoresizingMaskIntoConstraints = false
label.textColor = Color.primary
Font.applyStyle(to: label, style: Font.h1)
return label
}()
private let label2: UILabel = {
let label = UILabel()
label.text = "Label 2!"
label.textAlignment = .center
label.translatesAutoresizingMaskIntoConstraints = false
label.textColor = Color.onBackground
Font.applyStyle(to: label, style: Font.b1)
return label
}()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
view.backgroundColor = Color.background
view.addSubview(label)
view.addSubview(label1)
view.addSubview(label2)
NSLayoutConstraint.activate([
label.centerXAnchor.constraint(equalTo: view.centerXAnchor),
label.centerYAnchor.constraint(equalTo: view.centerYAnchor)
label1.centerXAnchor.constraint(equalTo: view.centerXAnchor),
label1.centerYAnchor.constraint(equalTo: view.centerYAnchor),
label2.centerXAnchor.constraint(equalTo: view.centerXAnchor),
label2.topAnchor.constraint(equalTo: label1.bottomAnchor, constant: 20)
])
}
}

View file

@ -16,15 +16,6 @@
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="oh no" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E6x-ak-Y7f">
<rect key="frame" x="285" y="587" width="43" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>

View file

@ -0,0 +1,57 @@
class Color {
class var background: UIColor {
return UIColor(named: "Background")!
}
class var border: UIColor {
return UIColor(named: "Border")!
}
class var error: UIColor {
return UIColor(named: "Error")!
}
class var heartRed: UIColor {
return UIColor(named: "HeartRed")!
}
class var hint: UIColor {
return UIColor(named: "Hint")!
}
class var onBackground: UIColor {
return UIColor(named: "OnBackground")!
}
class var onError: UIColor {
return UIColor(named: "OnError")!
}
class var onPrimary: UIColor {
return UIColor(named: "OnPrimary")!
}
class var onSelected: UIColor {
return UIColor(named: "OnSelected")!
}
class var onSurface: UIColor {
return UIColor(named: "OnSurface")!
}
class var primary: UIColor {
return UIColor(named: "Primary")!
}
class var selected: UIColor {
return UIColor(named: "Selected")!
}
class var starYellow: UIColor {
return UIColor(named: "StarYellow")!
}
class var surface: UIColor {
return UIColor(named: "Surface")!
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x32",
"green" : "0x18",
"red" : "0x10"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xE7",
"green" : "0xD4",
"red" : "0xC9"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x61",
"green" : "0x6C",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x61",
"green" : "0x6C",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xAD",
"green" : "0xAB",
"red" : "0xAA"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xAD",
"green" : "0xAB",
"red" : "0xAA"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x33",
"green" : "0x2D",
"red" : "0x2B"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0x00"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0x00"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x33",
"green" : "0x2D",
"red" : "0x2B"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xE7",
"green" : "0x88",
"red" : "0x06"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xE7",
"green" : "0x88",
"red" : "0x06"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.100",
"blue" : "0xE7",
"green" : "0x88",
"red" : "0x06"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x49",
"green" : "0xD7",
"red" : "0xF8"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x49",
"green" : "0xD7",
"red" : "0xF8"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xF4",
"red" : "0xEE"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x46",
"green" : "0x2F",
"red" : "0x27"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,113 @@
class Font {
// MARK: - Font by Weights
class func black(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-Black", size: size)
}
class func bold(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-Bold", size: size)
}
class func extraBold(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-ExtraBold", size: size)
}
class func heavy(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-Heavy", size: size)
}
class func light(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-Light", size: size)
}
class func medium(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-Medium", size: size)
}
class func regular(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-Regular", size: size)
}
class func semiBold(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-SemiBold", size: size)
}
class func thin(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-Thin", size: size)
}
class func ultraLight(size: CGFloat) -> UIFont {
return getCustomFont(withName: "Gilroy-UltraLight", size: size)
}
// MARK: - Font by Styles
static let genericStyle = TextStyle(
font: regular(size: 16.0),
lineHeight: 18
)
static let humongous = TextStyle(
font: extraBold(size: 36.0),
lineHeight: 40
)
static let h1 = TextStyle(
font: semiBold(size: 32.0),
lineHeight: 36
)
static let h2 = TextStyle(
font: semiBold(size: 24.0),
lineHeight: 36
)
static let h3 = TextStyle(
font: semiBold(size: 20.0),
lineHeight: 22
)
static let h4 = TextStyle(
font: medium(size: 16.0),
lineHeight: 18
)
static let b1 = TextStyle(
font: regular(size: 14.0),
lineHeight: 16
)
static let b2 = TextStyle(
font: regular(size: 12.0),
lineHeight: 14
)
static let b3 = TextStyle(
font: regular(size: 10.0),
lineHeight: 12
)
// MARK: - funcs
private class func getCustomFont(withName name: String, size: CGFloat) -> UIFont {
if let font = UIFont(name: name, size: size) {
return font
}
return UIFont.systemFont(ofSize: size)
}
static func applyStyle(to label: UILabel, style: TextStyle) {
label.font = style.font
label.adjustsFontForContentSizeCategory = true
let lineHeight = style.lineHeight
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = lineHeight - label.font.lineHeight
label.adjustsFontForContentSizeCategory = true
label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: style.font)
label.attributedText = NSAttributedString(string: label.text ?? "", attributes: [.paragraphStyle: paragraphStyle])
}
}
struct TextStyle {
let font: UIFont
let lineHeight: CGFloat
}