This file contains 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
#!/usr/bin/ruby -W0 | |
=begin | |
This file is to replace Cartfile to achieve patches between Carthage checkout and build | |
Please run `./Cartfile.patch` to browse its usage | |
=end | |
require_relative "Cartfile.patch.utils" | |
carthage do |
This file contains 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
import PromiseKit | |
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
let p = Promise.value(0) // A useless promise just for test |
This file contains 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
public class HelloWorld { | |
let hello = "Hello" | |
public init() {} | |
public func hello(to whom: String) -> String { | |
return "Hello \(whom)" | |
} | |
} |
This file contains 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
import XCTest | |
@testable import HelloWorldSDK | |
class HelloWorldSDKTests: XCTestCase { | |
func testHelloWorld() { | |
let hw = HelloWorld() | |
// test public method | |
XCTAssertEqual(hw.hello(to: "World"), "Hello World") |
This file contains 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
Pod::Spec.new do |s| | |
s.name = "HelloWorldSDK" | |
s.version = "0.0.1" | |
s.summary = "iOS SDK for Hello World" | |
s.description = "iOS SDK for Hello World, including example app" | |
s.homepage = "https://github.com/peteranny/" | |
s.license = "MIT" | |
s.author = "peteranny" | |
s.platform = :ios, "9.0" | |
s.swift_version = "4.2" |
This file contains 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
use_frameworks! | |
target 'HelloWorldExampleApp' do | |
platform :ios, '12.1' | |
pod 'HelloWorldSDK', :path => '.' | |
end |
This file contains 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
import UIKit | |
import HelloWorldSDK | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let label: UILabel = { | |
let label = UILabel() |
This file contains 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
public class HelloWorld { | |
let greet = "Hello" | |
public init() {} | |
public func hello(to whom: String) -> String { | |
return "\(greet) \(whom)" | |
} | |
public var helloColor: UIColor? { |
This file contains 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
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let label: UILabel = { | |
let label = UILabel() | |
label.frame.origin = CGPoint(x: 100, y: 100) | |
label.text = HelloWorld().hello(to: "World") | |
/* Use your asset */ |
This file contains 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
import Combine | |
import CombineCocoa // To allow publisher extensions such as button.tapPublisher | |
import UIKit | |
class SimpleViewController: UIViewController { | |
private let viewModel = SimpleViewModel() | |
private var cancellables: [AnyCancellable] = [] | |
private let button = UIButton() | |
override func viewDidLoad() { |
OlderNewer