-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from eddiekaiger/version-3.1.0
Version 3.1.0
- Loading branch information
Showing
41 changed files
with
3,036 additions
and
613 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
language: objective-c | ||
osx_image: xcode8 | ||
|
||
env: | ||
- PLATFORM=iOS CODECOV=ios DESTINATION='platform=iOS Simulator,name=iPhone 6S' | ||
- PLATFORM=Mac CODECOV=osx DESTINATION='platform=OS X' | ||
- PLATFORM=tvOS CODECOV=tvos DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p' | ||
|
||
script: | ||
- xcodebuild -version | ||
- xcodebuild -project SwiftyAttributes.xcodeproj -scheme SwiftyAttributesTests -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 6" -configuration Debug ONLY_ACTIVE_ARCH=YES -enableCodeCoverage YES test | ||
- bash <(curl -s https://codecov.io/bash) -cF ios | ||
- xcodebuild -project SwiftyAttributes.xcodeproj -scheme "SwiftyAttributes" -destination "$DESTINATION" -configuration Debug -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO test | ||
- bash <(curl -s https://codecov.io/bash) -cF "$CODECOV" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// AppDelegate.swift | ||
// ExampleApp-macOS | ||
// | ||
// Created by Eddie Kaiger on 11/26/16. | ||
// Copyright © 2016 Eddie Kaiger. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
@NSApplicationMain | ||
class AppDelegate: NSObject, NSApplicationDelegate { } |
58 changes: 58 additions & 0 deletions
58
ExampleApp-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "mac", | ||
"size" : "16x16", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "16x16", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "32x32", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "32x32", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "128x128", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "128x128", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "256x256", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "256x256", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "512x512", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"size" : "512x512", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIconFile</key> | ||
<string></string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2016 Eddie Kaiger. All rights reserved.</string> | ||
<key>NSMainStoryboardFile</key> | ||
<string>Main</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// ViewController.swift | ||
// ExampleApp-macOS | ||
// | ||
// Created by Eddie Kaiger on 11/26/16. | ||
// Copyright © 2016 Eddie Kaiger. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
import SwiftyAttributes | ||
|
||
class ViewController: NSViewController { | ||
|
||
fileprivate let attributedStrings: [NSAttributedString] = [ | ||
{ | ||
let attachment = TextAttachment() | ||
attachment.image = NSImage(named: "Star")! | ||
let str = "Attachment With Image".attributedString | ||
str.replaceCharacters(in: 10 ..< 12, with: NSAttributedString(attachment: attachment)) | ||
return str | ||
}(), | ||
"Baseline Offset".withBaselineOffset(8.5), | ||
"Background Color".withBackgroundColor(.blue), | ||
"Expansion".withExpansion(0.8), | ||
"Font".withFont(.boldSystemFont(ofSize: 20)), | ||
"Kern".withKern(5.1), | ||
"Default Ligatures".withLigatures(.default), | ||
"No Ligatures".withLigatures(.none), | ||
"Link".withLink(URL(string: "https://google.com")!), | ||
"Obliqueness".withObliqueness(2), | ||
"Shadow".withShadow({ | ||
let shadow = Shadow() | ||
shadow.shadowBlurRadius = 2 | ||
shadow.shadowOffset = CGSize(width: 3, height: -4) | ||
return shadow | ||
}()), | ||
"Stroke Color".withStrokeColor(.orange).withStrokeWidth(1), | ||
"Stroke Width".withStrokeWidth(2.7), | ||
"Strikethrough Style & Color".withStrikethroughColor(.green).withStrikethroughStyle(.styleDouble), | ||
"Text Color".withTextColor(.brown), | ||
"Text Effect".withTextEffect(.letterPressStyle), | ||
"Underline Style & Color".withUnderlineColor(.red).withUnderlineStyle(.styleDouble), | ||
"Writing Directions".withWritingDirections([.rightToLeftOverride]), | ||
"Multiple Attributes".withAttributes([.baselineOffset(5), .font(.boldSystemFont(ofSize: 20)), .kern(4), .underlineStyle(.styleSingle), .underlineColor(.magenta), .strokeColor(.orange), .strokeWidth(3), .strikethroughColor(.green), .strikethroughStyle(.styleSingle), .backgroundColor(.yellow)]), | ||
{ | ||
let str = "Partial Range Attributes".withUnderlineStyle(.styleSingle) | ||
str.addAttributes([.underlineStyle(.styleDouble), .textColor(.blue)], range: 3 ..< 8) | ||
str.addAttributes([.strikethroughStyle(.styleThick), .strikethroughColor(.purple)], range: 16 ..< 22) | ||
str.setAttributes([.textColor(.red)], range: 22 ..< 24) | ||
return str | ||
}() | ||
] | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
extension ViewController: NSTableViewDataSource { | ||
|
||
func numberOfRows(in tableView: NSTableView) -> Int { | ||
return attributedStrings.count | ||
} | ||
|
||
func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? { | ||
return attributedStrings[row] | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.