Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ reviews:
drafts: true

# 커밋이 추가될 때마다 변경된 부분만 자동으로 재리뷰
auto_incremental_review: false
auto_incremental_review: true

# ---------------------------------------------------------------- #
# 채팅 기능 설정
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions Examples/SampleApp/SampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Comment thread
indextrown marked this conversation as resolved.
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -303,7 +303,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
struct SampleApp: App {
var body: some Scene {
WindowGroup {
ContentView()
TabBarView()
}
}
}
33 changes: 33 additions & 0 deletions Examples/SampleApp/SampleApp/App/TabBarView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// TabBarView.swift
// SampleApp
//
// Created by 김동현 on 4/8/26.
//

import SwiftUI
import SwiftUI_Kit

struct TabBarView: View {
@State private var selectedTab: Int = 0
var body: some View {
TabView(selection: $selectedTab) {
WrapperListView()
.tabItem {
Label("Wrapper", systemImage: "0.square.fill")
}
.tag(0)

NativeListView()
.tabItem {
Label("Native", systemImage: "1.square.fill")
}
.tag(1)
}
}
}

#Preview {
TabBarView()
}

21 changes: 0 additions & 21 deletions Examples/SampleApp/SampleApp/ContentView.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// NativeListView.swift
// SampleApp
//
// Created by 김동현 on 4/8/26.
//

import SwiftUI

struct NativeListView: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}

#Preview {
NativeListView()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// WrapperListView.swift
// SampleApp
//
// Created by 김동현 on 4/8/26.
//

import SwiftUI

struct WrapperListView: View {
var body: some View {
NavigationStack {
List {
Section("") {
NavigationLink("SKWebView") {
SampleSKWebView()
.toolbar(.hidden, for: .tabBar)
}
}
}
}
}
}

#Preview {
WrapperListView()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// SampleSKWebView.swift
// SampleApp
//
// Created by 김동현 on 4/8/26.
//

import SwiftUI
import SwiftUI_Kit

struct SampleSKWebView: View {
var body: some View {
SKWebView(url: URL(string: "https://www.naver.com")!)
.refreshable()
.refreshText("새로고침")
.refreshIndicatorColor(.blue)
.refreshTextColor(.blue)
.refreshIndicatorScale(1.0)
.ignoresSafeArea()
}
}

#Preview {
SampleSKWebView()
}
8 changes: 0 additions & 8 deletions Sources/SwiftUI-Kit/Wrapper/SKWebView.swift

This file was deleted.

110 changes: 110 additions & 0 deletions Sources/SwiftUI-Kit/Wrapper/SKWebView/SKWebView+Modifier.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
//
// SKWebView+Modifier.swift
// SwiftUI-Kit
//
// Created by 김동현 on 4/8/26.
//

import SwiftUI

// MARK: - Modifier
public extension SKWebView {

/// Pull to Refresh 기능을 활성화합니다.
///
/// - Returns: 설정이 반영된 `SKWebView`
///
/// 기본적으로 비활성화되어 있으며, 호출 시 활성화됩니다.
///
/// ## Example
/// ```swift
/// SKWebView(url: url)
/// .refreshable()
/// ```
func refreshable() -> Self {
var copy = self
copy.isRefreshEnabled = true
return copy
}

/// Pull to Refresh 시 표시할 텍스트를 설정합니다.
///
/// - Parameter text: 새로고침 시 상단에 표시될 문자열
/// - Returns: 설정이 반영된 `SKWebView`
///
/// ## Example
/// ```swift
/// SKWebView(url: url)
/// .refreshable()
/// .refreshText("새로고침 중...")
/// ```
///
/// - Note: 이 설정은 `refreshable()`이 활성화된 경우에만 적용됩니다.
func refreshText(_ text: String) -> Self {
var copy = self
copy.refreshText = text
return copy
}

/// Pull to Refresh 텍스트의 색상을 설정합니다.
///
/// - Parameter color: 텍스트에 적용할 색상
/// - Returns: 설정이 반영된 `SKWebView`
///
/// 기본값은 `.label`이며 시스템 다크/라이트 모드에 자동 대응됩니다.
///
/// ## Example
/// ```swift
/// SKWebView(url: url)
/// .refreshable()
/// .refreshTextColor(.blue)
/// ```
///
/// - Note: 이 설정은 `refreshable()`이 활성화된 경우에만 적용됩니다.
func refreshTextColor(_ color: Color) -> Self {
var copy = self
copy.refreshTextColor = UIColor(color)
return copy
}

/// Pull to Refresh 인디케이터의 색상을 설정합니다.
///
/// - Parameter color: 인디케이터에 적용할 색상
/// - Returns: 설정이 반영된 `SKWebView`
///
/// iOS의 `tintColor`에 해당하는 값입니다.
///
/// ## Example
/// ```swift
/// SKWebView(url: url)
/// .refreshable()
/// .refreshIndicatorColor(.blue)
/// ```
///
/// - Note: 이 설정은 `refreshable()`이 활성화된 경우에만 적용됩니다.
func refreshIndicatorColor(_ color: Color) -> Self {
var copy = self
copy.refreshIndicatorColor = UIColor(color)
return copy
}

/// Pull to Refresh 인디케이터의 크기를 설정합니다.
///
/// - Parameter scale: 인디케이터의 스케일 값입니다. 기본값은 `0.7`입니다.
/// - Returns: 설정이 반영된 `SKWebView`
///
/// ## Example
/// ```swift
/// SKWebView(url: url)
/// .refreshable()
/// .refreshIndicatorScale(1.0)
/// ```
///
/// - Note: 이 설정은 `refreshable()`이 활성화된 경우에만 적용됩니다.
/// `CGAffineTransform`을 사용하여 크기를 조정합니다.
func refreshIndicatorScale(_ scale: CGFloat) -> Self {
var copy = self
copy.refreshIndicatorScale = scale
return copy
Comment thread
indextrown marked this conversation as resolved.
}
}
Loading