• Stars
    star
    31
  • Rank 792,295 (Top 17 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 3 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ—‚๏ธ This repository provides a guide to creating Xcode templates for iOS boilerplate code to save time and increase creativity in development. It simplifies the process and helps new team members get up to speed. A solution to Xcode's poorly documented templates.

๐Ÿ• Xcode templates

iOS Version Swift Version

If you are like me you love writing iOS code but there is nothing that breaks your creativity more than boilerplate code and having to think about it while some other more creative solutions might reside in your mind at the same time. Even if you have a pretty good idea about your architecture it is surely a waste of time to write boilerplate since itโ€™s just repeating code. All you need is a bunch of good templates and writing code in any architecture should be easier for you as well and easier to get into for new members of the team. But it has a catch. Xcode templates arenโ€™t exactly what you would call a well-documented part of the tool. That is why I decided to bring you through the process of building these from scratch to save you the trouble I went through with collecting the knowledge on this subject.

Writing templates has these advantages:

  • Makes you save time in the long run if you take time to maintain and write your templates well
  • It takes less time to onboard new people because they will not work from scratch
  • It helps maintain code conventions that you set up for yourself and your team
  • If you ever wanted to export your snippets youโ€™ll notice one similarity with templates and that is that they are saved locally and outside of any project that you are working on. That means that it's a great opportunity to upload those to a repository to be able to share them or to change your workstation while keeping up to date.

Table of content

#warning: all templates are dependent on GoodrequestIOSExtensions, that you can fetch with SPM from: https://github.com/GoodRequest/GoodIOSExtensions

Installation

First of all if you want to connect template to your template list you have to find the right folder to clone the repo. Directory where you can add custom templates so they are visible in your template list in xcode:

/Users/$USER_NAME/Library/Developer/Xcode/Templates

Git clone

Go to the folder and clone the the git repo contents

/Users/$USER_NAME/Library/Developer/Xcode/Templates

Copy paste

Alternativelly you can copy the project templates and paste thme in the folder

/Users/$USER_NAME/Library/Developer/Xcode/Templates

Create your own templates

Also if you want to create your own take inspiration from the already existing ones. Directory where to find already existing Xcode templates to take inspiration from:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File

Loading Dependencies with SPM

The template automatically generated build tools package. What you want to do now is to connect it to the project as a local package.

  1. Open the Package.swift you your project root and uncomment the package.swift. This will cause a compile error, but only because its still now added as a defacto package despite the fact that it is already in the right place in the project.

  2. Delete the reference to these two package files.

  3. Now you want to add a local package of good dependencies. Open the add package prompt for the project and click add local project. Point to the packages folder in the project root and find good dependencies. Once you select them hit add package and you are good to go Logo

  4. As soon as the packages are fetched add the package as framework

Logo

External Dependencies

All external dependencies should be primarily added via SPM via a local package or the projects package interface. Itโ€™s up to you which method you choose.

License

GoodIOSExtensions repository is released under the MIT license. See LICENSE for details.

More Repositories

1

GoodReactor

โš›๏ธ GoodReactor is a Redux-inspired Reactor framework for iOS developed using Swift. It enables seamless communication between the View Model, View Controller, and Coordinator through state and navigation functions. It ensures no side-effects by interacting with dependencies outside of the Reduce function. Integrate it with using SPM!
Swift
32
star
2

GoodPersistence

๐Ÿ’พ GoodPersistence is an iOS library that simplifies caching data in keychain and UserDefaults. Using a property wrapper, it reduces the complexity of implementing caching mechanisms, making it easier for developers to focus on app functionality. Compatible with latest Swift and supports all iOS devices. Easy to install with SPM.
Swift
32
star
3

GoodNetworking

๐Ÿ“ก GoodNetworking is an iOS library written in Swift that simplifies HTTP networking by using GRSession and Encodable/DataRequest extensions. It supports latest Swift and all iOS devices, making it a powerful solution for managing network interactions and data encoding/decoding. The library is easy to install with SPM.
Swift
31
star
4

GoodUIKit

๐Ÿ“‘ GoodUIKit is a UIKit extensions library filled with reusable UI snippets for faster and more efficient iOS development. Boost productivity and streamline your workflow with ready-to-use UI components.
Swift
30
star
5

GoodExtensions-iOS

๐Ÿ“‘ GoodExtensions is a collection of useful and frequently used Swift extensions for iOS development, designed to simplify and streamline common tasks.It helps developers write clean and concise code, saving time and effort while boosting productivity. Get access to a wealth of essential tools for iOS development in one convenient library.
Swift
28
star
6

GRProvider

๐Ÿš€UITableView and UICollectionView provider to simplify basic scenarios of showing the data.
Swift
27
star
7

GoodIOSExtensions

๐Ÿงพ GoodIOSExtensions is a collection of modules extending different aspects of your swift xcode project
Swift
19
star
8

express-joi-to-swagger

Simple tool for generating swagger API documentation from source code.
TypeScript
19
star
9

GoodSwiftUI

๐Ÿ“‘ GoodSwiftUI is a comprehensive library filled with reusable SwiftUI snippets for faster and more efficient iOS development. This library offers a wide range of customizable UI components, designed to boost your productivity and streamline your development workflow. Save time and effort by leveraging pre-made, tested, and ready-to-use code.
Swift
17
star
10

AppDebugMode-iOS

๐Ÿ› App Debug Mode ๐Ÿž for iOS. Allows special debug privileges.
Swift
16
star
11

GoodSwift

Some good swift extensions, handfully crafted by GoodRequest team.
Swift
9
star
12

spongly-dapp-public

TypeScript
3
star
13

GoodPagerIndicator

Kotlin
2
star
14

spongly-contracts

๐Ÿชธ Smart contracts for spongly protocol
TypeScript
2
star
15

BackupBuddy

Simple Bash app for backing up your database or filesystem data.
Shell
2
star
16

GoodCoordinator-iOS

๐Ÿงญ Simplified programmatic navigation in SwiftUI
Swift
2
star
17

Safe

Safe enables sharing confidential information with a limited number of views and overall lifetime.
HTML
2
star
18

test-coverage-push-script

JavaScript
1
star
19

Zoom

Kotlin optics library for immutable data manipulation
Kotlin
1
star
20

internship_ios

HTML
1
star
21

joi-type-extract

Extract type from Joi schema
1
star
22

joi-messages-extractor

Script for extracting joi messages. Useful for translations.
TypeScript
1
star
23

BackendAssignment-Fitness

TypeScript
1
star