[iOS] swift 취소선 표시

잘 표시되던 취소선이 어느날 갑자기 안나오기 시작했다.

아마도 iOS 10.3 이후부터 먼가 바껴서 생긴 문제 같다.

다음과 같이 수정하면 취소선 표시 가능하다


let attributes = [
            NSForegroundColorAttributeName : UIColor.init(hex: "#252525"),
            NSBaselineOffsetAttributeName: 0, // 아주 중요 - 이게 없으면 표시 안됨
            NSStrikethroughStyleAttributeName : 1] as [String : Any]
        let attributeString = NSAttributedString(string: "\(StringUtil.intToCommaString(giftProductVo.originPrice))원", attributes: attributes) //1
        cell.lblPromotionProductOriginalPrice.attributedText = attributeString

사용자 삽입 이미지

Posted by incree

2017/07/10 14:08 2017/07/10 14:08
, , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/381

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[iOS] xcode error



다른 컴퓨터에서 프로젝트를 복사해와서 작업할때


xcode 컴파일시 다음과 같은 오류가 발생할수 있다.

file:///Users/username/Documents/project/myproject/Pods/Alamofire/Source/Stream.swift: warning: Missing file: /Users/username/Documents/project/myproject/Pods/Alamofire/Source/Stream.swift is missing from working copy

  "protocol descriptor for SMSwipeableTabView.SMSwipeableTabViewControllerDelegate", referenced from:

  "SMSwipeableTabView.SMBackgroundColorAttribute.unsafeMutableAddressor : Swift.String", referenced from:


  "SMSwipeableTabView.SMBackgroundColorAttribute.unsafeMutableAddressor : Swift.String", referenced from:


  "direct field offset for SwiftValidator.ValidationError.errorMessage : Swift.String", referenced from:


……………………………………….

Undefined symbols for architecture arm64




이럴 경우 Xcode DerivedData 디렉토리 내의 모든 파일을 삭제하고 다시 컴파일 하면 정상작동한다


cd /Users/username/Library/Developer/Xcode/DerivedData

rm -rf *

Posted by incree

2017/03/22 12:45 2017/03/22 12:45
,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/379

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[iOS] swift 3.x : UILabel 높이 자동 맞춤


UILabel autosize height

외부 UIView에 Constraints 추가
사용자 삽입 이미지


UILabel에 Constranints 추가 및 Lines 0으로 설정
사용자 삽입 이미지



결과

사용자 삽입 이미지


전체소스 : labelAutoHeight.zip

Posted by incree

2017/01/24 21:29 2017/01/24 21:29
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/375

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

UILabel multiple attributes, UILabel strikethrough text



letstyle1: [String:Any] = [NSForegroundColorAttributeName:UIColor.darkGray,NSFontAttributeName:UIFont.systemFont(ofSize:12),NSStrikethroughStyleAttributeName:NSUnderlineStyle.styleSingle.rawValue,NSStrikethroughColorAttributeName:UIColor.cyan]
       
     
let style2: [String: Any] = [NSForegroundColorAttributeName: UIColor.red, NSFontAttributeName: UIFont(name: "Georgia", size: 25.0)!]
     
     
let style3: [String: Any] = [NSForegroundColorAttributeName: UIColor.blue, NSBackgroundColorAttributeName: UIColor.yellow, NSFontAttributeName: UIFont.boldSystemFont(ofSize: 13), NSUnderlineStyleAttributeName : NSUnderlineStyle.styleSingle.rawValue]
     
     
let style1Text = "회색 12폰트 취소선 cyan"
     
let style2Text = "빨간색 25폰트 폰트지정"
     
let style3Text = "파란색 13폰트 볼드 밑줄 배경 노랑"
     
     
let style1String = NSMutableAttributedString(string: style1Text, attributes: style1)
     
let style2String = NSMutableAttributedString(string: style2Text, attributes: style2)
     
let style3String = NSMutableAttributedString(string: style3Text, attributes: style3)
     
       style1String.
append(style2String)
       style1String.
append(style3String)
     

        lblMultiFontStyle.attributedText = style1String












/**
 * swift 2.x
let style1: [String : AnyObject] = [
                    NSForegroundColorAttributeName: UIColor.darkGrayColor(),
                    NSFontAttributeName: UIFont.systemFontOfSize(12),
                    NSStrikethroughStyleAttributeName: NSUnderlineStyle.StyleSingle.rawValue]
                let style2: [String : AnyObject] = [
                    NSForegroundColorAttributeName: UIColor.blackColor(),
                    NSFontAttributeName: UIFont.systemFontOfSize(12)]
                let style3: [String : AnyObject] = [
                    NSForegroundColorAttributeName: ColorUtil.hexStringToUIColor("#AF0A2B"),
                    NSFontAttributeName: UIFont.boldSystemFontOfSize(13)]

                let style1Text = "첫번째 12폰트 취소선 회색"
                let style2Text  = "두번째 12폰트 검은색"
                let style3Text = "세번째 볼드 13폰트 컬러 : AF0A2B"

                let style1String = NSMutableAttributedString(string: style1Text, attributes: style1)
                let style2String = NSMutableAttributedString(string: style2Text, attributes: style2)
                let style3String = NSMutableAttributedString(string: style3Text, attributes: style3)

                style1String.appendAttributedString(style2String)
                style1String.appendAttributedString(style3String)
                lblMultiFontStyle.attributedText = style1String
*/


