2021-10-12

 

사이트가 유료화가 되면서 다시 바뀐 사이트 공유

 

사용 방법

App Icon, Image Set 을 이용해 해당 이미지를 넣고 Generate만 하면 간단하게 사용 가능하다.

Android, iOS 둘 다 사용 가능하기 때문에 아주 좋다.

 

App Icon 같은 경우는 Assets 폴더가 생성되기 때문에 바로 넣기만 하면 된다.

 

끝!

 

https://appicon.co/

 

추천!!

 

 

 

 

2020-04-10

 

근례 아이콘 만들고 쓰는 사이트를 바꾸었다.

 

 

여기는 App 아이콘과 이미지를 [@1x, @2x, @3x], iPhone, iPad, Android 를 다 만들수 있다.

 

 

 

 

추천추천!! 별 5개 추천

 

설명은 나중에 넣고 이미지 다운로드 해보자.

 

Icon cutter

 

https://www.iconcutter.com/

 

 

Made with love in Bangkok, Thailand

 

 

 

 

 

 


 

 

개발에 꼭 들어가는 부분 중 하나는

 

사이즈가 다른 iCon 적용 부분이다.

 

그러나 그래픽에서 항상 원하는 사이즈를 그대로 주지는 않는다.

 

그래서 1024*1024 Size 아이콘 이미지 하나만 넣으면 쉽게 만들 수 있는

 

사이트 하나를 소개해본다.

 

 

 

http://icon.angrymarmot.org/

 

 

 

한번 쓰면 계속 쓰게 될것이다.

 

 

 

 

추천!

 

 

애플 아이콘 만들기

안드로이드 아이콘 만들기

iCon Make

 

 

 

 

2019 - 03 - 04 

확인해 보았는데 사이트가 안들어가지네요...

 

그래서 다른데...

 

https://makeappicon.com/

 

여기는 메일로 보내준다.. 구지 쓰기 싫으신분은 안쓰셔도 된다.

 

 

 

 

 

 

 

 

 

 

가장 잘 쓰고 있는 하나중에 손에 꼽힌다.

 

안드로이드에 있는 Toast를 똑같이 구현해본거다. 

원래는 상 | 중 | 하 단으로 선택해서 구현을 했지만, 딱히 상 | 하 단을 이용하지 않아 지워버렸다!

 

써보고 싶은 사람은 써보고 개선할점이 있으면 알려주기 바랍니다.

아니면 개선해서 알려주세요 ㅎㅎ

 

xib 파일은 다운받아서 써보세요. 쓰는 방법은

 

Toast.showToastMessage(message: "")

let kTOAST_DURATION_VALUE: TimeInterval = 0.5
let kTOAST_HEIGHT_VALUE: CGFloat = 80.0
let kTOAST_WIDTH_RATE_VALUE: CGFloat = 0.9

class Toast: UIView {
    
    @IBOutlet weak var msg_lb: UILabel!

    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    
    class func showToastMessage(message: String) {
        if let topVC = Utils.topViewController() {
            let name = String(describing: Toast.self)
            guard let loadedNib = Bundle.main.loadNibNamed(name, owner: self, options: nil) else { return }
            guard let toast = loadedNib.first as? Toast else { return }
            toast.msg_lb.text = message
            toast.show(activeView: topVC.view, message: message)
            
            toast.translatesAutoresizingMaskIntoConstraints = false
            toast.centerXAnchor.constraint(equalTo:topVC.view.centerXAnchor).isActive = true
            toast.centerYAnchor.constraint(equalTo:topVC.view.centerYAnchor).isActive = true
            toast.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.size.width * kTOAST_WIDTH_RATE_VALUE).isActive = true
        }
    }
    
    func show(activeView :UIView, message:String) {
        self.msg_lb.layer.cornerRadius = 5
        self.msg_lb.text = message
        
        self.alpha = 0
        self.isUserInteractionEnabled = false
        
        activeView.addSubview(self)
        
        UIView.animate(withDuration: kTOAST_DURATION_VALUE, delay: 0, options: .curveEaseIn, animations: {
            self.alpha = 1.0
        }) { (finished) in
            self.isUserInteractionEnabled = true
            UIView.animate(withDuration: kTOAST_DURATION_VALUE, delay: 1.0, options: .curveEaseIn, animations: {
                self.alpha = 0.0
            }) { (finished) in
                self.removeFromSuperview()
            }
        }
    }
}

 

