Created a simple Catalyst (Mac Idiom) template
|
Before Width: | Height: | Size: 749 KiB After Width: | Height: | Size: 749 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 8 KiB After Width: | Height: | Size: 8 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 816 B After Width: | Height: | Size: 816 B |
|
|
@ -9,7 +9,7 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
@UIApplicationMain
|
@UIApplicationMain
|
||||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
class ___VARIABLE_classPrefix___AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
//
|
||||||
|
// ___FILENAME___
|
||||||
|
// ___PROJECTNAME___
|
||||||
|
//
|
||||||
|
// Created by ___FULLUSERNAME___ on ___DATE___.
|
||||||
|
// ___COPYRIGHT___
|
||||||
|
//
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
#if targetEnvironment(macCatalyst)
|
||||||
|
import AppKit
|
||||||
|
|
||||||
|
extension ___VARIABLE_classPrefix___SceneDelegate: NSToolbarDelegate {
|
||||||
|
|
||||||
|
func toolbarItems() -> [NSToolbarItem.Identifier] {
|
||||||
|
return [.toggleSidebar]
|
||||||
|
}
|
||||||
|
|
||||||
|
func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
|
||||||
|
return toolbarItems()
|
||||||
|
}
|
||||||
|
|
||||||
|
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
|
||||||
|
return toolbarItems()
|
||||||
|
}
|
||||||
|
|
||||||
|
func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
|
||||||
|
return NSToolbarItem(itemIdentifier: itemIdentifier)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
//
|
||||||
|
// ___FILENAME___
|
||||||
|
// ___PROJECTNAME___
|
||||||
|
//
|
||||||
|
// Created by ___FULLUSERNAME___ on ___DATE___.
|
||||||
|
// ___COPYRIGHT___
|
||||||
|
//
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
class ___VARIABLE_classPrefix___SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
|
var window: UIWindow?
|
||||||
|
|
||||||
|
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||||
|
guard let windowScene = scene as? UIWindowScene else {
|
||||||
|
fatalError("Expected scene of type UIWindowScene but got an unexpected type")
|
||||||
|
}
|
||||||
|
window = UIWindow(windowScene: windowScene)
|
||||||
|
|
||||||
|
if let window = window {
|
||||||
|
window.rootViewController = ___VARIABLE_classPrefix___MainViewController()
|
||||||
|
|
||||||
|
#if targetEnvironment(macCatalyst)
|
||||||
|
|
||||||
|
let toolbar = NSToolbar(identifier: NSToolbar.Identifier("___VARIABLE_classPrefix___SceneDelegate.Toolbar"))
|
||||||
|
toolbar.delegate = self
|
||||||
|
toolbar.displayMode = .iconOnly
|
||||||
|
toolbar.allowsUserCustomization = false
|
||||||
|
|
||||||
|
windowScene.titlebar?.toolbar = toolbar
|
||||||
|
windowScene.titlebar?.toolbarStyle = .unified
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
window.makeKeyAndVisible()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,8 +8,7 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class MainViewController: UIViewController {
|
final class ___VARIABLE_classPrefix___MainViewController: UIViewController {
|
||||||
private let contentView = MainView()
|
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
super.init(nibName: nil, bundle: nil)
|
super.init(nibName: nil, bundle: nil)
|
||||||
|
|
@ -19,12 +18,4 @@ final class MainViewController: UIViewController {
|
||||||
required init?(coder aDecoder: NSCoder) {
|
required init?(coder aDecoder: NSCoder) {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func loadView() {
|
|
||||||
view = contentView
|
|
||||||
}
|
|
||||||
|
|
||||||
override func viewDidLoad() {
|
|
||||||
super.viewDidLoad()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
BIN
Project Templates/Custom/Catalyst App (Basic).xctemplate/TemplateIcon@1x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Project Templates/Custom/Catalyst App (Basic).xctemplate/TemplateIcon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
108
Project Templates/Custom/Catalyst App (Basic).xctemplate/TemplateInfo.plist
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?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>Kind</key>
|
||||||
|
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
||||||
|
<key>Identifier</key>
|
||||||
|
<string>com.highcaffeinecontent.catalyst.simple</string>
|
||||||
|
<key>Ancestors</key>
|
||||||
|
<array>
|
||||||
|
<string>com.highcaffeinecontent.catalyst.base</string>
|
||||||
|
</array>
|
||||||
|
<key>Concrete</key>
|
||||||
|
<true/>
|
||||||
|
<key>Description</key>
|
||||||
|
<string>Starting point for an app.</string>
|
||||||
|
<key>SortOrder</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string></string>
|
||||||
|
<key>Nodes</key>
|
||||||
|
<array>
|
||||||
|
<string>Source/Application/___VARIABLE_classPrefix___AppDelegate.swift</string>
|
||||||
|
<string>Source/Application/___VARIABLE_classPrefix___SceneDelegate.swift</string>
|
||||||
|
<string>Source/Application/___VARIABLE_classPrefix___SceneDelegate+NSToolbar.swift</string>
|
||||||
|
<string>Source/Main/___VARIABLE_classPrefix___MainViewController.swift</string>
|
||||||
|
<string>Assets.xcassets</string>
|
||||||
|
</array>
|
||||||
|
<key>Targets</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>SharedSettings</key>
|
||||||
|
<dict>
|
||||||
|
<key>SUPPORTS_MACCATALYST</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>TARGETED_DEVICE_FAMILY</key>
|
||||||
|
<string>1,2,6</string>
|
||||||
|
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
|
||||||
|
<string>14.0</string>
|
||||||
|
<key>IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]</key>
|
||||||
|
<string>14.2</string>
|
||||||
|
<key>SWIFT_TREAT_WARNINGS_AS_ERRORS</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>RUN_CLANG_STATIC_ANALYZER</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_STATIC_ANALYZER_MODE</key>
|
||||||
|
<string>deep</string>
|
||||||
|
<key>GCC_TREAT_WARNINGS_AS_ERRORS</key>
|
||||||
|
<string>deep</string>
|
||||||
|
<key>GCC_WARN_PEDANTIC</key>
|
||||||
|
<string>deep</string>
|
||||||
|
<key>INFOPLIST_FILE</key>
|
||||||
|
<string>$(PRODUCT_NAME)/Info.plist</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>Definitions</key>
|
||||||
|
<dict>
|
||||||
|
<key>Assets.xcassets</key>
|
||||||
|
<dict>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>Assets.xcassets</string>
|
||||||
|
</dict>
|
||||||
|
<key>Source/Application/___VARIABLE_classPrefix___AppDelegate.swift</key>
|
||||||
|
<dict>
|
||||||
|
<key>Group</key>
|
||||||
|
<array>
|
||||||
|
<string>Source</string>
|
||||||
|
<string>Application</string>
|
||||||
|
</array>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>Source/Application/___VARIABLE_classPrefix___AppDelegate.swift</string>
|
||||||
|
</dict>
|
||||||
|
<key>Source/Application/___VARIABLE_classPrefix___SceneDelegate.swift</key>
|
||||||
|
<dict>
|
||||||
|
<key>Group</key>
|
||||||
|
<array>
|
||||||
|
<string>Source</string>
|
||||||
|
<string>Application</string>
|
||||||
|
</array>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>Source/Application/___VARIABLE_classPrefix___SceneDelegate.swift</string>
|
||||||
|
</dict>
|
||||||
|
<key>Source/Application/___VARIABLE_classPrefix___SceneDelegate+NSToolbar.swift</key>
|
||||||
|
<dict>
|
||||||
|
<key>Group</key>
|
||||||
|
<array>
|
||||||
|
<string>Source</string>
|
||||||
|
<string>Application</string>
|
||||||
|
</array>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>Source/Application/___VARIABLE_classPrefix___SceneDelegate+NSToolbar.swift</string>
|
||||||
|
</dict>
|
||||||
|
<key>Source/Main/___VARIABLE_classPrefix___MainViewController.swift</key>
|
||||||
|
<dict>
|
||||||
|
<key>Group</key>
|
||||||
|
<array>
|
||||||
|
<string>Source</string>
|
||||||
|
<string>Main</string>
|
||||||
|
</array>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>Source/Main/___VARIABLE_classPrefix___MainViewController.swift</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>Options</key>
|
||||||
|
<array/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<key>Kind</key>
|
<key>Kind</key>
|
||||||
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
||||||
<key>Identifier</key>
|
<key>Identifier</key>
|
||||||
<string>dk.simonbs.dt.unit.iosBase</string>
|
<string>com.highcaffeinecontent.catalyst.base</string>
|
||||||
<key>Ancestors</key>
|
<key>Ancestors</key>
|
||||||
<array>
|
<array>
|
||||||
<string>com.apple.dt.unit.applicationBase</string>
|
<string>com.apple.dt.unit.applicationBase</string>
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
<key>UISceneConfigurationName</key>
|
<key>UISceneConfigurationName</key>
|
||||||
<string>Default Configuration</string>
|
<string>Default Configuration</string>
|
||||||
<key>UISceneDelegateClassName</key>
|
<key>UISceneDelegateClassName</key>
|
||||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
<string>$(PRODUCT_MODULE_NAME).___VARIABLE_classPrefix___SceneDelegate</string>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
@ -142,6 +142,19 @@
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Options</key>
|
<key>Options</key>
|
||||||
<array/>
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>Identifier</key>
|
||||||
|
<string>classPrefix</string>
|
||||||
|
<key>Name</key>
|
||||||
|
<string>Class Prefix</string>
|
||||||
|
<key>Description</key>
|
||||||
|
<string>The prefix to prepend to all created classes</string>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>text</string>
|
||||||
|
<key>Placeholder</key>
|
||||||
|
<string>XYZ</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
//
|
|
||||||
// ___FILENAME___
|
|
||||||
// ___PROJECTNAME___
|
|
||||||
//
|
|
||||||
// Created by ___FULLUSERNAME___ on ___DATE___.
|
|
||||||
// ___COPYRIGHT___
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
|
||||||
|
|
||||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|
||||||
var window: UIWindow?
|
|
||||||
|
|
||||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
|
||||||
guard let windowScene = scene as? UIWindowScene else {
|
|
||||||
fatalError("Expected scene of type UIWindowScene but got an unexpected type")
|
|
||||||
}
|
|
||||||
window = UIWindow(windowScene: windowScene)
|
|
||||||
window?.rootViewController = UINavigationController(rootViewController: MainViewController())
|
|
||||||
window?.makeKeyAndVisible()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
//
|
|
||||||
// ___FILENAME___
|
|
||||||
// ___PROJECTNAME___
|
|
||||||
//
|
|
||||||
// Created by ___FULLUSERNAME___ on ___DATE___.
|
|
||||||
// ___COPYRIGHT___
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
|
||||||
|
|
||||||
final class MainView: UIView {
|
|
||||||
init() {
|
|
||||||
super.init(frame: .zero)
|
|
||||||
setupView()
|
|
||||||
setupLayout()
|
|
||||||
}
|
|
||||||
|
|
||||||
required init?(coder aDecoder: NSCoder) {
|
|
||||||
fatalError("init(coder:) has not been implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
private func setupView() {
|
|
||||||
backgroundColor = .systemBackground
|
|
||||||
}
|
|
||||||
|
|
||||||
private func setupLayout() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
|
@ -1,80 +0,0 @@
|
||||||
<?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>Kind</key>
|
|
||||||
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
|
||||||
<key>Identifier</key>
|
|
||||||
<string>dk.simonbs.dt.unit.iosMinimalist</string>
|
|
||||||
<key>Ancestors</key>
|
|
||||||
<array>
|
|
||||||
<string>dk.simonbs.dt.unit.iosBase</string>
|
|
||||||
</array>
|
|
||||||
<key>Concrete</key>
|
|
||||||
<true/>
|
|
||||||
<key>Description</key>
|
|
||||||
<string>Starting point for an app.</string>
|
|
||||||
<key>SortOrder</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string></string>
|
|
||||||
<key>Nodes</key>
|
|
||||||
<array>
|
|
||||||
<string>Source/Application/AppDelegate.swift</string>
|
|
||||||
<string>Source/Application/SceneDelegate.swift</string>
|
|
||||||
<string>Source/Main/MainView.swift</string>
|
|
||||||
<string>Source/Main/MainViewController.swift</string>
|
|
||||||
<string>Assets.xcassets</string>
|
|
||||||
</array>
|
|
||||||
<key>Definitions</key>
|
|
||||||
<dict>
|
|
||||||
<key>Assets.xcassets</key>
|
|
||||||
<dict>
|
|
||||||
<key>Path</key>
|
|
||||||
<string>Assets.xcassets</string>
|
|
||||||
</dict>
|
|
||||||
<key>Source/Application/AppDelegate.swift</key>
|
|
||||||
<dict>
|
|
||||||
<key>Group</key>
|
|
||||||
<array>
|
|
||||||
<string>Source</string>
|
|
||||||
<string>Application</string>
|
|
||||||
</array>
|
|
||||||
<key>Path</key>
|
|
||||||
<string>Source/Application/AppDelegate.swift</string>
|
|
||||||
</dict>
|
|
||||||
<key>Source/Application/SceneDelegate.swift</key>
|
|
||||||
<dict>
|
|
||||||
<key>Group</key>
|
|
||||||
<array>
|
|
||||||
<string>Source</string>
|
|
||||||
<string>Application</string>
|
|
||||||
</array>
|
|
||||||
<key>Path</key>
|
|
||||||
<string>Source/Application/SceneDelegate.swift</string>
|
|
||||||
</dict>
|
|
||||||
<key>Source/Main/MainView.swift</key>
|
|
||||||
<dict>
|
|
||||||
<key>Group</key>
|
|
||||||
<array>
|
|
||||||
<string>Source</string>
|
|
||||||
<string>Main</string>
|
|
||||||
</array>
|
|
||||||
<key>Path</key>
|
|
||||||
<string>Source/Main/MainView.swift</string>
|
|
||||||
</dict>
|
|
||||||
<key>Source/Main/MainViewController.swift</key>
|
|
||||||
<dict>
|
|
||||||
<key>Group</key>
|
|
||||||
<array>
|
|
||||||
<string>Source</string>
|
|
||||||
<string>Main</string>
|
|
||||||
</array>
|
|
||||||
<key>Path</key>
|
|
||||||
<string>Source/Main/MainViewController.swift</string>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>Options</key>
|
|
||||||
<array/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
16
README.md
|
|
@ -1,8 +1,6 @@
|
||||||
# xctemplates
|
# catalyst-xctemplates
|
||||||
|
|
||||||
Opinionated templates for Xcode 11.
|
Basic Mac Catalyst templates for Xcode 11+.
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/simonbs/xctemplates/master/imgs/header.png" width="450">
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
@ -12,12 +10,10 @@ The project templates should be copied into the `~/Library/Developer/Xcode/Temp
|
||||||
|
|
||||||
Below is a brief description of the templates in this repository.
|
Below is a brief description of the templates in this repository.
|
||||||
|
|
||||||
### iOS Base
|
### Catalyst Base
|
||||||
|
|
||||||
This is not an actual project template. It contains the base configuration for an iOS project an is inherited by other project templates.
|
This is not an actual project template. It contains the base configuration for a Catalyst project and is inherited by other project templates.
|
||||||
|
|
||||||
### iOS Minimalist
|
### Catalyst App (Basic)
|
||||||
|
|
||||||
This is a minimalistic template for an iOS project. It configures the app to use scenes without storyboards.
|
This is a minimalistic template for a Mac Catalyst project using the Mac Idiom and targeting macOS 11. It configures the app to use scenes without storyboards, enables warnings-as-errors for both Swift & Objective-C, and prompts you for a class prefix.
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/simonbs/xctemplates/master/imgs/ios_minimalist.png" width="250">
|
|
||||||
|
|
|
||||||
BIN
imgs/header.png
|
Before Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 124 KiB |