This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension CollapsibleTableViewController: CollapsibleTableViewHeaderDelegate { | |
| func toggleSection(_ header: CollapsibleTableViewHeader, section: Int) { | |
| let collapsed = !sections[section].collapsed | |
| // Toggle collapse | |
| sections[section].collapsed = collapsed | |
| header.setCollapsed(collapsed) | |
| // Reload the whole section | |
| tableView.reloadSections(NSIndexSet(index: section) as IndexSet, with: .automatic) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Auto resizing the height of the cell | |
| tableView.estimatedRowHeight = 44.0 | |
| tableView.rowHeight = UITableViewAutomaticDimension | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var a = ["sdfdf", "http://oooooolol"], | |
| handleNetErr = function(e) { return e }; | |
| Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr)) | |
| .then(function(sdf, invalid) { | |
| console.log(sdf, invalid) // [Response, TypeError] | |
| }) | |
| .catch(function(err) { | |
| console.log(err); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // SwiftyLib.swift | |
| // | |
| public final class SwiftyLib { | |
| let name = "SwiftyLib" | |
| public func add(a: Int, b: Int) -> Int { | |
| return a + b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // SwiftyLibTests.swift | |
| // | |
| import XCTest | |
| @testable import SwiftyLib | |
| class SwiftyLibTests: XCTestCase { | |
| var swiftyLib: SwiftyLib! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // SwiftyLibTests.swift | |
| // | |
| import XCTest | |
| @testable import SwiftyLib | |
| class SwiftyLibTests: XCTestCase { | |
| var swiftyLib: SwiftyLib! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| language: objective-c | |
| osx_image: xcode10.1 | |
| env: | |
| matrix: | |
| - TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone XR' | |
| - TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone 7' | |
| script: | |
| - set -o pipefail && xcodebuild test -enableCodeCoverage YES -project SwiftyLib.xcodeproj -scheme SwiftyLib -sdk $TEST_SDK -destination "platform=iOS Simulator,OS=$OS,name=$NAME" ONLY_ACTIVE_ARCH=YES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| coverage_service: cobertura_xml | |
| xcodeproj: SwiftyLib.xcodeproj | |
| scheme: SwiftyLib | |
| output_directory: reports | |
| ignore: | |
| - SwiftyLibTests/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| language: objective-c | |
| osx_image: xcode10.1 | |
| env: | |
| matrix: | |
| - TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone XR' | |
| - TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone 7' | |
| script: | |
| - set -o pipefail && xcodebuild test -enableCodeCoverage YES -project SwiftyLib.xcodeproj -scheme SwiftyLib -sdk $TEST_SDK -destination "platform=iOS Simulator,OS=$OS,name=$NAME" ONLY_ACTIVE_ARCH=YES |

