Skip to content

Commit

Permalink
Dark mode support (#58)
Browse files Browse the repository at this point in the history
* Dark mode support

* update toolkits

* bump versions

* rebuild assets by latest toolsets

* update version

* fix supported xcode and swift versions
  • Loading branch information
keitaoouchi committed Oct 3, 2020
1 parent f486631 commit 018b90a
Show file tree
Hide file tree
Showing 22 changed files with 14,538 additions and 3,925 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
osx_image: xcode10.2
language: objective-c
osx_image: xcode11.6
language: swift
before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
Expand Down
4 changes: 2 additions & 2 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -358,7 +358,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
40 changes: 21 additions & 19 deletions Example/Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="0zV-ZM-AeL">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="0zV-ZM-AeL">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -18,9 +17,9 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="isE-Ah-h1M"/>
</viewController>
Expand All @@ -39,7 +38,7 @@
<view key="view" contentMode="scaleToFill" id="uai-KV-wIO">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4Q0-Hg-hAF" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand All @@ -51,7 +50,7 @@
<objects>
<navigationController id="0zV-ZM-AeL" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" translucent="NO" id="YIJ-65-bX7">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="ZuY-QC-Xpc">
Expand All @@ -78,8 +77,8 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Elg-eD-B8F" customClass="MarkdownView" customModule="MarkdownView">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -118,13 +117,12 @@
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7IU-tq-2e9" customClass="MarkdownView" customModule="MarkdownView">
<rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" placeholder="YES" id="JQv-Ma-12I"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="7IU-tq-2e9" secondAttribute="bottom" id="Ljb-Nd-ewm"/>
<constraint firstItem="7IU-tq-2e9" firstAttribute="leading" secondItem="7TF-Zc-lc6" secondAttribute="leading" id="Z9f-5S-tPI"/>
Expand All @@ -142,7 +140,7 @@
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="QoT-Qh-Bk4" firstAttribute="top" secondItem="uMW-MQ-HcC" secondAttribute="top" id="ahc-aP-1k3"/>
<constraint firstItem="7IQ-R8-o8K" firstAttribute="top" secondItem="QoT-Qh-Bk4" secondAttribute="bottom" id="mSN-hp-PKi"/>
Expand Down Expand Up @@ -171,20 +169,19 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="izT-Tv-hzD">
<rect key="frame" x="0.0" y="76" width="375" height="591"/>
<rect key="frame" x="0.0" y="56" width="375" height="611"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DNa-7Z-b9M">
<rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dG6-ar-pCb" customClass="MarkdownView" customModule="MarkdownView">
<rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" placeholder="YES" id="Gig-Pn-LYq"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="dG6-ar-pCb" firstAttribute="top" secondItem="DNa-7Z-b9M" secondAttribute="top" id="6sZ-ek-nRn"/>
<constraint firstAttribute="trailing" secondItem="dG6-ar-pCb" secondAttribute="trailing" id="KJp-IY-wPa"/>
Expand All @@ -202,11 +199,11 @@
</constraints>
</scrollView>
<searchBar contentMode="redraw" translatesAutoresizingMaskIntoConstraints="NO" id="TAa-ZV-mC7">
<rect key="frame" x="0.0" y="20" width="375" height="56"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="56"/>
<textInputTraits key="textInputTraits"/>
</searchBar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="TAa-ZV-mC7" secondAttribute="trailing" id="2Oa-Vl-h5M"/>
<constraint firstItem="izT-Tv-hzD" firstAttribute="leading" secondItem="XWG-QA-6Ev" secondAttribute="leading" id="6u4-9t-fAx"/>
Expand All @@ -227,4 +224,9 @@
<point key="canvasLocation" x="3232.8000000000002" y="35.532233883058474"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
2 changes: 1 addition & 1 deletion Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class ViewController: UIViewController {
example4Button
].forEach { button in

button.setTitleColor(UIColor.blue, for: .normal)
button.setTitleColor(UIColor.systemBlue, for: .normal)
button.contentEdgeInsets = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
button.titleLabel?.font = UIFont.systemFont(ofSize: 20)
stackView.addArrangedSubview(button)
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
platform :ios, '13.0'

target 'Example' do
use_modular_headers!
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- MarkdownView (1.6.0)
- MarkdownView (1.7.0)

DEPENDENCIES:
- MarkdownView (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
MarkdownView: 25c1c2d7ff9706624a575556296e188be3dd3f6b
MarkdownView: f652cdc7774a7d9dda1b5c3a2948f9a7d9eb36b4

PODFILE CHECKSUM: 81524f0576f4f47cc5d483ea9038e72eae263c2e
PODFILE CHECKSUM: aca8c849eff30cf020f460dc2fb5cc0b4a16e14a

COCOAPODS: 1.7.2
6 changes: 3 additions & 3 deletions MarkdownView.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MarkdownView"
s.version = "1.6.0"
s.version = "1.7.0"
s.summary = "Markdown View for iOS."
s.homepage = "https://github.com/keitaoouchi/MarkdownView"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand All @@ -11,6 +11,6 @@ Pod::Spec.new do |s|
'MarkdownView' => ['webassets/dist/*']
}
s.frameworks = "Foundation"
s.ios.deployment_target = "10.0"
s.swift_version = '5.0'
s.ios.deployment_target = "13.0"
s.swift_version = '5.2'
end
7 changes: 5 additions & 2 deletions MarkdownView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = FCA0500B1EC41211001DAD5F;
Expand Down Expand Up @@ -286,8 +287,9 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = MarkdownView/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.7.0;
PRODUCT_BUNDLE_IDENTIFIER = com.keita.oouchi.MarkdownView;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -312,8 +314,9 @@
GCC_OPTIMIZATION_LEVEL = fast;
INFOPLIST_FILE = MarkdownView/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.7.0;
PRODUCT_BUNDLE_IDENTIFIER = com.keita.oouchi.MarkdownView;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion MarkdownView/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 3 additions & 1 deletion MarkdownView/MarkdownView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ open class MarkdownView: UIView {
wv.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true
wv.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true
wv.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true
wv.backgroundColor = self.backgroundColor
wv.isOpaque = false
wv.backgroundColor = .clear
wv.scrollView.backgroundColor = .clear

self.webView = wv

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MarkdownView

[![CI Status](http://img.shields.io/travis/keitaoouchi/MArkdownView.svg?style=flat)](https://travis-ci.org/keitaoouchi/MarkdownView)
[![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://swift.org/)
[![Swift 5.2](https://img.shields.io/badge/Swift-5.2-orange.svg?style=flat)](https://swift.org/)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/MarkdownView.svg?style=flat)](http://cocoapods.org/pods/MarkdownView)
[![License](https://img.shields.io/cocoapods/l/MarkdownView.svg?style=flat)](http://cocoapods.org/pods/MarkdownView)
Expand Down Expand Up @@ -50,8 +50,8 @@ md.onTouchLink = { [weak self] request in

| Target | Version |
|-------------------|---------|
| iOS | => 10.0 |
| Swift | => 5.0 |
| iOS | => 13.0 |
| Swift | => 5.2 |

## Installation

Expand Down
8 changes: 6 additions & 2 deletions webassets/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"presets": [
"es2015"
["env", {
"targets": {
"ios": 13
}
}]
]
}
}
2 changes: 1 addition & 1 deletion webassets/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```
yarn install
npm install
npm run build
```
18 changes: 1 addition & 17 deletions webassets/dist/main.css

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion webassets/dist/main.js

Large diffs are not rendered by default.

0 comments on commit 018b90a

Please sign in to comment.