<commit_before>/**
 * @license
 * Copyright 2017 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

foam.CLASS({
  package: 'foam.swift.ui',
  name: 'ScrollingViewController',
  swiftImports: [
    'UIKit',
  ],
  properties: [
    {
      swiftType: 'UIView?',
      name: 'view',
    },
    {
      class: 'String',
      name: 'title',
    },
    {
      swiftType: 'UIViewController',
      name: 'vc',
      swiftExpressionArgs: ['view', 'title'],
      swiftExpression: function() {/*
let vc = VC_()
vc.innerView = view
vc.title = title
return vc
      */},
    },
  ],
  swiftCode: function() {/*
class VC_: UIViewController {
  let scrollView: UIScrollView = {
    let scrollView = UIScrollView()
    scrollView.keyboardDismissMode = .onDrag
    return scrollView
  }()
  var innerView: UIView!
  override func viewDidLoad() {
    super.viewDidLoad()

    view.addSubview(scrollView)
    scrollView.addSubview(innerView)

    let views: [String:UIView] = ["v": innerView, "sv": scrollView]
    for (_, v) in views {
      v.translatesAutoresizingMaskIntoConstraints = false
    }

    view.addConstraints(NSLayoutConstraint.constraints(
      withVisualFormat: "V:|-[v]-|",
      options: NSLayoutFormatOptions.init(rawValue: 0),
      metrics: nil,
      views: views))
    view.addConstraint(NSLayoutConstraint(
      item: innerView,
      attribute: .width,
      relatedBy: .equal,<commit_msg>Some changes to swift's ScrollingViewController which is still pretty experimental so don't read too much into these changes yet.<commit_after>/**
 * @license
 * Copyright 2017 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

foam.CLASS({
  package: 'foam.swift.ui',
  name: 'ScrollingViewController',
  swiftImports: [
    'UIKit',
  ],
  properties: [
    {
      swiftType: 'FObject?',
      name: 'view',
    },
    {
      class: 'String',
      name: 'title',
      swiftExpressionArgs: ['view$title'],
      swiftExpression: function() {/*
return view$title as? String ?? ""
      */},
    },
    {
      swiftType: 'UIColor',
      name: 'backgroundColor',
      swiftValue: 'UIColor.white',
    },
    {
      swiftType: 'UIViewController',
      name: 'vc',
      swiftExpressionArgs: ['view$view', 'title', 'backgroundColor'],
      swiftExpression: function() {/*
let vc = VC_()
vc.innerView = view$view as! UIView
vc.title = title
vc.backgroundColor = backgroundColor
return vc
      */},
    },
  ],
  swiftCode: function() {/*
class VC_: UIViewController {
  let scrollView: UIScrollView = {
    let scrollView = UIScrollView()
    scrollView.keyboardDismissMode = .onDrag
    return scrollView
  }()
  var innerView: UIView!
  var backgroundColor: UIColor!
  override func viewDidLoad() {
    super.viewDidLoad()

    view.backgroundColor = backgroundColor

    view.addSubview(scrollView)
    scrollView.addSubview(innerView)

    let views: [String:UIView] = ["v": innerView, "sv": scrollView]
    for (_, v) in views {
      v.translatesAutoresizingMaskIntoConstraints = false
    }

    view.addConstraints(NSLayoutConstraint.constraints(
      withVisualFormat: "V:|-[v]-|",
      options: NSLayoutFormatOptions.init(rawValue: 0),
      metrics: nil,
      views: views))
    view.addConstraint(NSLayoutConstraint(
      item: innerView,
      attribute: .width,
      relatedBy: .equal,
{'fraction_non_alphanumeric': 0.11438946890603723, 'fraction_numerical': 0.0040853381752156154, 'mean_word_length': 3.1732954545454546, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '124005', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1285, 'n_words': 391}