テスト用のターゲットを作成する必要があります。 ユニットテストを有効にした場合は、MyApplication_Testsという名前のターゲットが既に存在しているかもしれません。 その場合に、もしそのターゲットをユニットテスト用に使用しないのであれば、そのターゲットをKIF用に使用しても構いません。 それ以外の場合は、以下の手順で新規にターゲットを作成してください。
- Xcode上でプロジェクトやターゲット選択欄から、ターゲットの追加を押す
| ... | |
| headerView.translatesAutoresizingMaskIntoConstraints = false | |
| tableView.tableHeaderView = headerView | |
| NSLayoutConstraint.activate([ | |
| headerView.topAnchor.constraint(equalTo: tableView.topAnchor), | |
| headerView.widthAnchor.constraint(equalTo: tableView.widthAnchor), | |
| headerView.centerXAnchor.constraint(equalTo: tableView.centerXAnchor)]) | |
| tableView.tableHeaderView?.layoutIfNeeded() |
| import Foundation | |
| enum Either<A,B> { | |
| case left(A) | |
| case right(B) | |
| } | |
| // Works only using Swift 4.1 | |
| extension Either: Codable where A: Codable, B: Codable { | |
| enum CodingKeys: CodingKey { |
| // | |
| // SimpleScrollingStack.swift | |
| // A super-simple demo of a scrolling UIStackView in iOS 9 | |
| // | |
| // Created by Paul Hudson on 10/06/2015. | |
| // Learn Swift at www.hackingwithswift.com | |
| // @twostraws | |
| // | |
| import UIKit |
| // Copyright (c) 2014 Shintaro Kaneko | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // | |
| // The above copyright notice and this permission notice shall be included in |
| <key>UILaunchImages</key> | |
| <array> | |
| <dict> | |
| <key>UILaunchImageName</key> | |
| <string>Default</string> | |
| <key>UILaunchImageMinimumOSVersion</key> | |
| <string>7.0</string> | |
| <key>UILaunchImageOrientation</key> | |
| <string>Portrait</string> | |
| <key>UILaunchImageSize</key> |
| // Original by Erica Sadun | |
| // Source: http://ericasadun.com/2014/06/24/swift-reflection-dump/ | |
| import UIKit | |
| import Foundation | |
| func typestring(x : Any) -> String | |
| { | |
| if let obj = x as? NSObject { | |
| return NSStringFromClass((x as NSObject).dynamicType) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ACTION | |
| AD_HOC_CODE_SIGNING_ALLOWED | |
| ALTERNATE_GROUP | |
| ALTERNATE_MODE | |
| ALTERNATE_OWNER | |
| ALWAYS_SEARCH_USER_PATHS | |
| ALWAYS_USE_SEPARATE_HEADERMAPS | |
| APPLE_INTERNAL_DEVELOPER_DIR | |
| APPLE_INTERNAL_DIR | |
| APPLE_INTERNAL_DOCUMENTATION_DIR |