사용자 삽입 이미지

전체소스 : multiFontStye.zip

Posted by incree

2017/01/24 21:13 2017/01/24 21:13
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/374

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다


GCM 이용해서 Push Notifications 개발시 아래와 같은 에러가 나는 경우


2016-11-21 13:37:03.136446 ccourt[2223:955954] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.


Project -> Targets -> Capabilities  에서


Push Notifications 와 Background Modes.Remote notifications 를 ON으로 설정하면 된다


사용자 삽입 이미지

Posted by incree

2016/11/21 14:05 2016/11/21 14:05
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/372

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

Swift Cookie sharing between multiple WKWebViews

https://github.com/ShingoFukuyama/WKWebViewTips

self.processPool = [[WKProcessPool alloc] init];

WKWebViewConfiguration *configuration1 = [[WKWebViewConfiguration alloc] init];
configuration1.processPool = self.processPool;
WKWebView *webView1 = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration1];
...
WKWebViewConfiguration *configuration2 = [[WKWebViewConfiguration alloc] init];
configuration2.processPool = self.processPool;
WKWebView *webView2 = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration2];

Posted by incree

2016/04/21 20:54 2016/04/21 20:54
, , , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/366

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[iPhone] 웹뷰 프린트 하기

UIWebView에서 air print로 print하기

애플 개발자 센터에 있는 sample 소스


Posted by incree

2013/08/28 04:06 2013/08/28 04:06
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/263

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[iPhone] 25 iOS App Performance Tips & Tricks

25 iOS App Performance Tips & Tricks

http://www.raywenderlich.com/31166/25-ios-app-performance-tips-tricks?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+RayWenderlich+%28Ray+Wenderlich+|+iPhone+Developer+and+Gamer%29

Posted by incree

2013/04/05 04:18 2013/04/05 04:18
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/211

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[iPhone] 흔들기 모션 처리

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [self becomeFirstResponder];

}

// ***** - 요거 중요 자꾸 빼먹는다
- (BOOL)canBecomeFirstResponder {
    return YES;
}

- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{
    [super motionBegan:motion withEvent:event];

}
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    [super motionEnded:motion withEvent:event];
    
    if (motion == UIEventSubtypeMotionShake) {
        [self.delegate showBrokenImage];
    }
}

Posted by incree

2013/01/09 17:02 2013/01/09 17:02
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/185

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[iPhone] 앱이 판매될때마다 알림 받기

https://github.com/omz/AppSales-Mobile

AppSales

AppSales allows iOS and Mac App Store developers to download and analyze their sales reports from iTunes Connect on the iPhone.

Features

  • Automatic download of daily and weekly sales reports from iTunes Connect
  • Stacked bar graphs to see all your sales at a glance
  • Show your sales on a world map
  • View actual payments by Apple on a calendar
  • Group daily reports by fiscal or calendar month to predict your next payment
  • Automatic conversion to your currency of choice
  • Download customer reviews of your apps
  • Import reports that you downloaded elsewhere (for example with AppViz on your Mac) via iTunes File Sharing
  • Optional push notifications when new reports are available via Boxcar

Please see the screenshot below for a visual guide to AppSales' main interface and some tips and tricks.

Requirements

AppSales requires the iOS 5.0 SDK or later.

Because there is no API to access some parts of iTunes Connect, AppSales scrapes itunesconnect.apple.com. This means that even small changes on this website can break some functionality. In most cases, this is easy to fix and I'll try to make a new version available here. The report download itself uses Apple's auto-ingestion interface to iTunes Connect and should generally be unaffected by changes to the website.

Push Notifications

Because sales reports are not always available at the same time, I run a web service to send out push notifications when the daily reports have been generated.

You can get a notification when new reports are available with the free Boxcar app. Boxcar can also be installed directly from the settings in AppSales.

If AppSales is installed, opening the push notification will automatically trigger the download of new reports but you can also use the push service without AppSales being installed. To do so, install Boxcar and just add AppSales from the list of services in Boxcar.

Except for the total number of subscribers, I don't collect any data with the push service. You can stop receiving notifications at any time by simply removing AppSales from Boxcar.

About

You can follow me on Twitter for updates on the development: @olemoritz

If you'd like to support this effort, please consider a donation via PayPal or Flattr:

테스트는 안해봄

Posted by incree

2012/11/22 22:51 2012/11/22 22:51
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/176

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다


Notices

Archives

Authors

  1. incree

Recent Trackbacks

Calendar

«   2017/10   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Site Stats

Total hits:
428044
Today:
84
Yesterday:
91