Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Example project to use Swift 5 #71

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -134,6 +134,7 @@
TargetAttributes = {
099226AE20D286950002EBDA = {
CreatedOnToolsVersion = 9.3.1;
LastSwiftMigration = 1120;
};
};
};
Expand Down Expand Up @@ -192,17 +193,16 @@
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/StyledTextKit/StyledTextKit.framework",
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StyledTextKit.framework",
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -371,7 +371,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "Marcus-Wu.Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -390,7 +390,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "Marcus-Wu.Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

return true
}
Expand Down
10 changes: 5 additions & 5 deletions Example/Example/BackgroundRenderingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import UIKit
import StyledTextKit
import SafariServices

extension NSAttributedStringKey {
extension NSAttributedString.Key {

public static let tapable = NSAttributedStringKey(rawValue: "tapable")
public static let tapable = NSAttributedString.Key(rawValue: "tapable")

}

Expand Down Expand Up @@ -83,13 +83,13 @@ class BackgroundRenderingViewController: UIViewController {
}

extension BackgroundRenderingViewController: StyledTextViewDelegate {
func didTap(view: StyledTextView, attributes: [NSAttributedStringKey : Any], point: CGPoint) {

func didTap(view: StyledTextView, attributes: NSAttributedStringAttributesType, point: CGPoint) {
guard let action = attributes[.tapable] as? Selector else { return }

perform(action)
}

func didLongPress(view: StyledTextView, attributes: [NSAttributedStringKey : Any], point: CGPoint) {}
func didLongPress(view: StyledTextView, attributes: NSAttributedStringAttributesType, point: CGPoint) {}

}
2 changes: 1 addition & 1 deletion Example/Example/RenderingTextBitmapsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RenderingTextBitmapsViewController: UIViewController {
let result = renderer.render(for: UIScreen.main.bounds.width)

view.layer.contents = result.image
view.layer.contentsGravity = kCAGravityCenter
view.layer.contentsGravity = CALayerContentsGravity.center
}

}
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- StyledTextKit (0.1.1)
- StyledTextKit (0.2.0)

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

SPEC CHECKSUMS:
StyledTextKit: 7fb706b7dce1bf5adcf7df6054b5c321b94ebfc0
StyledTextKit: 72ce06a21fc6527093f2fcad246ed419707b4ff9

PODFILE CHECKSUM: cce33de777ba45b96bae71bcdc8c7705f353b112

COCOAPODS: 1.5.0
COCOAPODS: 1.11.0
9 changes: 5 additions & 4 deletions Example/Pods/Local Podspecs/StyledTextKit.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading