Skip to content

Commit 5ed70b9

Browse files
authored
Merge pull request #14 from contentful-labs/feature/swift-package-manager
Make the library available via Swift Package Manager
2 parents bf35ada + 79636f5 commit 5ed70b9

File tree

97 files changed

+1508
-1296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1508
-1296
lines changed

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ContentfulRichTextRenderer.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |spec|
44
spec.name = "ContentfulRichTextRenderer"
5-
spec.version = "0.2.0"
5+
spec.version = "0.2.1"
66
spec.summary = "Swift library for rendering Contentful RichTextDocument."
77
spec.homepage = "https://github.com/contentful-labs/rich-text-renderer.swift"
88
spec.social_media_url = 'https://twitter.com/contentful'
@@ -17,9 +17,9 @@ Pod::Spec.new do |spec|
1717
spec.swift_version = "5.2"
1818
spec.ios.deployment_target = "11.0"
1919

20-
spec.source_files = "RichTextRenderer/**/*.swift"
20+
spec.source_files = "Sources/RichTextRenderer/**/*.swift"
2121

22-
spec.dependency 'AlamofireImage'
23-
spec.dependency 'Contentful'
22+
spec.dependency 'AlamofireImage', '~> 4.1.0'
23+
spec.dependency 'Contentful', '~> 5.2.0'
2424
end
2525

Example-iOS/Example-iOS.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
6DB2F48F24C0302D00A07D9B /* Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DB2F48C24C0302D00A07D9B /* Article.swift */; };
2020
6DB2F49224C0303600A07D9B /* ExampleBlockViewProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DB2F49024C0303500A07D9B /* ExampleBlockViewProvider.swift */; };
2121
6DB2F49324C0303600A07D9B /* ExampleInlineStringProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DB2F49124C0303500A07D9B /* ExampleInlineStringProvider.swift */; };
22+
6DCC7F96250009CF000EF0E7 /* StartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DCC7F95250009CF000EF0E7 /* StartViewController.swift */; };
2223
6DEB233424E531AF009D5879 /* CarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DEB233324E531AF009D5879 /* CarView.swift */; };
2324
6DEB233624E531D3009D5879 /* SuggestedArticleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DEB233524E531D3009D5879 /* SuggestedArticleView.swift */; };
2425
/* End PBXBuildFile section */
@@ -40,6 +41,7 @@
4041
6DB2F48C24C0302D00A07D9B /* Article.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Article.swift; sourceTree = "<group>"; };
4142
6DB2F49024C0303500A07D9B /* ExampleBlockViewProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleBlockViewProvider.swift; sourceTree = "<group>"; };
4243
6DB2F49124C0303500A07D9B /* ExampleInlineStringProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleInlineStringProvider.swift; sourceTree = "<group>"; };
44+
6DCC7F95250009CF000EF0E7 /* StartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartViewController.swift; sourceTree = "<group>"; };
4345
6DEB233324E531AF009D5879 /* CarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarView.swift; sourceTree = "<group>"; };
4446
6DEB233524E531D3009D5879 /* SuggestedArticleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestedArticleView.swift; sourceTree = "<group>"; };
4547
D954E450246B71B288D7C891 /* Pods-Example-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-iOS.release.xcconfig"; path = "Target Support Files/Pods-Example-iOS/Pods-Example-iOS.release.xcconfig"; sourceTree = "<group>"; };
@@ -81,6 +83,7 @@
8183
6DB2F48124C02DF100A07D9B /* Contentful */,
8284
6DB2F46D24C02CB800A07D9B /* AppDelegate.swift */,
8385
6DB2F47124C02CB800A07D9B /* ViewController.swift */,
86+
6DCC7F95250009CF000EF0E7 /* StartViewController.swift */,
8487
6DB2F47324C02CB800A07D9B /* Main.storyboard */,
8588
6DB2F47624C02CB900A07D9B /* Assets.xcassets */,
8689
6DB2F47824C02CB900A07D9B /* LaunchScreen.storyboard */,
@@ -249,6 +252,7 @@
249252
6DB2F48F24C0302D00A07D9B /* Article.swift in Sources */,
250253
6DEB233624E531D3009D5879 /* SuggestedArticleView.swift in Sources */,
251254
6DB2F49324C0303600A07D9B /* ExampleInlineStringProvider.swift in Sources */,
255+
6DCC7F96250009CF000EF0E7 /* StartViewController.swift in Sources */,
252256
6DB2F49224C0303600A07D9B /* ExampleBlockViewProvider.swift in Sources */,
253257
6DB2F48E24C0302D00A07D9B /* Car.swift in Sources */,
254258
6DB2F46E24C02CB800A07D9B /* AppDelegate.swift in Sources */,

