Register
Submit a solution
The challenge is finished.

Challenge Overview

Setup

In order to obtain the code source to modify for this challenge, you will need to be added to the UNI-Mobile github repository. Make a request for access in the forums.

This contest will not require you to do any direct work with the Salesforce Mobile SDK, but it is a required element of the overall application. As such you will need to be able to login to Salesforce the first time you run the application in order to access the other components of the application. The credentials are as follows:

Again, you will not be required to utilize the Salesforce Mobile SDK for any of the customization you are doing in this challenge. But the application leverages it, so logging in is essential.

Contest Requirements

A new ViewController for the MainContentArea is to be built for this challenge - The GlobalSearchViewController. This screen should be developed using .XIB files, and using reusable components whenever possible to match the UI depicted in the attached mockups. The view as a whole should be broken into two parts - the left sidebar, and the central area.

The Sidebar

The sidebar is largely composed of components that were used in the Seller Homepage. The Seller Homepage was built using the  LeftSidebarViewController, LeftTableCell, LeftSidebarButtonViewController, and LeftTableViewController Swift classes. Please create a new sidebar, GlobalSearchSidebarViewController that displays inside the GlobalSearchViewController from these components.

Prerequisite changes that will need to be made to create desired functionality:

  • Modify Item.swift to set an optional contentURL parameter to be set on item

  • Modify the MENU_ACTION enum in MenuItem.swift to add “MODAL_CONTENT” as an enumeration case.

  • Modify LeftTableViewController.swift’s tableView:didSelectRowAtIndexPath: function to handle the MODAL_CONTENT case, and display a ModalViewController pointed at the contentURL on the selected item if it exists.

 

The components that need to be included/built are as follows:

  • GKServices Button

    • Display Text: “gkservices.com”

    • Background Image

    • When tapped should open a ModalViewController 

      • Content area of ModalViewController should be a webview pointed at http://www.gkservices.com/

      • TitleLabel of the ModalViewController should display “gkservices.com”

  • GKDirect Button

    • Display Text: “gkdirect.com”

    • Background Image

    • When tapped should open a ModalViewController 

      • Content area of ModalViewController should be a webview pointed at http://www.gkdirect.com/

      • TitleLabel of the ModalViewController should display “gkservices.com”

  • Recent Container

    • Build with LeftTableViewController

    • HeaderTitle: Recent

    • Header Tapped Action: None.

    • DataSource:

      • Create a new example table in LeftSidebarDataSource.swift called searchRecentTable of type LeftTable

      • Populate this table with “Acme Sales Tools “, A-F as Items

      • Set the contentURL on these items to http://www.salesforce.com

  • Popular Container

    • Build with LeftTableViewController

    • HeaderTitle: Popular

    • Header Tapped Action: None.

    • DataSource:

      • Create a new example table in LeftSidebarDataSource.swift called searchRecentTable of type LeftTable

      • Populate this table with “Acme Sales Tools “, A-E as Items

      • Set the contentURL on these items to http://www.salesforce.com

 

The Central Content Area

This is the real meat of this contest. The Central Content area is composed of 3 parts:

  • The Header (with UISearchBar)

  • The Filter View

  • The Results View

 

The Header

Build the header such that it meets the following criteria:

  • When the Sidebar is closed, or when the Global Menu changes from the FULLY_CLOSED to the ICONS_ONLY state, the Header should expand or compress to the full available width of the Central Content Area.

  • A custom UISearchBar matching the design in the UI Mockup should display on the right side of the header.

    • On focus auto-clear the text in the UISearchBar

    • The UIKeyboard that displays should have Search as the text on its return button.

    • When a user performs a search, trigger a change of the DataSource in the Results content area.

 

The Filter View

Build the filter view to match the design, and such that it meets the following criteria:

  • When the Sidebar is closed, or when the Global Menu changes from the FULLY_CLOSED to the ICONS_ONLY state, the Filter View should expand or compress to the full available width of the Central Content Area.

  • The Filter View is composed of levels of nestable categories.

    • When a category is tapped on, it should display red and trigger the the results screen to filter based on the selected category.

    • If there are child categories after a brief 1-second pause the view should slide up to reveal the child categories.

    • A drag-indicator bar at the top of the filter view can be swiped to cause the parent categories to come back into view

      • This is a one-way swipe action. You cannot swipe up at that point to reveal the child categories. 

      • When swiped, any selected child categories should be de-selected.

      • The parent should also be de-selected, and a re-filter triggered on the highest currently selected child.

    • At any level the Filter View should be a UICollectionView with at most two rows.

      • Cells should organize such that there are N/2 columns with a minimum of 1 column

        • IE, 6 Items? 3 columns 2 rows.

        • 8 Items? 4 columns 2 rows.

        • 2 Items? 1 column 2 rows.

        • 1 Item? 1 column 2 rows with only 1 cell displayed.

    • Categories should be configurable in the following ways:

      • Display Text

      • IconName 

        • Filter View should display the icon mentioned in this configuration if the image for that file exists in the bundle.

      • Filter Value

      • Subcategories 

        • This should be an array of Categories.

        • There should be at most 8 subcategories.