Toast.swift
0.00MB
Toast.xib
0.00MB

 

 


 

'[ 자기개발 ] > [ Swift ]' 카테고리의 다른 글

Alert.swift  (0) 2020.11.19
UIColor+Extension.swift  (0) 2020.11.19

 

 

UIAlertController | UIAlertAction

 

더 좋은 방법이 있을까요?

 

 

Alert.swift

class Alert: NSObject {
    class func showAlert(title :String, message :String, actions :[String], completion :@escaping (_ text :String, _ index :NSInteger) -> Void) -> Void {
        let alert :UIAlertController    = UIAlertController.init(title: title, message: message, preferredStyle: .alert)
        for i in 0 ..< actions.count {
            let action :UIAlertAction = UIAlertAction.init(title: actions[i],
                                                           style: .default) { (action) in
                completion(actions[i], i)
            }
            alert.addAction(action)
        }
        alert.modalPresentationStyle = .popover
        
        // getTopViewController : 최상단 뷰 컨트롤러
        getTopViewController()?.present(alert, animated: true, completion: {
            
        })
    }
    
    class func showAction(title :String, message :String, actions :[String], completion :@escaping (_ text :String, _ index :NSInteger) -> Void) -> Void {
        let alert :UIAlertController    = UIAlertController.init(title: title, message: message, preferredStyle: .actionSheet)
        for i in 0 ..< actions.count {
            let action :UIAlertAction = UIAlertAction.init(title: actions[i],
                                                           style: i == (actions.count-1) ? .cancel : .default) { (action) in
                completion(actions[i], i)
            }
            alert.addAction(action)
        }
        alert.modalPresentationStyle = .popover
        alert.view.tintColor = UIColor.black

	// getTopViewController : 최상단 뷰 컨트롤러
        getTopViewController()?.present(alert, animated: true, completion: {
            
        })
    }
}

 

사용방법

 

Alert 사용방법

Alert.showAlert(title: "[ 타이틀 ]",
                        message: "[ 메세지 ]]",
                        actions: ["액션 - 1","액션 - 2","액션 - 3","액션 - 4","액션 - 5","닫기"]) { (text, index) in
    if text != "닫기" {
                
    }
}
더보기

Alert 결과화면

showAlert 호출 화면

 

 

ActionSheet 사용방법

Alert.showAction(title: "[ 타이틀 ]",
                        message: "[ 메세지 ]]",
                        actions: ["액션 - 1","액션 - 2","액션 - 3","액션 - 4","액션 - 5","닫기"]) { (text, index) in
    if text != "닫기" {
                
    }
}
더보기

ActionSheet 결과화면

 

showAction 호출 화면

'[ 자기개발 ] > [ Swift ]' 카테고리의 다른 글

Toast.Swift  (0) 2021.04.27
UIColor+Extension.swift  (0) 2020.11.19

 

 

UIColor+Extension.swift

extension UIColor {
    public convenience init?(hex: String) {
        let r, g, b, a: CGFloat

        if hex.hasPrefix("#") {
            let start = hex.index(hex.startIndex, offsetBy: 1)
            let hexColor = String(hex[start...])

            if hexColor.count == 8 {
                let scanner = Scanner(string: hexColor)
                var hexNumber: UInt64 = 0

                if scanner.scanHexInt64(&hexNumber) {
                    r = CGFloat((hexNumber & 0xff000000) >> 24) / 255
                    g = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255
                    b = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255
                    a = CGFloat(hexNumber & 0x000000ff) / 255

                    self.init(red: r, green: g, blue: b, alpha: a)
                    return
                }
            }
        }
        return nil
    }
}

 

 

사용방법

UIColor.init(hex: "#ffe700ff")

 