Example-iOS/Example-iOS/AppDelegate.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1111
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
1212
) -> Bool {
1313
let window = UIWindow(frame: UIScreen.main.bounds)
14-
let viewController = ViewController()
14+
15+
let startViewController = UIStoryboard(name: "Main", bundle: nil)
16+
.instantiateViewController(withIdentifier: String(describing: StartViewController.self))
17+
18+
let viewController = startViewController
1519
window.rootViewController = viewController
1620
window.makeKeyAndVisible()
1721

Example-iOS/Example-iOS/Base.lproj/Main.storyboard

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,46 @@
44
<dependencies>
55
<deployment identifier="iOS"/>
66
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
7+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
79
</dependencies>
8-
<scenes/>
10+
<scenes>
11+
<!--Start View Controller-->
12+
<scene sceneID="ePm-pI-Y34">
13+
<objects>
14+
<viewController storyboardIdentifier="StartViewController" id="8hJ-5Q-1tc" customClass="StartViewController" customModule="Example_iOS" customModuleProvider="target" sceneMemberID="viewController">
15+
<view key="view" contentMode="scaleToFill" id="PG0-vh-vSH">
16+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<subviews>
19+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hFK-KD-pyR">
20+
<rect key="frame" x="151.5" y="85" width="111" height="30"/>
21+
<state key="normal" title="Present Modally"/>
22+
<connections>
23+
<action selector="presentModally" destination="8hJ-5Q-1tc" eventType="touchUpInside" id="jkF-s0-zGP"/>
24+
</connections>
25+
</button>
26+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Gc-el-DO7">
27+
<rect key="frame" x="98.5" y="139" width="217" height="30"/>
28+
<state key="normal" title="Present in Navigation Controller"/>
29+
<connections>
30+
<action selector="presentInNavigationController" destination="8hJ-5Q-1tc" eventType="touchUpInside" id="Due-Er-sc2"/>
31+
</connections>
32+
</button>
33+
</subviews>
34+
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
35+
<constraints>
36+
<constraint firstItem="hFK-KD-pyR" firstAttribute="top" secondItem="F55-1w-tiZ" secondAttribute="top" constant="41" id="0Pt-9J-2zZ"/>
37+
<constraint firstItem="6Gc-el-DO7" firstAttribute="top" secondItem="hFK-KD-pyR" secondAttribute="bottom" constant="24" id="I9I-VW-Cy7"/>
38+
<constraint firstItem="6Gc-el-DO7" firstAttribute="centerX" secondItem="F55-1w-tiZ" secondAttribute="centerX" id="cJ9-Cj-xAv"/>
39+
<constraint firstItem="hFK-KD-pyR" firstAttribute="centerX" secondItem="F55-1w-tiZ" secondAttribute="centerX" id="ju5-Fn-q2g"/>
40+
</constraints>
41+
<viewLayoutGuide key="safeArea" id="F55-1w-tiZ"/>
42+
</view>
43+
</viewController>
44+
<placeholder placeholderIdentifier="IBFirstResponder" id="ywY-vy-uYo" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
45+
</objects>
46+
<point key="canvasLocation" x="932" y="994"/>
47+
</scene>
48+
</scenes>
949
</document>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// Copyright © 2020 Contentful. All rights reserved.
3+
//
4+
5+
import UIKit
6+
7+
final class StartViewController: UIViewController {
8+
9+
@IBAction private func presentModally() {
10+
let viewController = ViewController()
11+
self.present(viewController, animated: true, completion: nil)
12+
}
13+
14+
@IBAction private func presentInNavigationController() {
15+
let viewController = ViewController()
16+
viewController.title = "Betonowy Dom."
17+
let navigationController = UINavigationController(rootViewController: viewController)
18+
self.present(navigationController, animated: true, completion: nil)
19+
}
20+
}

Package.resolved

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// swift-tools-version:5.2
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "ContentfulRichTextRenderer",
6+
platforms: [
7+
.iOS(.v11)
8+
],
9+
products: [
10+
.library(
11+
name: "ContentfulRichTextRenderer",
12+
targets: ["RichTextRenderer"])
13+
],
14+
dependencies: [
15+
.package(
16+
name: "Contentful",
17+
url: "https://github.com/contentful/contentful.swift.git",
18+
from: "5.2.0"
19+
),
20+
.package(
21+
name: "AlamofireImage",
22+
url: "https://github.com/Alamofire/AlamofireImage.git",
23+
from: "4.1.0"
24+
)
25+
],
26+
targets: [
27+
.target(
28+
name: "RichTextRenderer",
29+
dependencies: ["Contentful", "AlamofireImage"],
30+
path: "Sources"
31+
)
32+
],
33+
swiftLanguageVersions: [.v5]
34+
)

Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ PODS:
55
- Contentful (5.2.0):
66
- Contentful/ImageOptions (= 5.2.0)
77
- Contentful/ImageOptions (5.2.0)
8-
- ContentfulRichTextRenderer (1.0):
9-
- AlamofireImage
10-
- Contentful
8+
- ContentfulRichTextRenderer (0.2.0):
9+
- AlamofireImage (~> 4.1.0)
10+
- Contentful (~> 5.2.0)
1111

1212
DEPENDENCIES:
1313
- AlamofireImage
1414
- Contentful
1515
- ContentfulRichTextRenderer (from `ContentfulRichTextRenderer.podspec`)
1616

1717
SPEC REPOS:
18-
https://github.com/cocoapods/specs.git:
18+
trunk:
1919
- Alamofire
2020
- AlamofireImage
2121
- Contentful
@@ -28,8 +28,8 @@ SPEC CHECKSUMS:
2828
Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0
2929
AlamofireImage: c4a2ba349885fb3064feb74d2e547bd42ce9be10
3030
Contentful: 4973186d957d01c4868107fa4bda2149cd5ea107
31-
ContentfulRichTextRenderer: 4708dfac5e702058db0ad617e4d9e0e61cda5f7c
31+
ContentfulRichTextRenderer: c3ad3e3811139ec1da8c65632b5e135f86853cd5
3232

3333
PODFILE CHECKSUM: 5f25e3c0ed7f21cbf643044d554ad42e477ccf5e
3434

35-
COCOAPODS: 1.6.0.beta.2
35+
COCOAPODS: 1.9.3

Pods/Headers/Public/Alamofire/Alamofire-umbrella.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)