Giter Club home page Giter Club logo

appsportfolio's Introduction

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

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

Examples

Integrate within a UIViewController:

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:

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)
@objc private func goBackFromPortfolio(){
    self.navigationController?.popViewController(animated: true)
}

Apps Portfolio

Implement delegate to inform when user tap an app:

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:

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, or find me @mahmudahsan on Twitter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.