<commit_before>//
//  sdmRootController.swift
//  RadialSlider
//
//  Created by <NAME> on 23/06/2015.
//  Copyright (c) 2015 Spencer's digital media. All rights reserved.
//

import UIKit


class RootController: UIViewController {
    
    // MARK: - Managing the View (UIViewController)
    
    override func loadView() {
        
        self.view = UIView(frame: UIScreen.mainScreen().bounds)
        self.view.backgroundColor = UIColor.whiteColor()
        
        // NB: Although an interesting thought this isn't an excercise in parsing json.
        if let path = NSBundle.mainBundle().pathForResource("Settings", ofType: "json")
        {
            let data = NSData(contentsOfFile: path)
            
            do {
            
                if let json =  try NSJSONSerialization.JSONObjectWithData(data!,
                    options: NSJSONReadingOptions.MutableContainers) as? [String:AnyObject]
                {
                    if let items = json["items"] as? [AnyObject]
                    {
                        var cell: SegmentedRadialSliderCell!
                        var cells: [SegmentedRadialSliderCell] = []
                        
                        for config in items
                        {
                            cell = SegmentedRadialSliderCell(frame: CGRectMake(0.0, 0.0, 70.0, 70.0))
                            
                            cell.title = config["title"] as? String
                            cell.presentationAngle = config["presentation-angle"] as! CGFloat
                            
                            cells.append(cell)
                        }
                        
                        let radialControl: SegmentedRadialSlider = SegmentedRadialSlider(cells: cells)
                        
                        radialControl.addTarget(self, action: "valueChanged:", forControlEvents: UIControlEvents.ValueChanged)<commit_msg>Updated project, supports correct selector method<commit_after>//
//  sdmRootController.swift
//  RadialSlider
//
//  Created by <NAME> on 23/06/2015.
//  Copyright (c) 2015 Spencer's digital media. All rights reserved.
//

import UIKit


class RootController: UIViewController {
    
    // MARK: - Managing the View (UIViewController)
    
    override func loadView() {
        
        self.view = UIView(frame: UIScreen.mainScreen().bounds)
        self.view.backgroundColor = UIColor.whiteColor()
        
        // NB: Although an interesting thought this isn't an excercise in parsing json.
        if let path = NSBundle.mainBundle().pathForResource("Settings", ofType: "json")
        {
            let data = NSData(contentsOfFile: path)
            
            do {
            
                if let json =  try NSJSONSerialization.JSONObjectWithData(data!,
                    options: NSJSONReadingOptions.MutableContainers) as? [String:AnyObject]
                {
                    if let items = json["items"] as? [AnyObject]
                    {
                        var cell: SegmentedRadialSliderCell!
                        var cells: [SegmentedRadialSliderCell] = []
                        
                        for config in items
                        {
                            cell = SegmentedRadialSliderCell(frame: CGRectMake(0.0, 0.0, 70.0, 70.0))
                            
                            cell.title = config["title"] as? String
                            cell.presentationAngle = config["presentation-angle"] as! CGFloat
                            
                            cells.append(cell)
                        }
                        
                        let radialControl: SegmentedRadialSlider = SegmentedRadialSlider(cells: cells)
                        
                        radialControl.addTarget(self, action: #selector(RootController.valueChanged(_:)), forControlEvents: UIControlEvents.ValueChanged)
{'fraction_non_alphanumeric': 0.08119114278442352, 'fraction_numerical': 0.0111987783150929, 'mean_word_length': 1.383262583383869, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1452401', 'n_tokens_mistral': 1008, 'n_tokens_neox': 924, 'n_words': 220}