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

Hello, macOS. 👋 #245

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f0e273f
[BIG] Add macOS cross-platform compatibility, macOS demo application …
chriszielinski Feb 11, 2020
37f4771
Add macOS targets to travis, fastlane, & cocoapods.
chriszielinski Feb 11, 2020
e7c24e0
Update typesetter behavior.
chriszielinski Feb 11, 2020
b6750b1
Update README with macOS platform compatibility & add 'Features' section
chriszielinski Feb 12, 2020
b3c48c1
Merge branch 'master' of https://github.com/thii/FontAwesome.swift
chriszielinski Feb 12, 2020
de72e5f
Fix file header in NSToolbarItem.Identifier.swift
chriszielinski Feb 12, 2020
67d3e69
Downgrade macOS demo deployment target to 10.11
chriszielinski Feb 12, 2020
1e97efa
Fix macOS version compatibility.
chriszielinski Feb 14, 2020
47e657b
Fix macOS font loading.
chriszielinski Feb 21, 2020
e3fe013
Remove obsolete comment.
chriszielinski Feb 21, 2020
38bbf58
Change accessibility of `FontAwesomeToolbarItem.init(itemIdentifier:)…
chriszielinski Feb 21, 2020
c380495
Add `FontAwesomeToolbarItem.createButton()` to improve extensibility.
chriszielinski Feb 21, 2020
62e66c5
Refactor AppKit controls for better extensibility.
chriszielinski Feb 21, 2020
9b2b4a4
Fix font URL resolution.
chriszielinski Mar 29, 2020
8db102a
Fix Catalyst compilation and add unit test (#249).
chriszielinski Mar 29, 2020
31f5c4e
Patch edge case in `FontAwesomeButton`'s image generation + unit test…
chriszielinski Mar 29, 2020
c4c795e
👋, Duotone.
chriszielinski Mar 29, 2020
ea136e7
Merge branch 'master' of https://github.com/thii/FontAwesome.swift
chriszielinski Mar 29, 2020
20b2cbc
Fix Duotone's `fontName()` return value (#250).
chriszielinski Mar 29, 2020
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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ script:
- brew tap thii/xcbeautify https://github.com/thii/xcbeautify.git
- brew install xcbeautify
- xcodebuild test -project FontAwesome.xcodeproj -scheme FontAwesome -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max' | xcbeautify
- xcodebuild test -project FontAwesome.xcodeproj -scheme FontAwesome-macOS -destination 'platform=macOS' | xcbeautify
- xcodebuild test -project Demo/FontAwesomeDemo.xcodeproj -scheme 'FontAwesomeDemo (macOS)' | xcbeautify
- xcodebuild -project FontAwesome.xcodeproj -scheme FontAwesome-watchOS -destination 'platform=watchOS Simulator,name=Apple Watch Series 4 - 44mm' | xcbeautify
- xcodebuild -project FontAwesome.xcodeproj -scheme FontAwesome-tvOS -destination 'platform=tvOS Simulator,name=Apple TV' | xcbeautify
- pod lib lint --allow-warnings
before_deploy:
- carthage build --no-skip-current
- carthage archive FontAwesome
Expand Down
36 changes: 36 additions & 0 deletions Demo/FontAwesomeDemo (macOS)/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// AppDelegate.swift
//
// Copyright (c) 2014-present FontAwesome.swift contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}

func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}

}
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"
}
}
6 changes: 6 additions & 0 deletions Demo/FontAwesomeDemo (macOS)/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
931 changes: 931 additions & 0 deletions Demo/FontAwesomeDemo (macOS)/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// NSToolbarItem.Identifier.swift
//
// Copyright (c) 2014-present FontAwesome.swift contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import AppKit

extension NSToolbarItem.Identifier {

static let defaultWidth = NSToolbarItem.Identifier("default-width")
static let fittedWidth = NSToolbarItem.Identifier("fitted-width")
static let fixedWidth = NSToolbarItem.Identifier("fixed-width")
static let fixedPointSize = NSToolbarItem.Identifier("fixed-point-size")

}
10 changes: 10 additions & 0 deletions Demo/FontAwesomeDemo (macOS)/FontAwesomeDemo__macOS_.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?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>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>
34 changes: 34 additions & 0 deletions Demo/FontAwesomeDemo (macOS)/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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>$(DEVELOPMENT_LANGUAGE)</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>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticTermination</key>
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
</dict>
</plist>
50 changes: 50 additions & 0 deletions Demo/FontAwesomeDemo (macOS)/ViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// ViewController.swift
//
// Copyright (c) 2014-present FontAwesome.swift contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import Cocoa
import FontAwesome

class ViewController: NSViewController {

@IBOutlet
var fontAwesomeButton: FontAwesomeButton!
@IBOutlet
var fontAwesomeImageView: FontAwesomeImageView!
@IBOutlet
var fontAwesomeLabel: FontAwesomeLabel!
@IBOutlet
var fontAwesomeView: FontAwesomeView!

override func viewDidLoad() {
super.viewDidLoad()

// 🎡 Play around with the Font Awesome interface components.
// fontAwesomeView.icon = .ghost
// fontAwesomeView.style = .solid
}

@IBAction
func toolbarItemAction(button: FontAwesomeButton) {
print("Clicked on the '\(button.toolbarItemIdentifier.rawValue)' toolbar item.")
}

}
Loading