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
| # У Sony по всему миру упала сеть PSN | |
| Сеть PlayStation Network (PSN) не работает уже часы, что привело к проблемам с цифровыми копиями игр, онлайн-функциями и банальным управлением учетными записями. | |
| Игроки сообщают о трудностях с запуском игр, использованием приложений и доступом к сетевым функциям. Некоторые не могут увидеть своих друзей, трофеи или сетевой статус. Sony говорит, что работает над решением проблемы. | |
| [Источник](https://www.ferra.ru/news/apps/u-sony-po-vsemu-miru-upala-set-psn-08-02-2025.htm) | |
| # Власти Великобритании и Apple |
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
| //To configure the contents of the HUD | |
| struct HUDConfig { | |
| var text: String | |
| var icon: Image | |
| var autohide = true | |
| static func success(_ s: String) -> HUDConfig { | |
| return HUDConfig(text: s, icon: Image(systemName: "checkmark.circle.fill")) | |
| } | |
| } |
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
| // Original article here: https://www.fivestars.blog/code/swiftui-hierarchy-list.html | |
| import SwiftUI | |
| struct FileItem: Identifiable { | |
| let name: String | |
| var children: [FileItem]? | |
| var id: String { name } |
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
| import Combine | |
| import SwiftUI | |
| struct ImageViewController: View { | |
| @ObservedObject var url: LoadUrlImage | |
| init(imageUrl: String) { | |
| url = LoadUrlImage(imageURL: imageUrl) | |
| } | |
| var body: some View { |
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
| import Foundation | |
| let headers = [ | |
| "x-rapidapi-host": "trailapi-trailapi.p.rapidapi.com", | |
| "x-rapidapi-key": "SIGN-UP-FOR-KEY" | |
| ] | |
| let request = NSMutableURLRequest(url: NSURL(string: "https://trailapi-trailapi.p.rapidapi.com/trails/explore/")! as URL, |
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 UIView { | |
| static let loadingViewTag = 1938123987 | |
| func showLoading(style: UIActivityIndicatorView.Style = .gray, color: UIColor? = nil, scale: CGFloat = 1) { | |
| var loading = viewWithTag(UIView.loadingViewTag) as? UIActivityIndicatorView | |
| if loading == nil { | |
| loading = UIActivityIndicatorView(style: style) | |
| } | |
| loading?.scale(value: scale) | |
| if let color = color { | |
| loading?.color = color |
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
| //1 | |
| let image = UIImage(named: "swifty")! | |
| let swifty = Bird(name: "Swifty", rarity: .veryRare, image: image) | |
| //2 | |
| let viewModel = BirdViewModel(bird: swifty) | |
| //3 | |
| let frame = CGRect(x: 0, y: 0, width: 300, height: 450) | |
| let view = BirdView(frame: frame) |
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
| // MARK: - View | |
| public class BirdView: UIView { | |
| public let imageView: UIImageView | |
| public let nameLabel: UILabel | |
| public let purchaseFeeLabel: UILabel | |
| public override init(frame: CGRect) { | |
| var imageViewFrame = CGRect(x: 0, y: 16, width: frame.width, height: frame.width/2) | |
| imageView = UIImageView(frame: imageViewFrame) |
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
| // MARK: - Bird View Model | |
| public class BirdViewModel { | |
| //1 | |
| private let bird: Bird | |
| public init(bird: Bird) { | |
| self.bird = bird | |
| } |
NewerOlder