mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-24 08:54:10 +08:00
41 lines
989 B
Swift
41 lines
989 B
Swift
//
|
|
// IssuePatchContentViewController.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 8/12/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
final class IssuePatchContentViewController: UIViewController {
|
|
|
|
private let file: File
|
|
private let client: GithubClient
|
|
private let codeView = CodeView()
|
|
|
|
init(file: File, client: GithubClient) {
|
|
self.file = file
|
|
self.client = client
|
|
super.init(nibName: nil, bundle: nil)
|
|
title = file.actualFileName
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
view.backgroundColor = .white
|
|
view.addSubview(codeView)
|
|
codeView.set(attributedCode: CreateDiffString(code: file.patch))
|
|
}
|
|
|
|
override func viewWillLayoutSubviews() {
|
|
super.viewWillLayoutSubviews()
|
|
codeView.frame = view.bounds
|
|
}
|
|
|
|
}
|