'[ 자기개발 ] > [ Swift ]' 카테고리의 다른 글

Toast.Swift  (0) 2021.04.27
Alert.swift  (0) 2020.11.19

 

 

1. 13.0 이하 버전을 개발 시 필수사항

- AppDelegate.h 에 @property (nonatomic, strong) UIWindows *window; 추가 


2. prefix.pch 추가

(1). prefix.pch 파일 생성

     xCode - File - New - File - PCH

     ProjectName : 프로젝트명-PrefixHeader.pch

     * 파일을 추가할때는 프로젝트 폴더를 선택해서 추가

 

(2). build settings 설정

     Precompile Prefix Header : YES

     Prefix Header : 경로 ( sample_github/sample_github-PrefixHeader.pch )

     * 경로를 추가해야 하기 때문에 (1)에서 프로젝트 폴더 아래 생성을 하는거다.)

 


3. NSLog 디버그시에만 표출하고 (경로, 함수명, 라인) 표출 설정

#ifdef DEBUG
    #define NSLog( s, ... ) NSLog( @"[%@ %s(%d)] %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __PRETTY_FUNCTION__, __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
    #define NSLog( s, ... )
#endif

 

 

Photo Editing

A Photo Editing extension lets users edit a photo or video within the Photos app. After users confirm the changes they make in a Photo Editing extension, the adjusted content is available in Photos. Photos always keeps the original version of the content, too, so that users can revert the changes they make in an extension.

BEFORE YOU BEGIN

Make sure that the Photo Editing extension point is appropriate for the functionality you want to provide. A Photo Editing extension should make it easy for users to make quick, targeted adjustments to a photo or video without requiring too much user interaction. If you want to enable a more generic task or help users share photos and videos with others, the Photo Editing extension point is not the right choice.

To learn about other types of app extensions you can create, see Table 1-1.

Understand How a Photo Editing Extension Works with Photos

To support a consistent editing experience, Photos keeps multiple versions of each media asset’s image or video data, in addition to adjustment data, which describes past edits made to the asset. For each asset, Photos stores the original version, the current version (which includes the most recent adjustments), and the set of adjustments that were applied to the original version to create the current version.

When a user chooses a Photo Editing extension, Photos asks the extension if it can read the adjustment data. If the app extension supports the adjustment data, Photos provides the original version of the asset as input to the editing session. After the extension reads the adjustment data and reconstructs the past edits, it can allow users to alter or revert past edits or add new edits. For example, if the adjustment data describes filters applied to a photo, the extension reapplies those filters to the original asset and can let users change filter parameters, add new filters, or remove filters.

If the extension doesn’t support an asset’s adjustment data, Photos provides the current version of the asset as input to the editing session. Because the current version contains the rendered output of all past edits, the extension can let users apply new edits to the asset but not alter or revert past edits.

IMPORTANT

Photos does not store a current version of video assets. If your extension can’t read a video asset’s adjustment data, it must work with the original version of the video, overwriting past edits.

When a user finishes using a Photo Editing extension, the extension returns the edited asset and the adjustment data.

Use the Xcode Photo Editing Template

The Xcode Photo Editing template provides default header and implementation files for the principal view controller class (called PhotoEditingViewController), an Info.plist file, and an interface file (that is, a storyboard file).

IMPORTANT

Embed no more than one Photo Editing extension for each media type (photo, video, or Live Photo) in a containing app. The Photos app displays to the user, at most, one extension of each type from a given containing app. In general, it’s best when one Photo Editing extension handles multiple media types.

By default, the Photo Editing template supplies the following Info.plist keys and values:

  1. <key>NSExtension</key>
  2. <dict>
  3. <key>NSExtensionAttributes</key>
  4. <dict>
  5. <key>PHSupportedMediaTypes</key>
  6. <array>
  7. <string>Image</string>
  8. </array>
  9. </dict>
  10. <key>NSExtensionMainStoryboard</key>
  11. <string>MainInterface</string>
  12. <key>NSExtensionPointIdentifier</key>
  13. <string>com.apple.photo-editing</string>
  14. </dict>