Example Nesting structure to build for:

  • Accounts

  • Opportunities

  • Leads

  • Contacts

  • Quotes

  • Sales Tools

    • Catalogs

    • GK Rental Systems

    • Segments Collateral

      • Segment Subcat 1 (use Segments icon)

      • Segment Subcat 2 (use Segments icon)

      • Segment Subcat 3 (use Segments icon)

    • Videos

    • Products Collateral

      • Product Subcat 1 (use Products icon)

      • Product Subcat 2 (use Products icon)

    • GK Direct

    • Competitive Collateral

      • Competitive Subcat 1 (use Competitive icon)

      • Competitive Subcat 2 (use Competitive icon)

      • Competitive Subcat 3 (use Competitive icon)

      • Competitive Subcat 4 (use Competitive icon)

    • Forms

The Results View

Please build an example data source that has a method for returning objects when passed in a specific filter type.

Define a Swift Model Object to be used in the results and call it SearchResult.

Search Result should have the following properties:

  • Type

  • ID

  • Category

  • Title (Random string)

  • Content Path (optional for non-content objects)

  • Size : Int (kb) (optional for non-content objects)

  • CanEmail : Boolean (optional for non-content object types)

  • LastModifiedDate: NSDate  (Any date in the Past)

  • CreatedDate: NSDate (must be earlier than LastModifiedDate)

 

Obeying the nesting structure included the object types you’ll need to define and return are as follows:

  • Account

  • Opportunity

  • Lead

  • Contact

  • Quote

  • Content (Sales Tool)

 

As Content is the only type that has sub-categories, when you receive any category that isn’t Account, Opportunity, Lead, Contact, or Quote, create an object with Type set as Content and the Category set as the passed in category. Fill all other fields with a random value. If the passed in category value is nil, return 

 

Now with this data source defined, create a UICollectionView to display these results. This results table should match the design and fulfill the following criteria:

  • The Results section as a whole should stretch/compress to fill the full available width of the central content area.

  • When the sidebar and the Global Menu are closed, display results in 4 columns instead of 3.

  • When the SearchResult type is not of the Content type, do not display the PDF icon, the Size, or the mail icon.

  • When a Search Result is tapped open a ModalViewController with the title set to the title of the SearchResult, and the content area of the ModalView displaying a webview pointed at “http://www.salesforce.com”

  • When Search is executed, or if a filter is triggered, generate a new set of data from the datasource and reload the collection view, obeying any category filters set.

  • Drop selects should be built using the same design as the Filter Selects on the DayPlanViewController.

    • “Sort by” drop select will always be present and default option selected here should be “by last modified date”

    • IF/Where the selected Filter has sub-categories, we will show a drop select for “sub-categories” (none shown by default)

      • These should match the ones in the filter view.

      • Selecting one will trigger its selection in the filter above and in this select.

 

Tie Into Global Menu

Once all parts of the GlobalContentSearchViewController are in place, make sure to tie it into the Global Menu as the destination when Search is selected. To do this add a new case to “getViewControllerForMenuItem(item:MenuItem)->UIViewController?” in GlobalMenuViewController.swift. 

 

General Guidelines

This is an iOS Swift Challenge, as such the design implementation should be done with the latest version of XCode and the latest standards for iOS Development.


Interface items should be built in Interface Builder. Elements within the interface should be positioned and sized using standard UIConstraints. Wherever possible, elements should be customized within interface builder, with little­to­no interface customization done programmatically. If there is no other possible way to achieve the aesthetic as presented in our design PDF, or if there would be significant performance detriment by not customizing via code, programmatic customization is acceptable.


The views within ViewControllers should be created with their own XIB files. Elements within the design (such as the sidebar) should be built with re­use in mind.
With multi­language support being an eventual goal of this project, please populate static labels from the Settings.bundle > en.lproj > Root.strings file. When you create a static label, make sure to add it to this file.

Please make sure any colors used match the brand value in "G k brand hex values.png"

Environment Setup

 

GIT: The project will use a code repository at Github, please see additional details and participant responsibilities under Submission Guidelines.

Xcode: All code development should be done in Xcode 6.1 and tested in the simulator.

Framework: Code should be developed with the Cocoa Touch framework using Swift and must compile against iOS SDK 8.0 with a deployment target of iOS 7.0.

 

Get Started

 

- Request access to the project in the challenge forums

- Fork this project: git@github.com:cloudspokes/UNI-mobile.git

- Checkout this branch: https://github.com/cloudspokes/UNI-mobile/tree/global-search-prototype

- Write and submit your code as a zip file



Final Submission Guidelines

Submission Guidelines

 

- Cocoa Touch framework Xcode 6.1 project with well commented code

- Code must compile against iOS SDK 8.0 with a deployment target of iOS 7.0

- Upload all source projects as a zip

- Provide deployment guide documentation to run your code.

 

GIT Guidelines and Requirements


All code for this project will be maintained at Github. Challenge participants will have to request read-only access to the repository during the challenge and are expected to fork and do their coding on the challenge branch. Once contest submission closes, the project owner will update the code in the challenge branch to reflect the current state of development. The winner of the challenge will then be required to update their fork to the current state of the development repository and will be responsible for handling merge conflicts when updating their fork. They will then create a pull request.

ELIGIBLE EVENTS:

2015 topcoder Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30046879