Multipeer Connectivity - iOS8 with Swift
iOS8 full application written in the new Swift language.
Send files between your devices easily and chat in the same application, without the need of internet connection!?
This project features a complete iOS8 ready application written in the Swift language. Its main purpose is to exchange files wirelessly between devices. It uses the Multipeer Connectivity Framework to search and connect to available devices, without the need of internet connection or any kind of server and database.
Handy sidebar menu using UIDynamics.
Browse for all available nearby devices using the build-in Multipeer Connectivity browser.
Choose your documents or images and videos from your library and send them via wifi or bluetooth automatically in a paired device.
Lock/unlock features and enable/disable advertisements easily.
Also you can chat with the connected device, and play a fun TicTacToe game.
Action extension to easily send photos to other devices
Multipeer Connectivity Framework
Written in Swift exclusively
Universal app for all iPhones and iPads
Sidebar with UIDynamics
In-App purchases using StoreKit
Requires XCode6 and iOS8 framework
For using the Action Extension, the deployment target must be iOS8 and the device must support x64 architecture (iPhone5s/6/6+, iPad Retina/Air)
Unzip the project files and you have a full XCode6 project, ready to run. Double click the xcodeproj file to open the project and start working on it. No other installation needed.
Make sure you use XCode6 with the iOS8 SDK installed.
The app can be re-skinned very easily. Open the Main.storyboard file in XCode left menu and there you can see all the views this app consists of. Click on a png file in order to see its dimensions and change it to one of your own. If you would like to keep it simple and make no code changes, then you should name the new file the same as the original one.
Application icons and any other image used can be found under Images.xcassets. There you can see the relevant sizes these items must have and replace the existing ones as necessary.
The project consists of five different pages.
The main page that displays a message regarding the connection status and that displays the sidebar. These are handled by the ViewController.swift, SideBarTableViewController.swift and SideBar.swift. There we can change UIDynamics behaviour and how the sidebar is being displayed, change its attributes, colours, cells, etc. For that we use the available tableView delegate methods.
We also handle the Multipeer Connectivity delegate and how we present that controller. We use a singleton design pattern for this for the class MPCLibrary.swift, so it can be available throughout the class. We do that in the AppDelegate.swift file.
In the main page, we also display an iAd banner at the bottom.
The Documents page, where we have a table view that displays the available documents of the app (local folder) and we can send them to the connected device. All handled by DocumentsViewController.swift.
The Chat page, that displays a very simple chat interface. Handled by ChatViewController.swift.
The TicTacToe page, where we can play tic tac toe with the connected device! Handled by TTTViewController.swift.
The Settings page, where we have the InApp purchases and other settings. Handled by SettingsTableViewController.swift. For InApp, we have setup in the AppDelegate.swift two product ids, that can be changed accordingly.
The source code is fully customisable and can be extended to support other views. Again the code is designed to run on all devices, it’s universal.
We also have a progress view displayed when we exchange files, that use the open source class KYCircularProgress. Alerts are displayed using the open source class SCLAlertView.
There is also an action extension implemented that can send a photo chosen, to another device that runs this app.