In particular, make sure that the PHSupportedMediaTypes array specifies the types of media assets your app extension can edit. The default value is Image, but you can also use Video and LivePhoto.

Design the UI

IMPORTANT

For best results, use Auto Layout to design the view of a Photo Editing extension.

In iOS, your app extension’s view must support a full-screen presentation on devices of different sizes, as well as Slide Over and Split View presentations on iPad. In macOS, your app extension’s view occupies the entire Photos window, which is resizable and supports full-screen presentation.

The Photos app displays a Photo Editing extension with a navigation bar in iOS or a combined title bar and toolbar in macOS. Don’t create a navigation-based UI, and avoid stacking additional top-oriented toolbars in your app extension.

Photos automatically displays your app extension’s view so that it occupies the full height of the screen (iOS) or window (macOS), including the area behind the navigation bar or title bar. If you want your content view to appear below the bar, and not behind it, use the view’s top layout guide appropriately.

It’s best when a Photo Editing extension lets users preview the results of their edits. Giving users a preview while they’re still using your app extension means that they can get the effect they want without repeatedly exiting and reentering the extension.

Because users are likely to spend time editing a photo or movie in your app extension, you don’t want them to lose their work if they accidentally choose Cancel. To improve the user experience, be sure to implement the shouldShowCancelConfirmation method in your view controller, returning YES if there are unsaved changes. When this method returns YES, Photos displays confirmation UI so that users can confirm if they really want to cancel their changes.

Implement Your Extension

Users get access to Photo Editing extensions in the Photos app. When a user chooses your app extension, display a view that provides a custom editing interface. To present this view, use a view controller that adopts the PHContentEditingController protocol.

When a user chooses your app extension, Photos provides the asset being edited to your extension’s view controller in the form of a PHContentEditingInput object. For photo and video assets, you use this object to access the asset’s image or video data to perform your editing. When the user chooses to end editing, Photos asks your app extension’s view controller for a PHContentEditingOutput object, which you use to provide the edited asset data.

NOTE

To provide responsive performance during photo editing, use the content editing input’s displaySizeImage property to preview edits. When the user chooses to end editing, apply your edits to the full-size image using the fullSizeImageURL property.

When your app extension works with Live Photo assets, it doesn’t access the asset’s underlying image and video resources directly. Instead, you create a PHLivePhotoEditingContext object from the provided content editing input, and use the methods that class provides to perform and preview edits.

If your app extension edits video assets, see the AVVideoComposition videoCompositionWithAsset:applyingCIFiltersWithHandler: method for an easy way to apply image-processing filters.

For example code illustrating how to edit all asset media types, download the Sample Photo Editing Extension sample code project.

Handling Memory Constraints

Because a Photo Editing extension often needs to work with large high-resolution images and videos, the extension is likely to experience memory pressures when running on a device. It’s recommended that you examine your existing image-processing code and make sure that it performs to a high standard before you use it in your app extension.

Testing a Photo Editing Extension

Avoid making assumptions about the media formats that your app extension may receive. Be sure to test your filtering and other image-processing code with a wide range of media formats; don’t just test with content from the device camera.

To learn about debugging app extensions in general, see Debug, Profile, and Test Your App Extension.

 

 

스크랩 : https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/Photos.html

 

App Extension Programming Guide: Photo Editing

App Extension Programming Guide

developer.apple.com

 

Download Sample Code

https://developer.apple.com/library/archive/samplecode/SamplePhotoEditingExtension/Introduction/Intro.html#//apple_ref/doc/uid/TP40014576

Navigation Bar and Toolbar Icon Size

Use the following sizes for guidance when preparing custom navigation bar and toolbar icons, but adjust as needed to create balance.

Target sizesMaximum sizes

72px × 72px (24pt × 24pt @3x) 84px × 84px (28pt × 28pt @3x)
48px × 48px (24pt × 24pt @2x) 56px × 56px (28pt × 28pt @2x)

Tab Bar Icon Size

