Skip to content

Commit d465f90

Browse files
committed
Merged in update-ibdesignable-podspec (pull request #1)
Update of the IBDesignable class and .podspec file
2 parents 64da45c + 81b8a5e commit d465f90

24 files changed

Lines changed: 149 additions & 698 deletions

Example/KWTextStyleLabel.xcodeproj/project.pbxproj

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
1414
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
1515
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
16-
6F250C3B89A0EF508F08AE75 /* Pods_KWTextStyleLabel_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4CCDD07A4C1A4614F3D0E76 /* Pods_KWTextStyleLabel_Tests.framework */; };
17-
7F45ED709CF6F41BD02C86E6 /* Pods_KWTextStyleLabel_Example_KWTextStyleLabel_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 40D496E06330791F7B3BB072 /* Pods_KWTextStyleLabel_Example_KWTextStyleLabel_Tests.framework */; };
1816
F2EB0BDC4CBFE4FB16CB6F49 /* Pods_KWTextStyleLabel_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80148D5D26EDFA7E0F2E174E /* Pods_KWTextStyleLabel_Example.framework */; };
1917
/* End PBXBuildFile section */
2018

@@ -31,7 +29,6 @@
3129
/* Begin PBXFileReference section */
3230
2F3481396D95BA5CCC70548A /* Pods-KWTextStyleLabel_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KWTextStyleLabel_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-KWTextStyleLabel_Example/Pods-KWTextStyleLabel_Example.debug.xcconfig"; sourceTree = "<group>"; };
3331
3B0740BA4FE804A668633B6F /* KWTextStyleLabel.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = KWTextStyleLabel.podspec; path = ../KWTextStyleLabel.podspec; sourceTree = "<group>"; };
34-
3F50AC27116C8007719EFC0B /* Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.release.xcconfig"; sourceTree = "<group>"; };
3532
40D496E06330791F7B3BB072 /* Pods_KWTextStyleLabel_Example_KWTextStyleLabel_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_KWTextStyleLabel_Example_KWTextStyleLabel_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3633
607FACD01AFB9204008FA782 /* KWTextStyleLabel_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KWTextStyleLabel_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
3734
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -43,7 +40,6 @@
4340
607FACE51AFB9204008FA782 /* KWTextStyleLabel_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KWTextStyleLabel_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4441
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4542
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
46-
6A4473813C39359E4207A86C /* Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.debug.xcconfig"; sourceTree = "<group>"; };
4743
80148D5D26EDFA7E0F2E174E /* Pods_KWTextStyleLabel_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_KWTextStyleLabel_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4844
AD71E7218FD50D3A1716C4EC /* Pods-KWTextStyleLabel_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KWTextStyleLabel_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-KWTextStyleLabel_Example/Pods-KWTextStyleLabel_Example.release.xcconfig"; sourceTree = "<group>"; };
4945
B2B64461B46CEBC41F95A0C7 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
@@ -66,8 +62,6 @@
6662
isa = PBXFrameworksBuildPhase;
6763
buildActionMask = 2147483647;
6864
files = (
69-
6F250C3B89A0EF508F08AE75 /* Pods_KWTextStyleLabel_Tests.framework in Frameworks */,
70-
7F45ED709CF6F41BD02C86E6 /* Pods_KWTextStyleLabel_Example_KWTextStyleLabel_Tests.framework in Frameworks */,
7165
);
7266
runOnlyForDeploymentPostprocessing = 0;
7367
};
@@ -81,8 +75,6 @@
8175
AD71E7218FD50D3A1716C4EC /* Pods-KWTextStyleLabel_Example.release.xcconfig */,
8276
DA6B133529479ED555F985F3 /* Pods-KWTextStyleLabel_Tests.debug.xcconfig */,
8377
E36C94D96D06CB47A6BFD948 /* Pods-KWTextStyleLabel_Tests.release.xcconfig */,
84-
6A4473813C39359E4207A86C /* Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.debug.xcconfig */,
85-
3F50AC27116C8007719EFC0B /* Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.release.xcconfig */,
8678
);
8779
name = Pods;
8880
sourceTree = "<group>";
@@ -194,12 +186,9 @@
194186
isa = PBXNativeTarget;
195187
buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "KWTextStyleLabel_Tests" */;
196188
buildPhases = (
197-
62A878A67409B8AA9AF6AD39 /* [CP] Check Pods Manifest.lock */,
198189
607FACE11AFB9204008FA782 /* Sources */,
199190
607FACE21AFB9204008FA782 /* Frameworks */,
200191
607FACE31AFB9204008FA782 /* Resources */,
201-
DF84E6321090783A7DC01481 /* [CP] Embed Pods Frameworks */,
202-
4033C0B804C12045FBF2DD6D /* [CP] Copy Pods Resources */,
203192
);
204193
buildRules = (
205194
);
@@ -287,36 +276,6 @@
287276
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-KWTextStyleLabel_Example/Pods-KWTextStyleLabel_Example-frameworks.sh\"\n";
288277
showEnvVarsInLog = 0;
289278
};
290-
4033C0B804C12045FBF2DD6D /* [CP] Copy Pods Resources */ = {
291-
isa = PBXShellScriptBuildPhase;
292-
buildActionMask = 2147483647;
293-
files = (
294-
);
295-
inputPaths = (
296-
);
297-
name = "[CP] Copy Pods Resources";
298-
outputPaths = (
299-
);
300-
runOnlyForDeploymentPostprocessing = 0;
301-
shellPath = /bin/sh;
302-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests-resources.sh\"\n";
303-
showEnvVarsInLog = 0;
304-
};
305-
62A878A67409B8AA9AF6AD39 /* [CP] Check Pods Manifest.lock */ = {
306-
isa = PBXShellScriptBuildPhase;
307-
buildActionMask = 2147483647;
308-
files = (
309-
);
310-
inputPaths = (
311-
);
312-
name = "[CP] Check Pods Manifest.lock";
313-
outputPaths = (
314-
);
315-
runOnlyForDeploymentPostprocessing = 0;
316-
shellPath = /bin/sh;
317-
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";
318-
showEnvVarsInLog = 0;
319-
};
320279
9AC742039B879CBAAE95CFAF /* [CP] Check Pods Manifest.lock */ = {
321280
isa = PBXShellScriptBuildPhase;
322281
buildActionMask = 2147483647;
@@ -347,21 +306,6 @@
347306
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-KWTextStyleLabel_Example/Pods-KWTextStyleLabel_Example-resources.sh\"\n";
348307
showEnvVarsInLog = 0;
349308
};
350-
DF84E6321090783A7DC01481 /* [CP] Embed Pods Frameworks */ = {
351-
isa = PBXShellScriptBuildPhase;
352-
buildActionMask = 2147483647;
353-
files = (
354-
);
355-
inputPaths = (
356-
);
357-
name = "[CP] Embed Pods Frameworks";
358-
outputPaths = (
359-
);
360-
runOnlyForDeploymentPostprocessing = 0;
361-
shellPath = /bin/sh;
362-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests/Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests-frameworks.sh\"\n";
363-
showEnvVarsInLog = 0;
364-
};
365309
/* End PBXShellScriptBuildPhase section */
366310

