Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mahmudahsan/appsportfolio

To showcase multiple apps of a developer for cross promotion. Its an offline way to show user about other apps and it's also possible to know which app users are having more interest.
https://github.com/mahmudahsan/appsportfolio

ios-swift ios-ui showcase-app swift swift-library swift4 xcode

Last synced: 5 days ago
JSON representation

To showcase multiple apps of a developer for cross promotion. Its an offline way to show user about other apps and it's also possible to know which app users are having more interest.

Awesome Lists containing this project

README

        

# AppsPortfolio



iOS


Swift Package Manager


Twitter: @mahmudahsan


To showcase multiple apps of a developer for cross promotion. Its an offline way to show user about other apps and it's also possible to know which app users are having more interest. I have been using this UI in all of my iOS apps for cross promoting my other apps. This is a complete project but any improvements are welcome.

In plist data, if there is only one category mention for example games, then the segmented tab at top will not be shown. To show segmented tab with categories you must have to provide at least 2 categories of apps. Please check the plist file structure to know how to provide app list.


Apps Portfolio

## Features

- [X] Showcase apps for cross promotion
- [X] Delegate to integrate analytics to see which app user visits in app store
- [X] Works in both iPhone and iPad

## Examples

Integrate within a UIViewController:
```swift
let bundle = Bundle(for: AppsPortfolioViewController.self)
let storyboard = UIStoryboard(name: "AppsPortfolio", bundle: bundle)

let appsPortfolioVC = storyboard.instantiateInitialViewController() as! AppsPortfolioViewController
appsPortfolioVC.title = "Portfolio"
appsPortfolioVC.loadAppList(name: "sample_portfolio")
self.navigationController?.pushViewController(appsPortfolioVC, animated: true)
```

Add a custom back button to top left if by default navigation bar is hidden:
```swift
let backButton = UIButton(frame: CGRect(x: 10, y: 7, width: 74, height: 30))
backButton.setImage(UIImage(named: "btnBack"), for: UIControlState.normal)
backButton.addTarget(self, action: #selector(goBackFromPortfolio), for: UIControlEvents.touchUpInside)
appsPortfolioVC.view.addSubview(backButton)
```

```swift
@objc private func goBackFromPortfolio(){
self.navigationController?.popViewController(animated: true)
}
```


Apps Portfolio

Implement delegate to inform when user tap an app:
```swift
let bundle = Bundle(for: AppsPortfolioViewController.self)
let storyboard = UIStoryboard(name: "AppsPortfolio", bundle: bundle)

let appsPortfolioVC = storyboard.instantiateInitialViewController() as! AppsPortfolioViewController
appsPortfolioVC.title = "Portfolio"

//assigning analytics delegates
appsPortfolioVC.setAnalyticsDelegate(any: self)

appsPortfolioVC.loadAppList(name: "sample_portfolio")
self.navigationController?.pushViewController(appsPortfolioVC, animated: true)
```

One delegate method need to implement to know user interaction:
```swift
extension ViewController : AppsPortfolio.Analytics{
func appClicked(appNamed: String) {
print("App: \(appNamed) clicked.")
}
}
```

sample_portfolio.plist file structure:


plist flie stucture

## How to use

Add this Swift package to your project
```
https://github.com/mahmudahsan/AppsPortfolio
```

* In your project create a new **apps_portfolio.plist** file and provide your apps list. Follow the sample_portfolio.plist file format provided in AppsPortfolio/Data.

* In your project add the icons of your cross promoting apps and mention them in your plist file. Better use Images.assets to add apps's icons.


Images

## Questions or feedback?

Feel free to [open an issue](https://github.com/mahmudahsan/AppsPortfolio/issues/new), or find me [@mahmudahsan on Twitter](https://twitter.com/mahmudahsan).