In portrait orientation, tab bar icons appear above tab titles. In landscape orientation, the icons and titles appear side-by-side. Depending on the device and orientation, the system displays either a regular or compact tab bar. Your app should include custom tab bar icons for both sizes.

Target width and height (circular glyphs)

Regular tab barsCompact tab bars

75px × 75px (25pt × 25pt @3x) 54px × 54px (18pt × 18pt @3x)
50px × 50px (25pt × 25pt @2x) 36px × 36px (18pt × 18pt @2x)

Target width and height (square glyphs)

Regular tab barsCompact tab bars

69px × 69px (23pt × 23pt @3x) 51px × 51px (17pt × 17pt @3x)
46px × 46px (23pt × 23pt @2x) 34px × 34px (17pt × 17pt @2x)

Target width (wide glyphs)

Regular tab barsCompact tab bars

93px (31pt @3x) 69px (23pt @3x)
62px (31pt @2x) 46px (23pt @2x)

Target height (tall glyphs)

Regular tab barsCompact tab bars

84px (28pt @3x) 60px (20pt @3x)
56px (28pt @2x) 40px (20pt @2x)

 

 

스크랩 : https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/

현재 사용 하고 있는 POD를 정리 해 보기.

 

머 상황마다 다르겠지만 지금은 간단하게 사용할 수 있는 POD 를 나열해보자.

 

Objective-c를 사용는데 요세는 Objective-c를 찾기가 어렵다 ㅠ.ㅠ

 

 

 

pod 'ViewDeck', '~> 3.0'

https://github.com/ViewDeck/ViewDeck

 

ViewDeck/ViewDeck

An implementation of the sliding menu found in various iOS apps. - ViewDeck/ViewDeck

github.com

pod 'EKKeyboardAvoiding'

https://github.com/kirpichenko/EKKeyboardAvoiding

 

kirpichenko/EKKeyboardAvoiding

It's an universal solution for keyboard avoiding for iOS that allows automatically change content inset of UIScrollView and it's subclasses. When keyboard is presented you will be able to s...

github.com

 

pod 'Firebase/Core'

pod 'Firebase/Messaging'

 

pod 'FBSDKCoreKit', '~> 4.38.0'

pod 'FBSDKLoginKit', '~> 4.38.0'

 

pod 'youtube-ios-player-helper'

 

pod 'naveridlogin-sdk-ios'

pod 'IGRFastFilterView'

pod 'NMapsMap'

 

pod 'PPBadgeView'

https://github.com/jkpang/PPBadgeView

 

jkpang/PPBadgeView

iOS Custom Badge, Support UIView, UITabBarItem, UIBarButtonItem ,Support Objective-C/Swift; iOS自定义Badge组件, 支持UIView, UITabBarItem, UIBarButtonItem, 支持Objective-C/Swift - jkpang/PPBadgeView

github.com

pod 'BEMCheckBox'

https://github.com/Boris-Em/BEMCheckBox

 

Boris-Em/BEMCheckBox

Tasteful Checkbox for iOS. (Check box). Contribute to Boris-Em/BEMCheckBox development by creating an account on GitHub.

github.com

pod 'MarqueeLabel'

https://github.com/cbpowell/MarqueeLabel

 

cbpowell/MarqueeLabel

A drop-in replacement for UILabel, which automatically adds a scrolling marquee effect when the label's text does not fit inside the specified frame - cbpowell/MarqueeLabel

github.com

pod 'FSPagerView'

https://github.com/WenchaoD/FSPagerView

 

WenchaoD/FSPagerView

FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders. - WenchaoD/FSPagerView

github.com

 

 

 

 

 

 

 

아주 주관적이고 막혔을떄 정리하는거라 태글걸지 마시기 바랍니다.

 

