Skip to content

Instantly share code, notes, and snippets.

View hallomuze's full-sized avatar
💭
I may be slow to respond.

hallomuze hallomuze

💭
I may be slow to respond.
  • Atlanta
View GitHub Profile
@hallomuze
hallomuze / usePartialWeb.swift
Created September 6, 2023 05:45
partial_webview101
// usage view
struct UseMine: View {
var body: some View {
VStack{
Text("some page title")
ScrollView {
Text("some header")
Text("Hello, World!")
let warnCss = Bundle.preload(name: "sam", type: "css")
@hallomuze
hallomuze / taskCancel101.swift
Created December 23, 2022 04:47
taskCancel101.swift try Task.checkCancellation
// typewrite 강좌 해봄.
// https://www.kodeco.com/28434449-modern-concurrency-getting-started/lessons/4
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
@hallomuze
hallomuze / Dynamics101_WithDelegate.swift
Created January 28, 2018 16:11
UIDynamics 101 with Delegate
// delegation feature has not yet been implemented.
func addBlocksWithBottomTwisted(){
let rightEdge = UIScreen.main.bounds.width
let nemoRect = CGRect(x: rightEdge - 70, y: 250, width: 100, height: 100)
redNemo = UIView(frame:nemoRect)
redNemo?.layer.cornerRadius = 100/2
@hallomuze
hallomuze / KeyFrame101.swift
Created January 28, 2018 16:09
CAKeyFrame101 예제와 참고
// 간단
//https://stackoverflow.com/questions/16367958/move-to-few-point-with-cakeyframeanimation
// 좀더 부드럽게 하려면 http://nevard.tistory.com/entry/iOS-애니메이션-3-CAKeyframeAnimation
// api 상세설명 http://dolfalf.tistory.com/76
// 뷰가 커졌다.작아진다 http://wookiphone.tistory.com/81
@hallomuze
hallomuze / AutolayoutExtension.swift
Created June 20, 2017 02:06
translatesAutoresizingMaskIntoConstraints 가 너무 길어요. 짧게한거
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let nemo = CGRect(x: 0, y: 0, width: 100, height: 100)
let nemoView = UIView(frame: nemo )
nemoView.backgroundColor = UIColor.red.withAlphaComponent(0.7)
self.view.addSubview(nemoView)
@hallomuze
hallomuze / FixWarning.m
Last active April 24, 2017 23:01
NSString Const Warning Fix
//[Warning Message]
//“sending ‘const NSString *’ to parameter of type ‘NSString *’ discards qualifiers” warning
//[Warning]
const NSString * kBlahBlash = @""; // 상수를 가리키는 포인터 (pointer to constant)
// equivalent to
NSString const * kBlahBlash = @"";
@hallomuze
hallomuze / SerializationObjc.m
Created April 9, 2017 02:36
Serialization in OBJC
//make custom class
@interface MyData : NSObject <NSCoding>
-(id)initWithCoder:(NSCoder *)decoder; //for encoding.
-(void)encodeWithCoder:(NSCoder *)encoder; //for decoding
@end
//hot to use
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var scrollView: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()