367311
/* Begin PBXSourcesBuildPhase section */
@@ -524,7 +468,6 @@
524468
};
525469
607FACF31AFB9204008FA782 /* Debug */ = {
526470
isa = XCBuildConfiguration;
527-
baseConfigurationReference = 6A4473813C39359E4207A86C /* Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.debug.xcconfig */;
528471
buildSettings = {
529472
FRAMEWORK_SEARCH_PATHS = (
530473
"$(SDKROOT)/Developer/Library/Frameworks",
@@ -544,7 +487,6 @@
544487
};
545488
607FACF41AFB9204008FA782 /* Release */ = {
546489
isa = XCBuildConfiguration;
547-
baseConfigurationReference = 3F50AC27116C8007719EFC0B /* Pods-KWTextStyleLabel_Example-KWTextStyleLabel_Tests.release.xcconfig */;
548490
buildSettings = {
549491
FRAMEWORK_SEARCH_PATHS = (
550492
"$(SDKROOT)/Developer/Library/Frameworks",

Example/KWTextStyleLabel/AppDelegate.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
1716
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// Override point for customization after application launch.
1917
return true
2018
}
2119

2220
func applicationWillResignActive(_ application: UIApplication) {
23-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24-
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
2521
}
2622

2723
func applicationDidEnterBackground(_ application: UIApplication) {
28-
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
3024
}
3125

3226
func applicationWillEnterForeground(_ application: UIApplication) {
33-
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
3427
}
3528

3629
func applicationDidBecomeActive(_ application: UIApplication) {
37-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
3830
}
3931

4032
func applicationWillTerminate(_ application: UIApplication) {
41-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4233
}
43-
44-
4534
}
4635

Example/KWTextStyleLabel/Base.lproj/Main.storyboard

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<dependencies>
77
<deployment identifier="iOS"/>
88
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
9-
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
109
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1110
</dependencies>
1211
<scenes>
@@ -22,21 +21,68 @@
2221
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2322
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2423
<subviews>
25-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tBY-1B-pbW" customClass="KWTextStyleLabel" customModule="KWTextStyleLabel">
26-
<rect key="frame" x="39" y="70" width="296" height="21"/>
24+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="m8j-GV-ibK">
25+
<rect key="frame" x="28" y="46" width="320" height="575"/>
26+
<subviews>
27+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="justified" lineBreakMode="characterWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tBY-1B-pbW" customClass="KWTextStyleLabel" customModule="KWTextStyleLabel">
28+
<rect key="frame" x="8" y="142" width="296" height="433"/>
29+
<constraints>
30+
<constraint firstAttribute="height" constant="433" id="Zjq-e0-ceZ"/>
31+
</constraints>
32+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
33+
<nil key="textColor"/>
34+
<nil key="highlightedColor"/>
35+
<userDefinedRuntimeAttributes>
36+
<userDefinedRuntimeAttribute type="number" keyPath="lineGap">
37+
<real key="value" value="10"/>
38+
</userDefinedRuntimeAttribute>
39+
<userDefinedRuntimeAttribute type="number" keyPath="characterSpacing">
40+
<real key="value" value="3"/>
41+
</userDefinedRuntimeAttribute>
42+
<userDefinedRuntimeAttribute type="string" keyPath="kerningText">
43+
<string key="value">Body with
44+
Character spacing: 3 and
45+
Line spacing: 10
46+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</string>
47+
</userDefinedRuntimeAttribute>
48+
</userDefinedRuntimeAttributes>
49+
</label>
50+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="characterWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ICB-6o-zxg" customClass="KWTextStyleLabel" customModule="KWTextStyleLabel">
51+
<rect key="frame" x="8" y="0.0" width="296" height="122"/>
52+
<constraints>
53+
<constraint firstAttribute="height" constant="122" id="gpa-Oo-MND"/>
54+
</constraints>
55+
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
56+
<nil key="textColor"/>
57+
<nil key="highlightedColor"/>
58+
<userDefinedRuntimeAttributes>
59+
<userDefinedRuntimeAttribute type="number" keyPath="lineGap">
60+
<real key="value" value="25"/>
61+
</userDefinedRuntimeAttribute>
62+
<userDefinedRuntimeAttribute type="number" keyPath="characterSpacing">
63+
<real key="value" value="5"/>
64+
</userDefinedRuntimeAttribute>
65+
<userDefinedRuntimeAttribute type="string" keyPath="kerningText" value="Heading with Character spacing: 5 and Line spacing: 25"/>
66+
</userDefinedRuntimeAttributes>
67+
</label>
68+
</subviews>
69+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
2770
<constraints>
28-
<constraint firstAttribute="height" constant="21" id="dSU-6b-FVQ"/>
71+
<constraint firstAttribute="trailing" secondItem="tBY-1B-pbW" secondAttribute="trailing" constant="16" id="0sC-cU-038"/>
72+
<constraint firstAttribute="bottom" secondItem="tBY-1B-pbW" secondAttribute="bottom" id="9EN-r2-UJb"/>
73+
<constraint firstItem="tBY-1B-pbW" firstAttribute="leading" secondItem="m8j-GV-ibK" secondAttribute="leading" constant="8" id="Ah3-71-KWg"/>
74+
<constraint firstItem="ICB-6o-zxg" firstAttribute="leading" secondItem="m8j-GV-ibK" secondAttribute="leading" constant="8" id="PHb-2B-yaY"/>
75+
<constraint firstItem="ICB-6o-zxg" firstAttribute="top" secondItem="m8j-GV-ibK" secondAttribute="top" id="Tjj-rl-9Lc"/>
76+
<constraint firstAttribute="width" constant="320" id="UhG-RF-fGP"/>
77+
<constraint firstAttribute="height" constant="575" id="fdB-uY-dIL"/>
78+
<constraint firstAttribute="trailing" secondItem="ICB-6o-zxg" secondAttribute="trailing" constant="16" id="jcn-TF-c1I"/>
2979
</constraints>
30-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
31-
<nil key="textColor"/>
32-
<nil key="highlightedColor"/>
33-
</label>
80+
</view>
3481
</subviews>
3582
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3683
<constraints>
37-
<constraint firstItem="tBY-1B-pbW" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="50" id="Lgh-zR-yMx"/>
38-
<constraint firstAttribute="trailingMargin" secondItem="tBY-1B-pbW" secondAttribute="trailing" constant="24" id="RLl-id-eAj"/>
39-
<constraint firstItem="tBY-1B-pbW" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" constant="23" id="wIE-DJ-STg"/>
84+
<constraint firstItem="m8j-GV-ibK" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="TAa-p8-l2j"/>
85+
<constraint firstItem="m8j-GV-ibK" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="rfJ-ki-bbY"/>
4086
</constraints>
4187
</view>
4288
<connections>

Example/KWTextStyleLabel/ViewController.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ class ViewController: UIViewController {
1818
override func viewDidLoad() {
1919
super.viewDidLoad()
2020

21-
test.characterSpacing = 1.4
22-
test.text = "Testing"
21+
test.characterSpacing = 3
22+
test.lineGap = 10
23+
test.text = "Body with\nCharacter spacing: 3\nand Line spacing: 10\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
2324
}
24-
2525
}
26-

0 commit comments

Comments
 (0)