우선 최근까지 pod `NMapsMap' 만 install 해주면 아주 깔끔하게 사용할 수 있었다.

그래서 그렇게 사용하고 있었는데. 다른 프로젝트에 적용하려고 하니.. 이런 SSi... 에러가 에러가...

 

0. IB Designables: Failed to render and update auto layout status.

0. Undefined symbols for architecture x86_64 _objc_class_$

 

라는 에러를 계속 내뿜는게 아닌가.

 

그래서 이걸 어떻게 해결해야하나.. 구글링을 계속 하는데.. 별에 별걸 다 해본것 같다.


Build Setting -> BitCode 를 검색해 NO로 바꿔주라고해서 바꿔줬는데도 똑같고.

Framework Path가 잘못되어있나 강제로도 넣어봤고.

Other Path로 설정해봤고.

새로운 프로젝트를 열어서 다시 해보고.

혹시 Pod에 문제가있나해서 Pod도 지웠다가 다시 설치해보고.

컴퓨터가 문제인가 컴퓨터를 바꿔서도 해보고


.

아... 그런데 똑같은 문제가 계속 발생...

 

결국. Naver Cloud Platform 홈페이지 들어가서 문의글을 딱 남기는데...

바로 해결... ㅋㅋ

 

내가 멍청했던거지.. 물어보면 끝나는걸...

혹시 안되서 검색하는 분들을 위해 이걸을 남겨본다 ㅋㅋㅋ

 

이글 본사람들은 문의하길 바라고.. 우선 내가 해결했던 방법을 설명해본다.

 


 

간단 명료하게 결론만 말하자면 NMapsMap이 용량이 커지면서 Git-lfs 를 이용하게 되었다는것.

그래서 Git-lfs를 설치를 해줘야한다는 것.

 

https://github.com/navermaps/ios-map-sdk

NaverMap github에 들어가서 CocoaPods구성 확인

 

1. 기존에 사용중이던 Pods 폴더를 삭제.

2. 터미널창에 pod cache clean NMapsMap 실행

3. git-lfs 설치

3-1. 터미널창에 sudo gem install cocoapods 실행

3-2. brew install git-lfs 실행 [ https://brew.sh/ ]

   * not found ... 에러가 나는 분들은 Homebrew 가 없어서 그러니 

   /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

   위 명령어를 그대로 복사해서 실행.

   * brew 설치가 끝나고 확인하기위해 brew doctor 실행

   * brew doctor 실행이 끝나면 brew install git-lfs 실행

3-3. git-lfs install 실행 <- 나는 이건 실행안한것 같다.

4. 프로젝트 폴더로 이동 cd /path/your-project

   * 간혹 그대로 path/your-project로 control+c | control+v 하는 사람 있는데 그러지말고

   * 1. 터미널에 cd 입력하고 한칸띄고

   * 2. 당신의 프로젝트가 있는 Finder를 열어서 해당 폴터를 끌어다가 터미널에 넣으면 경로가 자동으로 입력이 되고

   * 3. 그뒤! 엔터를 누르면 됩니다.

5. 프로젝트에있는 Pods 폴더와 캐쉬를 지웠으니 터미널에 pod install --repo-update 실행

6. 업데이트가 다 되면 프로젝트 실행 후 클린하고 빌드하면 Build Success를 볼수 있다.

 


 

여기까지가 내가 애먹었던 부분을 풀어논것이다.

 

먼가 이상하고 애매하고 잘안되는 사람은 리뷰 달지마시고 찾아보는 것을 추천한다.

 

 

 

 

 

 

 

 

 

 




팩트 설명.


0. UIWebView 에 Delegate 연결

0. webView:shouldStartLoadWithRequest:navigationType: 함수 선언

0. [[request URL] absoluteString] 으로 케치

0. 입맛대로 코딩




코딩



클라이언트 -


- (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {

    NSLog(@"%@", [request URL].absoluteString);

    

    if ([[request URL].absoluteString isEqualToString:@"appscheme://callNative"]) {

        /// 입맛대로 코딩 ///

 ...

    }

    return YES;

}




웹 -


<script type='text/javascript'>(function callNative(){window.location = 'appscheme://callNative';}());</script>





웹에서 버튼 호출 시 클라이언트가 처리해야 되는 부분이 있으면 이런식으로 호출을 하고 받을 수가 있다.


이건 어려운거 아니니 간단하게 테스트해봐도 된다.




+ Recent posts