Skip to content

Commit 38e37ba

Browse files
Repaired errors in unwrapping optionals
1 parent ee724cf commit 38e37ba

File tree

8 files changed

+32
-17
lines changed

8 files changed

+32
-17
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2
1+
2.3

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- markymark (0.1.3)
2+
- markymark (1.0.0)
33

44
DEPENDENCIES:
55
- markymark (from `../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: ../
1010

1111
SPEC CHECKSUMS:
12-
markymark: 3ddb7b3e2d77f6daf458f17c58baf075e1da7c86
12+
markymark: 98e5f546d669b72a9a0421132435bda772f05a68
1313

1414
PODFILE CHECKSUM: 481cd97f67bbaaac4fbd503a35c4acb0fe69c1cc
1515

16-
COCOAPODS: 1.0.1
16+
COCOAPODS: 1.1.0.rc.2

Example/markymark.xcodeproj/project.pbxproj

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,15 +344,17 @@
344344
isa = PBXProject;
345345
attributes = {
346346
LastSwiftUpdateCheck = 0720;
347-
LastUpgradeCheck = 0720;
347+
LastUpgradeCheck = 0800;
348348
ORGANIZATIONNAME = CocoaPods;
349349
TargetAttributes = {
350350
607FACCF1AFB9204008FA782 = {
351351
CreatedOnToolsVersion = 6.3.1;
352352
DevelopmentTeam = 3B6J93GERH;
353+
LastSwiftMigration = 0800;
353354
};
354355
607FACE41AFB9204008FA782 = {
355356
CreatedOnToolsVersion = 6.3.1;
357+
LastSwiftMigration = 0800;
356358
TestTargetID = 607FACCF1AFB9204008FA782;
357359
};
358360
};
@@ -410,7 +412,7 @@
410412
);
411413
runOnlyForDeploymentPostprocessing = 0;
412414
shellPath = /bin/sh;
413-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
415+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
414416
showEnvVarsInLog = 0;
415417
};
416418
029A2E5D6800056D702BE822 /* [CP] Embed Pods Frameworks */ = {
@@ -470,7 +472,7 @@
470472
);
471473
runOnlyForDeploymentPostprocessing = 0;
472474
shellPath = /bin/sh;
473-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
475+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
474476
showEnvVarsInLog = 0;
475477
};
476478
F220BF3FD9625FD67595F183 /* [CP] Embed Pods Frameworks */ = {
@@ -576,8 +578,10 @@
576578
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
577579
CLANG_WARN_EMPTY_BODY = YES;
578580
CLANG_WARN_ENUM_CONVERSION = YES;
581+
CLANG_WARN_INFINITE_RECURSION = YES;
579582
CLANG_WARN_INT_CONVERSION = YES;
580583
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
584+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
581585
CLANG_WARN_UNREACHABLE_CODE = YES;
582586
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
583587
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -621,8 +625,10 @@
621625
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
622626
CLANG_WARN_EMPTY_BODY = YES;
623627
CLANG_WARN_ENUM_CONVERSION = YES;
628+
CLANG_WARN_INFINITE_RECURSION = YES;
624629
CLANG_WARN_INT_CONVERSION = YES;
625630
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
631+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
626632
CLANG_WARN_UNREACHABLE_CODE = YES;
627633
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
628634
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -642,6 +648,7 @@
642648
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
643649
MTL_ENABLE_DEBUG_INFO = NO;
644650
SDKROOT = iphoneos;
651+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
645652
VALIDATE_PRODUCT = YES;
646653
};
647654
name = Release;
@@ -650,6 +657,7 @@
650657
isa = XCBuildConfiguration;
651658
baseConfigurationReference = 09F6D551E99F224FBB0ACEA1 /* Pods-markymark_Example.debug.xcconfig */;
652659
buildSettings = {
660+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
653661
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
654662
CODE_SIGN_IDENTITY = "iPhone Developer";
655663
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -659,13 +667,15 @@
659667
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
660668
PRODUCT_NAME = "$(TARGET_NAME)";
661669
PROVISIONING_PROFILE = "";
670+
SWIFT_VERSION = 2.3;
662671
};
663672
name = Debug;
664673
};
665674
607FACF11AFB9204008FA782 /* Release */ = {
666675
isa = XCBuildConfiguration;
667676
baseConfigurationReference = 9704F30C7296E4A0EA9A0087 /* Pods-markymark_Example.release.xcconfig */;
668677
buildSettings = {
678+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
669679
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
670680
CODE_SIGN_IDENTITY = "iPhone Developer";
671681
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -675,13 +685,15 @@
675685
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
676686
PRODUCT_NAME = "$(TARGET_NAME)";
677687
PROVISIONING_PROFILE = "";
688+
SWIFT_VERSION = 2.3;
678689
};
679690
name = Release;
680691
};
681692
607FACF31AFB9204008FA782 /* Debug */ = {
682693
isa = XCBuildConfiguration;
683694
baseConfigurationReference = 9ACED21B5B719CEBD45DC4FF /* Pods-markymark_Tests.debug.xcconfig */;
684695
buildSettings = {
696+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
685697
FRAMEWORK_SEARCH_PATHS = (
686698
"$(SDKROOT)/Developer/Library/Frameworks",
687699
"$(inherited)",
@@ -694,13 +706,15 @@
694706
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
695707
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
696708
PRODUCT_NAME = "$(TARGET_NAME)";
709+
SWIFT_VERSION = 2.3;
697710
};
698711
name = Debug;
699712
};
700713
607FACF41AFB9204008FA782 /* Release */ = {
701714
isa = XCBuildConfiguration;
702715
baseConfigurationReference = F999758130B6D43C3A4FA9BF /* Pods-markymark_Tests.release.xcconfig */;
703716
buildSettings = {
717+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
704718
FRAMEWORK_SEARCH_PATHS = (
705719
"$(SDKROOT)/Developer/Library/Frameworks",
706720
"$(inherited)",
@@ -709,6 +723,7 @@
709723
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
710724
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
711725
PRODUCT_NAME = "$(TARGET_NAME)";
726+
SWIFT_VERSION = 2.3;
712727
};
713728
name = Release;
714729
};

Example/markymark.xcodeproj/xcshareddata/xcschemes/markymark-Example.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0720"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Example/markymark/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ViewController: UIViewController {
1818
self.view = UIScrollView()
1919

2020
//Change this constant to try different configurations
21-
let converterConfiguration = ConverterConfiguration.AttributedString
21+
let converterConfiguration = ConverterConfiguration.View
2222

2323

2424
//MarkyMark
@@ -91,4 +91,4 @@ private extension ViewController {
9191

9292
return markdownString
9393
}
94-
}
94+
}

markymark.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "markymark"
3-
s.version = "1.0.0"
3+
s.version = "2.0.1"
44
s.summary = "Markdown parser for iOS"
55
s.description = <<-DESC
66
Marky Mark is a parser written in Swift that converts markdown into native views. The way it looks is highly customizable and the supported markdown syntax and tags are easy to extend.

markymark/Classes/Layout Builders/AttributedString/Block Builders/Inline/TextAttachment.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class TextAttachment: NSTextAttachment {
1515

1616
var imageSize = CGSize()
1717

18-
var originalImageSize = image?.size ?? CGSize()
18+
let originalImageSize = image?.size ?? CGSize()
1919
let imageRatio = originalImageSize.height / originalImageSize.width
2020

2121
imageSize.width = lineFrag.width
2222
imageSize.height = imageSize.width * imageRatio
2323

2424
return CGRect(origin: CGPoint(), size: imageSize)
2525
}
26-
}
26+
}

markymark/Classes/Styling/Protocols/BaseFontStylingRule.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ private extension UIFont {
5656

5757
func makeBold() -> UIFont {
5858

59-
return UIFont.init(descriptor: self.fontDescriptor().fontDescriptorWithSymbolicTraits(.TraitBold), size: self.pointSize)
59+
return UIFont.init(descriptor: self.fontDescriptor().fontDescriptorWithSymbolicTraits(.TraitBold)!, size: self.pointSize)
6060
}
6161

6262
func makeItalic() -> UIFont {
63-
return UIFont.init(descriptor: self.fontDescriptor().fontDescriptorWithSymbolicTraits(.TraitItalic), size: self.pointSize)
63+
return UIFont.init(descriptor: self.fontDescriptor().fontDescriptorWithSymbolicTraits(.TraitItalic)!, size: self.pointSize)
6464
}
6565

6666
func makeItalicBold() -> UIFont {
67-
return UIFont.init(descriptor: self.fontDescriptor().fontDescriptorWithSymbolicTraits([.TraitItalic, .TraitBold]), size: self.pointSize)
67+
return UIFont.init(descriptor: self.fontDescriptor().fontDescriptorWithSymbolicTraits([.TraitItalic, .TraitBold])!, size: self.pointSize)
6868

6969
}
7070

7171
func changeSize(size : CGFloat) -> UIFont {
7272

7373
return UIFont.init(descriptor: self.fontDescriptor().fontDescriptorWithSize(size), size: size)
7474
}
75-
}
75+
}

0 commit comments

Comments
 (0)