[NOTE]
If you'd like to see PitchFormation
in action, check out this demo of PitchFormation
(see link below).
Clone PitchFormation Demo
: `📲 Available here)
PitchFormation
is an IOS Software Development Kit (SDK) that empowers app developers to effortlessly integrate custom soccer/football formations views into their applications.
This innovative SDK offers a comprehensive set of tools and components, enabling users to create, customize, and visualize soccer formations with ease.
✅ macOS 10.15+
✅ Xcode 11.0
✅ Swift 5+
✅ iOS 13+
✅ tvOS 13+
PitchFormation
is available via Swift Package Manager.
Using Xcode 11, go to File -> Swift Packages -> Add Package Dependency
and enter https://github.com/sageseid/PitchFormation.git
To get started with the SDK, you can follow this basic scenario to create and display a default pitch formation:
// this formation is for a 4-3-3
let defaultFormation: [[String]] = [
["DefaultGK"],
["DefaultDF", "DefaultDF", "DefaultDF", "DefaultDF"],
["DefaultMF", "DefaultMF", "DefaultMF"],
["DefaultST", "DefaultST", "DefaultST"]
]
let numbers: [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]
let formationView = Formation(
formation: defaultFormation,
numbers: numbers
)
or
// this formation is for a 3-4-3
let defaultFormation: [[String]] = [
["DefaultGK"],
["DefaultDF", "DefaultDF", "DefaultDF"],
["DefaultMF", "DefaultMF", "DefaultMF", "DefaultMF"],
["DefaultST", "DefaultST", "DefaultST"]
]
let numbers: [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]
let formationView = Formation(
formation: defaultFormation,
numbers: numbers
)
You can also customize the layout and appearance of the pitch formation using various configuration options. Here's an example of how you can create a customized pitch formation:
Formation(
formation: [["CustomGK"], ["CustomDF", "CustomDF"], ["CustomMF", "CustomMF", "CustomMF"], ["CustomST"]],
numbers: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"],
jerseyNumberColor: .white,
jerseyColor: .blue,
side: .away,
vSpacing: 30,
hSpacing: 15,
width: 60,
height: 60
)
}
.padding()
Version 1.0.0
of PitchFormation
contains a very limited set of features. It could be extended by implementing the following tasks:
- Addition of different Pitch Layouts
- Player Icon Customisation
- Tactics Annotations & Animation Preview
- Zoom and Pan feature
- Localization Support
👨🏻🔧 Feel free to contribute to PitchFormation
by creating a pull request, following these guidelines:
- Fork
PitchFormation
- Create your feature branch
- Commit your changes, along with unit tests
- Push to the branch
- Create pull request
👨💻 Noel Obaseki
📄 PitchFormation is available under the MIT license. See the LICENSE file for more info.