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 AVKit | |
import PhotosUI | |
import SwiftUI | |
struct VideoTransferable: Transferable { | |
let url: URL | |
static var transferRepresentation: some TransferRepresentation { | |
FileRepresentation(contentType: .movie) { exporting in | |
return SentTransferredFile(exporting.url) |
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
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
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 Foundation | |
import Security | |
private let DataKey = "MyDataKey" | |
/** | |
* The KeychainResult class wraps an OSStatus that is returned from a keychain action. It vends KeychainErrors. | |
*/ | |
struct KeychainResult { | |
let keychainError: OSStatus |
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 SnapKit | |
import UIKit | |
class TabBarController: UITabBarController { | |
// MARK: - Properties | |
private let TabBarHeight: CGFloat = 51 | |
// MARK: - UI Components | |
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 SnapKit | |
final class InnerCell: UICollectionViewCell { | |
// MARK: UI | |
let stack: UIStackView = { | |
let stack = UIStackView() | |
stack.axis = .vertical | |
stack.distribution = .fill | |
return stack |
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
// ViewController.swift에서 사용해본 테스트 코드 | |
// 텍스트 배열을 가져와서 각각의 크기를 측정해보고 있다. | |
import UIKit | |
class ViewController: UIViewController { | |
var texts = [ | |
"전체", | |
"오늘", |
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
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { | |
return CGSize(width: categoryTitles[indexPath.item].size(withAttributes: [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 14)]).width + 20, height: 32) | |
} |
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
for fontFamily in UIFont.familyNames { | |
for fontName in UIFont.fontNames(forFamilyName: fontFamily) { | |
print(fontName) | |
} | |
} |